Pimki 1.7.092 → 1.8.092

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/README-PIMKI +182 -178
  2. data/app/controllers/wiki.rb +950 -942
  3. data/app/models/chunks/category.rb +33 -33
  4. data/app/models/chunks/category_test.rb +21 -21
  5. data/app/models/chunks/chunk.rb +20 -20
  6. data/app/models/chunks/engines.rb +48 -48
  7. data/app/models/chunks/include.rb +1 -1
  8. data/app/models/chunks/match.rb +1 -1
  9. data/app/models/chunks/nowiki.rb +1 -1
  10. data/app/models/chunks/nowiki_test.rb +5 -0
  11. data/app/models/chunks/todo.rb +1 -0
  12. data/app/models/chunks/wiki.rb +130 -130
  13. data/app/models/page.rb +124 -124
  14. data/app/models/revision.rb +92 -92
  15. data/app/models/web.rb +314 -316
  16. data/app/models/wiki_content.rb +2 -2
  17. data/app/models/wiki_service.rb +170 -166
  18. data/app/models/wiki_words.rb +28 -28
  19. data/app/views/error.rhtml +37 -37
  20. data/app/views/navigation.rhtml +1 -1
  21. data/app/views/static_style_sheet.rhtml +10 -5
  22. data/app/views/top.rhtml +1 -1
  23. data/app/views/wiki/adv_search.rhtml +61 -61
  24. data/app/views/wiki/bliki.rhtml +7 -6
  25. data/app/views/wiki/bliki_edit.rhtml +26 -37
  26. data/app/views/wiki/bliki_new.rhtml +58 -64
  27. data/app/views/wiki/bliki_revision.rhtml +5 -3
  28. data/app/views/wiki/edit.rhtml +44 -44
  29. data/app/views/wiki/edit_menu.rhtml +26 -19
  30. data/app/views/wiki/edit_web.rhtml +303 -305
  31. data/app/views/wiki/glossary.rhtml +35 -27
  32. data/app/views/wiki/list.rhtml +175 -174
  33. data/app/views/wiki/list.rhtml.bak +175 -0
  34. data/app/views/wiki/mind.rhtml +70 -70
  35. data/app/views/wiki/new.rhtml +34 -32
  36. data/app/views/wiki/published.rhtml +34 -49
  37. data/app/views/wiki/revision.rhtml +88 -87
  38. data/app/views/wiki/rollback.rhtml +36 -35
  39. data/app/views/wiki/todo.rhtml +2 -2
  40. data/app/views/wiki_words_help.rhtml +8 -8
  41. data/libraries/action_controller_servlet.rb +202 -202
  42. data/libraries/madeleine_service.rb +162 -162
  43. data/pimki.rb +181 -181
  44. metadata +11 -12
  45. data/README +0 -172
  46. data/app/models/chunks/acronym.rb +0 -19
  47. data/app/views/wiki/test.rhtml +0 -25
  48. data/libraries/secure_web_controller_server.rb +0 -106
@@ -23,5 +23,5 @@ end
23
23
  <%= list_item "Web Setup", "../edit_web/", "Edit this web's options" %> |
24
24
  <%= list_item "Export", "../export/", "Download a zip with all the pages in this wiki", "X" %> |
25
25
  <input type="text" id="searchField" name="query" style="font-size: 10px" value="Search" onClick="this.value == 'Search' ? this.value = '' : true">
26
- <%= list_item "<small>(Adv)</small>", "../adv_search/", "Advanced Search" %>
26
+ <%= list_item "<small>(Advanced)</small>", "../adv_search/", "Advanced Search" %>
27
27
  </form>
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
  #Menu th {
15
- color: darkgreen;
15
+ color: <%= web ? web.color : '#008B26' %>;
16
16
  font-size: 12px;
17
17
  text-align: left
18
18
  }
