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
@@ -9,25 +9,28 @@
9
9
  - cssclasses << 'deleted' if post.frozen?
10
10
 
11
11
  .post{:id => post.dom_id, :class => cssclasses.join(' ')}
12
- .wrapper
12
+ - unless headless
13
+ = standard_gravatar_for(post.reader)
14
+ .post_header
13
15
  - unless headless
14
- .speaker
15
- = standard_gravatar_for(post.reader)
16
- .post_header
17
- - unless headless
18
- - if with_context
19
- %h2.reply
20
- = link_to post.topic.name, paginated_post_url(post)
21
- - else
22
- %h2
23
- = post.reader.name
16
+ - if with_context
17
+ %h2.reply
18
+ - if post.comment?
19
+ = t('forum_extension.comment_on')
20
+ -elsif post.reply?
21
+ = t('forum_extension.reply_to')
22
+ = link_to post.topic.name, paginated_post_url(post)
23
+ - else
24
+ %h2
25
+ = post.reader.name
24
26
 
25
- %p.context
26
- - if with_context
27
- = render :partial => 'posts/context', :locals => {:post => post}
28
- = friendly_date(post.created_at) + '.'
29
- = render :partial => 'posts/edit_links', :locals => {:post => post}
27
+ %p.context
28
+ - if with_context
29
+ = render :partial => 'posts/context', :locals => {:post => post}
30
+ = friendly_date(post.created_at) + '.'
31
+ = render :partial => 'posts/edit_links', :locals => {:post => post}
30
32
 
33
+ .wrapper
31
34
  .post_body
32
- = clean_textilize(post.body)
35
+ = clean_html(post.body)
33
36
  = render :partial => 'posts/attachments', :locals => {:post => post}
@@ -6,8 +6,8 @@ xm.item do
6
6
  else
7
7
  xm.title "Reply to '#{h(post.topic.name)}' (from #{h post.reader.name})"
8
8
  end
9
- xm.description clean_textilize(truncate_words(post.body, 64))
9
+ xm.description clean_html(truncate_words(post.body, 64))
10
10
  xm.pubDate post.created_at.to_s(:rfc822)
11
- xm.guid [ActionController::Base.session_options[:session_key], post.forum_id.to_s, post.topic_id.to_s, post.id.to_s].join(":"), "isPermaLink" => "false"
11
+ xm.guid UUIDTools::UUID.timestamp_create(post.created_at).to_s, "isPermaLink" => "false"
12
12
  xm.link paginated_post_url(post)
13
13
  end
@@ -1,31 +1,31 @@
1
1
  - minimal ||= false
2
2
 
3
- %form.friendly{:action => posts_url, :method => :get}
3
+ %form.friendly.forum_search{:action => posts_url, :method => :get}
4
4
  - unless minimal
5
5
  %h2
6
- =t('search_header')
6
+ =t('forum_extension.search_header')
7
7
 
8
8
  %p
9
9
  %label{:for => "q"}
10
- = t(minimal ? 'search_form.minimal_query_label' : 'search_form.query_label')
11
- = text_field_tag "q", params[:q], :class => 'titular'
10
+ = t(minimal ? 'forum_extension.search_form.minimal_query_label' : 'forum_extension.search_form.query_label')
11
+ %input{:name => 'q', :type => 'search', :value => params[:q], :placeholder => 'Search', :class => 'standard search'}
12
12
 
13
13
  - unless minimal
14
- %p
15
- %label{:for => "forum_id"}
16
- = t('search_form.forum_label')
17
-
18
- %select{:name => "forum_id"}
19
- %option{:value => ""}= t('anywhere')
20
- = options_from_collection_for_select(Forum.find(:all), "id", "name", params[:forum_id].to_i)
14
+ - if using_forums?
15
+ %p
16
+ %label{:for => "forum_id"}
17
+ = t('forum_extension.search_form.forum_label')
18
+ %select{:name => "forum_id"}
19
+ %option{:value => ""}= t('forum_extension.anywhere')
20
+ = options_from_collection_for_select(Forum.find(:all), "id", "name", params[:forum_id].to_i)
21
21
 
22
22
  - if Radiant::Config['forum.allow_search_by_reader?']
23
23
  %p
24
24
  %label{:for => "reader_id"}
25
- = t('search_form.person_label')
25
+ = t('forum_extension.search_form.person_label')
26
26
  %select{:name => "reader_id"}
27
27
  %option{:value => ""}
