radiant-forum-extension 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
@@ -4,7 +4,6 @@ class ForumBaseController < ReaderActionController
4
4
  radiant_layout { |c| Radiant::Config['forum.layout'] || Radiant::Config['reader.layout'] }
5
5
  before_filter :require_login_unless_public
6
6
  before_filter :establish_context
7
- after_filter :clear_site_cache, :only => [:create, :update, :destroy]
8
7
  helper :forum, :reader
9
8
 
10
9
  protected
@@ -55,10 +54,7 @@ protected
55
54
 
56
55
  def render_page_or_feed(template_name = action_name)
57
56
  respond_to do |format|
58
- format.html {
59
- expires_in SiteController.cache_timeout, :public => true, :private => false
60
- render :action => template_name
61
- }
57
+ format.html { render :action => template_name }
62
58
  format.rss { render :action => template_name, :layout => 'feed' }
63
59
  format.js { render :action => template_name, :layout => false }
64
60
  end
@@ -79,8 +75,4 @@ protected
79
75
  false
80
76
  end
81
77
 
82
- def clear_site_cache
83
- Radiant::Cache.clear if defined?(Radiant::Cache)
84
- end
85
-
86
78
  end
@@ -1,13 +1,13 @@
1
1
  class PostAttachmentsController < ForumBaseController
2
2
 
3
- # this simple controller exists for two reasons: to use sendfile for attachments (but it doesn't, yet)
4
- # and to allow other extensions (ie group_forum) to restrict access to post attachments
3
+ # this simple controller is only here to restrict access to post attachments
4
+ # if the forum is private, and to allow other extensions to add further restrictions
5
5
 
6
6
  def show
7
7
  @attachment = PostAttachment.find(params[:id])
8
8
  size = params[:size] || 'original'
9
- expires_in SiteController.cache_timeout, :public => true, :private => false
10
- send_file @attachment.file.path(size.to_sym), :type => @attachment.file_content_type, :disposition => 'inline'
9
+ expires_in 1.week, :public => true, :private => false
10
+ send_file @attachment.file.path(size.to_sym), :type => @attachment.file_content_type
11
11
  end
12
12
 
13
13
  end
@@ -16,12 +16,6 @@ class PostsController < ForumBaseController
16
16
  render_page_or_feed
17
17
  end
18
18
 
19
- def monitored
20
- @topics = current_reader.monitored_topics
21
- @posts = Post.in_topics(@topics).paginate(pagination_parameters)
22
- render_page_or_feed
23
- end
24
-
25
19
  def show
26
20
  respond_to do |format|
27
21
  format.html { redirect_to_post }
@@ -3,12 +3,8 @@ require "sanitize/config/forum"
3
3
 
4
4
  module ForumHelper
5
5
 
6
- def feed_tag(text, url, options={})
7
- link_to text, url, options.merge(:class => 'floating feedlink')
8
- end
9
-
10
6
  def feed_link(url)
11
- link_to image_tag('/images/furniture/feed_14.png', :class => 'feedicon', :alt => t('rss_feed'), :size => '14x20'), url
7
+ link_to image_tag('/images/furniture/feed_14.png', :alt => t('rss_feed')), url, :class => "rssfeed"
12
8
  end
13
9
 
14
10
  def clean_textilize(text) # adding smilies to the default reader method
@@ -21,20 +17,6 @@ module ForumHelper
21
17
  end
22
18
  end
23
19
 
24
- def watch_tag(topic, label='watching', formclass=nil)
25
- if current_user
26
- monitoring = current_user.monitoring?(topic)
27
- %{
28
- <form action="#{monitorship_path(topic.forum, topic)}" method="post" class="#{formclass}"><div>
29
- <input id="monitor_checkbox_#{topic.id}" name="monitor_checkbox" class="monitor_checkbox" type="checkbox"#{ ' checked="checked"' if monitoring } />
30
- <label class="monitor_label" for="monitor_checkbox_#{topic.id}">#{label}</label>
31
- #{hidden_field_tag '_method', monitoring ? 'delete' : ''}
32
- #{submit_tag :set, :class => 'monitor_submit'}
33
- </div></form>
34
- }
35
- end
36
- end
37
-
38
20
  def paginated_post_url(post)
