radiant-forum-extension 2.1.6 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/README.md +20 -16
  2. data/Rakefile +0 -16
  3. data/app/controllers/forum_base_controller.rb +32 -10
  4. data/app/controllers/posts_controller.rb +37 -14
  5. data/app/helpers/forum_helper.rb +23 -16
  6. data/app/models/forum.rb +11 -7
  7. data/app/models/post.rb +53 -14
  8. data/app/models/post_attachment.rb +1 -1
  9. data/app/models/topic.rb +21 -8
  10. data/app/views/admin/dashboard/_forum_dashboard.html.haml +51 -0
  11. data/app/views/admin/forums/_form.html.haml +12 -0
  12. data/app/views/admin/forums/edit.html.haml +1 -1
  13. data/app/views/admin/forums/index.html.haml +16 -20
  14. data/app/views/admin/posts/_form.html.haml +2 -2
  15. data/app/views/admin/posts/edit.html.haml +1 -1
  16. data/app/views/admin/posts/index.html.haml +5 -5
  17. data/app/views/admin/reader_configuration/_edit_forum.html.haml +6 -0
  18. data/app/views/admin/reader_configuration/_forum.html.haml +5 -1
  19. data/app/views/admin/topics/_form.html.haml +3 -5
  20. data/app/views/admin/topics/edit.html.haml +1 -1
  21. data/app/views/admin/topics/index.html.haml +5 -5
  22. data/app/views/forums/_forum.html.haml +6 -5
  23. data/app/views/forums/_latest.html.haml +14 -12
  24. data/app/views/forums/_statistics.html.haml +4 -4
  25. data/app/views/forums/index.html.haml +8 -10
  26. data/app/views/forums/index.rss.builder +2 -2
  27. data/app/views/forums/show.html.haml +12 -15
  28. data/app/views/pages/_add_comment.html.haml +9 -8
  29. data/app/views/pages/_comments.html.haml +3 -3
  30. data/app/views/posts/_attachments.html.haml +1 -1
  31. data/app/views/posts/_confirm_delete.html.haml +7 -2
  32. data/app/views/posts/_context.html.haml +5 -5
  33. data/app/views/posts/_edit_links.html.haml +4 -4
  34. data/app/views/posts/_form.html.haml +15 -12
  35. data/app/views/posts/_ineditable.html.haml +7 -0
  36. data/app/views/posts/_latest.html.haml +3 -8
  37. data/app/views/posts/_minimal.html.haml +7 -0
  38. data/app/views/posts/_post.html.haml +20 -17
  39. data/app/views/posts/_post.rss.builder +2 -2
  40. data/app/views/posts/_search_form.html.haml +13 -13
  41. data/app/views/posts/_search_results.html.haml +15 -0
  42. data/app/views/posts/_search_summary.html.haml +13 -0
  43. data/app/views/posts/_uploader.html.haml +1 -1
  44. data/app/views/posts/edit.html.haml +22 -21
  45. data/app/views/posts/index.html.haml +12 -19
  46. data/app/views/posts/index.rss.builder +6 -6
  47. data/app/views/posts/new.html.haml +19 -22
  48. data/app/views/posts/remove.html.haml +15 -15
  49. data/app/views/posts/show.html.haml +16 -10
  50. data/app/views/readers/_forum_messages.html.haml +9 -6
  51. data/app/views/readers/_messages_summary.html.haml +1 -1
  52. data/app/views/shared/_standard_forum_parts.html.haml +41 -0
  53. data/app/views/topics/_busiest.html.haml +9 -8
  54. data/app/views/topics/_context.html.haml +11 -8
  55. data/app/views/topics/_latest.html.haml +2 -2
  56. data/app/views/topics/_locked.html.haml +1 -1
  57. data/app/views/topics/_minimal.html.haml +2 -2
  58. data/app/views/topics/_replies.html.haml +4 -3
  59. data/app/views/topics/_reply.html.haml +13 -8
  60. data/app/views/topics/_topic.html.haml +5 -9
  61. data/app/views/topics/_topic.rss.builder +1 -1
  62. data/app/views/topics/index.html.haml +14 -10
  63. data/app/views/topics/index.rss.builder +2 -2
  64. data/app/views/topics/show.html.haml +20 -19
  65. data/app/views/topics/show.rss.builder +3 -3
  66. data/config/initializers/radiant_config.rb +4 -1
  67. data/config/locales/en.yml +202 -178
  68. data/db/migrate/002_pages_commentable.rb +1 -2
  69. data/db/migrate/004_sample_layout.rb +38 -15
  70. data/db/migrate/20110111080550_detach_observer.rb +4 -4
  71. data/db/migrate/20110613112823_search_text.rb +9 -0
  72. data/db/migrate/20110613130230_tidy_up.rb +27 -0
  73. data/db/migrate/20110630083446_page_replied_at.rb +11 -0
  74. data/forum_extension.rb +13 -11
  75. data/lib/commentable_model.rb +13 -9
  76. data/lib/forum_admin_ui.rb +6 -6
  77. data/lib/forum_page.rb +5 -3
  78. data/lib/forum_reader.rb +7 -1
  79. data/lib/forum_reader_sessions_controller.rb +2 -3
  80. data/lib/forum_tags.rb +126 -11
  81. data/lib/radiant-forum-extension.rb +8 -0
  82. data/public/cleditor/images/buttons.gif +0 -0
  83. data/public/cleditor/images/icons/1.gif +0 -0
  84. data/public/cleditor/images/icons/10.gif +0 -0
  85. data/public/cleditor/images/icons/11.gif +0 -0
  86. data/public/cleditor/images/icons/12.gif +0 -0
  87. data/public/cleditor/images/icons/2.gif +0 -0
  88. data/public/cleditor/images/icons/3.gif +0 -0
  89. data/public/cleditor/images/icons/4.gif +0 -0
  90. data/public/cleditor/images/icons/5.gif +0 -0
  91. data/public/cleditor/images/icons/6.gif +0 -0
  92. data/public/cleditor/images/icons/7.gif +0 -0
  93. data/public/cleditor/images/icons/8.gif +0 -0
  94. data/public/cleditor/images/icons/9.gif +0 -0
  95. data/public/cleditor/images/icons/icons.gif +0 -0
  96. data/public/cleditor/images/toolbar.gif +0 -0
  97. data/public/cleditor/jquery.cleditor.css +24 -0
  98. data/public/cleditor/jquery.cleditor.icon.js +65 -0
  99. data/public/cleditor/jquery.cleditor.js +1132 -0
  100. data/public/cleditor/jquery.cleditor.xhtml.js +230 -0
  101. data/public/javascripts/forum.js +146 -107
  102. data/public/stylesheets/sass/forum.sass +94 -58
  103. data/radiant-forum-extension.gemspec +25 -276
  104. data/spec/controllers/forums_controller_spec.rb +0 -7
  105. data/spec/controllers/posts_controller_spec.rb +20 -37
  106. data/spec/controllers/topics_controller_spec.rb +1 -7
  107. data/spec/datasets/forums_dataset.rb +38 -40
  108. data/spec/lib/commentable_model_spec.rb +26 -38
  109. data/spec/lib/forum_reader_spec.rb +0 -4
  110. data/spec/models/forum_spec.rb +46 -16
  111. data/spec/models/post_spec.rb +10 -6
  112. data/spec/models/topic_spec.rb +26 -17
  113. data/spec/spec_helper.rb +1 -0
  114. metadata +66 -99
  115. data/VERSION +0 -1
  116. data/app/views/forums/_standard_parts.html.haml +0 -59
  117. data/lib/sanitize/config/forum.rb +0 -49
  118. data/public/javascripts/gallery.js +0 -275
  119. data/public/punymce/blank.htm +0 -1
  120. data/public/punymce/css/content.css +0 -4
  121. data/public/punymce/css/editor.css +0 -58
  122. data/public/punymce/i18n/sv.js +0 -28
  123. data/public/punymce/img/icons.gif +0 -0
  124. data/public/punymce/img/icons_uncompressed.png +0 -0
  125. data/public/punymce/plugins/bbcode.js +0 -1
  126. data/public/punymce/plugins/bbcode_src.js +0 -50
  127. data/public/punymce/plugins/editsource/css/editor.css +0 -3
  128. data/public/punymce/plugins/editsource/editsource.js +0 -1
  129. data/public/punymce/plugins/editsource/editsource_src.js +0 -81
  130. data/public/punymce/plugins/editsource/img/icons.gif +0 -0
  131. data/public/punymce/plugins/emoticons/css/content.css +0 -13
  132. data/public/punymce/plugins/emoticons/css/editor.css +0 -17
  133. data/public/punymce/plugins/emoticons/emoticons.js +0 -1
  134. data/public/punymce/plugins/emoticons/emoticons_src.js +0 -303
  135. data/public/punymce/plugins/emoticons/img/emoticons.gif +0 -0
  136. data/public/punymce/plugins/emoticons/img/emoticons.png +0 -0
  137. data/public/punymce/plugins/emoticons/img/trans.gif +0 -0
  138. data/public/punymce/plugins/entities.js +0 -1
  139. data/public/punymce/plugins/entities_src.js +0 -37
  140. data/public/punymce/plugins/forceblocks.js +0 -1
  141. data/public/punymce/plugins/forceblocks_src.js +0 -465
  142. data/public/punymce/plugins/forcenl.js +0 -1
  143. data/public/punymce/plugins/forcenl_src.js +0 -26
  144. data/public/punymce/plugins/image/css/editor.css +0 -1
  145. data/public/punymce/plugins/image/image.js +0 -1
  146. data/public/punymce/plugins/image/image_src.js +0 -30
  147. data/public/punymce/plugins/image/img/icons.gif +0 -0
  148. data/public/punymce/plugins/link/css/editor.css +0 -2
  149. data/public/punymce/plugins/link/img/icons.gif +0 -0
  150. data/public/punymce/plugins/link/link.js +0 -1
  151. data/public/punymce/plugins/link/link_src.js +0 -36
  152. data/public/punymce/plugins/paste.js +0 -1
  153. data/public/punymce/plugins/paste_src.js +0 -169
  154. data/public/punymce/plugins/protect.js +0 -1
  155. data/public/punymce/plugins/protect_src.js +0 -30
  156. data/public/punymce/plugins/safari2x.js +0 -1
  157. data/public/punymce/plugins/safari2x_src.js +0 -284
  158. data/public/punymce/plugins/tabfocus.js +0 -1
  159. data/public/punymce/plugins/tabfocus_src.js +0 -45
  160. data/public/punymce/plugins/textcolor/css/editor.css +0 -7
  161. data/public/punymce/plugins/textcolor/img/icons.gif +0 -0
  162. data/public/punymce/plugins/textcolor/textcolor.js +0 -1
  163. data/public/punymce/plugins/textcolor/textcolor_src.js +0 -73
  164. data/public/punymce/puny_mce.js +0 -1
  165. data/public/punymce/puny_mce_full.js +0 -1
  166. data/public/punymce/puny_mce_src.js +0 -1460
