radiant-forum-extension 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/README.md +37 -56
  2. data/VERSION +1 -1
  3. data/app/controllers/forum_base_controller.rb +78 -0
  4. data/app/controllers/forums_controller.rb +5 -34
  5. data/app/controllers/posts_controller.rb +61 -153
  6. data/app/controllers/topics_controller.rb +6 -63
  7. data/app/helpers/forum_helper.rb +24 -48
  8. data/app/models/forum.rb +5 -18
  9. data/app/models/post.rb +53 -55
  10. data/app/models/post_attachment.rb +9 -6
  11. data/app/models/topic.rb +20 -113
  12. data/app/views/admin/reader_configuration/_edit_forum.html.haml +4 -2
  13. data/app/views/admin/reader_configuration/_forum.html.haml +6 -2
  14. data/app/views/forums/_forum.html.haml +14 -20
  15. data/app/views/forums/_latest.html.haml +12 -0
  16. data/app/views/forums/_standard_parts.html.haml +49 -0
  17. data/app/views/forums/index.html.haml +16 -24
  18. data/app/views/forums/show.html.haml +18 -28
  19. data/app/views/pages/_comment.html.haml +1 -1
  20. data/app/views/posts/_attachments.html.haml +13 -0
  21. data/app/views/posts/_confirm_delete.html.haml +10 -0
  22. data/app/views/posts/_context.html.haml +16 -0
  23. data/app/views/posts/_edit_links.html.haml +11 -0
  24. data/app/views/posts/_form.html.haml +40 -2
  25. data/app/views/posts/_latest.html.haml +10 -17
  26. data/app/views/posts/_new_attachment.html.haml +2 -0
  27. data/app/views/posts/_post.html.haml +25 -60
  28. data/app/views/posts/{_search.html.haml → _search_form.html.haml} +1 -1
  29. data/app/views/posts/_uploader.html.haml +2 -2
  30. data/app/views/posts/edit.html.haml +26 -13
  31. data/app/views/posts/index.html.haml +19 -27
  32. data/app/views/posts/new.html.haml +27 -7
  33. data/app/views/posts/remove.html.haml +27 -0
  34. data/app/views/posts/show.html.haml +20 -7
  35. data/app/views/readers/_forum_messages.html.haml +20 -0
  36. data/app/views/readers/_messages_summary.html.haml +3 -0
  37. data/app/views/topics/_context.html.haml +12 -0
  38. data/app/views/topics/_latest.html.haml +14 -16
  39. data/app/views/topics/_locked.html.haml +1 -1
  40. data/app/views/topics/_replies.html.haml +6 -0
  41. data/app/views/topics/_reply.html.haml +23 -0
  42. data/app/views/topics/_topic.html.haml +14 -43
  43. data/app/views/topics/_voices.html.haml +5 -0
  44. data/app/views/topics/index.html.haml +11 -24
  45. data/app/views/topics/show.html.haml +25 -38
  46. data/config/initializers/radiant_config.rb +5 -1
  47. data/config/locales/en.yml +73 -27
  48. data/config/routes.rb +3 -4
  49. data/db/migrate/20101222160900_page_posts.rb +21 -0
  50. data/db/migrate/20101222163605_no_comment_forum.rb +10 -0
  51. data/db/migrate/20110105103827_topic_merely_associative.rb +23 -0
  52. data/db/migrate/20110111080550_detach_observer.rb +11 -0
  53. data/db/migrate/20110127113852_import_attachments.rb +9 -0
  54. data/forum_extension.rb +12 -13
  55. data/lib/commentable_model.rb +98 -0
  56. data/lib/forum_page.rb +2 -22
  57. data/lib/forum_reader_sessions_controller.rb +14 -0
  58. data/lib/forum_readers_controller.rb +2 -9
  59. data/lib/forum_red_cloth3.rb +23 -4
  60. data/lib/forum_red_cloth4.rb +23 -4
  61. data/lib/forum_tags.rb +298 -194
  62. data/lib/sanitize/config/forum.rb +47 -0
  63. data/public/images/furniture/blank.png +0 -0
  64. data/public/images/furniture/emoticons.png +0 -0
  65. data/public/javascripts/forum.js +349 -93
  66. data/public/javascripts/jquery.tools.min.js +195 -0
  67. data/public/punymce/blank.htm +1 -0
  68. data/public/punymce/css/content.css +4 -0
  69. data/public/punymce/css/editor.css +58 -0
  70. data/public/punymce/i18n/sv.js +28 -0
  71. data/public/punymce/img/icons.gif +0 -0
  72. data/public/punymce/img/icons_uncompressed.png +0 -0
  73. data/public/punymce/plugins/bbcode.js +1 -0
  74. data/public/punymce/plugins/bbcode_src.js +50 -0
  75. data/public/punymce/plugins/editsource/css/editor.css +3 -0
  76. data/public/punymce/plugins/editsource/editsource.js +1 -0
  77. data/public/punymce/plugins/editsource/editsource_src.js +81 -0
  78. data/public/punymce/plugins/editsource/img/icons.gif +0 -0
  79. data/public/punymce/plugins/emoticons/css/content.css +13 -0
  80. data/public/punymce/plugins/emoticons/css/editor.css +17 -0
  81. data/public/punymce/plugins/emoticons/emoticons.js +1 -0
  82. data/public/punymce/plugins/emoticons/emoticons_src.js +303 -0
  83. data/public/punymce/plugins/emoticons/img/emoticons.gif +0 -0
  84. data/public/punymce/plugins/emoticons/img/emoticons.png +0 -0
  85. data/public/punymce/plugins/emoticons/img/trans.gif +0 -0
  86. data/public/punymce/plugins/entities.js +1 -0
  87. data/public/punymce/plugins/entities_src.js +37 -0
  88. data/public/punymce/plugins/forceblocks.js +1 -0
  89. data/public/punymce/plugins/forceblocks_src.js +465 -0
  90. data/public/punymce/plugins/forcenl.js +1 -0
  91. data/public/punymce/plugins/forcenl_src.js +26 -0
  92. data/public/punymce/plugins/image/css/editor.css +1 -0
  93. data/public/punymce/plugins/image/image.js +1 -0
  94. data/public/punymce/plugins/image/image_src.js +30 -0
  95. data/public/punymce/plugins/image/img/icons.gif +0 -0
  96. data/public/punymce/plugins/link/css/editor.css +2 -0
  97. data/public/punymce/plugins/link/img/icons.gif +0 -0
  98. data/public/punymce/plugins/link/link.js +1 -0
  99. data/public/punymce/plugins/link/link_src.js +36 -0
  100. data/public/punymce/plugins/paste.js +1 -0
  101. data/public/punymce/plugins/paste_src.js +169 -0
  102. data/public/punymce/plugins/protect.js +1 -0
  103. data/public/punymce/plugins/protect_src.js +30 -0
  104. data/public/punymce/plugins/safari2x.js +1 -0
  105. data/public/punymce/plugins/safari2x_src.js +284 -0
  106. data/public/punymce/plugins/tabfocus.js +1 -0
  107. data/public/punymce/plugins/tabfocus_src.js +45 -0
  108. data/public/punymce/plugins/textcolor/css/editor.css +7 -0
  109. data/public/punymce/plugins/textcolor/img/icons.gif +0 -0
  110. data/public/punymce/plugins/textcolor/textcolor.js +1 -0
  111. data/public/punymce/plugins/textcolor/textcolor_src.js +73 -0
  112. data/public/punymce/puny_mce.js +1 -0
  113. data/public/punymce/puny_mce_full.js +1 -0
  114. data/public/punymce/puny_mce_src.js +1460 -0
  115. data/public/stylesheets/sass/forum.sass +175 -169
  116. data/radiant-forum-extension.gemspec +81 -19
  117. data/spec/controllers/admin/forums_controller_spec.rb +2 -2
  118. data/spec/controllers/forums_controller_spec.rb +3 -6
  119. data/spec/controllers/posts_controller_spec.rb +76 -59
  120. data/spec/controllers/topics_controller_spec.rb +4 -95
  121. data/spec/datasets/forum_readers_dataset.rb +1 -0
  122. data/spec/datasets/forums_dataset.rb +91 -10
  123. data/spec/lib/commentable_model_spec.rb +88 -0
  124. data/spec/lib/forum_page_spec.rb +2 -34
  125. data/spec/lib/forum_site_spec.rb +2 -3
  126. data/spec/lib/forum_tags_spec.rb +35 -0
  127. data/spec/models/forum_spec.rb +31 -20
  128. data/spec/models/post_spec.rb +40 -39
  129. data/spec/models/topic_spec.rb +29 -71
  130. data/spec/spec_helper.rb +10 -1
  131. metadata +84 -22
  132. data/app/views/posts/_reply.html.haml +0 -35
  133. data/app/views/posts/_upload.html.haml +0 -2
  134. data/app/views/posts/preview.html.haml +0 -32
  135. data/app/views/posts/search.html.haml +0 -63
  136. data/app/views/posts/search.rss.builder +0 -14
  137. data/app/views/topics/_form.html.haml +0 -30
  138. data/app/views/topics/_help.html.haml +0 -8
  139. data/app/views/topics/comments.html.haml +0 -6
  140. data/app/views/topics/edit.html.haml +0 -26
  141. data/app/views/topics/new.html.haml +0 -56
  142. data/spec/datasets/forum_pages_dataset.rb +0 -11
  143. data/spec/datasets/posts_dataset.rb +0 -31
  144. data/spec/datasets/topics_dataset.rb +0 -37