39
21
  param_name = WillPaginate::ViewHelpers.pagination_options[:param_name]
40
22
  if post.page
@@ -1,11 +1,9 @@
1
1
  - post ||= @post
2
2
  - unless post.frozen?
3
3
  - if post.editable_by?(current_reader)
4
- %div.edit_me
5
- - if post.editable_interval
6
- = t('time_remaining_to_edit', :time => distance_of_time_in_words(post.still_editable_for))
7
- = link_to t('edit_your_post'), edit_topic_post_url(post.topic, post), :class => 'edit_post remote', :id => "revise_post_#{post.id}"
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 => 'edit_post remote', :id => "revise_post_#{post.id}"
8
7
  - elsif admin?
9
- %div.edit_me
10
- = link_to t("edit_minimal"), edit_topic_post_url(post.topic, post), :class => 'edit_post remote', :id => "revise_post_#{post.id}", :title => "edit post"
11
- = 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("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"
@@ -22,12 +22,11 @@
22
22
  %h2
23
23
  = post.reader.name
24
24
 
25
- = render :partial => 'posts/edit_links', :locals => {:post => post}
26
-
27
25
  %p.context
28
26
  - if with_context
29
27
  = render :partial => 'posts/context', :locals => {:post => post}
30
28
  = friendly_date(post.created_at) + '.'
29
+ = render :partial => 'posts/edit_links', :locals => {:post => post}
31
30
 
32
31
  .post_body
33
32
  = clean_textilize(post.body)
@@ -9,5 +9,5 @@ xm.item do
9
9
  xm.description clean_textilize(truncate_words(post.body, 64))
10
10
  xm.pubDate post.created_at.to_s(:rfc822)
11
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"
12
- xm.link paged_post_url(post)
12
+ xm.link paginated_post_url(post)
13
13
  end
@@ -7,9 +7,10 @@
7
7
  %br
8
8
  %span.context
9
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)
10
+ - if topic.replied_by
11
+ = t('new_reply_from')
12
+ = link_to topic.replied_by.name, reader_url(topic.replied_by)
13
+ = friendly_date(topic.replied_at)
13
14
  - else
14
15
  = t('started_by')
15
16
  = link_to topic.reader.name, reader_url(topic.reader)
@@ -6,8 +6,8 @@
6
6
  - else
7
7
  - if current_reader
8
8
  - if current_reader.activated?
9
- .post
10
- .post_wrapper.reply
9
+ .post.replyform
10
+ .post_wrapper
11
11
  .post_header
12
12
  .speaker
13
13
  = standard_gravatar_for(current_reader)
@@ -8,9 +8,11 @@
8
8
  .post_header
9
9
  %h2
10
10
  = link_to topic.name, forum_topic_url(topic.forum, topic)
11
- = render :partial => 'posts/edit_links', :locals => {:post => post}
11
+ = feed_link(topic_path(topic, :format => :rss))
12
+
12
13
  %p.context
13
14
  = render :partial => "topics/context", :locals => {:topic => topic}
15
+ = render :partial => 'posts/edit_links', :locals => {:post => post}
14
16
 
15
17
  .post_body
16
18
  = truncate_and_textilize(post.body, 100)
@@ -23,7 +23,7 @@
23
23
  = t('topics_heading')
24
24
 
25
25
  - content_for :feedlink do
26
- = feed_link(topics_path(:format => :rss))
26
+ = feed_link(topics_url(:format => :rss))
27
27
 
28
28
  - content_for :introduction do
29
29
  %p
@@ -10,5 +10,6 @@ xml.channel do
10
10
  xml.language "en-us"
11
11
  xml.ttl "60"
12
12
 
13
+ render :partial => "posts/post", :object => @topic.posts.first, :locals => {:xm => xml}
13
14
  render :partial => "posts/post", :collection => @posts, :locals => {:xm => xml}
14
15
  end
@@ -136,6 +136,7 @@ en:
136
136
  reply_posted: "reply posted"
