Soks 0.0.2 → 0.0.3

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.
Files changed (132) hide show
  1. data/README.txt +5 -4
  2. data/bin/soks-create-wiki.rb +153 -19
  3. data/contrib/easyprompt.rb +58 -0
  4. data/contrib/easyprompt_licence.txt +504 -0
  5. data/contrib/redcloth-2.0.11.rb +3 -1
  6. data/lib/authenticators.rb +18 -2
  7. data/lib/soks-helpers.rb +207 -157
  8. data/lib/soks-model.rb +131 -114
  9. data/lib/soks-servlet.rb +54 -35
  10. data/lib/soks-storage.rb +134 -0
  11. data/lib/soks-upgrade-0.0.2.rb +70 -0
  12. data/lib/soks-utils.rb +129 -19
  13. data/lib/soks-view.rb +136 -62
  14. data/lib/soks.rb +3 -1
  15. data/{template → templates/default}/attachment/logo.png +0 -0
  16. data/templates/default/attachment/logo.tiff +0 -0
  17. data/templates/default/attachment/newpage.js +41 -0
  18. data/templates/default/attachment/print_stylesheet.css +7 -0
  19. data/templates/default/attachment/rss.png +0 -0
  20. data/{template → templates/default}/attachment/stylesheet.css +44 -17
  21. data/templates/default/banned_titles.txt +31 -0
  22. data/templates/default/content/Bug%3A%20In%20a%20list%20of%20links%2C%20the%20last%20link%20is%20sometimes%20not%20linked.textile +10 -0
  23. data/templates/default/content/Bug%3A%20Symbols%20are%20not%20always%20correctly%20rendered%20in%20html.textile +3 -0
  24. data/templates/default/content/Bug%3A%20Uploads%20are%20not%20password%20protected.textile +3 -0
  25. data/templates/default/content/How%20to%20administrate%20this%20wiki.textile +62 -0
  26. data/templates/default/content/How%20to%20change%20the%20way%20this%20wiki%20looks.textile +30 -0
  27. data/templates/default/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  28. data/{template → templates/default}/content/How%20to%20hack%20soks.textile +3 -2
  29. data/{template → templates/default}/content/How%20to%20import%20a%20site%20from%20instiki.textile +1 -1
  30. data/templates/default/content/How%20to%20use%20this%20wiki.textile +27 -0
  31. data/templates/default/content/List%20of%20changes.textile +35 -0
  32. data/{template → templates/default}/content/Picture%20of%20a%20pair%20of%20soks.textile +0 -0
  33. data/{template → templates/default}/content/Soks%20Licence.textile +0 -0
  34. data/templates/default/content/home%20page.textile +17 -0
  35. data/templates/default/start.rb +94 -0
  36. data/templates/default/version.txt +1 -0
  37. data/{template → templates/default}/views/Page_content.rhtml +0 -0
  38. data/templates/default/views/Page_edit.rhtml +61 -0
  39. data/templates/default/views/Page_meta.rhtml +40 -0
  40. data/templates/default/views/Page_print.rhtml +6 -0
  41. data/templates/default/views/Page_revisions.rhtml +19 -0
  42. data/templates/default/views/Page_rss.rhtml +55 -0
  43. data/{template → templates/default}/views/Page_search_results.rhtml +1 -1
  44. data/templates/default/views/Page_view.rhtml +4 -0
  45. data/templates/default/views/UploadPage_edit.rhtml +38 -0
  46. data/templates/default/views/frame.rhtml +41 -0
  47. data/templates/default/views/messages.yaml +6 -0
  48. data/templates/instiki/attachment/header_backdrop.png +0 -0
  49. data/templates/instiki/attachment/instiki_style_sheet.css +199 -0
  50. data/templates/instiki/attachment/logo.tiff +0 -0
  51. data/templates/instiki/attachment/logotext.png +0 -0
  52. data/templates/instiki/attachment/newpage.js +41 -0
  53. data/templates/instiki/attachment/rss.png +0 -0
  54. data/templates/instiki/banned_titles.txt +31 -0
  55. data/templates/instiki/content/AutomaticSummary.textile +24 -0
  56. data/templates/instiki/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  57. data/templates/instiki/content/How%20to%20hack%20soks.textile +61 -0
  58. data/templates/instiki/content/How%20to%20import%20a%20site%20from%20instiki.textile +13 -0
  59. data/{template → templates/instiki}/content/Improving%20the%20style%20of%20this%20wiki.textile +2 -2
  60. data/templates/instiki/content/Known%20bugs.textile +8 -0
  61. data/templates/instiki/content/List%20of%20changes.textile +34 -0
  62. data/templates/instiki/content/Picture%20of%20a%20pair%20of%20soks.textile +1 -0
  63. data/templates/instiki/content/Pointers%20on%20adjusting%20the%20settings.textile +62 -0
  64. data/templates/instiki/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +27 -0
  65. data/templates/instiki/content/Recent%20Blog%20Entries.textile +3 -0
  66. data/templates/instiki/content/Recent%20Changes%20to%20This%20Site.textile +48 -0
  67. data/templates/instiki/content/Site%20Index.textile +16 -0
  68. data/templates/instiki/content/Soks%20Licence.textile +64 -0
  69. data/{template → templates/instiki}/content/home%20page.textile +9 -4
  70. data/templates/instiki/start.rb +85 -0
  71. data/templates/instiki/version.txt +1 -0
  72. data/templates/instiki/views/Page_content.rhtml +1 -0
  73. data/templates/instiki/views/Page_edit.rhtml +8 -0
  74. data/templates/instiki/views/Page_meta.rhtml +34 -0
  75. data/templates/instiki/views/Page_print.rhtml +6 -0
  76. data/templates/instiki/views/Page_revisions.rhtml +17 -0
  77. data/templates/instiki/views/Page_rss.rhtml +55 -0
  78. data/templates/instiki/views/Page_search_results.rhtml +18 -0
  79. data/templates/instiki/views/Page_view.rhtml +2 -0
  80. data/templates/instiki/views/UploadPage_edit.rhtml +16 -0
  81. data/templates/instiki/views/frame.rhtml +90 -0
  82. data/templates/instiki/views/messages.yaml +6 -0
  83. data/templates/rails/attachment/2colheader.css +77 -0
  84. data/templates/rails/attachment/basics.css +98 -0
  85. data/templates/rails/attachment/header_backdrop.png +0 -0
  86. data/templates/rails/attachment/logo.tiff +0 -0
  87. data/templates/rails/attachment/logotext.png +0 -0
  88. data/templates/rails/attachment/newpage.js +41 -0
  89. data/templates/rails/attachment/rss.png +0 -0
  90. data/templates/rails/banned_titles.txt +31 -0
  91. data/templates/rails/content/AutomaticSummary.textile +24 -0
  92. data/templates/rails/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  93. data/templates/rails/content/How%20to%20hack%20soks.textile +61 -0
  94. data/templates/rails/content/How%20to%20import%20a%20site%20from%20instiki.textile +13 -0
  95. data/templates/rails/content/Improving%20the%20style%20of%20this%20wiki.textile +30 -0
  96. data/templates/rails/content/Known%20bugs.textile +8 -0
  97. data/templates/rails/content/List%20of%20changes.textile +34 -0
  98. data/templates/rails/content/Picture%20of%20a%20pair%20of%20soks.textile +1 -0
  99. data/templates/rails/content/Pointers%20on%20adjusting%20the%20settings.textile +62 -0
  100. data/templates/rails/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +27 -0
  101. data/templates/rails/content/Recent%20Blog%20Entries.textile +3 -0
  102. data/templates/rails/content/Recent%20Changes%20to%20This%20Site.textile +48 -0
  103. data/templates/rails/content/Site%20Index.textile +16 -0
  104. data/templates/rails/content/Soks%20Licence.textile +64 -0
  105. data/templates/rails/content/home%20page.textile +23 -0
  106. data/templates/rails/start.rb +85 -0
  107. data/templates/rails/version.txt +1 -0
  108. data/templates/rails/views/Page_content.rhtml +1 -0
  109. data/templates/rails/views/Page_edit.rhtml +61 -0
  110. data/templates/rails/views/Page_meta.rhtml +38 -0
  111. data/templates/rails/views/Page_print.rhtml +6 -0
  112. data/templates/rails/views/Page_revisions.rhtml +19 -0
  113. data/templates/rails/views/Page_rss.rhtml +55 -0
  114. data/templates/rails/views/Page_search_results.rhtml +19 -0
  115. data/templates/rails/views/Page_view.rhtml +3 -0
  116. data/templates/rails/views/UploadPage_edit.rhtml +38 -0
  117. data/templates/rails/views/frame.rhtml +60 -0
  118. data/templates/rails/views/messages.yaml +6 -0
  119. metadata +122 -28
  120. data/template/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +0 -5
  121. data/template/content/Pointers%20on%20adjusting%20the%20settings.textile +0 -39
  122. data/template/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +0 -21
  123. data/template/content/Recent%20Changes%20to%20This%20Site.textile +0 -203
  124. data/template/start.rb +0 -74
  125. data/template/views/AttachmentPage_edit.rhtml +0 -36
  126. data/template/views/ImagePage_edit.rhtml +0 -36
  127. data/template/views/Page_edit.rhtml +0 -34
  128. data/template/views/Page_print.rhtml +0 -5
  129. data/template/views/Page_revisions.rhtml +0 -18
  130. data/template/views/Page_rss.rhtml +0 -34
  131. data/template/views/Page_view.rhtml +0 -3
  132. data/template/views/frame.rhtml +0 -34