@@ -12,6 +12,18 @@
12
12
  %label{:for=>"forum_description"} Description
13
13
  ~ text_area "forum", "description", :class => "textarea", :style => "width: 100%"
14
14
 
15
+ - form.edit_group do
16
+ - if @group && @forum.new_record?
17
+ - @forum.groups = [@group]
18
+
19
+ .set
20
+ %p
21
+ = t('allowed_groups')
22
+ - Group.find(:all).each do |group|
23
+ = check_box_tag "forum[group_ids][]", group.id, @forum.has_group?(group), :id => "forum_group_#{group.id}"
24
+ %label.checkbox{:for => "forum_group_#{group.id}"}
25
+ = group.name
26
+
15
27
  = javascript_tag "$('forum_name').activate()"
16
28
 
17
29
  - render_region :form_bottom do |form_bottom|
@@ -1,6 +1,6 @@
1
1
  - render_region :main do |main|
2
2
  - main.edit_header do
3
3
  %h1
4
- = t('edit_forum').titlecase
4
+ = t('forum_extension.edit_forum').titlecase
5
5
  - main.edit_form do
6
6
  = render :partial => 'form'
@@ -8,13 +8,13 @@
8
8
  - render_region :thead do |thead|
9
9
  - thead.title_header do
10
10
  %th.forum
