instiki 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +174 -165
- data/README +68 -68
- data/app/controllers/admin_controller.rb +94 -94
- data/app/controllers/application.rb +135 -131
- data/app/controllers/file_controller.rb +129 -129
- data/app/controllers/wiki_controller.rb +354 -354
- data/app/helpers/application_helper.rb +68 -68
- data/app/models/author.rb +3 -3
- data/app/models/chunks/category.rb +33 -33
- data/app/models/chunks/chunk.rb +86 -86
- data/app/models/chunks/engines.rb +61 -54
- data/app/models/chunks/include.rb +41 -41
- data/app/models/chunks/literal.rb +31 -31
- data/app/models/chunks/nowiki.rb +28 -28
- data/app/models/chunks/test.rb +18 -18
- data/app/models/chunks/uri.rb +182 -182
- data/app/models/chunks/wiki.rb +141 -141
- data/app/models/file_yard.rb +58 -58
- data/app/models/page.rb +112 -112
- data/app/models/page_lock.rb +22 -22
- data/app/models/page_set.rb +89 -89
- data/app/models/revision.rb +123 -123
- data/app/models/web.rb +182 -176
- data/app/models/wiki_content.rb +207 -207
- data/app/models/wiki_service.rb +233 -233
- data/app/models/wiki_words.rb +23 -23
- data/app/views/admin/create_system.rhtml +83 -83
- data/app/views/admin/create_web.rhtml +69 -69
- data/app/views/admin/edit_web.rhtml +137 -136
- data/app/views/file/file.rhtml +18 -18
- data/app/views/file/import.rhtml +22 -22
- data/app/views/layouts/default.rhtml +86 -85
- data/app/views/markdown_help.rhtml +12 -12
- data/app/views/mixed_help.rhtml +6 -6
- data/app/views/navigation.rhtml +30 -30
- data/app/views/rdoc_help.rhtml +12 -12
- data/app/views/textile_help.rhtml +24 -24
- data/app/views/wiki/authors.rhtml +11 -11
- data/app/views/wiki/edit.rhtml +39 -39
- data/app/views/wiki/export.rhtml +12 -12
- data/app/views/wiki/feeds.rhtml +14 -14
- data/app/views/wiki/list.rhtml +64 -64
- data/app/views/wiki/locked.rhtml +23 -23
- data/app/views/wiki/login.rhtml +14 -14
- data/app/views/wiki/new.rhtml +31 -31
- data/app/views/wiki/page.rhtml +115 -115
- data/app/views/wiki/print.rhtml +14 -14
- data/app/views/wiki/published.rhtml +9 -9
- data/app/views/wiki/recently_revised.rhtml +26 -26
- data/app/views/wiki/revision.rhtml +103 -103
- data/app/views/wiki/rollback.rhtml +36 -36
- data/app/views/wiki/rss_feed.rhtml +22 -22
- data/app/views/wiki/search.rhtml +38 -38
- data/app/views/wiki/tex.rhtml +22 -22
- data/app/views/wiki/tex_web.rhtml +34 -34
- data/app/views/wiki/web_list.rhtml +18 -18
- data/app/views/wiki_words_help.rhtml +9 -9
- data/config/environment.rb +82 -82
- data/config/environments/development.rb +5 -5
- data/config/environments/production.rb +4 -4
- data/config/environments/test.rb +17 -17
- data/config/routes.rb +18 -18
- data/lib/active_record_stub.rb +31 -31
- data/lib/bluecloth_tweaked.rb +1127 -0
- data/lib/diff.rb +444 -444
- data/lib/instiki_errors.rb +14 -14
- data/lib/rdocsupport.rb +151 -151
- data/lib/redcloth_for_tex.rb +736 -736
- data/natives/osx/desktop_launcher/AppDelegate.h +18 -18
- data/natives/osx/desktop_launcher/AppDelegate.mm +109 -109
- data/natives/osx/desktop_launcher/Credits.html +15 -15
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/classes.nib +12 -12
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/info.nib +24 -24
- data/natives/osx/desktop_launcher/Info.plist +12 -12
- data/natives/osx/desktop_launcher/Instiki.xcode/project.pbxproj +592 -592
- data/natives/osx/desktop_launcher/Instiki_Prefix.pch +7 -7
- data/natives/osx/desktop_launcher/MakeDMG.sh +9 -9
- data/natives/osx/desktop_launcher/main.mm +14 -14
- data/natives/osx/desktop_launcher/version.plist +16 -16
- data/public/404.html +5 -5
- data/public/500.html +5 -5
- data/public/dispatch.rb +9 -9
- data/public/javascripts/edit_web.js +52 -52
- data/public/javascripts/prototype.js +336 -336
- data/public/stylesheets/instiki.css +222 -222
- data/script/breakpointer +4 -4
- data/script/server +93 -93
- metadata +4 -3
data/app/views/wiki/edit.rhtml
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
<%
|
2
|
-
@title = "Editing #{@page.name}"
|
3
|
-
@content_width = 720
|
4
|
-
@hide_navigation = true
|
5
|
-
%>
|
6
|
-
|
7
|
-
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
8
|
-
|
9
|
-
<div id="MarkupHelp" style="float: right; width: 250px; margin-top: 5px">
|
10
|
-
<%= render("#{@web.markup}_help") %>
|
11
|
-
<%= render 'wiki_words_help' %>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<%= form_tag({ :action => 'save', :web => @web.address, :id => @page.name},
|
15
|
-
{'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'})
|
16
|
-
%>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<textarea name="content" style="width: 450px; height: 500px"><%= @page.content %></textarea>
|
20
|
-
</p>
|
21
|
-
<p>
|
22
|
-
<input type="submit" value="Submit" accesskey="s"/> as
|
23
|
-
<input type="text" name="author" id="authorName" value="<%= @author %>"
|
24
|
-
onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
|
25
|
-
|
|
26
|
-
<%= link_to('Cancel', {:web => @web.address, :action => 'cancel_edit', :id => @page.name},
|
27
|
-
{:accesskey => 'c'})
|
28
|
-
%>
|
29
|
-
<small>(unlocks page)</small>
|
30
|
-
</p>
|
31
|
-
<%= end_form_tag %>
|
32
|
-
|
33
|
-
<script language="JavaScript1.2">
|
34
|
-
function cleanAuthorName() {
|
35
|
-
if (document.getElementById('authorName').value == "") {
|
36
|
-
document.getElementById('authorName').value = 'AnonymousCoward';
|
37
|
-
}
|
38
|
-
}
|
39
|
-
</script>
|
1
|
+
<%
|
2
|
+
@title = "Editing #{@page.name}"
|
3
|
+
@content_width = 720
|
4
|
+
@hide_navigation = true
|
5
|
+
%>
|
6
|
+
|
7
|
+
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
8
|
+
|
9
|
+
<div id="MarkupHelp" style="float: right; width: 250px; margin-top: 5px">
|
10
|
+
<%= render("#{@web.markup}_help") %>
|
11
|
+
<%= render 'wiki_words_help' %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%= form_tag({ :action => 'save', :web => @web.address, :id => @page.name},
|
15
|
+
{'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'})
|
16
|
+
%>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<textarea name="content" style="width: 450px; height: 500px"><%= h @page.content %></textarea>
|
20
|
+
</p>
|
21
|
+
<p>
|
22
|
+
<input type="submit" value="Submit" accesskey="s"/> as
|
23
|
+
<input type="text" name="author" id="authorName" value="<%= @author %>"
|
24
|
+
onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
|
25
|
+
|
|
26
|
+
<%= link_to('Cancel', {:web => @web.address, :action => 'cancel_edit', :id => @page.name},
|
27
|
+
{:accesskey => 'c'})
|
28
|
+
%>
|
29
|
+
<small>(unlocks page)</small>
|
30
|
+
</p>
|
31
|
+
<%= end_form_tag %>
|
32
|
+
|
33
|
+
<script language="JavaScript1.2">
|
34
|
+
function cleanAuthorName() {
|
35
|
+
if (document.getElementById('authorName').value == "") {
|
36
|
+
document.getElementById('authorName').value = 'AnonymousCoward';
|
37
|
+
}
|
38
|
+
}
|
39
|
+
</script>
|
data/app/views/wiki/export.rhtml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
<% @title = "Export" %>
|
2
|
-
|
3
|
-
<p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
|
4
|
-
|
5
|
-
<ul id="feedsList">
|
6
|
-
<li><%= link_to 'HTML', :web => @web.address, :action => 'export_html' %></li>
|
7
|
-
<li><%= link_to "Markup (#{@web.markup.to_s.capitalize})", :web => @web.address, :action => 'export_markup' %></li>
|
8
|
-
<% if OPTIONS[:pdflatex] && @web.markup == :textile %>
|
9
|
-
<li><%= link_to 'TeX', :web => @web.address, :action => 'export_tex' %></li>
|
10
|
-
<li><%= link_to 'PDF', :web => @web.address, :action => 'export_pdf' %></li>
|
11
|
-
<% end %>
|
12
|
-
</ul>
|
1
|
+
<% @title = "Export" %>
|
2
|
+
|
3
|
+
<p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
|
4
|
+
|
5
|
+
<ul id="feedsList">
|
6
|
+
<li><%= link_to 'HTML', :web => @web.address, :action => 'export_html' %></li>
|
7
|
+
<li><%= link_to "Markup (#{@web.markup.to_s.capitalize})", :web => @web.address, :action => 'export_markup' %></li>
|
8
|
+
<% if OPTIONS[:pdflatex] && @web.markup == :textile %>
|
9
|
+
<li><%= link_to 'TeX', :web => @web.address, :action => 'export_tex' %></li>
|
10
|
+
<li><%= link_to 'PDF', :web => @web.address, :action => 'export_pdf' %></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
data/app/views/wiki/feeds.rhtml
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
<% @title = "Feeds" %>
|
2
|
-
|
3
|
-
<p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
|
4
|
-
|
5
|
-
<ul id="feedsList">
|
6
|
-
<li>
|
7
|
-
<% if @rss_with_content_allowed %>
|
8
|
-
<%= link_to 'Full content (RSS 2.0)', :web => @web.address, :action => :rss_with_content %>
|
9
|
-
<% end %>
|
10
|
-
</li>
|
11
|
-
<li>
|
12
|
-
<%= link_to 'Headlines (RSS 2.0)', :web => @web.address, :action => :rss_with_headlines %>
|
13
|
-
</li>
|
14
|
-
</ul>
|
1
|
+
<% @title = "Feeds" %>
|
2
|
+
|
3
|
+
<p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
|
4
|
+
|
5
|
+
<ul id="feedsList">
|
6
|
+
<li>
|
7
|
+
<% if @rss_with_content_allowed %>
|
8
|
+
<%= link_to 'Full content (RSS 2.0)', :web => @web.address, :action => :rss_with_content %>
|
9
|
+
<% end %>
|
10
|
+
</li>
|
11
|
+
<li>
|
12
|
+
<%= link_to 'Headlines (RSS 2.0)', :web => @web.address, :action => :rss_with_headlines %>
|
13
|
+
</li>
|
14
|
+
</ul>
|
data/app/views/wiki/list.rhtml
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
<% @title = "All Pages" %>
|
2
|
-
|
3
|
-
<%= categories_menu unless @categories.empty? %>
|
4
|
-
|
5
|
-
<div id="allPages" style="float: left; width: 280px; margin-right: 30px">
|
6
|
-
<% unless @pages_that_are_orphaned.empty? && @page_names_that_are_wanted.empty? %>
|
7
|
-
<h2>
|
8
|
-
All Pages
|
9
|
-
<br/><small style="font-size: 12px"><i>All pages in <%= @set_name %> listed alphabetically</i></small>
|
10
|
-
</h2>
|
11
|
-
<% end %>
|
12
|
-
|
13
|
-
<ul>
|
14
|
-
<% @pages_by_name.each do |page| %>
|
15
|
-
<li>
|
16
|
-
<%= link_to_existing_page page, truncate(page.plain_name, 35) %>
|
17
|
-
</li>
|
18
|
-
<% end %></ul>
|
19
|
-
|
20
|
-
<% if @web.count_pages %>
|
21
|
-
<% total_chars = @pages_in_category.characters %>
|
22
|
-
<p><small>All content: <%= total_chars %> chars / <%= sprintf("%-.1f", (total_chars / 2275 )) %> pages</small></p>
|
23
|
-
<% end %>
|
24
|
-
</div>
|
25
|
-
|
26
|
-
<div style="float: left; width: 280px">
|
27
|
-
<% unless @page_names_that_are_wanted.empty? %>
|
28
|
-
<h2>
|
29
|
-
Wanted Pages
|
30
|
-
<br/>
|
31
|
-
<small style="font-size: 12px">
|
32
|
-
<i>Unexisting pages that other pages in <%= @set_name %> reference</i>
|
33
|
-
</small>
|
34
|
-
</h2>
|
35
|
-
|
36
|
-
<ul style="margin-bottom: 10px">
|
37
|
-
<% @page_names_that_are_wanted.each do |wanted_page_name| %>
|
38
|
-
<li>
|
39
|
-
<%= link_to_page(wanted_page_name, @web, truncate(WikiWords.separate(wanted_page_name), 35)) %>
|
40
|
-
wanted by
|
41
|
-
<%= @web.select.pages_that_reference(wanted_page_name).collect { |referring_page|
|
42
|
-
link_to_existing_page referring_page
|
43
|
-
}.join(", ")
|
44
|
-
%>
|
45
|
-
</li>
|
46
|
-
<% end %>
|
47
|
-
</ul>
|
48
|
-
<% end %>
|
49
|
-
|
50
|
-
<% unless @pages_that_are_orphaned.empty? %>
|
51
|
-
<h2>
|
52
|
-
Orphaned Pages
|
53
|
-
<br/><small style="font-size: 12px"><i>Pages in <%= @set_name %> that no other page reference</i></small>
|
54
|
-
</h2>
|
55
|
-
|
56
|
-
<ul style="margin-bottom: 35px">
|
57
|
-
<% @pages_that_are_orphaned.each do |orphan_page| %>
|
58
|
-
<li>
|
59
|
-
<%= link_to_existing_page orphan_page %>
|
60
|
-
</li>
|
61
|
-
<% end %>
|
62
|
-
</ul>
|
63
|
-
<% end %>
|
64
|
-
</div>
|
1
|
+
<% @title = "All Pages" %>
|
2
|
+
|
3
|
+
<%= categories_menu unless @categories.empty? %>
|
4
|
+
|
5
|
+
<div id="allPages" style="float: left; width: 280px; margin-right: 30px">
|
6
|
+
<% unless @pages_that_are_orphaned.empty? && @page_names_that_are_wanted.empty? %>
|
7
|
+
<h2>
|
8
|
+
All Pages
|
9
|
+
<br/><small style="font-size: 12px"><i>All pages in <%= @set_name %> listed alphabetically</i></small>
|
10
|
+
</h2>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<ul>
|
14
|
+
<% @pages_by_name.each do |page| %>
|
15
|
+
<li>
|
16
|
+
<%= link_to_existing_page page, truncate(page.plain_name, 35) %>
|
17
|
+
</li>
|
18
|
+
<% end %></ul>
|
19
|
+
|
20
|
+
<% if @web.count_pages %>
|
21
|
+
<% total_chars = @pages_in_category.characters %>
|
22
|
+
<p><small>All content: <%= total_chars %> chars / <%= sprintf("%-.1f", (total_chars / 2275 )) %> pages</small></p>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div style="float: left; width: 280px">
|
27
|
+
<% unless @page_names_that_are_wanted.empty? %>
|
28
|
+
<h2>
|
29
|
+
Wanted Pages
|
30
|
+
<br/>
|
31
|
+
<small style="font-size: 12px">
|
32
|
+
<i>Unexisting pages that other pages in <%= @set_name %> reference</i>
|
33
|
+
</small>
|
34
|
+
</h2>
|
35
|
+
|
36
|
+
<ul style="margin-bottom: 10px">
|
37
|
+
<% @page_names_that_are_wanted.each do |wanted_page_name| %>
|
38
|
+
<li>
|
39
|
+
<%= link_to_page(wanted_page_name, @web, truncate(WikiWords.separate(wanted_page_name), 35)) %>
|
40
|
+
wanted by
|
41
|
+
<%= @web.select.pages_that_reference(wanted_page_name).collect { |referring_page|
|
42
|
+
link_to_existing_page referring_page
|
43
|
+
}.join(", ")
|
44
|
+
%>
|
45
|
+
</li>
|
46
|
+
<% end %>
|
47
|
+
</ul>
|
48
|
+
<% end %>
|
49
|
+
|
50
|
+
<% unless @pages_that_are_orphaned.empty? %>
|
51
|
+
<h2>
|
52
|
+
Orphaned Pages
|
53
|
+
<br/><small style="font-size: 12px"><i>Pages in <%= @set_name %> that no other page reference</i></small>
|
54
|
+
</h2>
|
55
|
+
|
56
|
+
<ul style="margin-bottom: 35px">
|
57
|
+
<% @pages_that_are_orphaned.each do |orphan_page| %>
|
58
|
+
<li>
|
59
|
+
<%= link_to_existing_page orphan_page %>
|
60
|
+
</li>
|
61
|
+
<% end %>
|
62
|
+
</ul>
|
63
|
+
<% end %>
|
64
|
+
</div>
|
data/app/views/wiki/locked.rhtml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
<% @title = "#{@page.plain_name} is locked" %>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<%= link_to_page(@page.locked_by) %>
|
5
|
-
<% if @page.lock_duration(Time.now) == 0 %>
|
6
|
-
just started editing this page.
|
7
|
-
<% else %>
|
8
|
-
has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.
|
9
|
-
<% end %>
|
10
|
-
</p>
|
11
|
-
|
12
|
-
<p>
|
13
|
-
<%= link_to 'Edit the page anyway',
|
14
|
-
{:web => @web_name, :action => 'edit', :id => @page.name, :params => {'break_lock' => '1'} },
|
15
|
-
{:accesskey => 'E'}
|
16
|
-
%>
|
17
|
-
|
18
|
-
<%= link_to 'Cancel',
|
19
|
-
{:web => @web_name, :action => 'show', :id => @page.name},
|
20
|
-
{:accesskey => 'C'}
|
21
|
-
%>
|
22
|
-
|
23
|
-
</p>
|
1
|
+
<% @title = "#{@page.plain_name} is locked" %>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<%= link_to_page(@page.locked_by) %>
|
5
|
+
<% if @page.lock_duration(Time.now) == 0 %>
|
6
|
+
just started editing this page.
|
7
|
+
<% else %>
|
8
|
+
has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.
|
9
|
+
<% end %>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<p>
|
13
|
+
<%= link_to 'Edit the page anyway',
|
14
|
+
{:web => @web_name, :action => 'edit', :id => @page.name, :params => {'break_lock' => '1'} },
|
15
|
+
{:accesskey => 'E'}
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= link_to 'Cancel',
|
19
|
+
{:web => @web_name, :action => 'show', :id => @page.name},
|
20
|
+
{:accesskey => 'C'}
|
21
|
+
%>
|
22
|
+
|
23
|
+
</p>
|
data/app/views/wiki/login.rhtml
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
<% @title = "#{@web_name} Login" %><% @hide_navigation = true %>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<%= form_tag({ :controller => 'wiki', :action => 'authenticate', :web => @web.address},
|
5
|
-
{ 'name' => 'loginForm', 'id' => 'loginForm', 'method' => 'post'})
|
6
|
-
%>
|
7
|
-
<b>Password</b><br />
|
8
|
-
<input type="password" name="password" id="password" default="yes" />
|
9
|
-
<%= end_form_tag %>
|
10
|
-
</p>
|
11
|
-
|
12
|
-
<script language="JavaScript">
|
13
|
-
document.forms["loginForm"].elements["password"].focus();
|
14
|
-
</script>
|
1
|
+
<% @title = "#{@web_name} Login" %><% @hide_navigation = true %>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<%= form_tag({ :controller => 'wiki', :action => 'authenticate', :web => @web.address},
|
5
|
+
{ 'name' => 'loginForm', 'id' => 'loginForm', 'method' => 'post'})
|
6
|
+
%>
|
7
|
+
<b>Password</b><br />
|
8
|
+
<input type="password" name="password" id="password" default="yes" />
|
9
|
+
<%= end_form_tag %>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<script language="JavaScript">
|
13
|
+
document.forms["loginForm"].elements["password"].focus();
|
14
|
+
</script>
|
data/app/views/wiki/new.rhtml
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
<%
|
2
|
-
@title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
|
3
|
-
@content_width = 720
|
4
|
-
@hide_navigation = true
|
5
|
-
%>
|
6
|
-
|
7
|
-
<div id="MarkupHelp" style="float: right; width: 250px; margin-top: 5px">
|
8
|
-
<%= render("#{@web.markup}_help") %>
|
9
|
-
<%= render 'wiki_words_help' %>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<%= form_tag({ :action => 'save', :web => @web.address, :id => @page_name},
|
13
|
-
{'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'})
|
14
|
-
%>
|
15
|
-
|
16
|
-
<p>
|
17
|
-
<textarea name="content" style="width: 450px; height: 500px"></textarea>
|
18
|
-
</p>
|
19
|
-
<p>
|
20
|
-
<input type="submit" value="Submit" accesskey="s"/> as
|
21
|
-
<input type="text" name="author" id="authorName" value="<%= @author %>" onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
|
22
|
-
</p>
|
23
|
-
<%= end_form_tag %>
|
24
|
-
|
25
|
-
<script language="JavaScript1.2">
|
26
|
-
function cleanAuthorName() {
|
27
|
-
if (document.getElementById('authorName').value == "") {
|
28
|
-
document.getElementById('authorName').value = 'AnonymousCoward';
|
29
|
-
}
|
30
|
-
}
|
31
|
-
</script>
|
1
|
+
<%
|
2
|
+
@title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
|
3
|
+
@content_width = 720
|
4
|
+
@hide_navigation = true
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div id="MarkupHelp" style="float: right; width: 250px; margin-top: 5px">
|
8
|
+
<%= render("#{@web.markup}_help") %>
|
9
|
+
<%= render 'wiki_words_help' %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<%= form_tag({ :action => 'save', :web => @web.address, :id => @page_name},
|
13
|
+
{'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'})
|
14
|
+
%>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<textarea name="content" style="width: 450px; height: 500px"></textarea>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<input type="submit" value="Submit" accesskey="s"/> as
|
21
|
+
<input type="text" name="author" id="authorName" value="<%= @author %>" onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
|
22
|
+
</p>
|
23
|
+
<%= end_form_tag %>
|
24
|
+
|
25
|
+
<script language="JavaScript1.2">
|
26
|
+
function cleanAuthorName() {
|
27
|
+
if (document.getElementById('authorName').value == "") {
|
28
|
+
document.getElementById('authorName').value = 'AnonymousCoward';
|
29
|
+
}
|
30
|
+
}
|
31
|
+
</script>
|
data/app/views/wiki/page.rhtml
CHANGED
@@ -1,115 +1,115 @@
|
|
1
|
-
<%
|
2
|
-
@title = @page.plain_name
|
3
|
-
@show_footer = true
|
4
|
-
%>
|
5
|
-
|
6
|
-
<div id="revision">
|
7
|
-
<%= @page.display_content %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<div id="changes" style="display: none">
|
11
|
-
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
12
|
-
<small>
|
13
|
-
Showing changes from revision #<%= @page.number - 1 %> to #<%= @page.number %>:
|
14
|
-
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
15
|
-
</small>
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<%= @page.display_diff %>
|
19
|
-
</div>
|
20
|
-
|
21
|
-
<div class="byline">
|
22
|
-
<%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
|
23
|
-
by <%= @page.author_link %>
|
24
|
-
<%= "(#{@page.author.ip})" if @page.author.respond_to?(:ip) %>
|
25
|
-
<% if @web.count_pages %>
|
26
|
-
<% total_chars = @page.content.length %>
|
27
|
-
(<%= total_chars %> characters / <%= sprintf("%-.1f", (total_chars / 2275 rescue 0)) %> pages)
|
28
|
-
<% end %>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<div class="navigation">
|
32
|
-
<% if @page.name == "HomePage" %>
|
33
|
-
<%= link_to('Edit Page',
|
34
|
-
{:web => @web.address, :action => 'edit', :id => @page.name},
|
35
|
-
{:class => 'navlink', :accesskey => 'E'})
|
36
|
-
%>
|
37
|
-
|
|
38
|
-
<%= link_to('Edit Web',
|
39
|
-
{:web => @web.address, :action => 'edit_web'},
|
40
|
-
{:class => 'navlink'})
|
41
|
-
%>
|
42
|
-
<% else %>
|
43
|
-
<%= link_to('Edit',
|
44
|
-
{:web => @web.address, :action => 'edit', :id => @page.name},
|
45
|
-
{:class => 'navlink', :accesskey => 'E'})
|
46
|
-
%>
|
47
|
-
<% end %>
|
48
|
-
|
49
|
-
<% if @page.revisions.length > 1 %>
|
50
|
-
|
|
51
|
-
<%= link_to('Back in time',
|
52
|
-
{:web => @web.address, :action => 'revision', :id => @page.name,
|
53
|
-
:rev => @page.revisions.length - 2},
|
54
|
-
{:class => 'navlink', :accesskey => 'R'})
|
55
|
-
%>
|
56
|
-
<small>(<%= @page.revisions.length - 1 %> revisions)</small>
|
57
|
-
<% end %>
|
58
|
-
|
59
|
-
<% if @page.revisions.length > 1 %>
|
60
|
-
<span id="show_changes">
|
61
|
-
| <a href="#" onClick="toggleChanges(); return false;">See changes</a>
|
62
|
-
</span>
|
63
|
-
<span id="hide_changes" style="display: none">
|
64
|
-
| <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
|
65
|
-
</span>
|
66
|
-
<% end %>
|
67
|
-
|
68
|
-
<small>
|
69
|
-
| Views:
|
70
|
-
<%= link_to('Print',
|
71
|
-
{:web => @web.address, :action => 'print', :id => @page.name},
|
72
|
-
{:accesskey => 'p'}) %>
|
73
|
-
<% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile %>
|
74
|
-
|
|
75
|
-
<%= link_to 'TeX', :web => @web.address, :action => 'tex', :id => @page.name %>
|
76
|
-
|
|
77
|
-
<%= link_to 'PDF', :web => @web.address, :action => 'pdf', :id => @page.name %>
|
78
|
-
<% end %>
|
79
|
-
</small>
|
80
|
-
|
81
|
-
<% unless @page.linked_from.empty? %>
|
82
|
-
<small>
|
83
|
-
| Linked from:
|
84
|
-
<%= @page.linked_from.collect { |referring_page|
|
85
|
-
link_to_existing_page referring_page
|
86
|
-
}.join(", ")
|
87
|
-
%>
|
88
|
-
</small>
|
89
|
-
<% end %>
|
90
|
-
|
91
|
-
<% if @page.included_from.length > 0 %>
|
92
|
-
<small>
|
93
|
-
| Included from: <%= @page.included_from.collect { |referring_page|
|
94
|
-
link_to_existing_page referring_page
|
95
|
-
}.join(", ")
|
96
|
-
%>
|
97
|
-
</small>
|
98
|
-
<% end %>
|
99
|
-
</div>
|
100
|
-
|
101
|
-
<script language="Javascript">
|
102
|
-
function toggleChanges() {
|
103
|
-
if (document.getElementById("changes").style.display == "none") {
|
104
|
-
document.getElementById("changes").style.display = "block";
|
105
|
-
document.getElementById("revision").style.display = "none";
|
106
|
-
document.getElementById("show_changes").style.display = "none";
|
107
|
-
document.getElementById("hide_changes").style.display = "inline";
|
108
|
-
} else {
|
109
|
-
document.getElementById("changes").style.display = "none";
|
110
|
-
document.getElementById("revision").style.display = "block";
|
111
|
-
document.getElementById("show_changes").style.display = "inline";
|
112
|
-
document.getElementById("hide_changes").style.display = "none";
|
113
|
-
}
|
114
|
-
}
|
115
|
-
</script>
|
1
|
+
<%
|
2
|
+
@title = @page.plain_name
|
3
|
+
@show_footer = true
|
4
|
+
%>
|
5
|
+
|
6
|
+
<div id="revision">
|
7
|
+
<%= @page.display_content %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div id="changes" style="display: none">
|
11
|
+
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
12
|
+
<small>
|
13
|
+
Showing changes from revision #<%= @page.number - 1 %> to #<%= @page.number %>:
|
14
|
+
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
15
|
+
</small>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<%= @page.display_diff %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="byline">
|
22
|
+
<%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
|
23
|
+
by <%= @page.author_link %>
|
24
|
+
<%= "(#{@page.author.ip})" if @page.author.respond_to?(:ip) %>
|
25
|
+
<% if @web.count_pages %>
|
26
|
+
<% total_chars = @page.content.length %>
|
27
|
+
(<%= total_chars %> characters / <%= sprintf("%-.1f", (total_chars / 2275 rescue 0)) %> pages)
|
28
|
+
<% end %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="navigation">
|
32
|
+
<% if @page.name == "HomePage" %>
|
33
|
+
<%= link_to('Edit Page',
|
34
|
+
{:web => @web.address, :action => 'edit', :id => @page.name},
|
35
|
+
{:class => 'navlink', :accesskey => 'E'})
|
36
|
+
%>
|
37
|
+
|
|
38
|
+
<%= link_to('Edit Web',
|
39
|
+
{:web => @web.address, :action => 'edit_web'},
|
40
|
+
{:class => 'navlink'})
|
41
|
+
%>
|
42
|
+
<% else %>
|
43
|
+
<%= link_to('Edit',
|
44
|
+
{:web => @web.address, :action => 'edit', :id => @page.name},
|
45
|
+
{:class => 'navlink', :accesskey => 'E'})
|
46
|
+
%>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
<% if @page.revisions.length > 1 %>
|
50
|
+
|
|
51
|
+
<%= link_to('Back in time',
|
52
|
+
{:web => @web.address, :action => 'revision', :id => @page.name,
|
53
|
+
:rev => @page.revisions.length - 2},
|
54
|
+
{:class => 'navlink', :accesskey => 'R'})
|
55
|
+
%>
|
56
|
+
<small>(<%= @page.revisions.length - 1 %> revisions)</small>
|
57
|
+
<% end %>
|
58
|
+
|
59
|
+
<% if @page.revisions.length > 1 %>
|
60
|
+
<span id="show_changes">
|
61
|
+
| <a href="#" onClick="toggleChanges(); return false;">See changes</a>
|
62
|
+
</span>
|
63
|
+
<span id="hide_changes" style="display: none">
|
64
|
+
| <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
|
65
|
+
</span>
|
66
|
+
<% end %>
|
67
|
+
|
68
|
+
<small>
|
69
|
+
| Views:
|
70
|
+
<%= link_to('Print',
|
71
|
+
{:web => @web.address, :action => 'print', :id => @page.name},
|
72
|
+
{:accesskey => 'p'}) %>
|
73
|
+
<% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile %>
|
74
|
+
|
|
75
|
+
<%= link_to 'TeX', :web => @web.address, :action => 'tex', :id => @page.name %>
|
76
|
+
|
|
77
|
+
<%= link_to 'PDF', :web => @web.address, :action => 'pdf', :id => @page.name %>
|
78
|
+
<% end %>
|
79
|
+
</small>
|
80
|
+
|
81
|
+
<% unless @page.linked_from.empty? %>
|
82
|
+
<small>
|
83
|
+
| Linked from:
|
84
|
+
<%= @page.linked_from.collect { |referring_page|
|
85
|
+
link_to_existing_page referring_page
|
86
|
+
}.join(", ")
|
87
|
+
%>
|
88
|
+
</small>
|
89
|
+
<% end %>
|
90
|
+
|
91
|
+
<% if @page.included_from.length > 0 %>
|
92
|
+
<small>
|
93
|
+
| Included from: <%= @page.included_from.collect { |referring_page|
|
94
|
+
link_to_existing_page referring_page
|
95
|
+
}.join(", ")
|
96
|
+
%>
|
97
|
+
</small>
|
98
|
+
<% end %>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<script language="Javascript" type="text/Javascript">
|
102
|
+
function toggleChanges() {
|
103
|
+
if (document.getElementById("changes").style.display == "none") {
|
104
|
+
document.getElementById("changes").style.display = "block";
|
105
|
+
document.getElementById("revision").style.display = "none";
|
106
|
+
document.getElementById("show_changes").style.display = "none";
|
107
|
+
document.getElementById("hide_changes").style.display = "inline";
|
108
|
+
} else {
|
109
|
+
document.getElementById("changes").style.display = "none";
|
110
|
+
document.getElementById("revision").style.display = "block";
|
111
|
+
document.getElementById("show_changes").style.display = "inline";
|
112
|
+
document.getElementById("hide_changes").style.display = "none";
|
113
|
+
}
|
114
|
+
}
|
115
|
+
</script>
|