@@ -1,4 +1,4 @@
1
- %form.friendly{:action => search_posts_url}
1
+ %form.friendly{:action => posts_url}
2
2
  %p
3
3
  %label{:for => "q"}
4
4
  = t('search_form.query_label')
@@ -9,7 +9,7 @@
9
9
  %ul.uploads
10
10
  .selector
11
11
  - new_attachment = post.attachments.build
12
- - f.fields_for :attachments, new_attachment do |uf|
13
- = render :partial => 'posts/upload', :object => new_attachment, :locals => {:uf => uf}
12
+ - f.fields_for :attachments, new_attachment do |naf|
13
+ = render :partial => 'posts/new_attachment', :object => new_attachment, :locals => {:naf => naf}
14
14
  .addfile
15
15
  = link_to t('attach_file'), "#"
@@ -1,18 +1,31 @@
1
- / this form is usually brought in by a remote call to sit on the page in the place of the post itself.
1
+ = render :partial => 'forums/standard_parts'
2
2
 
3
- - form_for :post, @post, :url => topic_post_path(@topic, @post), :html => {:method => 'put', :multipart => true, :id => "post_form_#{@post.id}", :class => 'friendly'} do |f|
4
- = render :partial => 'posts/form', :object => f
5
- %p.buttons
6
- = f.submit t('save_changes')
7
- or
8
- = link_to t('cancel'), topic_post_path(@topic, @post), :class => 'cancel'
3
+ - content_for :form do
4
+ .post_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}
9
13
 