11
- =t('forum').titlecase
11
+ =t('forum_extension.forum').titlecase
12
12
  - thead.description_header do
13
13
  %th.description
14
- =t('description').titlecase
14
+ =t('forum_extension.description').titlecase
15
15
  - thead.latest_header do
16
16
  %th.forum_latest
17
- =t('latest_activity').titlecase
17
+ =t('forum_extension.latest_activity').titlecase
18
18
  - thead.modify_header do
19
19
  %th.action
20
20
  %tbody
@@ -31,22 +31,18 @@
31
31
 
32
32
  - tbody.latest_cell do
33
33
  %td.forum_latest
34
- - if forum.posts_count > 0
35
- %ul.latest
36
- - forum.topics.latest(1).each do |topic|
37
- %li.topic
38
- = friendly_date(topic.replied_at) + ":"
39
- - if topic.replied_by
40
- = t('new_reply_to')
41
- = link_to topic.name, forum_topic_url(topic.forum, topic), {:class => 'topic'}
42
- = t('from_reader', :name => topic.replied_by.name)
43
- - else
44
- = t('new_topic')
45
- = link_to topic.name, forum_topic_url(topic.forum, topic), {:class => 'topic'}
46
- = t('from_reader', :name => topic.reader.name)
47
- -else
48
- %p
49
- = t('no_topics')
34
+ %ul.latest
35
+ - forum.topics.latest(1).each do |topic|
36
+ %li.topic
37
+ = friendly_date(topic.replied_at) + ":"
38
+ - if topic.replied_by
39
+ = t('forum_extension.new_reply_to')
40
+ = link_to_topic(topic, :class => 'topic')
41
+ = t('forum_extension.from_reader', :name => topic.replied_by.name)
42
+ - else
43
+ = t('forum_extension.new_topic')
44
+ = link_to_topic(topic, :class => 'topic')
45
+ = t('forum_extension.from_reader', :name => topic.reader.name)
50
46
 