@@ -0,0 +1,16 @@
1
+ h1. Site Index
2
+
3
+ * Picture of a pair of soks
4
+ * AutomaticSummary
5
+ * home page
6
+ * How to export a site from this wiki
7
+ * How to hack soks
8
+ * How to import a site from instiki
9
+ * Improving the style of this wiki
10
+ * Known bugs
11
+ * List of changes
12
+ * Pointers on adjusting the settings
13
+ * Pointers on how to use this wiki
14
+ * Recent Blog Entries
15
+ * Recent Changes to This Site
16
+ * Soks Licence
@@ -0,0 +1,64 @@
1
+ h1. Soks is licensed under the The Ruby License
2
+
3
+ Note: This licence applies to all that is contained in this distribution EXCEPT files within the contrib folder which may be under different licences.
4
+
5
+ Soks is copyrighted (c) 2004, 2005 free software by Thomas Counsell tamc@rubyforge.org.
6
+
7
+ <pre>
8
+
9
+ You can redistribute it and/or modify it under either the terms of the
10
+ GPL (see the file GPL), or the conditions below:
11
+
12
+ 1. You may make and give away verbatim copies of the source form of the
13
+ software without restriction, provided that you duplicate all of the
14
+ original copyright notices and associated disclaimers.
15
+
16
+ 2. You may modify your copy of the software in any way, provided that
17
+ you do at least ONE of the following:
18
+
19
+ a) place your modifications in the Public Domain or otherwise
20
+ make them Freely Available, such as by posting said
21
+ modifications to Usenet or an equivalent medium, or by allowing
22
+ the author to include your modifications in the software.
23
+
24
+ b) use the modified software only within your corporation or
25
+ organization.
26
+
27
+ c) rename any non-standard executables so the names do not conflict
28
+ with standard executables, which must also be provided.
29
+
30
+ d) make other distribution arrangements with the author.
31
+
32
+ 3. You may distribute the software in object code or executable
33
+ form, provided that you do at least ONE of the following:
34
+
35
+ a) distribute the executables and library files of the software,
36
+ together with instructions (in the manual page or equivalent)
37
+ on where to get the original distribution.
38
+
39
+ b) accompany the distribution with the machine-readable source of
40
+ the software.
41
+
42
+ c) give non-standard executables non-standard names, with
43
+ instructions on where to get the original software distribution.
44
+
45
+ d) make other distribution arrangements with the author.
46
+
47
+ 4. You may modify and include the part of the software into any other
48
+ software (possibly commercial). But some files in the distribution
49
+ are not written by the author, so that they are not under these terms.
50
+
51
+ For the list of those files and their copying conditions, see the
52
+ contrib directory.
53
+
54
+ 5. The scripts and library files supplied as input to or produced as
55
+ output from the software do not automatically fall under the
56
+ copyright of the software, but belong to whomever generated them,
57
+ and may be sold commercially, and may be aggregated with this
58
+ software.
59
+
60
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
61
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
62
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
63
+ PURPOSE.
64
+ </pre>
@@ -1,16 +1,21 @@
1
1
  h1. Welcome!