10
- - content_for :pagetitle do
11
- = t('edit')
12
- = @topic.page ? t('comment') : t('post')
14
+ - content_for :title do
15
+ - if @post.page
16
+ = t('edit_comment')
17
+ - elsif @post.first?
18
+ = t('edit_topic')
19
+ - else
20
+ = t('edit_reply')
13
21
 
14
22
  - content_for :breadhead do
15
- = link_to @post.topic.name, forum_topic_url(@post.topic.forum, @post.topic), {:class => 'breadhead'}
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'
16
27
 
17
- - content_for :controls do
18
- = render :partial => 'readers/controls'
28
+
29
+
30
+ #forum
31
+ = yield :form
@@ -1,45 +1,37 @@
1
- - content_for :signals do
2
- = render :partial => 'readers/flasher'
1
+ = render :partial => 'forums/standard_parts'
3
2
 
4
3
  - content_for :title do
5
- = t('latest_posts')
6
-
7
- - content_for :messages do
8
- - if @posts.empty?
9
- %p
10
- = t('no_posts')
11
- - else
12
- = render :partial => 'posts/post', :collection => @posts, :locals => {:with_context => true}
4
+ = t('posts_heading')
13
5
 
6
+ - content_for :introduction do
7
+ = t('posts_introduction')
8
+
14
9
  - content_for :sidebar do
15
10
  = render :partial => "topics/latest"
16
11
 
17
- - content_for :new_topic do
12
+ - content_for :newtopic do
18
13
  .newmessage
19
- = link_to t('new_topic'), new_topic_url
14
+ = link_to t('new_topic'), new_post_url
20
15
 
21
16
  - content_for :pagination do
22
17
  = pagination_and_summary_for(@posts, t('post'))
23
18
 
24
19
  - content_for :breadcrumbs do
25
- = link_to 'Forum', topics_url
26
- \>
27
- = @title
28
-
29
- - content_for :breadhead do
30
- = link_to "Forum", topics_url, :class => 'breadhead'
20
+ = link_to t('forum').titlecase, topics_url
21
+ = t('separator')
22
+ = yield :title
31
23
 
32
- - content_for :feed do
24
+ - content_for :feedlink do
33
25
  = feed_link(posts_path(:format => :rss))
34
26
 