@@ -62,10 +62,12 @@ a:hover { color: #fff; background-color:#000; }
62
62
  /* a.edit:link, a.edit:visited { color: #DA0006; } */
63
63
 
64
64
 
65
- h1, h2, h3 { color: #333; font-family: georgia, verdana; }
66
- h1 { font-size: 24px; color: blue }
67
- h2 { font-size: 19px; color: darkblue }
68
- h3 { font-size: 16px; color: darkblue }
65
+ h1, h2, h3 { color: <%= web ? web.color : '#008B26' %>; font-family: georgia, verdana; }
66
+ h4, h5, h6 { color: <%= web ? web.color : '#008B26' %> }
67
+ b, strong { color: <%= web ? web.color : '#008B26' %>; }
68
+ h1 { font-size: 24px }
69
+ h2 { font-size: 19px }
70
+ h3 { font-size: 16px }
69
71
 
70
72
  h1#pageName {
71
73
  margin: 5px 0px 0px 0px;
@@ -229,6 +231,9 @@ ins.diffmod {
229
231
  margin-left: 10px;
230
232
  padding-left: 20px;
231
233
  border-left: 1px dotted #ccc;
234
+ position: absolute;
235
+ top: 150;
236
+ right: 20%;
232
237
  }
233
238
 
234
239
  .rightHandSide p {
@@ -33,7 +33,7 @@
33
33
  </head>
34
34
 
35
35
  <% if @web && @page && @web.enable_dclick_edit && !%( new edit revision bliki bliki_new bliki_edit bliki_revision published ).include?(@action_name) %>
36
- <body ondblclick="location.href='../edit/<%= @page.name %>'">
36
+ <body ondblclick="location.href='../edit/<%= CGI.escape @page.name %>'">
37
37
  <% else %>
38
38
  <body>
39
39
  <% end %>
@@ -1,61 +1,61 @@
1
- <% @title = "Advanced Search Options" %>
2
- <%= sub_template "top" %>
3
- <div class='content-box'>
4
- <h3>Advanced Search Options:</h3>
5
-
6
- <form action="../search/" method="post">
7
- <table>
8
- <tr>
9
- <td>Search string:</td>
10
- <td colspan="3"><input type='text' name='query' id='query' size='60' /></td>
11
- </tr>
12
- <tr><td>&nbsp;</td></tr>
13
- <tr>
14
- <td colspan="3"><input type='checkbox' name='case'>Case sensitive</input></td>
15
- </tr>
16
- <tr>
17
- <td>Search string as</td>
18
- <td><input type='Radio' name='expression' value='regex' checked>Regular Expression</input></td>
19
- <td><input type='Radio' name='expression' value='all'>All words</input></td>
20
- <td><input type='Radio' name='expression' value='exact'>Exact phrase</input></td>
21
- </tr>
22
- <tr>
23
- <td>Search in</td>
24
- <td><input type='Radio' name='where' value='all' checked>Pages &amp; Bliki entries</input></td>
25
- <td><input type='Radio' name='where' value='pages'>Pages only</input></td>
26
- <td><input type='Radio' name='where' value='bliki'>Bliki entries only</input></td>
27
- </tr>
28
- <tr>
29
- <td>Search on</td>
30
- <td><input type='Radio' name='fields' value='both' checked>Pages names &amp; contents</input></td>
31
- <td><input type='Radio' name='fields' value='names'>Page names only</input></td>
32
- <td><input type='Radio' name='fields' value='contents'>Page contents only</input></td>
33
- </tr>
34
- <tr>
35
- <td colspan="2">Limit search to selected categories:</td>
36
- <td colspan="2"><select id="category" name="category" size="3" multiple style="width:200">
37
- <option value="noselect">------------
38
- <% for category in web.categories %>
39
- <option value="<%= category %>"><%= category %>
40
- <% end %>
41
- </select>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td colspan="2">Limit search to selected authors:</td>
46
- <td colspan="2"><select id="author" name="author" size="3" multiple style="width:200">
47
- <option value="noselect">------------
48
- <% for author in web.authors %>
49
- <option value="<%= author %>"><%= author %>
50
- <% end %>
51
- </select>
52
- </tr>
53
- <tr>
54
- <td><input type='submit' value='Search'></td>
55
- </tr>
56
- </table>
57
- </form>
58
- </div>
59
-
60
- <%= sub_template "bottom" %>
61
-
1
+ <% @title = "Advanced Search Options" %>
2
+ <%= sub_template "top" %>
3
+ <div class='content-box'>
4
+ <h3>Advanced Search Options:</h3>
5
+
6
+ <form action="../search/" method="post">
7
+ <table>
8
+ <tr>
9
+ <td>Search string:</td>
10
+ <td colspan="3"><input type='text' name='query' id='query' size='60' /></td>
11
+ </tr>
12
+ <tr><td>&nbsp;</td></tr>
13
+ <tr>
14
+ <td colspan="3"><input type='checkbox' name='case'>Case sensitive</input></td>
15
+ </tr>
16
+ <tr>
17
+ <td>Search string as</td>
18
+ <td><input type='Radio' name='expression' value='regex' checked>Regular Expression</input></td>
19
+ <td><input type='Radio' name='expression' value='all'>All words</input></td>
20
+ <td><input type='Radio' name='expression' value='exact'>Exact phrase</input></td>
21
+ </tr>
22
+ <tr>
23
+ <td>Search in</td>
24
+ <td><input type='Radio' name='where' value='all' checked>Pages &amp; Bliki entries</input></td>
25
+ <td><input type='Radio' name='where' value='pages'>Pages only</input></td>
26
+ <td><input type='Radio' name='where' value='bliki'>Bliki entries only</input></td>
27
+ </tr>
28
+ <tr>
29
+ <td>Search on</td>
30
+ <td><input type='Radio' name='fields' value='both' checked>Pages names &amp; contents</input></td>
31
+ <td><input type='Radio' name='fields' value='names'>Page names only</input></td>
32
+ <td><input type='Radio' name='fields' value='contents'>Page contents only</input></td>
33
+ </tr>
34
+ <tr>
35
+ <td colspan="2">Limit search to selected categories:</td>
36
+ <td colspan="2"><select id="category" name="category" size="3" multiple style="width:200">
37
+ <option value="noselect">------------
38
+ <% for category in web.categories %>
39
+ <option value="<%= category %>"><%= category %>
40
+ <% end %>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td colspan="2">Limit search to selected authors:</td>
46
+ <td colspan="2"><select id="author" name="author" size="3" multiple style="width:200">
47
+ <option value="noselect">------------
48
+ <% for author in web.authors %>
49
+ <option value="<%= author %>"><%= author %>
50
+ <% end %>
51
+ </select>
52
+ </tr>
53
+ <tr>
54
+ <td><input type='submit' value='Search'></td>
55
+ </tr>
56
+ </table>
57
+ </form>
58
+ </div>
59
+
60
+ <%= sub_template "bottom" %>
61
+
@@ -15,14 +15,14 @@
15
15
 
16
16
  <% if @entries.length > 0 %>
17
17
  <% (@entries.length > 3 ? 3 : @entries.length).times do |idx| %>
18
- <table width="100%" class='content-box' ondblclick="location.href='../bliki_edit/<%= @entries[idx].name %>'">
18
+ <table width="100%" class='content-box' <%= "ondblclick=\"location.href='../bliki_edit/#{@entries[idx].name}'\"" if web.enable_dclick_edit %>>
19
19
  <tr>
20
20
  <td width="70%"><h3 style="color:<%= @color %>"><%= @entries[idx].plain_name %></h3></td>
21
21
  </tr>
22
22
  <tr>
23
- <th align="left" style="font-size:10;color:<%= @color %>"><%= @entries[idx].revisions.first.created_at.strftime("%B %d, %Y") %>
23
+ <th align="left" style="font-size:10;color:<%= @color %>"><%= @entries[idx].revisions.first.created_at.strftime("%B %d, %Y %H:%M") %>
24
24
  <% if @entries[idx].revisions.first != @entries[idx].revisions.last %>
25
- -- Last revised on: <%= @entries[idx].revisions.last.created_at.strftime("%B %d, %Y") %>
25
+ -- Last revised on: <%= @entries[idx].revisions.last.created_at.strftime("%B %d, %Y %H:%M") %>
26
26
  <% end %>
27
27
  </th>
28
28
  </tr>
@@ -32,6 +32,7 @@
32
32
  <tr><td>
33
33
  <div class="navigation">
34
34
  <a href="../bliki_edit/<%= @entries[idx].name %>" class="navlink" accesskey="E">Edit</a>
35
+ <!-- | <a href="../bliki_revision_all/<%= @entries[idx].name %>" class="navlink">All Revisions</a> -->
35
36
  | <a href="../bliki_delete/<%= @entries[idx].name %>" class="navlink" onClick="return confirm('Are you sure you want delete this entry completely?')">Delete</a>
36
37
  <% if @entries[idx].revisions.length > 1 %>
37
38
  <small>
@@ -57,9 +58,9 @@
57
58
  <p><strong>No entries found.</strong></p>
58
59
  <% end %>
59
60
 
60
- <p><a href="../bliki_new/" class="navlink" accesskey="E">Create New Entry</a></p>
61
+ <h3><a href="../bliki_new/" class="navlink" accesskey="E">Create New Entry</a></h3>
61
62
 
62
- <h2>All Entries:</h2>
63
+ <h3>All Entries:</h3>
63
64
  <ul>
64
65
  <% @entries.each do |page| %>
65
66
  <li><a href="../bliki_revision/<%= page.name %>?rev=<%= page.revisions.length - 1 %>" class="navlink" accesskey="R"><%= page.plain_name %></a>
@@ -80,7 +81,7 @@ function validateSelection() {
80
81
  }
81
82
  </script>
82
83
 
83
- <h2>Apply filter:</h2>
84
+ <h3>Apply filter:</h3>
84
85
  <form class="navigation" action="bliki" action="post" onSubmit="return validateSelection();">
85
86
  <table><tr>
86
87
  <td>Show only pages authored by:</td>
@@ -1,38 +1,27 @@
1
- <%
2
- @title = "Editing #{@page.plain_name}"
3
- @content_width = 810
4
- @hide_navigation = true
5
- @hide_menu = true
6
- @style_additions = "#Content, #Container {width = 820px; padding-left:100px;}"
7
- %>
8
- <%= sub_template "top" %>
9
-
10
- <%= render_markup_help %>
11
-
12
- <form action="../bliki_save/<%= @page.name %>" method="post" onSubmit="return validateAuthorName();">
13
- <p>
14
- <textarea name="content" style="width: 450px; height: 430px"><%= @page.content %></textarea>
15
- </p>
16
- <p>
17
- <% if @web.check_pass_on_edit %>
18
- Please enter edit password: <input type="password" name="password" id="password"><br />
19
- <% end %>
20
- <input type="submit" value="Update"> as
21
- <input type="text" name="author" id="authorName" value="<%= @author %>"
22
- onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
23
- | <a href="../cancel_bliki_edit/<%= @page.name %>">Cancel</a> <small>(unlocks entry)</small>
24
- </p>
25
- </form>
26
-
27
- <script language="JavaScript1.2">
28
- function validateAuthorName() {
29
- if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById('authorName').value)) {
30
- return true;
31
- } else {
32
- alert('You wrote "' + document.getElementById('authorName').value + '" as your name, but it needs to be a wiki word. Try concating first name and last name, like DavidHeinemeierHansson.');
33
- return false;
34
- }
35
- }
36
- </script>
37
-
1
+ <%
2
+ @title = "Editing #{@page.plain_name}"
3
+ @content_width = 810
4
+ @hide_navigation = true
5
+ @hide_menu = true
6
+ @style_additions = "#Content, #Container {width = 820px; padding-left:100px;}"
7
+ %>
8
+ <%= sub_template "top" %>
9
+
10
+ <%= render_markup_help %>
11
+
12
+ <form action="../bliki_save/<%= @page.name %>" method="post">
13
+ <p>
14
+ <textarea name="content" style="width: 450px; height: 75%"><%= @page.content %></textarea>
15
+ </p>
16
+ <p>
17
+ <% if @web.check_pass_on_edit %>
18
+ Please enter edit password: <input type="password" name="password" id="password"><br />
19
+ <% end %>
20
+ <input type="submit" value="Update"> as
21
+ <input type="text" name="author" id="authorName" value="<%= @author %>"
22
+ onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
23
+ | <a href="../cancel_bliki_edit/<%= @page.name %>">Cancel</a> <small>(unlocks entry)</small>
24
+ </p>
25
+ </form>
26
+
38
27
  <%= sub_template "bottom" %>
@@ -1,65 +1,59 @@
1
- <%
2
- @title = "Creating new bliki entry"
3
- @content_width = 720
4
- @hide_navigation = true
5
- @hide_menu = true
6
- @style_additions = "#Content, #Container {padding-left:100px;}"
7
- %>
8
- <%= sub_template "top" %>
9
-
10
- <p>
11
- <%= render_markup_help %>
12
-
13
- <form action="../bliki_save/" method="post" onSubmit="return validateWikiWords();">
14
- <table width="450">
15
- <tr style="background-color:dfd">
16
- <td width="70%">Title: <input size="40%" type="text" name="pagename" id="newPageName" value='<%= @entry_name %>'></td>
17
- <th align="right"><small><%= Date.today.strftime("%d %b %Y") %></small></th>
18
- </tr>
19
- <tr>
20
- <td colspan="2"><textarea name="content" style="width: 450px; height: 430px">
21
- | / | *Morning* | *Afternoon* |
22
- | *Mon* | - | - |
23
- | *Tue* | - | - |
24
- | *Wed* | - | - |
25
- | *Thu* | - | - |
26
- | *Fri* | - | - |</textarea></td>
27
- </tr>
28
- <tr style="background-color:efe">
29
- <th colspan="2" align="right">
30
- <input type="text" name="author" id="authorName" value="<%= @author || 'AnonymousCoward'%>"
31
- onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
32
- </th>
33
- </tr>
34
- </table>
35
-
36
- <p>
37
- <% if @web.check_pass_on_edit %>
38
- Please enter edit password: <input type="password" name="password" id="password"><br />
39
- <% end %>
40
- <input type="submit" value="Update"> as
41
-
42
- | <a href="../cancel_bliki_edit/">Cancel</a> <small>(unlocks entry)</small>
43
- </p>
44
- </form>
45
-
46
- <script language="JavaScript">
47
- function validateWikiWords() {
48
- // alert(escape(document.getElementById('newPageName').value));
49
- // return false;
50
- if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById('authorName').value)) {
51
- // return true; skip to validate page name
52
- } else {
53
- alert('You wrote "' + document.getElementById('authorName').value + '" as your name, but it needs to be a wiki word. Try concating first name and last name, like DavidHeinemeierHansson.');
54
- return false;
55
- }
56
- if (/^([\w\s\d]+)$/.test(document.getElementById('newPageName').value)) {
57
- return true;
58
- } else {
59
- alert('You wrote "' + document.getElementById('newPageName').value + '" as the entry name, but it can only contain letters, digits and space.');
60
- return false;
61
- }
62
- }
63
- </script>
64
-
1
+ <%
2
+ @title = "Creating new bliki entry"
3
+ @content_width = 720
4
+ @hide_navigation = true
5
+ @hide_menu = true
6
+ @style_additions = "#Content, #Container {padding-left:100px;}"
7
+ %>
8
+ <%= sub_template "top" %>
9
+
10
+ <p>
11
+ <%= render_markup_help %>
12
+
13
+ <form action="../bliki_save/" method="post" onSubmit="return validateWikiWords();">
14
+ <table width="450">
15
+ <tr style="background-color:dfd">
16
+ <td width="70%">Title: <input size="40%" type="text" name="pagename" id="newPageName" value='<%= @entry_name %>'></td>
17
+ <th align="right"><small><%= Date.today.strftime("%d %b %Y") %></small></th>
18
+ </tr>
19
+ <tr>
20
+ <td colspan="2"><textarea name="content" style="width: 450px; height: 75%"></textarea></td>
21
+ </tr>
22
+ <tr style="background-color:efe">
23
+ <th colspan="2" align="right">
24
+ <input type="text" name="author" id="authorName" value="<%= @author || 'AnonymousCoward'%>"
25
+ onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
26
+ </th>
27
+ </tr>
28
+ </table>
29
+
30
+ <p>
31
+ <% if @web.check_pass_on_edit %>
32
+ Please enter edit password: <input type="password" name="password" id="password"><br />
33
+ <% end %>
34
+ <input type="submit" value="Update"> as
35
+
36
+ | <a href="../cancel_bliki_edit/">Cancel</a> <small>(unlocks entry)</small>
37
+ </p>
38
+ </form>
39
+
40
+ <script language="JavaScript">
41
+ function validateWikiWords() {
42
+ // alert(escape(document.getElementById('newPageName').value));
43
+ // return false;
44
+ // if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById('authorName').value)) {
45
+ // // return true; skip to validate page name
46
+ // } else {
47
+ // alert('You wrote "' + document.getElementById('authorName').value + '" as your name, but it needs to be a wiki word. Try concating first name and last name, like DavidHeinemeierHansson.');
48
+ // return false;
49
+ // }
50
+ if (/^([\w\s\d]+)$/.test(document.getElementById('newPageName').value)) {
51
+ return true;
52
+ } else {
53
+ alert('You wrote "' + document.getElementById('newPageName').value + '" as the entry name, but it can only contain letters, digits and space.');
54
+ return false;
55
+ }
56
+ }
57
+ </script>
58
+
65
59
  <%= sub_template "bottom" %>