28
- =t('anyone')
28
+ =t('forum_extension.anyone')
29
29
  = options_from_collection_for_select(Reader.find(:all), "id", "name", params[:reader_id].to_i)
30
30
 
31
31
  %p.buttons
@@ -0,0 +1,15 @@
1
+ %h2= t('forum_extension.search_results')
2
+ %p
3
+ = render :partial => 'search_summary'
4
+
5
+ - if @posts.empty?
6
+ - if @searching
7
+ %p.has_error
8
+ = t('forum_extension.no_search_results')
9
+ = render :partial => 'posts/search_form'
10
+ - else
11
+ %p
12
+ = t('forum_extension.no_posts')
13
+ - else
14
+ %ul.search_results
15
+ = render :partial => 'posts/minimal', :collection => @posts
@@ -0,0 +1,13 @@
1
+ - @searching = !@term.blank? || @reader || @forum || @topic
2
+
3
+ - if @searching
4
+ = t('forum_extension.topics_and_posts')
5
+ - if @forum
6
+ = t('forum_extension.in') + ' ' + link_to(@forum.name, forum_url(@forum))
7
+ - unless @term.blank?
8
+ = t('forum_extension.containing')
9
+ %strong= @term
10
+ - if @reader
11
+ = t('forum_extension.posted_by') + ' ' + link_to(@reader.name, reader_url(@reader))
12
+ - if @topic
13
+ - summary << t('forum_extension.in_topic') + ' ' + link_to_topic(@topic)
@@ -12,4 +12,4 @@
12
12
  - f.fields_for :attachments, new_attachment do |naf|
13
13
  = render :partial => 'posts/new_attachment', :object => new_attachment, :locals => {:naf => naf}
14
14
  .addfile
15
- = link_to t('attach_file'), "#"
15
+ = link_to t('forum_extension.attach_file'), "#"
@@ -1,31 +1,32 @@
1
- = render :partial => 'forums/standard_parts'
1
+ - content_for :context do
2
+ %p.context
3
+ = render :partial => 'posts/context'
2
4
 
3
- - content_for :form do
4
- .wrapper
5
- .post_header
6
- .speaker
7
- = standard_gravatar_for(@post.reader)
8
- %h2.person
9
- = current_reader.name
10
- %p.context
11
- = friendly_date(@post.created_at)
12
- = render :partial => 'form', :locals => {:post => @post}
5
+ - content_for :person do
6
+ = standard_gravatar_for(@post.reader)
13
7
 
14
8
  - content_for :title do
15
9
  - if @post.page
16
- = t('edit_comment')
10
+ = t('forum_extension.edit_comment')
17
11
  - elsif @post.first?
18
- = t('edit_topic')
12
+ = t('forum_extension.edit_topic')
19
13
  - else
20
- = t('edit_reply')
14
+ = t('forum_extension.edit_reply')
21
15
 
22
16
  - content_for :breadhead do
23
- - if @post.page
24
- = link_to @page.title, @page.url, :class => 'breadhead'
25
- - elsif @post.topic && !@post.first?
26
- = link_to @post.topic.name, forum_topic_url(@topic.forum, @topic), :class => 'breadhead'
27
-
17
+ %span.breadhead
18
+ - if @post.page
19
+ = link_to @page.title, @page.url, :class => 'breadhead'
20
+ - elsif @post.topic && !@post.first?
21
+ = link_to_topic(@post.topic, :class => 'breadhead')
28
22
 
23
+ - content_for :form do
24
+ - if post.editable_by?(current_reader)
25
+ = render :partial => 'form', :locals => {:post => @post}
26
+ - else
27
+ = render :partial => 'ineditable', :locals => {:post => @post}
28
+
29
+ = render :partial => 'shared/standard_forum_parts'
29
30
 
30
- #forum
31
- = yield :form
31
+ .forum
32
+ = yield :form
@@ -1,9 +1,4 @@
1
- - if @searching = !@term.blank? || @reader || @forum || @topic
2
- - summary = [t('topics_and_posts')]
3
- - summary << t('in') + ' ' + link_to(@forum.name, forum_url(@forum)) if @forum
4
- - summary << t('containing') + " <strong>#{@term}</strong>" unless @term.blank?
5
- - summary << t('posted_by') + ' ' + link_to(@reader.name, reader_url(@reader)) if @reader
6
- - summary << t('in_topic') + ' ' + link_to(@topic.name, forum_topic_url(@topic.forum, @topic)) if @topic
1
+ - @searching = !@term.blank? || @reader || @forum || @topic
7
2
 