35
- - content_for :controls do
36
- = render :partial => 'readers/controls'
37
-
38
- - content_for :help do
39
- = render :partial => 'topics/help'
40
-
27
+ - content_for :messages do
28
+ - if @posts.empty?
29
+ %p
30
+ = t('no_posts')
31
+ - else
32
+ = yield :pagination if @posts.previous_page
33
+ = render :partial => 'posts/post', :collection => @posts, :locals => {:with_context => true}
34
+ = yield :pagination if @posts.next_page
41
35
 
42
36
  #forum
43
- = yield :pagination if @posts.previous_page
44
37
  = yield :messages
45
- = yield :pagination if @posts.next_page
@@ -1,14 +1,34 @@
1
- - message_type = @page ? 'comment' : 'reply'
1
+ = render :partial => 'forums/standard_parts'
2
2
 
3
- #forum
4
- = render :partial => 'posts/reply'
3
+ - content_for :form do
4
+ .post
5
+ .post_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
+ - content_for :person do
17
+ - standard_gravatar_for(current_reader)
18
+
19
+ - content_for :title do
20
+ - if @page
21
+ = t('new_comment')
22
+ - elsif @topic
23
+ = t('new_reply')
24
+ - else
25
+ = t('new_topic')
5
26
 
6
27
  - content_for :breadhead do
7
28
  - if @page
8
29
  = link_to @page.title, @page.url, :class => 'breadhead'
9
- - else
30
+ - elsif @topic
10
31
  = link_to @topic.name, forum_topic_url(@topic.forum, @topic), :class => 'breadhead'
11
32
 
12
- - content_for :pagetitle do
13
- Add a
14
- = message_type
33
+ #forum
34
+ = yield :form
@@ -0,0 +1,27 @@
1
+ = render :partial => 'forums/standard_parts'
2
+
3
+ - content_for :messages do
4
+ = render :partial => 'confirm_delete', :locals => {:post => @post}
5
+
6
+ - content_for :parent do
7
+ = link_to @post.topic.name, forum_topic_url(@post.topic, @post.topic.forum)
8
+
9
+ - 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
13
+
14
+ - content_for :person do
15
+ = standard_gravatar_for(@post.reader)
16
+
17
+ - content_for :title do
18
+ - if @post.page
19
+ = t('confirm_remove_comment')
20
+ - elsif @post.first?
21
+ = t('confirm_remove_topic')
22
+ - else
23
+ = t('confirm_remove_post')
24
+
25
+
26
+ #forum
27
+ = yield :messages
@@ -1,18 +1,31 @@
1
+ = render :partial => 'forums/standard_parts'
2
+
1
3
  - content_for :messages do
2
- = render :partial => 'post', :object => @post, :locals => {:with_context => true}
4
+ = render :partial => 'post', :object => @post
3
5
 
4
6
  - content_for :parent do
5
7
  = link_to @post.topic.name, forum_topic_url(@post.topic, @post.topic.forum)
6
8
 
7
9
  - content_for :breadhead do
8
- = link_to @post.topic.name + ':', forum_topic_url(@post.topic.forum, @post.topic), {:class => 'breadhead'}
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
13
+
14
+ - content_for :person do
15
+ = standard_gravatar_for(@post.reader)
16
+
17
+ - content_for :title do
18
+ -if @post.page
19
+ = t('comment_on') + @post.page.title
20
+ - elsif @post.first?
21
+ = @post.topic.name
22
+ - else
23
+ = t('reply_to') + @post.topic.name
24
+
25
+ - content_for :sidebar do
26
+ = render :partial => 'topics/latest'
9
27
 
10
- - content_for :speaker do
11
- = gravatar_for(@post.reader, {:size => 42}, {:alt => @post.reader.name, :class => 'gravatar'})
12
28
 
13
- - content_for :thing_title do
14
- = t('reply_to')
15
- = @post.topic.name
16
29
 
17
30
  #forum
18
31
  = yield :messages
@@ -0,0 +1,20 @@
1
+ - reader ||= @reader
2
+ - posts ||= reader.posts.paginate(pagination_parameters)
3
+
4
+ #forum
5
+ %h2
6
+ =t('forum_messages', :name => reader.name)
7
+
8
+ - if posts.empty?
9
+ %p
10
+ = t('no_posts')
11
+ - else
12
+ = pagination_and_summary_for(posts, t('post')) if posts.previous_page
13
+ - posts.each do |post|
14
+ - if post.comment?
15
+ = render :partial => 'posts/post', :object => post, :locals => {:with_context => true}
16
+ - elsif post.first?
17
+ = render :partial => 'topics/topic', :object => post.topic
18
+ - else
19
+ = render :partial => 'posts/post', :object => post, :locals => {:with_context => true}
20
+ = pagination_and_summary_for(posts, t('post')) if posts.next_page
@@ -0,0 +1,3 @@
1
+ - if reader.posts.any?
2
+ = reader.posts.count
3
+ = t('posts') + '.'
@@ -0,0 +1,12 @@
1
+ - topic ||= @topic
2
+ - post = topic.posts.first
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')
12
+
@@ -1,19 +1,17 @@
1
1
  %h2
