app/views/wiki/list.rhtml in Pimki-1.1.092 vs app/views/wiki/list.rhtml in Pimki-1.2.092

- old
+ new

@@ -7,124 +7,119 @@ [<a href=".">Any</a>] <%= @category_links.join(', ') %> </div> <% end %> -<div id="allPages" style="float: left; width: 280px; margin-right: 30px"> -<% unless @pages_that_are_orphaned.empty? && @page_names_that_are_wanted.empty? %> - <h2> - All Pages - <br/><small style="font-size: 12px"><i>All pages in <%= @set_name %> listed alphabetically</i></small> - </h2> -<% end %> - -<ul><% for page in @pages_by_name.sort_by { |p| p.name } %><li><a href="../show/<%= page.name %>"><%= truncate(page.plain_name, 35) %></a></li><% end %></ul> - -<% if @web.count_pages %> - <% total_chars = @pages_in_category.characters %> - <p><small>All content: <%= total_chars %> chars / <%= sprintf("%-.1f", (total_chars / 2275 )) %> pages</small></p> -<% end %> -</div> - -<div style="float: left; width: 500px"> -<% unless @page_names_that_are_wanted.empty? %> - <h2> - Wanted Pages - <br/><small style="font-size: 12px"><i>Unexisting pages that other pages in <%= @set_name %> reference</i></small> - </h2> - - <ul style="margin-bottom: 10px"> - <% for page_name in @page_names_that_are_wanted.sort_by { |pname| pname } %> - <li> - <a href="../show/<%= page_name %>"><%= truncate(WikiWords.separate(page_name), 35) %></a> - wanted by - <%= web.select.pages_that_reference(page_name).collect { |page| page.link }.join(", ") %> - </li> +<div id="listsContainer" style="float: left; width: 300px;"> + <% unless @pages_that_are_orphaned.empty? && @page_names_that_are_wanted.empty? %> + <h2> + All Pages + <br/><small style="font-size: 12px"><i>All pages in <%= @set_name %> listed alphabetically</i></small> + </h2> <% end %> - </ul> -<% end %> + + <ul><% for page in @pages_by_name.sort_by { |p| p.name } %><li><a href="../show/<%= page.name %>"><%= truncate(page.plain_name, 35) %></a></li><% end %></ul> + + <% if @web.count_pages %> + <% total_chars = @pages_in_category.characters %> + <p><small>All content: <%= total_chars %> chars / <%= sprintf("%-.1f", (total_chars / 2275 )) %> pages</small></p> + <% end %> -<% unless @pages_that_are_orphaned.empty? %> - <h2> - Orphaned Pages - <br/><small style="font-size: 12px"><i>Pages in <%= @set_name %> that no other page reference</i></small> - </h2> - <ul style="margin-bottom: 35px"> - <% for page in @pages_that_are_orphaned.sort_by { |p| p.name } %><li><a href="../show/<%= page.name %>"><%= truncate(page.plain_name, 35) %></a></li><% end %> - </ul> -<% end %> + <% unless @page_names_that_are_wanted.empty? %> + <h2> + Wanted Pages + <br/><small style="font-size: 12px"><i>Unexisting pages that other pages in <%= @set_name %> reference</i></small> + </h2> + + <ul style="margin-bottom: 10px"> + <% for page_name in @page_names_that_are_wanted.sort_by { |pname| pname } %> + <li> + <a href="../show/<%= page_name %>"><%= truncate(WikiWords.separate(page_name), 35) %></a> + wanted by + <%= web.select.pages_that_reference(page_name).collect { |page| page.link }.join(", ") %> + </li> + <% end %> + </ul> + <% end %> + + <% unless @pages_that_are_orphaned.empty? %> + <h2> + Orphaned Pages + <br/><small style="font-size: 12px"><i>Pages in <%= @set_name %> that no other page reference</i></small> + </h2> + + <ul style="margin-bottom: 35px"> + <% for page in @pages_that_are_orphaned.sort_by { |p| p.name } %><li><a href="../show/<%= page.name %>"><%= truncate(page.plain_name, 35) %></a></li><% end %> + </ul> + <% end %> </div> -</td></tr> -<tr><td> - +<div id="pageAdmin"style="float: right; width: 280px; vertical-align: top;"> <script language="JavaScript1.2"> - function validateSelection(fieldID) { - var selection = document.getElementById(fieldID).value; - if (selection == "noselect") { - alert("Please make a selection"); - return false; - } - return true; - } - function validatePageName(fieldID) { - if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById(fieldID).value)) { + function validateSelection(fieldID) { + var selection = document.getElementById(fieldID).value; + if (selection == "noselect") { + alert("Please make a selection"); + return false; + } return true; - } else { - alert('You wrote "' + document.getElementById(fieldID).value + '" as a page name, but it needs to be a wiki word.'); - return false; } - } - function verifyDelete() { - var del = confirm("Are you sure you want to delete " + document.getElementById('sel_delete').value + "?") - return del; - } - function verifyRename() { - if (!validatePageName('ren_newpage')) { - return false; + function validatePageName(fieldID) { + if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById(fieldID).value)) { + return true; + } else { + alert('You wrote "' + document.getElementById(fieldID).value + '" as a page name, but it needs to be a wiki word.'); + return false; + } } - var ren = confirm("Are you sure you want to rename '" + document.getElementById('sel_rename').value + - "' to '" + document.getElementById('ren_newpage').value + - "'?\nNOTE: Links in other pages will have to be manually translated!") - return ren; - } + function verifyDelete() { + var del = confirm("Are you sure you want to delete " + document.getElementById('sel_delete').value + "?") + return del; + } + function verifyRename() { + if (!validatePageName('ren_newpage')) { + return false; + } + var ren = confirm("Are you sure you want to rename '" + document.getElementById('sel_rename').value + + "' to '" + document.getElementById('ren_newpage').value + + "'?\nNOTE: Links in other pages will have to be manually translated!") + return ren; + } </script> <!-- hr --> - <h2><br /> - Page Administration - </h2> + <h2>Page Administration</h2> <table border="0" style="font-size:10px"> - <!-- Delete Page --> + <!-- Delete Page --> + <form class="navigation" action="list/" action="get" onSubmit="return validateSelection('sel_delete') && verifyDelete();"> <tr> - <form class="navigation" action="list/" action="get" onSubmit="return validateSelection('sel_delete') && verifyDelete();"> <td>Delete page:</td> - <td><select id="sel_delete" name="sel_page_name" size="1" style="width:190"> - <option value="noselect">------------ + <td><select id="sel_delete" name="sel_page_name" size="1" style="width:195"> + <option value="noselect">------------</option> <% for page in @pages_by_name %> - <option value="<%= page.name %>"><%= page.name %> + <option value="<%= page.name %>"><%= page.name %></option> <% end %> </select> </td> </tr> <tr> <td>&nbsp;</td> <td align="right"> <input type="submit" name="Action" value="Delete"> </td> - </form> </tr> - <!-- Rename Page --> + </form> + <!-- Rename Page --> + <form class="navigation" action="../list/" action="get" onSubmit="return validateSelection('sel_rename') && verifyRename() && validatePageName('ren_newpage');"> <tr> - <form class="navigation" action="../list/" action="get" onSubmit="return validateSelection('sel_rename') && verifyRename() && validatePageName('ren_newpage');"> <td>Rename:</td> - <td><select id="sel_rename" name="sel_page_name" size="1" style="width:190"> - <option value="noselect">------------ + <td><select id="sel_rename" name="sel_page_name" size="1" style="width:195"> + <option value="noselect">------------</option> <% for page in @pages_by_name %> - <option value="<%= page.name %>"><%= page.name %> + <option value="<%= page.name %>"><%= page.name %></option> <% end %> </select> </td> </tr> <tr> @@ -136,15 +131,15 @@ <tr> <td>&nbsp;</td> <td align="right"> <input type="submit" name="Action" value="Rename"> </td> - </form> </tr> - <!-- Create Page --> + </form> + <!-- Create Page --> + <form class="navigation" action="../list/" action="get" onSubmit="return validatePageName('newpage');"> <tr> - <form class="navigation" action="../list/" action="get" onSubmit="return validatePageName('newpage');"> <td>Create New Page:</td> <td> <input type="text" name="newpage" id="newpage" size="28"> </td> </tr> @@ -152,13 +147,11 @@ <td>&nbsp;</td> <td align="right"> <input type="submit" name="Action" value="Create"> </td> </td> - </form> </tr> + </form> </table> - - </td></tr> -</table> +</div> <%= sub_template "bottom" %>