2
2
 
3
- You have succesfully installed soks. Remember it is work in progress, and definitely not fully de-bugged. So don't trust your mission critical sites to it. In particular, I have only really used it with ruby 1.8.2 on Mac OS X 10.3. If you have any success or failure on other platforms, please let me know.
3
+ You have succesfully installed soks. Remember it is work in progress, and definitely not fully de-bugged. So don't trust your mission critical sites to it.
4
+
5
+ If you are upgrading from a previous version, you may wish to glance at the list of changes.
6
+
7
+ h2. Further information
4
8
 
5
- For further information see:
6
9
  * Pointers on how to use this wiki
7
10
  * Improving the style of this wiki
8
11
  * Pointers on adjusting the settings such as the url, or the port, or 'advanced' features such as automatic calendars and summaries.
9
12
  * How to import a site from instiki
10
13
  * How to export a site from this wiki
11
- * [[How to hack soks]]
14
+ * How to hack soks
15
+ * [[Known bugs]] (If you know how to fix them, please let me know!)
16
+
17
+ h2. Feedback
12
18
 
13
- Feedback
14
19
  * Please send me your feedback. tamc@rubyforge.com.
15
20
  * Or submit a bug at http://rubyforge.org/projects/soks/.
16
21
  * To keep track of developments, you may wish to subscribe to the mailing list at http://rubyforge.org/projects/soks to be notified of updates.