@@ -20,14 +20,16 @@
20
20
  </td>
21
21
  </tr>
22
22
  <tr style="font-style:italic;">
23
- <td style="padding-left:5px"><small>Revision <%= @revision.number+1 %> of <%= @page.revisions.length %> from
24
- <%= @revision.pretty_created_at %></small></td>
25
- <td style="font-weight:bold;text-align:right;padding-right:5px"><small><%= web.make_link(@page.revisions.first.author, nil, {}) %></small></td>
23
+ <td><small>Entry created on <%= @page.revisions.first.created_at.strftime("%b %d, %Y %H:%M") %> by <%= web.make_link(@page.revisions.first.author, nil, {}) %></td>
24
+ <td style="text-align:right;"><small>Revision <%= @revision.number+1 %> of <%= @page.revisions.length %> from
25
+ <%= @revision.created_at.strftime("%b %d, %Y %H:%M") %>
26
+ <%= web.make_link(@revision.author, nil, {}) %></small></td>
26
27
  </tr>
27
28
  </table>
28
29
 
29
30
  <div class="navigation">
30
31
  <a href="../bliki_edit/<%= @page.name %>" class="navlink">Edit</a> |
32
+ <!-- <a href="../bliki_revision_all/<%= @page.name %>" class="navlink">All Revisions</a> | -->
31
33
  <% if @revision.previous_revision %>
