savage-beast 0.1.0

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 (265) hide show
  1. data/.gitignore +2 -0
  2. data/README.rdoc +42 -0
  3. data/Rakefile +25 -0
  4. data/VERSION +1 -0
  5. data/app/controllers/application.rb +6 -0
  6. data/app/controllers/beast_application_controller.rb +3 -0
  7. data/app/controllers/forums_controller.rb +64 -0
  8. data/app/controllers/moderators_controller.rb +10 -0
  9. data/app/controllers/monitorships_controller.rb +22 -0
  10. data/app/controllers/posts_controller.rb +134 -0
  11. data/app/controllers/topics_controller.rb +110 -0
  12. data/app/helpers/count_helper.rb +13 -0
  13. data/app/helpers/forums_helper.rb +15 -0
  14. data/app/helpers/moderators_helper.rb +2 -0
  15. data/app/helpers/monitorships_helper.rb +2 -0
  16. data/app/helpers/posts_helper.rb +3 -0
  17. data/app/helpers/topics_helper.rb +3 -0
  18. data/app/models/forum.rb +26 -0
  19. data/app/models/moderatorship.rb +6 -0
  20. data/app/models/monitorship.rb +5 -0
  21. data/app/models/monitorships_sweeper.rb +9 -0
  22. data/app/models/post.rb +33 -0
  23. data/app/models/posts_sweeper.rb +12 -0
  24. data/app/models/topic.rb +94 -0
  25. data/app/views/forums/_form.html.erb +21 -0
  26. data/app/views/forums/edit.html.erb +12 -0
  27. data/app/views/forums/index.html.erb +77 -0
  28. data/app/views/forums/new.html.erb +10 -0
  29. data/app/views/forums/show.html.erb +94 -0
  30. data/app/views/layouts/_head.html.erb +34 -0
  31. data/app/views/layouts/_post.rss.builder +9 -0
  32. data/app/views/layouts/application.html.erb +29 -0
  33. data/app/views/layouts/beast.html.erb +29 -0
  34. data/app/views/monitorships/create.js.rjs +4 -0
  35. data/app/views/monitorships/destroy.js.rjs +4 -0
  36. data/app/views/posts/_edit.html.erb +38 -0
  37. data/app/views/posts/edit.html.erb +14 -0
  38. data/app/views/posts/edit.js.rjs +6 -0
  39. data/app/views/posts/index.html.erb +53 -0
  40. data/app/views/posts/index.rss.builder +20 -0
  41. data/app/views/posts/monitored.html.erb +55 -0
  42. data/app/views/posts/monitored.rss.builder +15 -0
  43. data/app/views/posts/update.js.rjs +3 -0
  44. data/app/views/topics/_form.html.erb +28 -0
  45. data/app/views/topics/edit.html.erb +10 -0
  46. data/app/views/topics/index.html.erb +2 -0
  47. data/app/views/topics/new.html.erb +18 -0
  48. data/app/views/topics/show.html.erb +183 -0
  49. data/app/views/topics/show.rss.builder +16 -0
  50. data/config/routes.rb +18 -0
  51. data/generators/beast/beast_generator.rb +88 -0
  52. data/generators/beast/templates/migrations/create_savage_tables.rb +73 -0
  53. data/generators/beast/templates/public/images/clearbits/_readme.txt +12 -0
  54. data/generators/beast/templates/public/images/clearbits/add.gif +0 -0
  55. data/generators/beast/templates/public/images/clearbits/addressbook.gif +0 -0
  56. data/generators/beast/templates/public/images/clearbits/alert.gif +0 -0
  57. data/generators/beast/templates/public/images/clearbits/apple.gif +0 -0
  58. data/generators/beast/templates/public/images/clearbits/arrow1_e.gif +0 -0
  59. data/generators/beast/templates/public/images/clearbits/arrow1_n.gif +0 -0
  60. data/generators/beast/templates/public/images/clearbits/arrow1_ne.gif +0 -0
  61. data/generators/beast/templates/public/images/clearbits/arrow1_nw.gif +0 -0
  62. data/generators/beast/templates/public/images/clearbits/arrow1_s.gif +0 -0
  63. data/generators/beast/templates/public/images/clearbits/arrow1_se.gif +0 -0
  64. data/generators/beast/templates/public/images/clearbits/arrow1_sw.gif +0 -0
  65. data/generators/beast/templates/public/images/clearbits/arrow1_w.gif +0 -0
  66. data/generators/beast/templates/public/images/clearbits/arrow2_e.gif +0 -0
  67. data/generators/beast/templates/public/images/clearbits/arrow2_n.gif +0 -0
  68. data/generators/beast/templates/public/images/clearbits/arrow2_ne.gif +0 -0
  69. data/generators/beast/templates/public/images/clearbits/arrow2_nw.gif +0 -0
  70. data/generators/beast/templates/public/images/clearbits/arrow2_s.gif +0 -0
  71. data/generators/beast/templates/public/images/clearbits/arrow2_se.gif +0 -0
  72. data/generators/beast/templates/public/images/clearbits/arrow2_sw.gif +0 -0
  73. data/generators/beast/templates/public/images/clearbits/arrow2_w.gif +0 -0
  74. data/generators/beast/templates/public/images/clearbits/arrow3_e.gif +0 -0
  75. data/generators/beast/templates/public/images/clearbits/arrow3_n.gif +0 -0
  76. data/generators/beast/templates/public/images/clearbits/arrow3_ne.gif +0 -0
  77. data/generators/beast/templates/public/images/clearbits/arrow3_nw.gif +0 -0
  78. data/generators/beast/templates/public/images/clearbits/arrow3_s.gif +0 -0
  79. data/generators/beast/templates/public/images/clearbits/arrow3_se.gif +0 -0
  80. data/generators/beast/templates/public/images/clearbits/arrow3_sw.gif +0 -0
  81. data/generators/beast/templates/public/images/clearbits/arrow3_w.gif +0 -0
  82. data/generators/beast/templates/public/images/clearbits/ascii.gif +0 -0
  83. data/generators/beast/templates/public/images/clearbits/back.gif +0 -0
  84. data/generators/beast/templates/public/images/clearbits/bg_blank.gif +0 -0
  85. data/generators/beast/templates/public/images/clearbits/bg_circle.gif +0 -0
  86. data/generators/beast/templates/public/images/clearbits/bg_rounded.gif +0 -0
  87. data/generators/beast/templates/public/images/clearbits/bg_rounded_ne.gif +0 -0
  88. data/generators/beast/templates/public/images/clearbits/bg_rounded_nw.gif +0 -0
  89. data/generators/beast/templates/public/images/clearbits/bg_rounded_se.gif +0 -0
  90. data/generators/beast/templates/public/images/clearbits/bg_rounded_sw.gif +0 -0
  91. data/generators/beast/templates/public/images/clearbits/bigsmile.gif +0 -0
  92. data/generators/beast/templates/public/images/clearbits/binary.gif +0 -0
  93. data/generators/beast/templates/public/images/clearbits/blah.gif +0 -0
  94. data/generators/beast/templates/public/images/clearbits/bstop.gif +0 -0
  95. data/generators/beast/templates/public/images/clearbits/buy.gif +0 -0
  96. data/generators/beast/templates/public/images/clearbits/calday.gif +0 -0
  97. data/generators/beast/templates/public/images/clearbits/calendar.gif +0 -0
  98. data/generators/beast/templates/public/images/clearbits/camera.gif +0 -0
  99. data/generators/beast/templates/public/images/clearbits/cart.gif +0 -0
  100. data/generators/beast/templates/public/images/clearbits/cd.gif +0 -0
  101. data/generators/beast/templates/public/images/clearbits/cellphone.gif +0 -0
  102. data/generators/beast/templates/public/images/clearbits/chat.gif +0 -0
  103. data/generators/beast/templates/public/images/clearbits/check.gif +0 -0
  104. data/generators/beast/templates/public/images/clearbits/close.gif +0 -0
  105. data/generators/beast/templates/public/images/clearbits/comment.gif +0 -0
  106. data/generators/beast/templates/public/images/clearbits/cube.gif +0 -0
  107. data/generators/beast/templates/public/images/clearbits/day.gif +0 -0
  108. data/generators/beast/templates/public/images/clearbits/denied.gif +0 -0
  109. data/generators/beast/templates/public/images/clearbits/document.gif +0 -0
  110. data/generators/beast/templates/public/images/clearbits/download.gif +0 -0
  111. data/generators/beast/templates/public/images/clearbits/edit.gif +0 -0
  112. data/generators/beast/templates/public/images/clearbits/eject.gif +0 -0
  113. data/generators/beast/templates/public/images/clearbits/equalizer.gif +0 -0
  114. data/generators/beast/templates/public/images/clearbits/first.gif +0 -0
  115. data/generators/beast/templates/public/images/clearbits/flag.gif +0 -0
  116. data/generators/beast/templates/public/images/clearbits/flash.gif +0 -0
  117. data/generators/beast/templates/public/images/clearbits/folder.gif +0 -0
  118. data/generators/beast/templates/public/images/clearbits/forward.gif +0 -0
  119. data/generators/beast/templates/public/images/clearbits/frown.gif +0 -0
  120. data/generators/beast/templates/public/images/clearbits/ftp.gif +0 -0
  121. data/generators/beast/templates/public/images/clearbits/graph.gif +0 -0
  122. data/generators/beast/templates/public/images/clearbits/heart.gif +0 -0
  123. data/generators/beast/templates/public/images/clearbits/home.gif +0 -0
  124. data/generators/beast/templates/public/images/clearbits/html.gif +0 -0
  125. data/generators/beast/templates/public/images/clearbits/ipod.gif +0 -0
  126. data/generators/beast/templates/public/images/clearbits/last.gif +0 -0
  127. data/generators/beast/templates/public/images/clearbits/lock.gif +0 -0
  128. data/generators/beast/templates/public/images/clearbits/loop.gif +0 -0
  129. data/generators/beast/templates/public/images/clearbits/mail.gif +0 -0
  130. data/generators/beast/templates/public/images/clearbits/man.gif +0 -0
  131. data/generators/beast/templates/public/images/clearbits/manman.gif +0 -0
  132. data/generators/beast/templates/public/images/clearbits/music.gif +0 -0
  133. data/generators/beast/templates/public/images/clearbits/mute.gif +0 -0
  134. data/generators/beast/templates/public/images/clearbits/mute_centered.gif +0 -0
  135. data/generators/beast/templates/public/images/clearbits/newwindow.gif +0 -0
  136. data/generators/beast/templates/public/images/clearbits/next.gif +0 -0
  137. data/generators/beast/templates/public/images/clearbits/night.gif +0 -0
  138. data/generators/beast/templates/public/images/clearbits/open.gif +0 -0
  139. data/generators/beast/templates/public/images/clearbits/pause.gif +0 -0
  140. data/generators/beast/templates/public/images/clearbits/phone.gif +0 -0
  141. data/generators/beast/templates/public/images/clearbits/play.gif +0 -0
  142. data/generators/beast/templates/public/images/clearbits/previous.gif +0 -0
  143. data/generators/beast/templates/public/images/clearbits/quicktime.gif +0 -0
  144. data/generators/beast/templates/public/images/clearbits/redo.gif +0 -0
  145. data/generators/beast/templates/public/images/clearbits/reload.gif +0 -0
  146. data/generators/beast/templates/public/images/clearbits/sad.gif +0 -0
  147. data/generators/beast/templates/public/images/clearbits/save.gif +0 -0
  148. data/generators/beast/templates/public/images/clearbits/scream.gif +0 -0
  149. data/generators/beast/templates/public/images/clearbits/search.gif +0 -0
  150. data/generators/beast/templates/public/images/clearbits/seconds.gif +0 -0
  151. data/generators/beast/templates/public/images/clearbits/smile.gif +0 -0
  152. data/generators/beast/templates/public/images/clearbits/smirk.gif +0 -0
  153. data/generators/beast/templates/public/images/clearbits/star.gif +0 -0
  154. data/generators/beast/templates/public/images/clearbits/stop.gif +0 -0
  155. data/generators/beast/templates/public/images/clearbits/subtract.gif +0 -0
  156. data/generators/beast/templates/public/images/clearbits/switch.gif +0 -0
  157. data/generators/beast/templates/public/images/clearbits/target.gif +0 -0
  158. data/generators/beast/templates/public/images/clearbits/tcp.gif +0 -0
  159. data/generators/beast/templates/public/images/clearbits/time.gif +0 -0
  160. data/generators/beast/templates/public/images/clearbits/toggle.gif +0 -0
  161. data/generators/beast/templates/public/images/clearbits/tongue.gif +0 -0
  162. data/generators/beast/templates/public/images/clearbits/tools.gif +0 -0
  163. data/generators/beast/templates/public/images/clearbits/trackback.gif +0 -0
  164. data/generators/beast/templates/public/images/clearbits/trash.gif +0 -0
  165. data/generators/beast/templates/public/images/clearbits/tv.gif +0 -0
  166. data/generators/beast/templates/public/images/clearbits/type.gif +0 -0
  167. data/generators/beast/templates/public/images/clearbits/undo.gif +0 -0
  168. data/generators/beast/templates/public/images/clearbits/unlock.gif +0 -0
  169. data/generators/beast/templates/public/images/clearbits/upload.gif +0 -0
  170. data/generators/beast/templates/public/images/clearbits/user.gif +0 -0
  171. data/generators/beast/templates/public/images/clearbits/video.gif +0 -0
  172. data/generators/beast/templates/public/images/clearbits/volume_high.gif +0 -0
  173. data/generators/beast/templates/public/images/clearbits/volume_low.gif +0 -0
  174. data/generators/beast/templates/public/images/clearbits/wifi.gif +0 -0
  175. data/generators/beast/templates/public/images/clearbits/window.gif +0 -0
  176. data/generators/beast/templates/public/images/clearbits/woman.gif +0 -0
  177. data/generators/beast/templates/public/images/clearbits/womanman.gif +0 -0
  178. data/generators/beast/templates/public/images/clearbits/work.gif +0 -0
  179. data/generators/beast/templates/public/images/clearbits/zoomin.gif +0 -0
  180. data/generators/beast/templates/public/images/clearbits/zoomout.gif +0 -0
  181. data/generators/beast/templates/public/images/feed-icon.png +0 -0
  182. data/generators/beast/templates/public/images/rails.png +0 -0
  183. data/generators/beast/templates/public/images/reply_background.png +0 -0
  184. data/generators/beast/templates/public/images/small_circle.gif +0 -0
  185. data/generators/beast/templates/public/images/spinner.gif +0 -0
  186. data/generators/beast/templates/public/images/spinner_black.gif +0 -0
  187. data/generators/beast/templates/public/images/spinner_bounce.gif +0 -0
  188. data/generators/beast/templates/public/javascripts/beast.js +80 -0
  189. data/generators/beast/templates/public/stylesheets/display.css +941 -0
  190. data/lang/en.yml +206 -0
  191. data/lib/beast.rb +79 -0
  192. data/lib/savage_beast/application_helper.rb +91 -0
  193. data/lib/savage_beast/authentication_system.rb +47 -0
  194. data/lib/savage_beast/user_init.rb +79 -0
  195. data/lib/tasks/capistrano.rake +90 -0
  196. data/lib/tasks/deploy_edge.rake +44 -0
  197. data/lib/tasks/savage_beast.rake +133 -0
  198. data/po/beast.pot +712 -0
  199. data/po/nl/beast.po +700 -0
  200. data/tested_plugins/acts_as_list/README +23 -0
  201. data/tested_plugins/acts_as_list/init.rb +3 -0
  202. data/tested_plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
  203. data/tested_plugins/acts_as_list/test/list_test.rb +332 -0
  204. data/tested_plugins/gibberish/LICENSE +18 -0
  205. data/tested_plugins/gibberish/README +118 -0
  206. data/tested_plugins/gibberish/Rakefile +14 -0
  207. data/tested_plugins/gibberish/init.rb +3 -0
  208. data/tested_plugins/gibberish/lang/es.yml +3 -0
  209. data/tested_plugins/gibberish/lang/fr.yml +3 -0
  210. data/tested_plugins/gibberish/lib/gibberish.rb +8 -0
  211. data/tested_plugins/gibberish/lib/gibberish/localize.rb +88 -0
  212. data/tested_plugins/gibberish/lib/gibberish/string_ext.rb +17 -0
  213. data/tested_plugins/gibberish/test/gibberish_test.rb +203 -0
  214. data/tested_plugins/gibberish/test/lang/es.yml +1 -0
  215. data/tested_plugins/gibberish/test/lang/fr.yml +1 -0
  216. data/tested_plugins/mislav-will_paginate/CHANGELOG.rdoc +110 -0
  217. data/tested_plugins/mislav-will_paginate/LICENSE +18 -0
  218. data/tested_plugins/mislav-will_paginate/README.rdoc +107 -0
  219. data/tested_plugins/mislav-will_paginate/Rakefile +53 -0
  220. data/tested_plugins/mislav-will_paginate/examples/apple-circle.gif +0 -0
  221. data/tested_plugins/mislav-will_paginate/examples/index.haml +69 -0
  222. data/tested_plugins/mislav-will_paginate/examples/index.html +92 -0
  223. data/tested_plugins/mislav-will_paginate/examples/pagination.css +90 -0
  224. data/tested_plugins/mislav-will_paginate/examples/pagination.sass +91 -0
  225. data/tested_plugins/mislav-will_paginate/init.rb +1 -0
  226. data/tested_plugins/mislav-will_paginate/lib/will_paginate.rb +78 -0
  227. data/tested_plugins/mislav-will_paginate/lib/will_paginate/array.rb +16 -0
  228. data/tested_plugins/mislav-will_paginate/lib/will_paginate/collection.rb +146 -0
  229. data/tested_plugins/mislav-will_paginate/lib/will_paginate/core_ext.rb +32 -0
  230. data/tested_plugins/mislav-will_paginate/lib/will_paginate/finder.rb +264 -0
  231. data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope.rb +170 -0
  232. data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope_patch.rb +37 -0
  233. data/tested_plugins/mislav-will_paginate/lib/will_paginate/version.rb +9 -0
  234. data/tested_plugins/mislav-will_paginate/lib/will_paginate/view_helpers.rb +402 -0
  235. data/tested_plugins/mislav-will_paginate/test/boot.rb +21 -0
  236. data/tested_plugins/mislav-will_paginate/test/collection_test.rb +143 -0
  237. data/tested_plugins/mislav-will_paginate/test/console +8 -0
  238. data/tested_plugins/mislav-will_paginate/test/database.yml +22 -0
  239. data/tested_plugins/mislav-will_paginate/test/finder_test.rb +476 -0
  240. data/tested_plugins/mislav-will_paginate/test/fixtures/admin.rb +3 -0
  241. data/tested_plugins/mislav-will_paginate/test/fixtures/developer.rb +14 -0
  242. data/tested_plugins/mislav-will_paginate/test/fixtures/developers_projects.yml +13 -0
  243. data/tested_plugins/mislav-will_paginate/test/fixtures/project.rb +15 -0
  244. data/tested_plugins/mislav-will_paginate/test/fixtures/projects.yml +6 -0
  245. data/tested_plugins/mislav-will_paginate/test/fixtures/replies.yml +29 -0
  246. data/tested_plugins/mislav-will_paginate/test/fixtures/reply.rb +7 -0
  247. data/tested_plugins/mislav-will_paginate/test/fixtures/schema.rb +38 -0
  248. data/tested_plugins/mislav-will_paginate/test/fixtures/topic.rb +10 -0
  249. data/tested_plugins/mislav-will_paginate/test/fixtures/topics.yml +30 -0
  250. data/tested_plugins/mislav-will_paginate/test/fixtures/user.rb +2 -0
  251. data/tested_plugins/mislav-will_paginate/test/fixtures/users.yml +35 -0
  252. data/tested_plugins/mislav-will_paginate/test/helper.rb +40 -0
  253. data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_case.rb +43 -0
  254. data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_connector.rb +75 -0
  255. data/tested_plugins/mislav-will_paginate/test/lib/load_fixtures.rb +11 -0
  256. data/tested_plugins/mislav-will_paginate/test/lib/view_test_process.rb +178 -0
  257. data/tested_plugins/mislav-will_paginate/test/tasks.rake +59 -0
  258. data/tested_plugins/mislav-will_paginate/test/view_test.rb +365 -0
  259. data/tested_plugins/white_list/README +29 -0
  260. data/tested_plugins/white_list/Rakefile +22 -0
  261. data/tested_plugins/white_list/init.rb +2 -0
  262. data/tested_plugins/white_list/lib/white_list_helper.rb +97 -0
  263. data/tested_plugins/white_list/test/white_list_test.rb +132 -0
  264. data/tested_plugins/white_list_formatted_content/init.rb +27 -0
  265. metadata +322 -0
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="beast">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title><%= "#{h @page_title} - " if @page_title %><%= 'Beast'[:beast_title] %></title>
7
+ <%= stylesheet_link_tag 'savage_beast/display' %>
8
+
9
+ <%# Assumption: If you're a rails project, you already have your own version of these, and don't need the SB version %>
10
+ <%= javascript_include_tag "prototype", "effects" %>
11
+ <%= javascript_include_tag "savage_beast/beast" %>
12
+ <% unless @feed_icons.blank? -%>
13
+ <% @feed_icons.each do |feed| -%>
14
+ <%= auto_discovery_link_tag :rss, feed[:url], :title => "Subscribe to '#{feed[:title]}'" %>
15
+ <% end -%>
16
+ <% end -%>
17
+ <%= head_extras %>
18
+ </head>
19
+ <body>
20
+ <div id="header">
21
+ <ul id="nav">
22
+ <li><%= link_to 'Forums'[:forums_title], forums_path, :rel => 'home' %></li>
23
+ <li><%= link_to 'Users'[:users_title], users_path %></li>
24
+ <li id="search">
25
+ <% form_tag search_all_posts_url, :method => :get do -%>
26
+ <%= text_field_tag :q, params[:q], :size => 15, :id => :search_box %>
27
+ <li><%= submit_tag t(:search_title) %></li>
28
+ <% end -%>
29
+ </li>
30
+ <li class="login"><%= beast_user_link %></li>
31
+ </ul>
32
+ <h1><%= link_to 'Beast'[:beast_title], forums_path %></h1>
33
+ </div>
34
+
@@ -0,0 +1,9 @@
1
+ xm.item do
2
+ key = post.topic.posts.size == 1 ? :topic_posted_by : :topic_replied_by
3
+ xm.title "{title} posted by {user} @ {date}"[key, h(post.respond_to?(:topic_title) ? post.topic_title : post.topic.title), h(post.user.display_name), post.created_at.rfc822]
4
+ xm.description post.body_html
5
+ xm.pubDate post.created_at.rfc822
6
+ xm.guid [request.host_with_port+request.relative_url_root, post.forum_id.to_s, post.topic_id.to_s, post.id.to_s].join(":"), "isPermaLink" => "false"
7
+ xm.author "#{post.user.display_name}"
8
+ xm.link forum_topic_url(post.forum_id, post.topic_id)
9
+ end
@@ -0,0 +1,29 @@
1
+ <%= render :partial => "layouts/head" %>
2
+
3
+ <div id="container">
4
+
5
+ <div id="content">
6
+
7
+ <%= content_tag 'p', h(flash[:notice]), :class => 'notice' if flash[:notice] %>
8
+ <%= content_tag 'p', h(flash[:error]), :class => 'notice error' if flash[:error] %>
9
+
10
+ <%= yield %>
11
+ </div>
12
+
13
+ <div id="right">
14
+ <%= yield :right %>
15
+ </div>
16
+
17
+ <br style="clear:both;" />
18
+
19
+ </div>
20
+
21
+ <div id="footer">
22
+ <p class="disclaim">
23
+ <strong>
24
+ </strong>
25
+ </p>
26
+ <br style="clear:both;" />
27
+ </div>
28
+ </body>
29
+ </html>
@@ -0,0 +1,29 @@
1
+ <%= render :partial => "layouts/head" %>
2
+
3
+ <div id="container">
4
+
5
+ <div id="content">
6
+
7
+ <%= content_tag 'p', h(flash[:notice]), :class => 'notice' if flash[:notice] %>
8
+ <%= content_tag 'p', h(flash[:error]), :class => 'notice error' if flash[:error] %>
9
+
10
+ <%= yield %>
11
+ </div>
12
+
13
+ <div id="right">
14
+ <%= yield :right %>
15
+ </div>
16
+
17
+ <br style="clear:both;" />
18
+
19
+ </div>
20
+
21
+ <div id="footer">
22
+ <p class="disclaim">
23
+ <strong>
24
+ </strong>
25
+ </p>
26
+ <br style="clear:both;" />
27
+ </div>
28
+ </body>
29
+ </html>
@@ -0,0 +1,4 @@
1
+ #page["monitorship-icon-topics-#{params[:topic_id]}"].remove_class_name(:grey)
2
+ #page["monitorship-icon-topics-#{params[:topic_id]}"].add_class_name(:green)
3
+
4
+ page[:monitor_label].innerHTML = "Monitoring topic"[]
@@ -0,0 +1,4 @@
1
+ #page["monitorship-icon-topics-#{params[:topic_id]}"].remove_class_name(:green)
2
+ #page["monitorship-icon-topics-#{params[:topic_id]}"].add_class_name(:darkgrey)
3
+
4
+ page[:monitor_label].innerHTML = "Monitor topic"[]
@@ -0,0 +1,38 @@
1
+ <div id="edit" class="editbox">
2
+ <div class="container">
3
+ <% remote_form_for :post, :url => post_path(:forum_id => @post.forum_id, :topic_id => @post.topic_id, :id => @post),
4
+ :html => { :method => :put }, :before => "$('editbox_spinner').show();" do |f| -%>
5
+
6
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
7
+ <tr>
8
+ <td rowspan="2" width="70%">
9
+ <%= f.text_area :body, :rows => 10, :id => "edit_post_body", :tabindex => 1 %>
10
+ </td>
11
+ <td valign="top">
12
+
13
+ <%= link_to('delete post'[], post_path(:forum_id => @post.topic.forum, :topic_id => @post.topic, :id => @post, :page => params[:page]),
14
+ :class => "utility", :method => :delete, :confirm => "Delete this post? Are you sure?"[:delete_post_conf]) %>
15
+
16
+
17
+ <h5><%= t(:formatting_help) %></h5>
18
+
19
+ <ul class="help">
20
+ <li><%= t(:formatting_bold) %></li>
21
+ <li><%= t(:formatting_italics) %></li>
22
+ <li><%= t(:formatting_blockquote) %></li>
23
+ <li>"IBM":http://www.ibm.com</li>
24
+ <li><%= t(:formatting_list) %></li>
25
+ </ul>
26
+
27
+ </td>
28
+ </tr>
29
+ <tr>
30
+ <td valign="bottom" style="padding-bottom:15px;">
31
+ <%= ajax_spinner_for "editbox", "spinner_black.gif" %>
32
+ <%= submit_tag t(:save_changes), :or => link_to_function(t(:cancel), "EditForm.cancel()"), :tabindex => 2 %>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ <% end -%>
37
+ </div>
38
+ </div>
@@ -0,0 +1,14 @@
1
+ <h1><%= t(:edit_post) %></h1>
2
+
3
+ <h2><%= link_to h(@post.topic.title), forum_topic_path(@post.forum_id, @post.topic) %></h2>
4
+
5
+ <%= link_to(t(:delete_post), post_path(:forum_id => @post.forum_id, :topic_id => @post.topic, :id => @post, :page => params[:page]),
6
+ :class => "utility", :method => :delete, :confirm => t(:delete_post_conf)) %>
7
+
8
+ <%= error_messages_for :topic %>
9
+ <% form_for :post, :html => { :method => :put },
10
+ :url => post_path(:forum_id => params[:forum_id], :topic_id => params[:topic_id], :id => @post, :page => params[:page]) do |f| -%>
11
+ <p id="post_body"><%= f.text_area :body %></p>
12
+
13
+ <%= submit_tag t(:save_title) %> <%= t(:or) %> <%= link_to t(:cancel), forum_topic_path(:forum_id => params[:forum_id], :topic_id => params[:topic_id], :page => params[:page]) %>
14
+ <% end -%>
@@ -0,0 +1,6 @@
1
+ page.replace :edit, :partial => "edit"
2
+ page.edit_form.set_reply_id @post.id
3
+ page["edit-post-#{@post.id}_spinner"].hide
4
+ page.delay(0.25) do
5
+ page[:edit_post_body].focus
6
+ end
@@ -0,0 +1,53 @@
1
+ <% @page_title = search_posts_title -%>
2
+
3
+ <h1>
4
+ <% if params[:q].blank? -%>
5
+ <%= @page_title %>
6
+ <% else -%>
7
+ <%= t(:searching_for) %> '<%= h params[:q] %>'
8
+ <% end -%>
9
+ </h1>
10
+ <p class="subtitle">
11
+ <%= feed_icon_tag @page_title, search_posts_path(true) %>
12
+ <%= posts_count_found(@posts.total_entries) %>
13
+ </p>
14
+
15
+ <%= will_paginate @posts %>
16
+
17
+ <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
18
+ <% for post in @posts do %>
19
+ <% unless post == @posts.first %>
20
+ <tr class="spacer">
21
+ <td colspan="2">&nbsp;</td>
22
+ </tr>
23
+ <% end %>
24
+ <tr class="post hentry" id="<%= dom_id post %>">
25
+ <td class="author vcard">
26
+ <div class="date">
27
+ <abbr class="updated" title="<%= post.created_at.xmlschema %>">
28
+ <% if post.created_at > Time.now.utc-24.hours%>
29
+ <%= time_ago_in_words(post.created_at).sub(/about /, '') %>
30
+ <% else %>
31
+ <%= post.created_at.strftime("%b %e, %Y"[:date_format])%>
32
+ <% end %>
33
+ </abbr>
34
+ </div>
35
+
36
+ <%= avatar_for @users[post.user_id] %>
37
+ <span class="fn"><%= link_to truncate(h(@users[post.user_id].display_name), 15), user_path(post.user_id) %></span>
38
+ <span class="posts"><%= posts_count(@user[post.user_id]) %></span>
39
+ </td>
40
+ <td class="body entry-content">
41
+ <p class="topic">
42
+ <%= t(:topic_title) %>: <%= link_to h(post.forum_name), forum_path(post.forum_id) %> /
43
+ <%= link_to h(post.topic_title), forum_topic_path(post.forum_id, post.topic_id) %>
44
+ </p>
45
+
46
+ <%= post.body_html %>
47
+ </td>
48
+ </tr>
49
+
50
+ <% end %>
51
+ </table>
52
+
53
+ <%= will_paginate @posts %>
@@ -0,0 +1,20 @@
1
+ xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
2
+
3
+ xml.rss "version" => "2.0",
4
+ 'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
5
+ 'xmlns:atom' => "http://www.w3.org/2005/Atom" do
6
+ xml.channel do
7
+ xml.title "{search_posts_title} | Beast"[:posts_feed_title, search_posts_title]
8
+ xml.link "http://#{request.host_with_port}#{search_posts_path}"
9
+ xml.language "en-us"[:feed_language]
10
+ xml.ttl "60"
11
+ xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port+request.relative_url_root}/open_search.xml"
12
+ unless params[:q].blank?
13
+ xml.tag! "opensearch:totalResults", @posts.total_entries
14
+ xml.tag! "opensearch:startIndex", (((params[:page] || 1).to_i - 1) * @posts.per_page)
15
+ xml.tag! "opensearch:itemsPerPage", @posts.per_page
16
+ xml.tag! "opensearch:Query", :role => 'request', :searchTerms => params[:q], :startPage => (params[:page] || 1)
17
+ end
18
+ render :partial => "layouts/post", :collection => @posts, :locals => {:xm => xml}
19
+ end
20
+ end
@@ -0,0 +1,55 @@
1
+ <% @page_title = "Posts that {user} is monitoring"[:posts_user_is_monitoring, h(@user.display_name)] -%>
2
+
3
+ <% content_for :right do %>
4
+
5
+ <h4><%= "{name}'s Monitored Topics"[:users_monitored_topics, link_to(h(@user.display_name), user_path(@user))] %></h4>
6
+ <ul class="flat">
7
+ <% @user.monitored_topics.find(:all, :limit => 25).each do |topic| %>
8
+ <li><%= link_to topic.title, forum_topic_path(topic.forum_id, topic) %></li>
9
+ <% end %>
10
+ </ul>
11
+
12
+ <% end -%>
13
+
14
+ <h1><%= @page_title %></h1>
15
+ <p class="subtitle">
16
+ <%= feed_icon_tag @page_title, monitored_posts_path(:user_id => @user, :format => 'rss') %>
17
+ <%= '{count} post(s) found'[(count=@posts.total_entries)==1 ? :post_count_found : :posts_count_found, number_with_delimiter(count)] %>
18
+ </p>
19
+
20
+ <%= will_paginate @posts %>
21
+
22
+ <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
23
+ <% for post in @posts do %>
24
+ <% unless post == @posts.first %>
25
+ <tr class="spacer">
26
+ <td colspan="2">&nbsp;</td>
27
+ </tr>
28
+ <% end %>
29
+ <tr class="post hentry" id="<%= dom_id post %>">
30
+ <td class="author vcard">
31
+ <div class="date">
32
+ <abbr class="updated" title="<%= post.created_at.xmlschema %>">
33
+ <% if post.created_at > Time.now.utc-24.hours%>
34
+ <%= time_ago_in_words(post.created_at).sub(/about /, '') %>
35
+ <% else %>
36
+ <%= post.created_at.strftime("%b %e, %Y"[:date_format])%>
37
+ <% end %>
38
+ </abbr>
39
+ </div>
40
+
41
+ <%= avatar_for post.user %>
42
+ <span class="fn"><%= link_to truncate(h(post.user.display_name), 15), user_path(post.user), :class => (post.user == @posts.first.user ? "admin" : nil) %></span>
43
+ <span class="posts"><%= '{count} post(s)'[(count=post.user.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
44
+ </td>
45
+ <td class="body entry-content">
46
+ <p class="topic"><%= 'Topic'[:topic_title] %>: <%= link_to h(post.topic_title), forum_topic_path(post.forum_id, post.topic_id) %></p>
47
+
48
+ <%= post.body_html %>
49
+ </td>
50
+ </tr>
51
+
52
+ <% end %>
53
+ </table>
54
+
55
+ <%= will_paginate @posts %>
@@ -0,0 +1,15 @@
1
+ xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
2
+
3
+ xml.rss "version" => "2.0",
4
+ 'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
5
+ 'xmlns:atom' => "http://www.w3.org/2005/Atom" do
6
+ xml.channel do
7
+ xml.title "Posts that {user} is monitoring | Beast"[:posts_user_is_monitoring, @user.display_name]
8
+ xml.link monitored_posts_url(@user)
9
+ xml.language "en-us"[:feed_language]
10
+ xml.ttl "60"
11
+ xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port+request.relative_url_root}/open_search.xml"
12
+
13
+ render :partial => "layouts/post", :collection => @posts, :locals => {:xm => xml}
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ page.edit_form.cancel
2
+ page.replace_html "post-body-#{@post.id}", @post.body_html
3
+ page.visual_effect :highlight, "post-body-#{@post.id}", :duration => 1.5
@@ -0,0 +1,28 @@
1
+ <p>
2
+ <%= form.label :title %><br/>
3
+ <%= form.text_field :title, :onchange => "/*TopicForm.editNewTitle(this);*/", :class => "primary", :tabindex => 10 %>
4
+
5
+ <% if admin? or current_user.moderator_of?(@topic.forum) %>
6
+ <label style="margin-left:1em;">
7
+ <%= form.check_box :sticky %> <%= Topic.human_attribute_name(:sticky) %>
8
+ </label>
9
+
10
+ <label style="margin-left:1em;">
11
+ <%= form.check_box :locked %> <%= Topic.human_attribute_name(:locked) %>
12
+ </label>
13
+
14
+ <% end %>
15
+
16
+ </p>
17
+ <% if @topic.new_record? %>
18
+ <p>
19
+ <%= form.label :body %><br />
20
+ <%= form.text_area :body, :rows => 12, :tabindex => 20 %></p>
21
+ <% end %>
22
+
23
+ <% if admin? and not @topic.new_record? %>
24
+ <p id="topic_forum_id">
25
+ <%= form.label :forum_id %><br />
26
+ <%= form.select :forum_id, Forum.find(:all, :order => "position").map {|x| [x.name, x.id] } %></p>
27
+ </p>
28
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <h1><%= t(:edit_topic) %></h1>
2
+
3
+ <%= error_messages_for :topic %>
4
+ <% form_for :topic,
5
+ :url => forum_topic_path(@forum, @topic),
6
+ :html => { :method => :put } do |f| -%>
7
+ <%= render :partial => "form", :object => f %>
8
+ <br />
9
+ <%= submit_tag t(:save_changes), :or => link_to(t(:cancel), forum_topic_path(@forum, @topic)) %>
10
+ <% end -%>
@@ -0,0 +1,2 @@
1
+ <h1>Post#index</h1>
2
+ <p>Find me in app/views/posts/index.rhtml</p>
@@ -0,0 +1,18 @@
1
+ <div class="crumbs" xstyle="margin-top:1.1em;">
2
+ <%= link_to t(:forums_title), forums_path %> <span class="arrow">&rarr;</span>
3
+ <%= link_to h(@forum.name), forum_path(@forum) %> <span class="arrow">&rarr;</span>
4
+ </div>
5
+
6
+
7
+ <h1 id="new_topic"><%= t(:new_topic) %></h1>
8
+ <p class="subtitle"><%= t(:by_user, :user => current_user.display_name) %></p>
9
+
10
+ <%= error_messages_for :post %>
11
+ <%= error_messages_for :topic %>
12
+ <% form_for :topic, :url => forum_topics_path(@forum) do |f| -%>
13
+ <%= render :partial => "form", :object => f %>
14
+ <%= submit_tag t(:post_topic), :or => link_to(t(:cancel), forum_path(@forum)) %>
15
+ <% end -%>
16
+
17
+ <%= javascript_tag "$('topic_title').focus();" %>
18
+
@@ -0,0 +1,183 @@
1
+ <% @page_title = @topic.title %>
2
+ <% @monitoring = logged_in? && !Monitorship.count(:id, :conditions => ['user_id = ? and topic_id = ? and active = ?', current_user.id, @topic.id, true]).zero? %>
3
+
4
+ <% content_for :right do -%>
5
+
6
+ <h5><%= t(:voices_title) %></h5>
7
+ <ul class="flat talking">
8
+ <% @topic.voices.each do | user | %>
9
+ <li><%= link_to h(user.display_name), user_path(user) %></li>
10
+ <% end %>
11
+ </ul>
12
+
13
+
14
+ <% end # right content -%>
15
+
16
+ <% if logged_in? %>
17
+ <% form_tag forum_topic_monitorship_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do -%>
18
+ <div>
19
+ <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
20
+ onclick="if (this.checked) {<%= remote_function :url => forum_topic_monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => forum_topic_monitorship_path(@forum, @topic), :method => :delete %>}" />
21
+ <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? t(:monitoring_topic) : t(:monitor_topic) %></label>
22
+ <%= hidden_field_tag '_method', 'delete' if @monitoring %>
23
+ <%= submit_tag :Set, :id => 'monitor_submit' %>
24
+ </div>
25
+ <% end -%>
26
+
27
+ <% end -%>
28
+
29
+
30
+ <div class="crumbs">
31
+ <%= link_to t(:forums_title), forums_path %> <span class="arrow">&rarr;</span>
32
+ <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %>
33
+ <%
34
+ page=session[:forum_page] ? session[:forum_page][@topic.forum.id] : nil
35
+ if page and page!=1 %>
36
+ <small style="color:#ccc">
37
+ (<%= link_to t(:page, :page => page), forum_path(:id => @topic.forum, :page => page) %>)
38
+ </small>
39
+ <% end %>
40
+ <span class="arrow">&rarr;</span>
41
+ </div>
42
+
43
+ <h1 id="topic-title" style="margin-top:0.5em;"<%= %( onmouseover="$('topic_mod').show();" onmouseout="$('topic_mod').hide();") if logged_in? %>>
44
+
45
+
46
+ <%= h @topic.title %>
47
+ <% if @topic.locked? %>
48
+ <span>(<%= t(:locked) %>)</span>
49
+ <% end %>
50
+ <% if logged_in? %>
51
+ <span style="display:none;" id="topic_mod">
52
+ <% if @topic.editable_by?(current_user) -%>
53
+ <%= link_to(t(:edit), edit_forum_topic_path(@forum, @topic), :class => "utility") %> |
54
+ <%= link_to(t(:delete), forum_topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => 'Delete this topic forever?'[:delete_topic_conf]) %>
55
+ <% end -%>
56
+ </span>
57
+ <% end %>
58
+ </h1>
59
+
60
+ <p class="subtitle">
61
+ <%= feed_icon_tag @topic.title, forum_topic_path(@forum, @topic, :format => :rss) %>
62
+ <%= posts_count(@topic.posts.size)%>,
63
+ <%= voices_count(@topic.voices.size) %>
64
+ </p>
65
+
66
+ <%= will_paginate @posts %>
67
+
68
+ <a name="<%= dom_id @posts.first %>" id="<%= dom_id @posts.first %>">&nbsp;</a>
69
+
70
+ <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
71
+ <% for post in @posts do %>
72
+ <% unless post == @posts.first %>
73
+ <tr class="spacer">
74
+ <td colspan="2">
75
+ <a name="<%= dom_id post %>" id="<%= dom_id post %>">&nbsp;</a>
76
+ </td>
77
+ </tr>
78
+ <% end %>
79
+ <tr class="post hentry" id="<%= dom_id post %>-row">
80
+ <td class="author vcard">
81
+ <div class="date">
82
+ <a href="#<%= dom_id post %>" rel="bookmark">
83
+ <abbr class="updated" title="<%= post.created_at.xmlschema %>">
84
+ <%= time_ago_in_words(post.created_at) %>
85
+ </abbr>
86
+ </a>
87
+ </div>
88
+
89
+ <%= avatar_for post.user %>
90
+ <span class="fn"><%= link_to truncate(h(post.user.display_name), 15), user_path(post.user), :class => (post.user == @posts.first.user ? "threadauthor" : nil) %></span>
91
+ <% if post.user.admin? or post.forum.moderators.include?(post.user) %>
92
+ <span class="admin">
93
+ <% if post.user.admin? %>
94
+ <%= t(:administrator_title) %>
95
+ <% elsif post.forum.moderators.include?(post.user) %>
96
+ <%= t(:moderator_title) %>
97
+ <% end %>
98
+ </span>
99
+ <% end %>
100
+ <span class="posts"><%= posts_count(post.user.posts.size) %></span>
101
+
102
+
103
+ <% if logged_in? && post.editable_by?(current_user) -%>
104
+ <p>
105
+ <span class="edit">
106
+ <%= ajax_spinner_for "edit-post-#{post.id}", "spinner_bounce.gif" %>
107
+ <%= link_to_remote(t(:edit_post),
108
+ {:url => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post), :method => :get,
109
+ :before => "EditForm.init(#{post.id});", :condition => "!EditForm.isEditing(#{post.id})" },
110
+ {:href => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post, :page => params[:page]), :class => "utility"}) %>
111
+ </span>
112
+ </p>
113
+ <% end -%>
114
+
115
+
116
+ </td>
117
+ <td class="body entry-content" id="post-body-<%= post.id %>">
118
+ <!--
119
+ <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? %>
120
+ -->
121
+ <%= post.body_html %>
122
+ </td>
123
+ </tr>
124
+
125
+ <% end %>
126
+ </table>
127
+
128
+ <%= will_paginate @posts %>
129
+
130
+ <% if logged_in? %>
131
+ <div id="edit"></div>
132
+ <% if @topic.locked? %>
133
+ <p>
134
+ <%= image_tag "savage_beast/clearbits/lock.gif", :class => "icon grey", :title => "Topic locked"[:topic_locked_title] %>
135
+ <label>
136
+ <%= 'This topic is locked'[:locked_topic] %>.</label>
137
+ </p>
138
+ <% else %>
139
+
140
+ <p><%= link_to_function t(:reply_to_topic), "ReplyForm.init()", :class => "utility" %></p>
141
+
142
+ <div id="reply" class="editbox">
143
+ <div class="container">
144
+ <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %>
145
+ <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%>
146
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
147
+ <tr>
148
+ <td rowspan="2" width="70%">
149
+ <%= f.text_area :body, :rows => 8 %>
150
+ </td>
151
+ <td valign="top">
152
+
153
+
154
+ <h5><%= t(:formatting_help) %></h5>
155
+
156
+ <ul class="help">
157
+ <li><%= t(:formatting_bold) %></li>
158
+ <li><%= t(:formatting_italics) %></li>
159
+ <li><%= t(:formatting_blockquote) %></li>
160
+ <li>"IBM":http://www.ibm.com</li>
161
+ <li><%= t(:formatting_list) %></li>
162
+ </ul>
163
+
164
+ </td>
165
+ </tr>
166
+ <tr>
167
+ <td valign="bottom" style="padding-bottom:15px;">
168
+ <%= submit_tag t(:save_reply) %><span class="button_or"><%= t(:or) %>
169
+ <%= link_to_function t(:cancel), "$('reply').hide()" %></span>
170
+ </td>
171
+ </tr>
172
+ </table>
173
+ <% end -%>
174
+ </div>
175
+ </div>
176
+ <%= javascript_tag "$('reply').hide();"%>
177
+ <% end %>
178
+ <% end %>
179
+
180
+ <div class="crumbs" style="margin-top:1.1em;">
181
+ <%= link_to t(:forums_title), forums_path %> <span class="arrow">&rarr;</span>
182
+ <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">&rarr;</span>
183
+ </div>