51
47
  - tbody.modify_cell do
52
48
  %td.actions
@@ -62,4 +58,4 @@
62
58
  #actions
63
59
  = pagination_for @forums
64
60
  %ul
65
- %li= link_to image('plus') + " " + t("new_forum"), new_admin_forum_url
61
+ %li= link_to image('plus') + " " + t("forum_extension.new_forum"), new_admin_forum_url
@@ -6,12 +6,12 @@
6
6
  - form.show_name do
7
7
  %p.title
8
8
  %label
9
- = t('topic_name') + ":"
9
+ = t('forum_extension.topic_name') + ":"
10
10
  = @post.topic.name
11
11
 
12
12
  - form.edit_body do
13
13
  %p.content
14
- = f.label :body, t('post_body')
14
+ = f.label :body, t('forum_extension.post_body')
15
15
  = f.text_area :body, :class => "textarea", :style => "width: 100%"
16
16
 
17
17
  - render_region :form_bottom do |form_bottom|
@@ -1,6 +1,6 @@
1
1
  - render_region :main do |main|
2
2
  - main.edit_header do
3
3
  %h1
4
- = t('edit_post').titlecase
4
+ = t('forum_extension.edit_post').titlecase
5
5
  - main.edit_form do
6
6
  = render :partial => 'form'
@@ -8,15 +8,15 @@
8
8
  - render_region :thead do |thead|
9
9
  - thead.body_header do
10
10
  %th.body
11
- = t('body')
11
+ = t('forum_extension.body')
12
12
  - thead.author_header do
13
13
  %th.author
14
- = t('author')
14
+ = t('forum_extension.author')
15
15
  - thead.date_header do
16
16
  %th.date
17
17
  - thead.topic_header do
18
18
  %th.topic
19
- = t('topic')
19
+ = t('forum_extension.topic')
20
20
  - thead.modify_header do
21
21
  %th.action
22
22
  %tbody
@@ -25,7 +25,7 @@
25
25
  - render_region :tbody do |tbody|
26
26
  - tbody.body_cell do
27
27
  %td.post_body
28
- = link_to truncate(post.body, :length => 64), edit_admin_post_url(post)
28
+ = link_to truncate_words(scrub_html(post.body), 8), edit_admin_post_url(post)
29
29
 
30
30
  - tbody.author_cell do
31
31
  %td.post_author
@@ -37,7 +37,7 @@
37
37
 
38
38
  - tbody.topic_cell do
39
39
  %td.post_topic
40
- = link_to post.topic.name, forum_topic_url(post.topic.forum, post.topic), :class => 'external'
40
+ = link_to_topic(post.topic, :class => 'external')
41
41
 
42
42
  - tbody.modify_cell do
43
43
  %td.actions
@@ -2,6 +2,8 @@
2
2
  %h3 Forum
3
3
  %p
4
4
  = edit_config 'forum.public?'
5
+ %p
6
+ = edit_config 'forum.cached?'
5
7
  %p
6
8
  = edit_config 'forum.layout'
7
9
  %p
@@ -10,8 +12,12 @@
10
12
  = edit_config 'forum.editable_period'
11
13
  %p
12
14
  = edit_config 'forum.allow_page_comments?'
15
+ %p
16
+ = edit_config 'forum.commentable_period'
13
17
  %p
14
18
  = edit_config 'forum.allow_attachments?'
19
+ %p
20
+ = edit_config 'forum.offer_rss?'
15
21
  %p
16
22
  = edit_config 'forum.attachment.content_types'
17
23
  %p
@@ -2,9 +2,11 @@
2
2
  %h3
3
3
  .actions
4
4
  = button_to t("edit"), edit_admin_reader_configuration_url, :method => :get
5
- =t("forum_configuration")
5
+ =t("forum_extension.forum_configuration")
6
6
  %p.ruled
7
7
  = show_config 'forum.public?'
8
+ %p.ruled
9
+ = show_config 'forum.cached?'
8
10
  %p.ruled
9
11
  = show_config 'forum.layout'
10
12
  %p.ruled
@@ -17,6 +19,8 @@
17
19
  = show_config 'forum.commentable_period'
18
20
  %p.ruled
19
21
  = show_config 'forum.allow_attachments?'
22
+ %p.ruled
23
+ = show_config 'forum.offer_rss?'
20
24
  %p.ruled