@@ -0,0 +1,85 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ # This file was created automatically on <%= Time.now %>
4
+ # Uncomment different sections to enable features of this wiki.
5
+
6
+ #Add the required libraries to the search path:
7
+ $:.push( "<%= settings[:soks_libraries].join('","') %>" )
8
+
9
+ require 'soks'
10
+
11
+ module StartSoks
12
+
13
+ =begin
14
+ # You can choose what level of authentication to apply based on regular expressions matched
15
+ # against the page title. These regexps are tried in order.Defaults are here:
16
+ AUTHENTICATORS = [ [ %r{/(view|rss|print|find|meta)/.*}, WEBrick::HTTPAuth::NoAuthenticationRequired.new ],
17
+ # [ %r{/upload/.*}, WEBrick::HTTPAuth::NotPermitted.new ],
18
+ # [ %r{/(edit|save)/home page}, WEBrick::HTTPAuth::SiteWidePassword.new('password','You need to enter the site wide password to edit the home page') ],
19
+ # [ %r{/(view|edit|save)/private.*},WEBrick::HTTPAuth::BasicAuth.new( :UserDB => htpasswd, :Realm => realm ) ], # See webrick documentation
20
+ [ %r{.*}, WEBrick::HTTPAuth::AskForUserName.new( 'No password, just enter a name') ]
21
+ ]
22
+
23
+ =end
24
+
25
+ CUSTOMSETTINGS = {
26
+ :root_directory => '<%= settings[:root_directory] %>',
27
+ # :name => 'test',
28
+ # :description => 'A Soks Wiki',
29
+ :url => '<%= settings[:url] %>',
30
+ :port => <%= settings[:port] %>,
31
+ # :authenticators => AUTHENTICATORS
32
+ }
33
+
34
+ def self.start
35
+ start_wiki( CUSTOMSETTINGS ) do |wiki, view|
36
+ AutomaticRecentChanges.new( wiki )
37
+
38
+ AutomaticOnePageIndex.new( wiki ) # Index on one page, best for small wikis
39
+ # AutomaticMultiPageIndex.new( wiki ) # One page per letter index, best for large wikis
40
+
41
+ # calendar = AutomaticCalendar.new( wiki ) # Adds a series of calendar pages to the wiki
42
+ # AutomaticUpcomingEvents.new( wiki, calendar ) # Creates a page with the next weeks events drawn from the calendar pages
43
+
44
+ AutomaticAuthorIndex.new( wiki )
45
+
46
+ # Example of an automatically generated summary of any new pages whose title starts with 'blog'
47
+ AutomaticSummary.new( wiki,
48
+ :regexp_for_title => /^Blog/i,
49
+ :max_pages_to_show => 10,
50
+ :pagename => 'Recent Blog Entries',
51
+ :only_new_pages => true,
52
+ :lines_to_include => 10,
53
+ :include_metadata => true
54
+ )
55
+
56
+ # Possible settings for the Automatic Summary (with defaults)
57
+ # :regexp_for_title => /.*/, # These three regexps act as an AND
58
+ # :regexp_for_author => nil,
59
+ # :regexp_for_content => nil,
60
+ # :max_pages_to_show => nil,
61
+ # :pagename => 'Summary',
62
+ # :author => 'AutomaticSummary',
63
+ # :lines_to_include => nil, # nil puts a link, can pass a block instead to render
64
+ # :only_new_pages => false,
65
+ # :sort_pages_by => :created_on, # Could be :revised_on or :score or :name or :name_for_index, or :author
66
+ # :reverse_sort => false,
67
+ # :include_metadata => false, # Includes author and time in summary
68
+ # :summarise_revisions => false, # If true, then can contain several revisions for same page
69
+ # :remove_deleted_pages => true, # If false will keep references to deleted pages
70
+
71
+ # This is an array of titles that will NOT be automatically linked.
72
+ # Default is the 30 most common words in the english language
73
+ # Note that pages can still be created with these titles, and they can still be manually linked to.
74
+ banned_titles = IO.readlines('<%= settings[:root_directory] %>/banned_titles.txt').map { |title| title.strip }
75
+
76
+ # This takes a while, so do it last. Note that the banned_titles argument is optional.
77
+ AutomaticUpdateCrossLinks.new( wiki, view, banned_titles )
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ if $0 == __FILE__ then
84
+ StartSoks::start
85
+ end
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -0,0 +1 @@
1
+ <%= page.content %>
@@ -0,0 +1,8 @@
1
+ <div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
2
  </table>