2
2
  = t('recent_topics')
3
- %ul.recently
3
+ %ul
4
4
  - Topic.latest(10).each do |topic|
5
- - if topic.visible_to?(current_reader)
6
- %li.topic
7
- %span.subject
8
- %a{:href => forum_topic_url(topic.forum, topic)}
9
- = topic.name
10
- %span.context
11
- = t('posted_by')
12
- = link_to topic.reader.name + '.', reader_url(topic.reader)
13
- = t('post_count_from', :count => topic.posts.count - 1)
14
- - if topic.has_posts?
15
- = link_to topic.replied_by.name, reader_url(topic.replied_by)
16
- = friendly_date(topic.replied_at)
17
- - else
18
- = friendly_date(topic.created_at)
19
-
5
+ %li.topic
6
+ = link_to_post(topic.posts.last, :class => 'title')
7
+ %br
8
+ %span.context
9
+ - if topic.has_replies?
10
+ = t('new_reply_from')
11
+ = link_to topic.replied_by.name, reader_url(topic.replied_by)
12
+ = friendly_date(topic.replied_at)
13
+ - else
14
+ = t('started_by')
15
+ = link_to topic.reader.name, reader_url(topic.reader)
16
+ = friendly_date(topic.created_at)
17
+
@@ -1,2 +1,2 @@
1
1
  %p
2
- = t('sorry_locked')
2
+ = t('topic_locked')
@@ -0,0 +1,6 @@
1
+ - topic ||= @topic
2
+
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))
@@ -0,0 +1,23 @@
1
+ - topic ||= @topic
2
+
3
+ - if topic.locked?
4
+ %p.administrative
5
+ = t("topic_locked")
6
+ - else
7
+ - if current_reader
8
+ - if current_reader.activated?
9
+ .post
10
+ .post_wrapper.reply
11
+ .post_header
12
+ .speaker
13
+ = standard_gravatar_for(current_reader)
14
+ %h2.person
15
+ = t("add_reply")
16
+ %p.context
17
+ = t('if_you_not', :name => current_reader.name)
18
+ = link_to(t('log_out'), reader_logout_url) + '.'
19
+ = render :partial => 'posts/form', :locals => {:post => topic.posts.build, :omit_label => true}
20
+ - else
21
+ = render :partial => 'reader_activations/activation_required', :locals => {:purpose => t('to_reply')}
22
+ - else
23
+ = render :partial => 'reader_sessions/login_form', :locals => {:purpose => t('to_reply')}
@@ -1,53 +1,24 @@
1
- - if topic.visible_to?(current_reader)
2
- - post = topic.first_post
3
- %div.post{:id => post.dom_id}
4
- .speaker
5
- = link_to gravatar_for(topic.reader, {:size => 40}, {:alt => topic.reader.name, :class => 'gravatar offset', :width => '40', :height => '40'}), forum_topic_url(topic.forum, topic)
1
+ - post = topic.posts.first
6
2
 
3
+ %div{:id => topic.dom_id}
4
+ .post
7
5
  .post_wrapper
6
+ .speaker
7
+ = standard_gravatar_for(post.reader, forum_topic_url(topic.forum, topic))
8
8
  .post_header
9
- %h2.subject
10
- %a{:href => forum_topic_url(topic.forum, topic), :class => 'main'}
11
- = topic.name
12
-
9
+ %h2
10
+ = link_to topic.name, forum_topic_url(topic.forum, topic)
11
+ = render :partial => 'posts/edit_links', :locals => {:post => post}
13
12
  %p.context