21
25
  = show_config 'forum.attachment.content_types'
22
26
  %p.ruled
@@ -4,18 +4,16 @@
4
4
  - render_region :form do |form|
5
5
  - form.edit_name do
6
6
  %p.title
7
- = f.label :name, t('topic_name')
7
+ = f.label :name, t('forum_extension.topic_name')
8
8
  = f.text_field :name, :class => 'textbox', :maxlength => 100
9
9
 
10
10
  - form.edit_body do
11
- - f.fields_for :posts, @topic.first_post do |pf|
11
+ - f.fields_for :posts, @topic.posts.first do |pf|
12
12
  %p.body
13
- = pf.label :body, t('topic_body')
13
+ = pf.label :body, t('forum_extension.topic_body')
14
14
  = pf.text_area :body, :class => "textarea", :style => "width: 100%"
15
15
 
16
16
  - render_region :form_bottom do |form_bottom|
17
- - form_bottom.edit_timestamp do
18
- = updated_stamp @topic
19
17
  - form_bottom.edit_buttons do
20
18
  %p.buttons
21
19
  = save_model_button(@topic)
@@ -1,6 +1,6 @@
1
1
  - render_region :main do |main|
2
2
  - main.edit_header do
3
3
  %h1
4
- = t('edit_topic').titlecase
4
+ = t('forum_extension.edit_topic').titlecase
5
5
  - main.edit_form do
6
6
  = render :partial => 'form'
@@ -8,15 +8,15 @@
8
8
  - render_region :thead do |thead|
9
9
  - thead.title_header do
10
10
  %th.topic
11
- = t('topic')
11
+ = t('forum_extension.topic')
12
12
  - thead.date_header do
13
13
  %th.date
14
14
  - thead.author_header do
15
15
  %th.author
16
- = t('author')
16
+ = t('forum_extension.author')
17
17
  - thead.body_header do
18
18
  %th.body
19
- = t('body')
19
+ = t('forum_extension.body')
20
20
  - thead.modify_header do
21
21
  %th.action
22
22
  %tbody
@@ -33,11 +33,11 @@
33
33
 
34
34
  - tbody.author_cell do
35
35
  %td.topic_author
36
- = link_to topic.reader.name, admin_reader_url(topic.reader)
36
+ = link_to topic.reader.name, edit_admin_reader_url(topic.reader)
37
37
 
38
38
  - tbody.body_cell do
39
39
  %td.topic_body
40
- = truncate(topic.first_post.body, :length => 64)
40
+ = truncate_words(scrub_html(topic.body), 12)
41
41
 
42
42
  - tbody.modify_cell do
43
43
  %td.actions
@@ -4,13 +4,14 @@
4
4
  .forum_header
5
5
  %h2
6
6
  = link_to forum.name, forum_url(forum), :class => 'main'
7
- %p.context
8
- = forum.description
7
+ - if forum.description
8
+ %p.context
9
+ = forum.description
9
10
  .forum_contents
10
11
  - if forum.topics.any?
11
12
  %ul
12
13
  - forum.topics.latest(3).each do |topic|
13
14
  = render :partial => 'topics/minimal', :locals => {:topic => topic}
14
-
15
-
16
-
15
+ - else
16
+ %p.note
17
+ = t('forum_extension.no_topics')
@@ -1,12 +1,14 @@
1
- %h2
2
- = t('forums')
3
- %ul
4
- - Forum.all.each do |forum|
5
- - if topic = forum.topics.bydate.first
6
- %li
7
- = link_to forum.name, forum_url(forum), :class => 'title'
8
- %br
9
- = forum.topics.count
10
- = t('topics') + ','
11
- = t('most_recently')
12
- = link_to topic.name, forum_topic_url(forum, topic)
1
+ - if using_forums?
2
+ %h2
3
+ = t('forum_extension.forums')
4
+ %ul
5
+ - Forum.visible_to(current_reader).each do |forum|
6
+ - if topic = forum.topics.bydate.first
7
+ %li
8
+ = link_to forum.name, forum_url(forum), :class => 'title'
9
+ %br
10
+ %span.context
11
+ = forum.topics.count
12
+ = t('forum_extension.topics') + ','
13
+ = t('forum_extension.most_recently')
14
+ = link_to_topic(topic)
@@ -1,12 +1,12 @@
1
1
  %h2
2
- = t('busy_readers')
2
+ = t('forum_extension.busy_readers')
3
3
  %ul
4
4
  - Reader.most_commenting(10).each do |reader|
5
5
  %li
6
6
  = link_to reader.name, reader_url(reader), :class => 'title'
7
7
  = reader.posts.count