137
137
  reply_to: "Reply to"
138
138
  reply: "reply"
139
+ rss: "RSS"
139
140
  rss_feed: "RSS feed"
140
141
  save_changes: "Save changes"
141
142
  save_post: "Save post"
data/forum_extension.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require_dependency 'application_controller'
2
2
 
3
3
  class ForumExtension < Radiant::Extension
4
- version "2.0.2"
4
+ version "2.0.3"
5
5
  description "Nice clean forums and page comments for inclusion in your radiant site. Requires the reader extension and share_layouts."
6
6
  url "http://spanner.org/radiant/forum"
7
7
 
@@ -1,10 +1,6 @@
1
1
  @import compass/css3
2
2
  @import reader.sass
3
-
4
- p.context
5
- +functional
6
- line-height: 1.2
7
- margin: 0 0 10px 0
3
+ @import gallery.sass
8
4
 
9
5
  div#forum
10
6
  div.forum
@@ -37,22 +33,25 @@ div#forum
37
33
  &:hover
38
34
  color: $accent
39
35
  a
40
- &.edit_post
41
- color: green
42
- &.delete_post
43
- padding-left: 5px
44
- color: red
45
36
  &:hover
46
37
  color: $accent
47
38
  &.waiting
48
39
  color: $mid
49
40
  padding-left: 18px
50
41
  background: transparent url(/images/furniture/wait_16_grey.gif) no-repeat left top
51
- div.edit_me
52
- float: right
53
- +strong
54
- color: $dark
55
- margin: 0 0 0 10px
42
+ &.edit_post, &.delete_post
43
+ color: white
44
+ padding: 1px 3px
45
+ +border-radius(3px)
46
+ font-size: 75%
47
+ opacity: 0.2
48
+ &:hover
49
+ opacity: 1
50
+ color: white
51
+ &.edit_post
52
+ background-color: green
53
+ &.delete_post
54
+ background-color: red
56
55
  div.post_body
57
56
  position: relative
58
57
  p
@@ -97,6 +96,11 @@ div#forum
97
96
  color: green
98
97
  font-size: 1.4
99
98
 
99
+ p.context
100
+ +functional
101
+ line-height: 1.2
102
+ margin: 0 0 10px 0
103
+
100
104
  div#search
101
105
  overflow: hidden
102
106
  margin: 0 0 2em 0
@@ -178,6 +182,12 @@ div#forum_search
178
182
  img.feedicon
179
183
  margin: 8px 0
180
184
 
185
+ a.rssfeed
186
+ display: inline
187
+ margin: 0
188
+ padding: 0
189
+ width: 14px
190
+
181
191
  .context, .updatenote
182
192
  +functional
183
193
  color: $pale
@@ -196,9 +206,9 @@ div.speaker
196
206
  float: left
197
207
  width: 50px
198
208
  height: 50px
199
- margin-right: 0
209
+ margin-right: 8px
200
210
 
201
- ///////////////////////////// emoticons in message display are interpolated by our redcloth extension as span class="emoticon something"
211
+ // emoticons in message display are interpolated by our redcloth extension as <img class="emoticon something" />
202
212
 
203
213
  img.emoticon
204
214
  overflow: hidden
@@ -233,93 +243,3 @@ img.emoticon
233
243
  &.cool
234
244
  background-position: -176px 0
235
245
 