8
3
  - feed_url_parts = {:format => :rss}
9
4
  - if @searching
@@ -12,17 +7,12 @@
12
7
  - feed_url_parts[:forum_id] = @forum.id if @forum
13
8
  - feed_url_parts[:reader_id] = @topic.id if @topic
14
9
 
15
- = render :partial => 'forums/standard_parts'
16
-
17
10
  - content_for :title do
18
- = t('posts_heading')
11
+ = t('forum_extension.posts_heading')
19
12
 
20
13
  - content_for :introduction do
21
14
  %p
22
- - if @searching
23
- = summary.join(' ') + ":"
24
- - else
25
- = t('posts_introduction')
15
+ = render :partial => 'search_summary'
26
16
 
27
17
  - content_for :sidebar do
28
18
  - unless @searching && @posts.empty?
@@ -30,11 +20,11 @@
30
20
  = render :partial => "topics/latest"
31
21
 
32
22
  - content_for :pagination do
33
- = pagination_and_summary_for(@posts, t('post'))
23
+ = pagination_and_summary_for(@posts, t('forum_extension.post'))
34
24
 
35
25
  - content_for :breadcrumbs do
36
- = link_to t('forum').titlecase, topics_url
37
- = t('separator')
26
+ = link_to t('forum_extension.forum').titlecase, topics_url
27
+ = t('reader_extension.separator')
38
28
  = yield :title
39
29
 
40
30
  - content_for :feedurl do
@@ -47,15 +37,18 @@
47
37
  - if @posts.empty?
48
38
  - if @searching
49
39
  %p.has_error
50
- = t('no_search_results')
40
+ = t('forum_extension.no_search_results')
51
41
  = render :partial => 'posts/search_form'
52
42
  - else
53
43
  %p
54
- = t('no_posts')
44
+ = t('forum_extension.no_posts')
55
45
  - else
56
46
  = yield :pagination if @posts.previous_page
57
47
  = render :partial => 'posts/post', :collection => @posts, :locals => {:with_context => true, :headless => false}
58
48
  = yield :pagination if @posts.next_page
59
49
 
60
- #forum
50
+ = render :partial => 'shared/standard_forum_parts'
51
+
52
+ .forum
61
53
  = yield :messages
54
+
@@ -7,15 +7,15 @@ xml.channel do
7
7
  }
8
8
 
9
9
  if @searching
10
- summary = [t('topics_and_posts')]
11
- summary << t('matching') + " '#{@term}'" unless @term.blank?
12
- summary << t('posted_by') + " #{@reader.name}" if @reader
13
- summary << t('in_forum') + " #{@forum.name}" if @forum
10
+ summary = [t('forum_extension.topics_and_posts')]
11
+ summary << t('forum_extension.matching') + " '#{@term}'" unless @term.blank?
12
+ summary << t('forum_extension.posted_by') + " #{@reader.name}" if @reader
13
+ summary << t('forum_extension.in_forum') + " #{@forum.name}" if @forum
14
14
  xml.title Radiant::Config['site.name'] + ': ' + summary.join(' ')
15
15
  xml.description summary.join(' ')
16
16
  else
17
- xml.title Radiant::Config['site.name'] + ': ' + t('latest_posts')
18
- xml.description t('latest_posts_description')
17
+ xml.title Radiant::Config['site.name'] + ': ' + t('forum_extension.latest_posts')
18
+ xml.description t('forum_extension.latest_posts_description')
19
19
  end
20
20
 
21
21
  url_parts = {}
@@ -1,34 +1,31 @@
1
- = render :partial => 'forums/standard_parts'
2
-
3
- - content_for :form do
4
- .post
5
- .wrapper
6
- .post_header
7
- .speaker
8
- = standard_gravatar_for(current_reader)
9
- %h2.person
10
- = current_reader.name
11
- %p.context
12
- = t('if_you_not', :name => current_reader.name)
13
- = link_to(t('log_out'), reader_logout_url) + '.'
14
- = render :partial => 'form', :locals => {:post => @post}
15
-
16
1
  - content_for :person do
17
- - standard_gravatar_for(current_reader)
2
+ = standard_gravatar_for(current_reader)
3
+
4
+ - content_for :context do
5
+ %p.context
6
+ = t('forum_extension.if_you_not', :name => current_reader.name)
7
+ = link_to(t('reader_extension.log_out'), reader_logout_url) + '.'
18
8
 
19
9
  - content_for :title do
20
10
  - if @page