8
- = t('posts') + ','
8
+ = t('forum_extension.posts') + ','
9
9
  %br
10
- = t('last_seen')
10
+ = t('forum_extension.last_seen')
11
11
  = time_ago_in_words(reader.posts.first.created_at)
12
- = t('ago')
12
+ = t('forum_extension.ago')
@@ -1,11 +1,9 @@
1
- = render :partial => 'forums/standard_parts'
2
-
3
1
  - content_for :title do
4
- = t('forums_heading')
2
+ = t('forum_extension.forums_heading')
5
3
 
6
4
  - content_for :introduction do
7
5
  %p
8
- = t('forums_introduction')
6
+ = t('forum_extension.forums_introduction')
9
7
 
10
8
  - content_for :sidebar do
11
9
  = render :partial => 'posts/search_form', :locals => {:minimal => true}
@@ -15,14 +13,14 @@
15
13
  - content_for :messages do
16
14
  - if @forums.empty?
17
15
  %p
18
- = t('no_forums')
16
+ = t('forum_extension.no_forums')
19
17
  - else
20
18
  = yield :pagination if @forums.previous_page
21
19
  = render :partial => 'forums/forum', :collection => @forums
22
20
  = yield :pagination if @forums.next_page
23
21
 
24
22
  - content_for :pagination do
25
- = pagination_and_summary_for(@forums, t('forum'))
23
+ = pagination_and_summary_for(@forums, t('forum_extension.forum'))
26
24
 
27
25
  - content_for :feedurl do
28
26
  = forums_path(:format => :rss)
@@ -31,12 +29,12 @@
31
29
  = feed_link(forums_path(:format => :rss))
32
30
 
33
31
  - content_for :breadcrumbs do
34
- = link_to t('forum').titlecase, topics_url
35
- = t('separator')
32
+ = link_to t('forum_extension.forum').titlecase, topics_url
33
+ = t('reader_extension.separator')
36
34
  = yield :title
37
35
 
36
+ = render :partial => 'shared/standard_forum_parts'
38
37
 
39
-
40
- #forum
38
+ .forum
41
39
  = yield :messages
42
40
  = yield :newtopic
@@ -4,8 +4,8 @@ xml.channel do
4
4
  :rel => 'self', :type => 'application/rss+xml'
5
5
  }
6
6
 
7
- xml.title "#{@site_title} : #{t('forums')}"
8
- xml.description t('forums')
7
+ xml.title "#{@site_title} : #{t('forum_extension.forums')}"
8
+ xml.description t('forum_extension.forums')
9
9
  xml.link forums_url
10
10
  xml.language I18n.locale.to_s
11
11
  xml.ttl "60"
@@ -1,17 +1,10 @@
1
- = render :partial => 'forums/standard_parts'
2
-
3
1
  - content_for :title do
4
2
  = @forum.name
5
3
 
6
4
  - content_for :introduction do
7
- = clean_textilize(@forum.description)
8
-
9
- - content_for :newtopic do
10
- .newmessage
11
- = link_to t('new_topic_here'), new_post_url(:forum_id => @forum.id)
5
+ = clean_html(@forum.description)
12
6
 
13
7
  - content_for :sidebar do
14
- = render :partial => 'posts/search_form'
15
8
  = render :partial => "topics/latest"
16
9
 
17
10
  - content_for :pagination do
@@ -24,25 +17,29 @@
24
17
  = feed_link(forum_path(@forum, :format => :rss))
25
18
 
26
19
  - content_for :breadhead do
27
- = link_to t('forum').titlecase + t('separator'), topics_url
28
- = link_to t('forums'), forums_url
20
+ %span.breadhead
21
+ = link_to t('forum_extension.forum').titlecase, topics_url
22
+ = t('reader_extension.separator')
23
+ = link_to t('forum_extension.forums'), forums_url
29
24
 
30
25
  - content_for :breadcrumbs do
31
- = yield :breadhead
32
- = t('separator')
26
+ = link_to t('forum_extension.forum').titlecase, topics_url
27
+ = t('reader_extension.separator')
28
+ = link_to t('forum_extension.forums'), forums_url
29
+ = t('reader_extension.separator')
33
30
  = yield :title
34
31
 
35
32
  - content_for :messages do
36
33
  - if @topics.empty?
37
34
  %p
38
- = t('no_topics')
35
+ = t('forum_extension.no_topics')
39
36
  - else
40
37
  = yield :pagination if @topics.previous_page
41
38
  = render :partial => 'topics/topic', :collection => @topics, :locals => { :with_context => false }
42
39
  = yield :pagination if @topics.next_page
43
40
 
41
+ = render :partial => 'shared/standard_forum_parts'
44
42
 