1
3
 
2
4
  <h3>Wiki words</h3>
3
5
  Internal links are made automatically by typing the title of the other page. They can be forced by putting them inside double square brackes [[a forced link]]. They can be redirected by [[ this points to => another page ]]. The other page can be inserted by typing [[ insert title of other page ]]. This is particularly useful for adding images [[ insert picture of a pair of soks ]].
4
6
  function quickRedReference() {
5
7
  window.open(
6
8
  "http://hobix.com/textile/quick.html",
7
9
  "redRef",
8
10
  "height=600,width=550,channelmode=0,dependent=0," +
9
11
  "directories=0,fullscreen=0,location=0,menubar=0," +
10
12
  "resizable=0,scrollbars=1,status=1,toolbar=0"
11
13
  );
12
14
  }
15
+
16
+ <form id="editForm" method=post action='/save/<%= pagename %>' >
17
+ <p><input name='newtitle' style="width: 600px;" size='80' value='<%= pagename %>' onClick="this.value == 'Type a title here' ? this.value = '' : true" /></p>
18
+ <p>
19
+ <textarea name='content' style="width: 600px; height: 500px" onClick="this.value == 'Type what you want here and click save' ? this.value = '' : true" ><%= page.content %></textarea>
20
+ </p>
21
+ <p>
13
22
  <input type="submit" value="Update" accesskey="S"> as <a href='/<%= person %>'><%= person %></a>