236
- ///////////////////////////// pictures
237
-
238
- img.bordered
239
- border: 16px solid white
240
- +box-shadow
241
- &.thin
242
- border: 8px solid white
243
- &.thinner
244
- border: 4px solid white
245
-
246
- p.caption
247
- color: $mid
248
- margin: 4px 20px 20px 20px
249
- a
250
- color: $dark
251
- &:hover
252
- color: $accent
253
-
254
- img.grower
255
- position: absolute
256
- border: 20px solid white
257
- +box-shadow
258
-
259
- img.preloader
260
- visibility: hidden
261
-
262
- div.gallery
263
- position: absolute
264
- overflow: hidden
265
- display: none
266
- background-color: white
267
- +box-shadow
268
- img
269
- overflow: hidden
270
- border: 20px solid white
271
- p.caption
272
- width: 480px
273
- overflow: hidden
274
- margin: 10px 0 0 0
275
- +small
276
- color: $mid
277
- a
278
- color: $dark
279
- &:hover
280
- color: $accent
281
- div.closer
282
- position: absolute
283
- top: 32px
284
- right: 32px
285
- width: 32px
286
- height: 32px
287
- background-color: white
288
- +border-radius
289
- +box-shadow
290
- a
291
- position: relative
292
- display: block
293
- width: 32px
294
- height: 32px
295
- background: transparent url('/images/furniture/gallerylinks.png') no-repeat -96px 0
296
- &:hover
297
- background-image: url('/images/furniture/gallerylinks_over.png')
298
- div.controls
299
- position: absolute
300
- display: none
301
- width: 96px
302
- height: 32px
303
- bottom: 50px
304
- left: 50px
305
- background-color: white
306
- +border-radius
307
- +box-shadow
308
- a
309
- position: relative
310
- display: block
311
- float: left
312
- width: 32px
313
- height: 32px
314
- background: transparent url('/images/furniture/gallerylinks.png') no-repeat 0 0
315
- &:hover
316
- background-image: url('/images/furniture/gallerylinks_over.png')
317
- &.disabled
318
- background-image: url('/images/furniture/gallerylinks_disabled.png')
319
- &.download
320
- background-position: -32px 0
321
- &.next
322
- background-position: -64px 0
323
- &.close
324
- background-position: -96px 0
325
-
@@ -0,0 +1,83 @@
1
+ @import compass/css3
2
+ @import reader.sass
3
+
4
+ p.caption
5
+ color: $mid
6
+ margin: 4px 20px 20px 20px
7
+ a
8
+ color: $dark
9
+ &:hover
10
+ color: $accent
11
+
12
+ img.grower
13
+ position: absolute
14
+ border: 20px solid white
15
+ +box-shadow
16
+
17
+ img.preloader
18
+ visibility: hidden
19
+
20
+ div.gallery
21
+ position: absolute
22
+ overflow: hidden
23
+ display: none
24
+ background-color: white
25
+ +box-shadow
26
+ img
27
+ overflow: hidden
28
+ border: 20px solid white
29
+ p.caption
30
+ width: 480px
31
+ overflow: hidden
32
+ margin: -10px 0 10px 20px
33
+ +small
34
+ color: $mid
35
+ a
36
+ color: $dark
37
+ &:hover
38
+ color: $accent
39
+ div.closer
40
+ position: absolute
41
+ top: 32px
42
+ right: 32px
43
+ width: 32px
44
+ height: 32px
45
+ background-color: white
46
+ +border-radius
47
+ +box-shadow
48
+ a
49
+ position: relative
50
+ display: block
51
+ width: 32px
52
+ height: 32px
53
+ background: transparent url('/images/furniture/gallerylinks.png') no-repeat -96px 0
54
+ &:hover
55
+ background-image: url('/images/furniture/gallerylinks_over.png')
56
+ div.controls
57
+ position: absolute
58
+ display: none
59
+ width: 96px
60
+ height: 32px
61
+ bottom: 50px
62
+ left: 50px
63
+ background-color: white
64
+ +border-radius
65
+ +box-shadow
66
+ a
67
+ position: relative
68
+ display: block
69
+ float: left
70
+ width: 32px
71
+ height: 32px
72
+ background: transparent url('/images/furniture/gallerylinks.png') no-repeat 0 0
73
+ &:hover
74
+ background-image: url('/images/furniture/gallerylinks_over.png')
75
+ &.disabled
76
+ background-image: url('/images/furniture/gallerylinks_disabled.png')
77
+ &.download
78
+ background-position: -32px 0
79
+ &.next
80
+ background-position: -64px 0
81
+ &.close
82
+ background-position: -96px 0
83
+
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-forum-extension}
8
- s.version = "2.0.2"
8
+ s.version = "2.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
12
- s.date = %q{2011-01-31}
12
+ s.date = %q{2011-02-01}
13
13
  s.description = %q{Nice clean forums and page comments for inclusion in your radiant site. Derived long ago from beast. Requires the reader extension and share_layouts.}