45
-
46
- #forum
43
+ .forum
47
44
  = yield :messages
48
45
  = yield :newtopic
@@ -6,18 +6,19 @@
6
6
  .post.replyform
7
7
  .wrapper
8
8
  .post_header
9
- .speaker
10
- = standard_gravatar_for(current_reader)
9
+ = standard_gravatar_for(current_reader)
11
10
  %h2.person
12
- = t("add_comment")
11
+ = t("forum_extension.add_comment")
13
12
  %p.context
14
- = t('if_you_not', :name => current_reader.name)
15
- = link_to(t('log_out'), reader_logout_url) + '.'
13
+ = t('forum_extension.if_you_not', :name => current_reader.name)
14
+ = link_to(t('reader_extension.log_out'), reader_logout_url) + '.'
16
15
  = render :partial => 'posts/form', :locals => {:post => page.posts.build, :omit_label => true}
16
+
17
+
17
18
  - else
18
- = render :partial => 'reader_activations/activation_required', :locals => {:purpose => t('to_reply')}
19
+ = render :partial => 'reader_activations/activation_required', :locals => {:purpose => t('forum_extension.to_reply')}
19
20
  - else
20
- = render :partial => 'reader_sessions/login_form', :locals => {:purpose => t('to_reply')}
21
+ = render :partial => 'reader_sessions/login_form', :locals => {:purpose => t('forum_extension.to_reply')}
21
22
  - else
22
23
  %p.administrative
23
- = t("page_locked")
24
+ = t("forum_extension.page_locked")
@@ -1,13 +1,13 @@
1
1
  - posts ||= @posts
2
2
  - page ||= @page
3
3
 
4
- #forum
4
+ .forum
5
5
  %h2
6
- = t('comments_on')
6
+ = t('forum_extension.comments_on')
7
7
  = page.title
8
8
 
9
9
  - if posts.empty?
10
10
  %p
11
- = t('none_yet')
11
+ = t('forum_extension.none_yet')
12
12
  - else
13
13
  = render :partial => 'posts/post', :collection => posts
@@ -1,7 +1,7 @@
1
1
  - if Radiant::Config['forum.allow_attachments?'] && !post.frozen? && post.attachments.any?
2
2
  .post_attachments
3
3
  %h4
4
- = t('attached') + ':'
4
+ = t('forum_extension.attached') + ':'
5
5
  - post.attachments.images.each do |att|
6
6
  - display_size = Radiant::Config['forum.image_zoom_size'] || :original
7
7
  = link_to image_tag(post_attachment_url(att, :size => :thumbnail)), post_attachment_url(att, :size => display_size), :class => :thumbnail, :rel => post_attachment_url(att, :size => :original)
@@ -1,10 +1,15 @@
1
1
  - post ||= @post
2
2
  .post_removal
3
3
  %p.warning
4
- = t('confirm_removal_of', :author => post.reader.name)
4
+ - if post.comment?
5
+ = t('forum_extension.confirm_removal_of_comment', :author => post.reader.name)
6
+ - elsif post.first?
7
+ = t('forum_extension.confirm_removal_of_topic', :author => post.reader.name)
8
+ - else
9
+ = t('forum_extension.confirm_removal_of_post', :author => post.reader.name)
5
10
  %p.buttons
6
11
  - form_for post, :html => {:method => 'delete', :class => 'friendly'} do |f|
7
- = f.submit t('definitely_remove_post')
12
+ = f.submit t('forum_extension.definitely_remove_post')
8
13
  = t('or')
9
14
  = link_to t('cancel'), paginated_post_url(post), :class => 'cancel'
10
15
 
@@ -2,15 +2,15 @@
2
2
 
3
3
  - if post
4
4
  - if post.comment?
5
- = t('comment_on')
5
+ = t('forum_extension.comment_on')
6
6
  = link_to post.page.title, post.page.url
7
- = t('posted')
7
+ = t('forum_extension.posted')
8
8
  - elsif post.first?
9
- = t('new_topic_started')
9
+ = t('forum_extension.new_topic_started')
10
10
  - else
11
- = t('reply_posted')
11
+ = t('forum_extension.reply_posted')
12
12
  - if post.reader
13
- = t('by')
13
+ = t('forum_extension.by')
14
14
  = link_to post.reader.name, reader_url(post.reader)
15
15
  - else
16
16
  No post!
@@ -2,8 +2,8 @@
2
2
  - unless post.frozen?
3
3
  - if post.editable_by?(current_reader)
4
4
  - if post.editable_interval