14
23
 
15
24
  | <a href='/<%= pagename %>' accesskey="C" >Cancel</a> | <a href='/delete/<%= pagename %>' accesskey="D" >Delete this page</a>
@@ -0,0 +1,34 @@
1
+ <p>This page was created on <%= page.created_on %> by <%= page.revisions.first.author %>. </p><p>It was last updated on <%= page.revised_on %> by <%= page.author %>.</p><p> It has been changed <%= page.revisions.size %> time(s) (roughly once every <%= (((Time.now-page.created_on)/page.revisions.size)/(60*60*24)).to_i %> days).</p>
2
+
3
+ <div class='metacolumn' >
4
+ <h2>Wiki links from this page</h2>
5
+
6
+ <ul>
7
+ <% page.links_from.each do |linkedpage| %>
8
+ <li><a href='/<%= linkedpage.name %>'><%= linkedpage.name %></a></li>
9
+ <% end %>
10
+ </ul>
11
+
12
+ </div>
13
+
14
+ <div class='metacolumn' >
15
+ <h2>Wiki links to this page</h2>
16
+
17
+ <ul>
18
+ <% page.links_to.each do |linkedpage| %>
19
+ <li><a href='/<%= linkedpage.name %>'><%= linkedpage.name %></a></li>
20
+ <% end %>
21
+ </ul>
22
+
23
+ </div>
24
+
25
+ <div class='metacolumn' >
26
+ <h2>Authors</h2>
27
+
28
+ <ol>
29
+ <% page.revisions.each do |revision| %>
30
+ <li><a href='/<%= revision.author %>'><%= revision.author %></a></li>
31
+ <% end %>
32
+ </ol>
33
+
34
+ </div>
@@ -0,0 +1,6 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <body>
4
+ <%= renderedview %>
5
+ </body>
6
+ </html>
@@ -0,0 +1,17 @@
1
+ <div class="undochange">
2
+ <% page.revisions.reverse_each do |revision| %>
3
+ <p><%= revision.created_on %> by <a href='/<%= revision.author %>'><%= revision.author %></a> <a href='/rollback/<%= pagename %>?revision=<%= revision.number-1 %>' >(undo)</a>:</p>
4
+ <p>
5
+ <% revision.changes.each do |change_group| %>
6
+ <% change_group.each do |change|
7
+ case change[0]
8
+ when "-" %>
9
+ <del><%= change[1] %>. <%= change[2] %></del><br />
10
+ <% when "+" %>
11
+ <%= change[1] %>. <%= change[2] %><br />
12
+ <% end %>
13
+ <% end %>
14
+ <% end %>
15
+ </p>
16
+ <% end %>
17
+ </div>
@@ -0,0 +1,55 @@
1
+ <%=
2
+ require "rss/maker"
3
+
4
+ RSS::Maker.make("2.0") do |maker|
5
+
6
+ maker.channel.title = "#{$SETTINGS[:name]} #{pagename}"
7
+ maker.channel.description = $SETTINGS[:description]
8
+ maker.channel.link = $SETTINGS[:url]
9
+
10
+ maker.image.title = "#{$SETTINGS[:name]}"
11
+ maker.image.url = "#{$SETTINGS[:url]}/attachment/logo.png"
12
+
13
+ maker.textinput.title = "Search"
14
+ maker.textinput.description = "Search #{$SETTINGS[:name]}'s text"
15
+ maker.textinput.name = "regex"
16
+ maker.textinput.link = "#{$SETTINGS[:url]}/find/searchpage"
17
+
18
+ maker.items.do_sort = true
19
+
20
+ count = 0
21
+ for revision in page.revisions
22
+ break if (count +=1) == 15
23
+ item = maker.items.new_item
24
+ item.link = "#{$SETTINGS[:url]}/#{pagename}"
25
+ # Get the first change that makes an addition and use as the title
26
+ title = nil
27
+ revision.changes.each do |group|
28
+ group.each do |type,line,text|
29
+ if type == '+' && text != ''
30
+ title = text.gsub(/<.*?>/,'')
31
+ end
32
+ break if title
33
+ end
34
+ break if title
35
+ end
36
+ # If change found, take just the changed text and remove tags.
37
+ # If no change found, then must be because only deleted stuff so give that message
38
+ item.title = title || $MESSAGES[:some_content_has_been_deleted] # Default
39
+ item.date = revision.created_on
40
+ item.author = revision.author
41
+ item.description = ""
42
+ content_deleted = false
43
+ revision.changes.each do |change_group|
44
+ change_group.each do |change|
45
+ case change[0]
46
+ when "-"; content_deleted = true
47
+ when "+"; item.description << "#{change[2]}<br />"
48
+ end
49
+ end
50
+ item.description << "&#8230;<br />"
51
+ end
52
+ item.description << "Content was also deleted" if content_deleted
53
+ end
54
+ end
55
+ %>
@@ -0,0 +1,18 @@
1
+ <h1>Results of Search for &#8220;<%= pagename %>&#8221;</h1>
2
+ <% unless title_results.empty? %>
3
+ <h2>Matches in the titles of pages</h2>
4
+ <ul>
5
+ <% title_results.each do |name, page| %>
6
+ <li><a href='/<%= name %>' ><%= name %></a></li>
7
+ <% end %>
8
+ </ul>
9
+ <% end %>
10
+ <% unless text_results.empty? %>
11
+ <h2>Matches in the text of pages</h2>
12
+ <ul>
13
+ <% text_results.each do |name, page| %>
14
+ <li><a href='/<%= name %>' ><%= name %></a></li>
15
+ <% end %>
16
+ </ul>
17
+ <% end %>
18
+ <div class='command'>(<a href='/edit/<%= pagename %>' accesskey="E" >Create a page titled &#8220;<%= pagename %>&#8221;</a>)</div>
@@ -0,0 +1,2 @@
1
+ <%= renderedview %>
2
+
@@ -0,0 +1,16 @@
1
+ <form action='/upload/<%= pagename %>' method=post enctype=multipart/form-data >
2
+ <table>
3
+ <tr><td>Title:</td><td>
4
+ <% if page.is_a? ImagePage %>
5
+ <input type=hidden name='titleprefix' value='Picture of ' />
6
+ Picture of <input name='newtitle' size = '51' value='<%= pagename[ 10..-1].strip %>'
7
+ <% else %>
8
+ <input type=hidden name='titleprefix' value='Attached ' />
9
+ Attached <input name='newtitle' size = '52' value='<%= pagename[ 9..-1].strip %>'
10
+ <% end %>
11
+ onClick="this.value == 'Type a title here' ? this.value = '' : true"/></td></tr>
12
+ <tr><td valign='top'>File:</td><td><input name='file' type=file /></td></tr>
13
+ <tr><td>Author:</td><td><a href='/<%= person %>'><%= person %></a> Quit browser to log out.</td>
14
+ <tr><td></td><td><input name=action value='Save' type=submit accesskey="S"> <a href='/<%= pagename %>' accesskey="C" >(Cancel)</a> or <a href='/delete/<%= pagename %>' accesskey='D'>(Delete)</a> this page.</td></tr>
15
+ </table>
16
+ </form>
@@ -0,0 +1,90 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html lang="en">
3
+ <head>
4
+ <title><%= pagename %></title>
5
+ <meta name="description" content="<%= $SETTINGS[:description] %>" />
6
+ <meta name="keywords" content="Soks, <%= $SETTINGS[:name] %>" />
7
+
8
+ <style type="text/css">
9
+ h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
10
  color: #008B26;
1
11
  }