21
- = t('new_comment')
11
+ = t('forum_extension.new_comment')
22
12
  - elsif @topic
23
- = t('new_reply')
13
+ = t('forum_extension.new_reply')
24
14
  - else
25
- = t('new_topic')
15
+ = t('forum_extension.new_topic')
26
16
 
27
17
  - content_for :breadhead do
28
18
  - if @page
29
19
  = link_to @page.title, @page.url, :class => 'breadhead'
30
20
  - elsif @topic
31
- = link_to @topic.name, forum_topic_url(@topic.forum, @topic), :class => 'breadhead'
21
+ = link_to_topic(@topic, :class => 'breadhead')
22
+
23
+ - content_for :form do
24
+ = yield :context
25
+ = render :partial => 'form', :locals => {:post => @post}
26
+
27
+ = render :partial => 'shared/standard_forum_parts'
28
+
29
+ .forum
30
+ = yield :form
32
31
 
33
- #forum
34
- = yield :form
@@ -1,27 +1,27 @@
1
- = render :partial => 'forums/standard_parts'
2
-
3
- - content_for :messages do
4
- = render :partial => 'confirm_delete', :locals => {:post => @post}
5
-
6
1
  - content_for :parent do
7
- = link_to @post.topic.name, forum_topic_url(@post.topic, @post.topic.forum)
2
+ = link_to_topic(@post.topic)
8
3
 
9
4
  - content_for :breadhead do
10
- = link_to t('forum').titlecase + t('separator'), topics_url
11
- = link_to @post.topic.forum.name + t('separator'), forum_url(@post.topic.forum)
12
- = yield :parent
5
+ %span.breadhead
6
+ = link_to t('forum_extension.forum').titlecase + t('reader_extension.separator'), topics_url
7
+ = link_to @post.topic.forum.name + t('reader_extension.separator'), forum_url(@post.topic.forum)
8
+ = yield :parent
9
+
10
+ - content_for :context do
11
+ %p.context
12
+ = render :partial => 'posts/context'
13
13
 
14
14
  - content_for :person do
15
15
  = standard_gravatar_for(@post.reader)
16
16
 
17
17
  - content_for :title do
18
18
  - if @post.page
19
- = t('confirm_remove_comment')
19
+ = t('forum_extension.confirm_remove_comment')
20
20
  - elsif @post.first?
21
- = t('confirm_remove_topic')
21
+ = t('forum_extension.confirm_remove_topic')
22
22
  - else
23
- = t('confirm_remove_post')
23
+ = t('forum_extension.confirm_remove_post')
24
+
25
+ = render :partial => 'shared/standard_forum_parts'
24
26
 
25
-
26
- #forum
27
- = yield :messages
27
+ = render :partial => 'confirm_delete', :locals => {:post => @post}
@@ -1,31 +1,37 @@
1
- = render :partial => 'forums/standard_parts'
2
-
3
1
  - content_for :messages do
4
2
  = render :partial => 'post', :object => @post
5
3
 
4
+ - content_for :context do
5
+ %p.context
6
+ = render :partial => 'posts/context'
7
+
6
8
  - content_for :parent do
7
- = link_to @post.topic.name, forum_topic_url(@post.topic, @post.topic.forum)
9
+ = link_to_topic(@post.topic)
8
10
 
9
11
  - content_for :breadhead do
10
- = link_to t('forum').titlecase + t('separator'), topics_url
11
- = link_to @post.topic.forum.name + t('separator'), forum_url(@post.topic.forum)
12
- = yield :parent
12
+ %span.breadhead
13
+ = link_to t('forum').titlecase, topics_url
14
+ = t('reader_extension.separator')
15
+ = link_to @post.topic.forum.name, forum_url(@post.topic.forum)
16
+ = t('reader_extension.separator')
17
+ = yield :parent
13
18
 
14
19
  - content_for :person do
15
20
  = standard_gravatar_for(@post.reader)
16
21
 
17
22
  - content_for :title do
18
23
  -if @post.page
19
- = t('comment_on') + @post.page.title
24
+ = t('forum_extension.comment_on') + @post.page.title
20
25
  - elsif @post.first?
21
26
  = @post.topic.name
22
27
  - else
23
- = t('reply_to') + @post.topic.name
28
+ = t('forum_extension.reply_to') + @post.topic.name
24
29
 
25
30
  - content_for :sidebar do
26
31
  = render :partial => 'topics/latest'
27
32
 
33
+ = render :partial => 'shared/standard_forum_parts'
28
34
 
