radiant-forum-extension 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/forum_page.rb +47 -0
- data/config/locales/en.yml +2 -2
- data/lib/radiant-forum-extension.rb +1 -1
- data/radiant-forum-extension-3.0.6.gem +0 -0
- metadata +7 -5
@@ -0,0 +1,47 @@
|
|
1
|
+
class ForumPage < Page
|
2
|
+
attr_accessor :forum, :topic, :post
|
3
|
+
helper_method :forum, :topic, :post, :forums, :topics, :posts
|
4
|
+
|
5
|
+
description I18n.t 'forum_page.description'
|
6
|
+
|
7
|
+
def cache?
|
8
|
+
!restricted?
|
9
|
+
end
|
10
|
+
|
11
|
+
def find_by_path(path, live = true, clean = true)
|
12
|
+
path = clean_path(path) if clean
|
13
|
+
my_path = self.path_without_parts
|
14
|
+
if path =~ /^#{Regexp.quote(my_path)}(.*)/
|
15
|
+
read_parameters($1)
|
16
|
+
self
|
17
|
+
else
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def read_parameters(path)
|
23
|
+
unless path.blank?
|
24
|
+
parts = path.split(/\/+/)
|
25
|
+
if forum_id = parts.pop
|
26
|
+
forum = Forum.find(@forum_id)
|
27
|
+
if topic_id = parts.pop
|
28
|
+
topic = forum.topics.find(@topic_id)
|
29
|
+
if post_id = parts.pop
|
30
|
+
post = topic.posts.find(@topic_id)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def forums
|
38
|
+
Forum.visible_to(Reader.current)
|
39
|
+
end
|
40
|
+
def topics
|
41
|
+
Topic.visible_to(Reader.current)
|
42
|
+
end
|
43
|
+
def posts
|
44
|
+
Post.visible_to(Reader.current)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -78,7 +78,7 @@ en:
|
|
78
78
|
definitely_remove_post: "Yes: delete it"
|
79
79
|
description: Description
|
80
80
|
edit_forum: "Edit forum"
|
81
|
-
edit_minimal: "
|
81
|
+
edit_minimal: "edit"
|
82
82
|
edit_post: "Edit post"
|
83
83
|
edit_topic: "Edit topic"
|
84
84
|
edit_your_post: "edit your post"
|
@@ -171,7 +171,7 @@ en:
|
|
171
171
|
reader_deleted: 'Reader deleted'
|
172
172
|
really_remove_post: "Are you sure you want to delete this comment?"
|
173
173
|
recent_topics: "Recent topics"
|
174
|
-
remove_minimal: "
|
174
|
+
remove_minimal: "delete"
|
175
175
|
remove_post: "delete comment"
|
176
176
|
replied_on: "replied on %{date}"
|
177
177
|
reply_from: "reply from"
|
Binary file
|
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 7
|
10
|
+
version: 3.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- William Ross
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-02 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: radiant-reader-extension
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- app/controllers/topics_controller.rb
|
70
70
|
- app/helpers/forum_helper.rb
|
71
71
|
- app/models/forum.rb
|
72
|
+
- app/models/forum_page.rb
|
72
73
|
- app/models/moderatorship.rb
|
73
74
|
- app/models/post.rb
|
74
75
|
- app/models/post_attachment.rb
|
@@ -234,6 +235,7 @@ files:
|
|
234
235
|
- public/stylesheets/sass/admin/forum_dashboard.sass
|
235
236
|
- public/stylesheets/sass/forum.sass
|
236
237
|
- public/stylesheets/sass/gallery.sass
|
238
|
+
- radiant-forum-extension-3.0.6.gem
|
237
239
|
- radiant-forum-extension.gemspec
|
238
240
|
- Rakefile
|
239
241
|
- README.md
|
@@ -260,7 +262,7 @@ files:
|
|
260
262
|
homepage: http://radiant.spanner.org/forum
|
261
263
|
licenses: []
|
262
264
|
|
263
|
-
post_install_message: "\n Add this to the Gemfile in your radiant project:\n\n gem 'radiant-forum-extension', '~> 3.0.
|
265
|
+
post_install_message: "\n Add this to the Gemfile in your radiant project:\n\n gem 'radiant-forum-extension', '~> 3.0.7'\n\n "
|
264
266
|
rdoc_options: []
|
265
267
|
|
266
268
|
require_paths:
|