2
12
  #Container, #Content {
3
13
  width: <%= view == 'edit' ? '870px' : '600px' %>;
4
14
  }
15
+ </style>
16
+
17
+ <link rel="stylesheet" href="/attachment/instiki_style_sheet.css" type="text/css" media="screen" />
18
+
19
+ <style type="text/css">
20
+
21
+ .leftHandSide {
22
+ float: right;
23
+ width: 147px;
24
+ margin-left: 10px;
25
+ padding-left: 20px;
26
+ border-left: 1px dotted #ccc;
27
+ }
28
+
29
+ .leftHandSide p {
30
+ font-size: 10px;
31
+ }
32
+
33
+ #navigationForm {
34
+ display: block;
35
+ }
36
+ </style>
37
+ </head>
38
+ <body onkeypress="hotkey(event);">
39
+ <div id="Container">
40
+ <div id="Content">
41
+
42
+ <h1 id="pageName">
43
+ <small><%= $SETTINGS[:name] %></small><br />
44
+ <%= pagename %>
45
+ </h1>
46
+ <form id="navigationForm" class="navigation" method=GET action='/find/<%= pagename %>' style="font-size: 10px">
47
+ <a href="/view/home page" title="Home, Sweet Home" accesskey="H">Home Page</a> |
48
+ <a href="/view/site index" title="Alphabetically sorted list of pages" accesskey="A">All Pages</a> |
49
+ <a href="/view/recent changes to this site" title="Pages sorted by when they were last changed" accesskey="U">Recently Revised</a> |
50
+ <a href="/view/authors" title="Who wrote what" accesskey="">Authors</a> |
51
+ <a href="/rss/<%= pagename %>" title="Subscribe to changes by RSS">Feed</a> |
52
+ <a href="/view/How to create a new page" title="How to export from this wiki">New Page</a> |
53
+ <input type="text" id="searchField" name='regex' style="font-size: 10px" value="Search" onClick="this.value == 'Search' ? this.value = '' : true">
54
+ </form>
55
+
56
+ <div id="revision">
57
+ <%= content_of_page %>
58
+ </div>
59
+
60
+ <% if page %>
61
+ <div class="byline">
62
+ Revised on <%= page.revised_on %>
63
+ by <a class="existingWikiWord" href="/view/<%= page.author %>"><%= page.author %></a>
64
+ </div>
65
+ <% end %>
66
+
67
+ <div class="navigation">
68
+
69
+ <a href="/edit/<%= pagename %>" class="navlink" accesskey="E">Edit</a>
70
+ | <small>(<%= page ? page.revisions.size : '0' %>)</small>
71
+ <span id="show_changes">
72
+ | <a href="/revisions/<%= pagename %>" >See changes</a>
73
+ </span>
74
+ <small>
75
+ | Views: <a href="/view/<%= pagename %>" >Normal</a>, <a href="/meta/<%= pagename %>" >Meta-Data</a>, <a href="/print/<%= pagename %>" >Print</a>
76
+ </small>
77
+
78
+
79
+ <small>
80
+ | Linked from:
81
+ <% if page %>
82
+ <% page.links_to.each do |linkedpage| %>
83
+ <a href='/<%= linkedpage.name %>'><%= linkedpage.name %></a>
84
+ <% end %>
85
+ <% end %>
86
+ </small>
87
+
88
+ </div>
89
+ </script>
90
+
91
+ </div>
92
+ <i style='font-size:x-small;'>Powered by <a style='display:inline;' href='http://soks.rubyforge.org'>Soks</a> in 'look a bit like <a href='http://www.instiki.org/'>Instiki</a>' mode</i>
93
+ </div>
94
+ </body>
95
+ </html>