32
34
  <a href="../bliki_revision/<%= @page.name %>?rev=<%= @revision.previous_revision.number %>" class="navlink">Lower</a>
33
35
  <% else %>
@@ -1,45 +1,45 @@
1
- <%
2
- @title = "Editing #{@page.plain_name}"
3
- @content_width = 810
4
- @hide_navigation = true
5
- @hide_menu = true
6
- @style_additions = "#Content, #Container {width = 820px; padding-left:100px;}"
7
- %>
8
- <%= sub_template "top" %>
9
-
10
- <%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
11
-
12
- <%= render_markup_help %>
13
-
14
- <div id='main'>
15
- <form style="float:left" id="editForm" action="../save/<%= @page.name %>" method="post" onSubmit="cleanAuthorName();">
16
- <p>
17
- <textarea name="content" style="width: 550px; height: 400px"><%= @page.content %></textarea>
18
- </p>
19
- <p style="font-size: smaller;">This change is a...
20
- <input type="radio" name="edit_type" value="minor">Minor Edit</input>
21
- <input type="radio" name="edit_type" value="major">Major Edit</input>
22
- <input type="radio" name="edit_type" value="default" checked>Default</input>
23
- <br />
24
- Learn more on the concept of <a href='.' onClick="alert('The default behaviour when revising a page is of a \'Continuous Edit\'.\nThis means that if the previous edit was done by the same author and less than 30 minutes ago, this edit is minor and only the latest version will be kept as the revision. Otherwise (different author and/or more than 30 minutes ago) this edit will create a new revision of the page.\nThis default behaviour can be overriden by specifying a major/minor edit.');return false;">continuous edit</a>.
25
- </p>
26
- <p>
27
- <% if @web.check_pass_on_edit %>
28
- <p>Please enter edit password: <input type="password" name="password" id="password"></p>
29
- <% end %>
30
- <input type="submit" value="Update"> as
31
- <input type="text" name="author" id="authorName" value="<%= @author %>"
32
- onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
33
- | <a href="../cancel_edit/<%= @page.name %>">Cancel</a> <small>(unlocks page)</small>
34
- </p>
35
- </form>
36
- </div>
37
- <script language="JavaScript1.2">
38
- function cleanAuthorName() {
39
- if (document.getElementById('authorName').value == "") {
40
- document.getElementById('authorName').value = 'AnonymousCoward';
41
- }
42
- }
43
- </script>
44
-
1
+ <%
2
+ @title = "Editing #{@page.plain_name}"
3
+ @content_width = 810
4
+ @hide_navigation = true
5
+ @hide_menu = true
6
+ @style_additions = "#Content, #Container {width = 820px; padding-left:100px;}"
7
+ %>
8
+ <%= sub_template "top" %>
9
+
10
+ <%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
11
+
12
+ <%= render_markup_help %>
13
+
14
+ <div id='main'>
15
+ <form style="float:left" id="editForm" action="../save/<%= @page.name %>" method="post" onSubmit="cleanAuthorName();">
16
+ <p>
17
+ <textarea name="content" style="width: 550px; height: 75%"><%= @page.content %></textarea>
18
+ </p>
19
+ <p style="font-size: smaller;">This change is a...
20
+ <input type="radio" name="edit_type" value="minor">Minor Edit</input>
21
+ <input type="radio" name="edit_type" value="major">Major Edit</input>
22
+ <input type="radio" name="edit_type" value="default" checked>Default</input>
23
+ <br />
24
+ Learn more on the concept of <a href='.' onClick="alert('The default behaviour when revising a page is of a \'Continuous Edit\'.\nThis means that if the previous edit was done by the same author and less than 30 minutes ago, this edit is minor and only the latest version will be kept as the revision. Otherwise (different author and/or more than 30 minutes ago) this edit will create a new revision of the page.\nThis default behaviour can be overriden by specifying a major/minor edit.');return false;">continuous edit</a>.
25
+ </p>
26
+ <p>
27
+ <% if @web.check_pass_on_edit %>
28
+ <p>Please enter edit password: <input type="password" name="password" id="password"></p>
29
+ <% end %>
30
+ <input type="submit" value="Update"> as
31
+ <input type="text" name="author" id="authorName" value="<%= @author %>"
32
+ onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
33
+ | <a href="../cancel_edit/<%= @page.name %>">Cancel</a> <small>(unlocks page)</small>
34
+ </p>
35
+ </form>
36
+ </div>
37
+ <script language="JavaScript1.2">
38
+ function cleanAuthorName() {
39
+ if (document.getElementById('authorName').value == "") {
40
+ document.getElementById('authorName').value = 'AnonymousCoward';
41
+ }
42
+ }
43
+ </script>
44
+
45
45
  <%= sub_template "bottom" %>