14
- = t('begun_on', :date => friendly_date(topic.created_at))
15
- = t('in')
16
- = link_to topic.forum.name, forum_url(topic.forum)
17
- = t('by')
18
- = link_to post.reader.name, reader_url(topic.reader), :class => 'person'
19
-
20
- - if post.editable_by?(current_reader)
21
- %br
22
- %span.still_editable
23
- - if post.editable_interval
24
- = t('time_remaining_to_edit', :time => distance_of_time_in_words(post.still_editable_for))
25
- = link_to t('edit_your_post'), edit_topic_post_url(topic, post), :class => 'edit_post', :id => "revise_post_#{post.id}"
26
- - elsif admin?
27
- = link_to t("edit_minimal"), edit_topic_post_url(topic, post), :class => 'edit_post', :id => "revise_post_#{post.id}"
28
- = link_to t("remove_minimal"), topic_post_url(topic, post), :method => 'delete', :class => 'delete_post', :id => "delete_post_#{post.id}", :title => "remove post", :confirm => "Are you sure you want to delete this message?"
13
+ = render :partial => "topics/context", :locals => {:topic => topic}
29
14
 
30
15
  .post_body
31
16
  = truncate_and_textilize(post.body, 100)
17
+ = render :partial => 'posts/attachments', :locals => {:post => post}
32
18
 
33
- - unless post.attachments.empty?
34
- .post_attachments
35
- %h4
36
- attached:
37
- - post.attachments.images.each do |att|
38
- = link_to image_tag(att.thumbnail), att.file.url, :class => :thumbnail
39
- - if post.attachments.non_images.any?
40
- %ul.attachments
41
- - post.attachments.non_images.each do |att|
42
- %li
43
- = link_to att.filename, att.file.url, :class => "attachment #{att.extension}"
44
-
45
- - if topic.has_posts?
19
+ - if topic.has_replies?
20
+ .post_replies
46
21
  %p.voices
47
- - topic.other_voices.each do |reader|
48
- = gravatar_for(reader, {:size => 16}, {:alt => reader.name, :class => 'gravatar tiny', :width => '16', :height => '16'})
22
+ = render :partial => 'topics/voices', :locals => {:topic => topic}
49
23
  %p.replies
50
- = t('post_count_from', :count => topic.posts.count - 1)
51
- = link_to topic.replied_by.name, reader_url(topic.replied_by)
52
- = friendly_date(topic.replied_at)
53
-
24
+ = render :partial => 'topics/replies', :locals => {:topic => topic}
@@ -0,0 +1,5 @@
1
+ - topic ||= @topic
2
+ - topic.other_voices.each do |reader|
3
+ - if reader
4
+ - gravatar = gravatar_for(reader, {:size => 16, :default => "#{request.protocol}#{request.host_with_port}/images/furniture/no_gravatar.png"}, {:alt => reader.name, :class => 'gravatar tiny', :width => '16', :height => '16'})
5
+ = link_to gravatar, reader_url(reader)
@@ -1,45 +1,32 @@
1
- - content_for :signals do
2
- = render :partial => 'readers/flasher'
1
+ = render :partial => 'forums/standard_parts'
3
2
 
4
3
  - content_for :messages do
5
4
  - if @topics.empty?
6
5
  %p
7
6
  = t('no_topics')
8
7
  - else
9
- = render :partial => 'topics/topic', :collection => @topics, :locals => {:with_context => true}
8
+ = render :partial => 'topics/topic', :collection => @topics
10
9
 
11
10
  - content_for :sidebar do
12
- %h2
13
- = t('forums')
14
- %ul
15
- - Forum.all.each do |forum|
16
- %li
17
- = link_to forum.name, forum_url(forum)
18
- %br
19
- = forum.topics.count
20
- = t('topics')
21
-
22
- - content_for :new_topic do
23
- .newmessage
24
- = link_to t('new_topic'), new_topic_url
11
+ = render :partial => 'forums/latest'
25
12
 
26
13
  - content_for :pagination do
27
14
  = pagination_and_summary_for(@topics, t('topics'))
28
15
 
29
- - content_for :breadhead do
30
- = home_page_link
31
-
32
16
  - content_for :breadcrumbs do
33
- = t('forum').titlecase
17
+ = link_to t('forum').titlecase, topics_url
18
+ = t('separator')
19
+ = yield :title
34
20
 
35
21
  - content_for :title do
36
- = t('latest_discussion')
22
+ = t('topics_heading')
37
23
 
38
- - content_for :feed do
24
+ - content_for :feedlink do
39
25
  = feed_link(topics_path(:format => :rss))
40
26
 
41
- - content_for :controls do
42
- = render :partial => 'readers/controls'
27
+ - content_for :introduction do
28
+ %p
29
+ =t('topics_introduction')
43
30
 
44
31
  #forum
45
32
  = yield :pagination if @topics.previous_page