14
14
  s.email = %q{will@spanner.org}
15
15
  s.extra_rdoc_files = [
@@ -57,9 +57,6 @@ Gem::Specification.new do |s|
57
57
  "app/views/forums/show.html.haml",
58
58
  "app/views/forums/show.rss.builder",
59
59
  "app/views/layouts/feed.rss.builder",
60
- "app/views/monitorships/create.rjs.erb",
61
- "app/views/monitorships/destroy.rjs.erb",
62
- "app/views/monitorships/index.html.erb",
63
60
  "app/views/pages/_comment.html.haml",
64
61
  "app/views/pages/_comments.html.haml",
65
62
  "app/views/posts/_attachment.html.haml",
@@ -209,6 +206,7 @@ Gem::Specification.new do |s|
209
206
  "public/punymce/puny_mce_full.js",
210
207
  "public/punymce/puny_mce_src.js",
211
208
  "public/stylesheets/sass/forum.sass",
209
+ "public/stylesheets/sass/gallery.sass",
212
210
  "radiant-forum-extension.gemspec",
213
211
  "spec/controllers/admin/forums_controller_spec.rb",
214
212
  "spec/controllers/forums_controller_spec.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-forum-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-31 00:00:00 +00:00
18
+ date: 2011-02-01 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -100,9 +100,6 @@ files:
100
100
  - app/views/forums/show.html.haml
101
101
  - app/views/forums/show.rss.builder
102
102
  - app/views/layouts/feed.rss.builder
103
- - app/views/monitorships/create.rjs.erb
104
- - app/views/monitorships/destroy.rjs.erb
105
- - app/views/monitorships/index.html.erb
106
103
  - app/views/pages/_comment.html.haml
107
104
  - app/views/pages/_comments.html.haml
108
105
  - app/views/posts/_attachment.html.haml
@@ -252,6 +249,7 @@ files:
252
249
  - public/punymce/puny_mce_full.js
253
250
  - public/punymce/puny_mce_src.js
254
251
  - public/stylesheets/sass/forum.sass
252
+ - public/stylesheets/sass/gallery.sass
255
253
  - radiant-forum-extension.gemspec
256
254
  - spec/controllers/admin/forums_controller_spec.rb
257
255
  - spec/controllers/forums_controller_spec.rb
@@ -1 +0,0 @@
1
- page[:monitor_label].innerHTML = "Watching topic"
@@ -1 +0,0 @@
1
- page[:monitor_label].innerHTML = "Watch topic"
@@ -1,35 +0,0 @@
1
- <%= render :partial => 'forums/controls' %>
2
- <%= render :partial => 'forums/notification' %>
3
-
4
- <div id="forum_preamble" class="contentblock">
5
- <h2>Watch list</h2>
6
-
7
- <p>
8
- New posts in any these topics will show up in your personal feed, which you can see as a <%= link_to "web page", monitored_posts_url %> or an <%= link_to "rss feed", formatted_monitored_posts_url(current_user, :rss), :class => 'feedlink' %>.
9
- To add a topic to this list, click on the 'watch this' link at the top of the topic page.
10
- </p>
11
-
12
- <% @topics.group_by(&:forum).each do |forum, topics| %>
13
- <h3 class="section""><%= forum.name %></h3>
14
-
15
- <% topics.each do |topic| %>
16
- <%= watch_tag(topic, topic.title) %>
17
- <% end %>
18
- <% end%>
19
-
20
- <p>
21
- You can remove any of these topics from your feed by clicking it in the list above (or on the topic page). It will remain in this list so you can easily reactivate the subscription.
22
- </p>
23
-
24
- </div>
25
-
26
- <% content_for :breadcrumbs do %>
27
- <%= link_to 'Home', '/' %> &gt;
28
- <%= link_to 'Forum', '/forums' %> &gt;
29
- <%= link_to 'You', '/users/me' %> &gt;
30
- Subscriptions
31
- <% end %>
32
-
33
- <% content_for :title do %>
34
- Your subscriptions
35
- <% end %>