35
+ .forum
36
+ = yield :messages
29
37
 
30
- #forum
31
- = yield :messages
@@ -1,15 +1,18 @@
1
+ - add_reader_css '/stylesheets/forum.css'
2
+ - add_reader_js '/javascripts/forum.js'
3
+
1
4
  - reader ||= @reader
2
5
  - posts ||= reader.posts.paginate(pagination_parameters)
3
6
 
4
- #forum
5
- %h2
6
- =t('forum_messages', :name => reader.name)
7
+ .forum
8
+ %h3
9
+ =t('forum_extension.forum_messages', :name => reader.name)
7
10
 
8
11
  - if posts.empty?
9
12
  %p
10
- = t('no_posts')
13
+ = t('forum_extension.no_posts')
11
14
  - else
12
- = pagination_and_summary_for(posts, t('post')) if posts.previous_page
15
+ = pagination_and_summary_for(posts, t('forum_extension.post')) if posts.previous_page
13
16
  - posts.each do |post|
14
17
  - if post.comment?
15
18
  = render :partial => 'posts/post', :object => post, :locals => {:with_context => true}
@@ -17,4 +20,4 @@
17
20
  = render :partial => 'topics/topic', :object => post.topic
18
21
  - else
19
22
  = render :partial => 'posts/post', :object => post, :locals => {:with_context => true}
20
- = pagination_and_summary_for(posts, t('post')) if posts.next_page
23
+ = pagination_and_summary_for(posts, t('forum_extension.post')) if posts.next_page
@@ -1,3 +1,3 @@
1
1
  - if reader.posts.any?
2
2
  = reader.posts.count
3
- = t('posts') + '.'
3
+ = t('forum_extension.posts') + '.'
@@ -0,0 +1,41 @@
1
+ - content_for :section_navigation do
2
+ = link_to t('forum_extension.navigation.forum'), topics_url, :class => 'section'
3
+ - if using_forums?
4
+ = link_to t('forum_extension.navigation.forums'), forums_url
5
+ = link_to t('forum_extension.navigation.search'), posts_url
6
+ - if current_reader
7
+ = link_to t('forum_extension.navigation.new_topic'), new_post_url
8
+ - if Radiant::Config['forum.help_url']
9
+ = link_to t('forum_extension.navigation.forum_help'), Radiant::Config['forum.help_url']
10
+
11
+ - content_for :header do
12
+ .header
13
+ = yield :person
14
+ %h1.title
15
+ = yield :breadhead
16
+ = yield :title
17
+
18
+ - content_for :footer do
19
+ .footer
20
+ = yield :controls
21
+
22
+ - content_for :search do
23
+ = render :partial => 'posts/search_form', :locals => {:minimal => true}
24
+
25
+ - content_for :latest do
26
+ = render :partial => 'topics/latest'
27
+
28
+ - content_for :busiest do
29
+ = render :partial => 'topics/busiest'
30
+
31
+ - content_for :forums do
32
+ = render :partial => 'forums/latest'
33
+
34
+ - content_for :newtopic do
35
+ .newmessage
36
+ - if using_forums? && @forum
37
+ = link_to t('forum_extension.new_topic_here'), new_post_url(:forum_id => @forum.id), :class => "post"
38
+ - else
39
+ = link_to t('forum_extension.new_topic'), new_post_url(), :class => "post"
40
+
41
+ = render :partial => 'shared/standard_reader_parts'
@@ -1,12 +1,13 @@
1
1
  %h2
2
- = t('busy_topics')
2
+ = t('forum_extension.top_topics')
3
3
  %ul
4
- - Topic.most_commented(10).each do |topic|
4
+ - Topic.visible_to(current_reader).most_commented(10).each do |topic|
5
5
  %li
6
- = link_to topic.name, forum_topic_url(topic.forum, topic), :class => 'title'
6
+ = link_to_topic(topic, :class => 'title')
7
7
  %br
8
- = t('started_by')
9
- = link_to(topic.reader.name, reader_url(topic.reader)) + ', '
10
- = t('now_has')
11
- = topic.posts.count
12
- = t('posts') + '.'
8
+ %span.context
9
+ = t('forum_extension.started_by')
10
+ = link_to(topic.reader.name, reader_url(topic.reader)) + ', '
11
+ = t('forum_extension.now_has')
12
+ = topic.posts.count
13
+ = t('forum_extension.posts') + '.'
@@ -1,12 +1,15 @@
1
1
  - topic ||= @topic
2
2
  - post = topic.posts.first
