app/views/wiki/edit_web.rhtml in Pimki-1.6.092 vs app/views/wiki/edit_web.rhtml in Pimki-1.7.092

- old
+ new

@@ -1,8 +1,11 @@ -<% @title = "Edit Web" +<% @title = "Web Setup" @hide_menu = true - @style_additions = "#Container { width: 600px; margin-left: 180px;}" + @style_additions = " + #Container { width: 600px; margin-left: 180px;} + input { vertical-align: bottom } + " %> <%= sub_template "top" %> <%= "<p style='font-size: 15px; font-variant: italic; color: red;'>#{@message}</span>" if @message %> @@ -18,15 +21,29 @@ Address: <input type="text" id="address" name="address" value="<%= @web.address %>" onChange="cleanAddress();"> <i>(Letters & digits only)</i> </div> <h2 style="margin-bottom: 3px">Specialize</h2> + <script> + function see_styles() { + document.getElementById('additionalStyle').style.display='block'; + document.getElementById('see_styles').style.display='none'; + document.getElementById('hide_styles').style.display='inline'; + return false; + } + function hide_styles() { + document.getElementById('additionalStyle').style.display='none'; + document.getElementById('see_styles').style.display='inline'; + document.getElementById('hide_styles').style.display='none'; + return false; + } + </script> <div class="help"> Turning safe mode on will strip HTML tags and stylesheet options from the content of all pages. Turning on "brackets only" will require all wiki words to be as [[wiki word]] and WikiWord won't work. - Additions to the stylesheet take precedence over the existing styles. <i>Hint:</i> View source on a page you want to - style to find ID names on individual tags. <a href="#" onClick="document.getElementById('additionalStyle').style.display='block';return false;">See styles >></a> + Additions to the stylesheet take precedence over the existing styles. <i>Hint:</i> View source on a page you want to style to find ID names on individual tags. + </div> <div class="inputBox"> Markup: <select name="markup"> <%= html_options({ "Textile" => :textile, "Markdown via RedCloth (experimental)" => :red_markdown, "Markdown via BlueCloth" => :blue_markdown, "RDoc" => :rdoc }, @web.markup) %> @@ -40,10 +57,12 @@ @web.color) %> </select> &nbsp;&nbsp; + <br /> + <small> <input type="checkbox" name="safe_mode"<%= " CHECKED" if @web.safe_mode %>> Safe mode &nbsp;&nbsp; @@ -54,11 +73,14 @@ <input type="checkbox" name="count_pages"<%= " CHECKED" if @web.count_pages %>> Count pages </small> - <textarea id="additionalStyle" style="display: none; margin-top: 10px; margin-bottom: 5px; width: 560px; height: 200px" name="additional_style"><%= @web.additional_style %></textarea> + <br /> + <a style='font-size:smaller;' id='see_styles' href="#" onClick="return see_styles();">See styles >></a> + <a style='font-size:smaller; display:none;' id='hide_styles' href="#" onClick="return hide_styles();">Hide styles <<</a> + <textarea id="additionalStyle" style="display: none; margin-top: 10px; margin-bottom: 5px; width: 100%; height: 200px" name="additional_style"><%= @web.additional_style %></textarea> </div> <h2 style="margin-bottom: 3px">Persistence Options (all webs)</h2> <div class="help"> You can set how often to take snapshots of the web data. (All incremental changes are saved as command_logs; snapshots supercede those with the full data). Recommended values are 1-2 hours if you turn the web on and off often, or 24-48 hours if this is a long running service.<br /> @@ -66,38 +88,66 @@ </div> <div class="inputBox"> <input align='right' type="text" name="snapshots_interval" value='<%= @snapshot_interval %>' /> hour(s). </div> - <h2 style="margin-bottom: 3px">Password protection for this web (<%= @web.name %>)</h2> + <h2 style="margin-bottom: 3px">Password protection for this PIM (<%= @web.name %>)</h2> <div class="help"> This is the password that visitors need to login to view and edit this web. Setting the password to nothing will remove the password protection. </div> <div class="inputBox"> Password: <input type="password" id="password" name="password" value="<%= @web.password %>"> &nbsp;&nbsp; Verify: <input type="password" id="password_check" value="<%= @web.password %>" name="password_check"><br /> - <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='each_edit' <%= 'checked' if @web.check_pass_on_edit %>>Require password for each edit - <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='login_only' <%= 'checked' if @web.check_pass_on_edit %>>Require password once on logon + <!-- + <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='each_edit' <%= 'checked' if @web.password && @web.check_pass_on_edit %>>Require password for each edit + <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='login_only' <%= 'checked' if @web.password && !@web.check_pass_on_edit %>>Require password once on logon + --> </div> <h2 style="margin-bottom: 3px">Publish read-only version of this web (<%= @web.name %>)</h2> <div class="help"> You can turn on a read-only version of this web that's accessible even when the regular web is password protected. - The published version is accessible through URLs like /wiki/published/HomePage. + The published version is accessible through URLs like /wiki/published/HomePage.<br /><br /> + + Defaulting non-localhost requests to the 'published' version means that requests coming from other machines to the root (e.g. http://host:2500/) will be passed to /web/published and not /web/show.<br /> + + Other machines can still explicitly request the /web/show versions, for which you need to set editing password etc. This is just to make referring colleagues to your PIM easier. </div> <div class="inputBox"> - <input type="checkbox" name="published"<%= " CHECKED" if @web.published %>> Publish this web + <script> + function checkPublished() { + if (!document.getElementById("published").checked) { + document.getElementById("default_to_published").checked = false; + document.getElementById("default_to_published").disabled = true; + } else { + document.getElementById("default_to_published").disabled = false; + } + }; + function checkPublishedDefault() { + if (document.getElementById("default_to_published").checked) { + document.getElementById("published").checked = true; + } + }; + </script> + <input type="checkbox" id="published" name="published" onClick='return checkPublished();' <%= "CHECKED" if @web.published %>> Publish this web + <br /> + <input type="checkbox" id="default_to_published" name="default_to_published" onClick='return checkPublishedDefault();' + <%= "disabled" unless @web.published %> + <%= "checked" if @web.default_to_published %>> Default non-localhost requests to the 'published' version </div> <h2 style="margin-bottom: 3px">Customise this PIM</h2> <div class="help"> Here are a few setting you can use to tweak the appearance and behaviour of your Pimki. </div> <div class="inputBox"> <h4>Interface Options</h4> - <input type="checkbox" name="enable_dclick_edit" <%= "checked" if @web.enable_dclick_edit %>> Edit page on double click. + <input type="checkbox" name="enable_dclick_edit" <%= "checked" if @web.enable_dclick_edit %>> Edit page on double click.<br /> + + <input type="checkbox" name="enable_menu" <%= "checked" if @web.enable_menu %>> Enable menu on left. Don't forget to <a href='../edit_menu'>set the menu contents</a>. + <h4>Mind Map</h4> <i>Size</i>:<br /> Limit the size of the Mind Map image. Format is "width,height" in inches. Leave blank for no size limit.<br /> <input type="text" name="mind_map_size" id="mind_map_size" value="<%= web.mind_map_size %>"> <table> @@ -164,38 +214,50 @@ <input type="submit" value="Update Web"> </small> </p> </form> +<p style='font-size: 10px; text-align: right;'>...or forget all your changes and <a href="/new_web/">create a new web</a>.<br /> +<% num_webs = WikiService.instance.webs.length %> +(There <%= num_webs > 1 ? 'are' : 'is' %> currently <a href='/web_list/'><%= WikiService.instance.webs.length %> web<%= 's' if num_webs > 1 %></a>)</p> + +<hr /> <br/> + <h2>Other administrative tasks</h2> -<form action="../administrate" id="administrate" method="post"> +<form action="../administrate" id="administrate" method="post" class="inputBox"> <p style="font-size: 10px;"> Clean up by entering system password <input type="password" id="system_password" name="system_password"> and... </p> <p align='right'> <input type="submit" name='action' value="Delete Orphan Pages"><br/> <input type="submit" name='action' value="Clear Render Cache"><br/> <input type="submit" name='action' value="Force Data Snapshot"><br/> <input type="submit" name='action' value="Clean Storage"><br/> + <% if wiki.webs.size > 1 %> + <input type="submit" name='action' value="Make This Web Default"><br/> + <% end %> + <br/> + <input type="submit" name='action' value="Remove This Web" onClick="return confirm('Are you absolutely sure you want to delete the \'<%= web.name %>\' web?')"><br/> </p> </form> -<p style='font-size: 10px;'>...or forget all your changes and <a href="/new_web/">create a new web</a>.</p> +<hr /> +<br/> <h2>Stop Pimki</h2> -<p style="color:red">Please note that stopping the server will stop all pimki webs running on this server! It is a also a forced exit, so any changes currently being made by other users will be lost!</p> +<p style="color:red">Please note that stopping the server will stop all pimki webs running on this server!</p> <form action="../stop" id="stop" method="post"> - <p style="font-size: 10px;"> + <p style="font-size: 10px;" class="inputBox"> Enter system password <input type="password" id="system_password" name="system_password"> and <input type="submit" name='stop' value="Stop Pimki"> in - <input type="text" name='seconds' value='3' size='5' align='right'> + <input type="text" name='seconds' value="3" size='5' style="text-align:right;"> seconds. </p> </form> <script> @@ -229,14 +291,14 @@ document.getElementById('password').value != document.getElementById('password_check').value) { alert("The password and its verification doesn't match"); return false; } - // if (document.getElementById('mind_map_size').value != "" && - // !/^\d+,\d+$/.test(document.getElementById('mind_map_size').value)) { - // alert("The Mind Map size must be in the format of 'digit,digit'!"); - // return false; - // } + if (document.getElementById('mind_map_size').value != "" && + !(/^\d+,\d+$/.test(document.getElementById('mind_map_size').value))) { + alert("The Mind Map size must be in the format of 'digit(s),digit(s)'!"); + return false; + } return true; } </script> \ No newline at end of file