5
- = t('time_remaining_to_edit', :time => distance_of_time_in_words(post.still_editable_for))
6
- = link_to t('edit_your_post'), edit_topic_post_url(post.topic, post), :class => 'remote', :id => "revise_post_#{post.id}"
5
+ = t('forum_extension.time_remaining_to_edit', :time => distance_of_time_in_words(post.still_editable_for))
6
+ = link_to t('forum_extension.edit_your_post'), edit_topic_post_url(post.topic, post), :class => 'remote', :id => "revise_post_#{post.id}"
7
7
  - elsif admin?
8
- = link_to t("edit_minimal"), edit_topic_post_url(post.topic, post), :class => 'edit_post remote', :id => "revise_post_#{post.id}", :title => "edit post"
9
- = link_to t("remove_minimal"), remove_post_url(post), :class => 'delete_post remote', :id => "delete_post_#{post.id}", :title => "remove post"
8
+ = link_to t("forum_extension.edit_minimal"), edit_topic_post_url(post.topic, post), :class => 'edit_post remote', :id => "revise_post_#{post.id}", :title => "edit post"
9
+ = link_to t("forum_extension.remove_minimal"), remove_post_url(post), :class => 'delete_post remote', :id => "delete_post_#{post.id}", :title => "remove post"
@@ -7,34 +7,37 @@
7
7
  - elsif post.first?
8
8
  - f.fields_for :topic do |tf|
9
9
  %p
10
- = tf.label :name, t('label.topic.name'), :class => 'required'
10
+ = tf.label :name, nil, :class => 'required'
11
11
  %br
12
12
  = tf.text_field :name, :class => 'titular'
13
13
  - if admin?
14
14
  %br
15
15
  %span.quiet
16
16
  = tf.check_box :sticky
17
- = tf.label :sticky, t('label.topic.sticky'), :class => 'minor'
17
+ = tf.label :sticky, nil, :class => 'minor'
18
18
  = tf.check_box :locked
19
- = tf.label :locked, t('label.topic.locked'), :class => 'minor'
20
- %p
21
- = tf.label :forum_id, t('label.topic.forum'), :class => "required"
22
- %br
23
- = tf.select :forum_id, Forum.all.collect {|forum| [ forum.name, forum.id ] }, :class=> 'standard'
19
+ = tf.label :locked, nil, :class => 'minor'
20
+
21
+ - if using_forums?
22
+ %p
23
+ = tf.label :forum_id, nil, :class => "required"
24
+ %br
25
+ = tf.select :forum_id, Forum.all.collect {|forum| [ forum.name, forum.id ] }, :class=> 'standard'
26
+
24
27
  - elsif post.topic
25
28
  = f.hidden_field :topic_id
26
29
 
27
30
  %p
28
31
  - unless omit_label
29
- = f.label :body, t('label.post.body'), :class => 'required'
32
+ = f.label :body, nil, :class => 'required'
30
33
  %br
31
- = f.text_area :body, :rows => 12, :class => Radiant::Config['forum.toolbar?'] ? 'toolbarred' : ''
34
+ = f.text_area :body, :rows => 12, :class => Radiant::Config['forum.toolbar?'] ? 'rte' : ''
32
35
 
33
36
  = render :partial => 'posts/uploader', :locals => {:post => post, :f => f}
34
37
 
35
38
  %p.buttons
36
- = f.submit t('save_post')
37
- - unless post.new_record?
39
+ = f.submit t('forum_extension.save_post')
40
+ - if @inline
38
41
  = t('or')
39
- = link_to t("cancel"), paginated_post_url(post), :class => 'cancel'
42
+ = link_to t("cancel"), '#', :class => 'cancel'
40
43
 
@@ -0,0 +1,7 @@
1
+ - post ||= @post
2
+ .ineditable
3
+ %p.warning
4
+ = t('forum_extension.sorry_cannot_edit')
5
+ %p.buttons
6
+ = link_to t('cancel'), paginated_post_url(post), :class => 'cancel'
7
+
@@ -1,10 +1,5 @@
1
1
  %h2
2
- = t('recent_posts')
2
+ = t('forum_extension.recent_posts')
3
3
  %ul
4
- - Post.latest(10).each do |post|
5
- %li.post
6
- %span.subject
7
- = link_to_post(post, :class => 'title')
8
- %span.context
9
- = render :partial => 'posts/context', :locals => {:post => post}
10
- = friendly_date(post.created_at)
4
+ - Post.visible_to(current_reader).latest(10).each do |post|
5
+ = render :partial => 'posts/minimal', :locals => {:post => post}
@@ -0,0 +1,7 @@
1
+ %li.post
2
+ = link_to_post(minimal, :class => 'title')
3
+ %br
4
+ %span.context
5
+ = render :partial => 'posts/context', :locals => {:post => minimal}
6
+ %br
7
+ = truncate_words(scrub_html(minimal.body), 12)