3
3
 
4
- = t('new_topic_started')
5
- = t('on_date', :date => friendly_date(post.created_at))
6
- - if topic.reader
7
- = t('by')
8
- = link_to post.reader.name, reader_url(post.reader), :class => 'person'
9
- - if topic.forum
10
- = t('under')
11
- = link_to(topic.forum.name, forum_url(topic.forum), :class => 'forum')
4
+ %p.context
5
+ - if topic.reader
6
+ = t('forum_extension.started_by')
7
+ = link_to post.reader.name, reader_url(post.reader), :class => 'person'
8
+ = friendly_date(post.created_at)
9
+
10
+ - if topic.forum
11
+ = t('forum_extension.under')
12
+ = link_to(topic.forum.name, forum_url(topic.forum), :class => 'forum')
13
+
14
+ = render :partial => 'posts/edit_links', :locals => {:post => post}
12
15
 
@@ -1,5 +1,5 @@
1
1
  %h2
2
- = t('recent_topics')
2
+ = t('forum_extension.recent_topics')
3
3
  %ul
4
- - Topic.latest(5).each do |topic|
4
+ - Topic.visible_to(current_reader).latest(5).each do |topic|
5
5
  = render :partial => 'topics/minimal', :locals => {:topic => topic}
@@ -1,2 +1,2 @@
1
1
  %p
2
- = t('topic_locked')
2
+ = t('forum_extension.topic_locked')
@@ -6,10 +6,10 @@
6
6
  %span.context
7
7
  - if topic.has_replies?
8
8
  - if topic.replied_by
9
- = t('new_reply_from')
9
+ = t('forum_extension.new_reply_from')
10
10
  = link_to topic.replied_by.name, reader_url(topic.replied_by)
11
11
  = friendly_date(topic.replied_at)
12
12
  - else
13
- = t('started_by')
13
+ = t('forum_extension.started_by')
14
14
  = link_to topic.reader.name, reader_url(topic.reader)
15
15
  = friendly_date(topic.created_at)
@@ -1,6 +1,7 @@
1
1
  - topic ||= @topic
2
2
 
3
3
  - if topic.replied_by
4
- = t('post_count_from', :count => topic.posts.count - 1)
5
- = link_to topic.replied_by.name, reader_url(topic.replied_by)
6
- = t('on_date', :date => friendly_date(topic.replied_at))
4
+ - reply_count = topic.posts.count - 1
5
+ = t('forum_extension.post_count', :count => reply_count) + ','
6
+ = link_to "#{t('forum_extension.most_recently') if reply_count > 1} #{t('forum_extension.from')} #{topic.replied_by.name}" , post_url(topic.posts.last)
7
+ = friendly_date(topic.replied_at)
@@ -2,22 +2,27 @@
2
2
 
3
3
  - if topic.locked?
4
4
  %p.administrative
5
- = t("topic_locked")
5
+ = t("forum_extension.topic_locked")
6
+
7
+ - elsif Radiant.config['forum.cached?'] && !@inline
8
+ .new_post
9
+ .wrapper
10
+ = link_to t("forum_extension.add_reply"), new_topic_post_url(topic), :class => 'remote post'
11
+
6
12
  - else
7
13
  - if current_reader
8
14
  - if current_reader.activated?
9
15
  .post.replyform
10
16
  .wrapper
11
17
  .post_header
12
- .speaker
13
- = standard_gravatar_for(current_reader)
18
+ = standard_gravatar_for(current_reader)
14
19
  %h2.person
15
- = t("add_reply")
20
+ = t("forum_extension.add_reply")
16
21
  %p.context
17
- = t('if_you_not', :name => current_reader.name)
18
- = link_to(t('log_out'), reader_logout_url) + '.'
22
+ = t('forum_extension.if_you_not', :name => current_reader.name)
23
+ = link_to(t('reader_extension.log_out'), reader_logout_url) + '.'
19
24
  = render :partial => 'posts/form', :locals => {:post => topic.posts.build, :omit_label => true}
20
25
  - else
21
- = render :partial => 'reader_activations/activation_required', :locals => {:purpose => t('to_reply')}
26
+ = render :partial => 'reader_activations/activation_required', :locals => {:purpose => t('forum_extension.to_reply')}
22
27
  - else
23
- = render :partial => 'reader_sessions/login_form', :locals => {:purpose => t('to_reply')}
28
+ = render :partial => 'reader_sessions/login_form', :locals => {:purpose => t('forum_extension.to_reply')}