ack-mongoid-forums 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/mongoid_forums/admin/base.js +2 -0
  5. data/app/assets/javascripts/mongoid_forums/admin/categories.js +2 -0
  6. data/app/assets/javascripts/mongoid_forums/admin/forums.js +2 -0
  7. data/app/assets/javascripts/mongoid_forums/admin/groups.js +2 -0
  8. data/app/assets/javascripts/mongoid_forums/admin/users.js +2 -0
  9. data/app/assets/javascripts/mongoid_forums/application.js +15 -0
  10. data/app/assets/javascripts/mongoid_forums/forums.js +2 -0
  11. data/app/assets/javascripts/mongoid_forums/posts.js +2 -0
  12. data/app/assets/javascripts/mongoid_forums/topics.js +2 -0
  13. data/app/assets/stylesheets/mongoid_forums/admin/base.css +4 -0
  14. data/app/assets/stylesheets/mongoid_forums/admin/categories.css +4 -0
  15. data/app/assets/stylesheets/mongoid_forums/admin/forums.css +4 -0
  16. data/app/assets/stylesheets/mongoid_forums/admin/groups.css +4 -0
  17. data/app/assets/stylesheets/mongoid_forums/admin/users.css +4 -0
  18. data/app/assets/stylesheets/mongoid_forums/application.css +15 -0
  19. data/app/assets/stylesheets/mongoid_forums/forums.css +4 -0
  20. data/app/assets/stylesheets/mongoid_forums/posts.css +4 -0
  21. data/app/assets/stylesheets/mongoid_forums/topics.css +4 -0
  22. data/app/assets/stylesheets/scaffold.css +56 -0
  23. data/app/controllers/mongoid_forums/admin/base_controller.rb +18 -0
  24. data/app/controllers/mongoid_forums/admin/categories_controller.rb +83 -0
  25. data/app/controllers/mongoid_forums/admin/forums_controller.rb +83 -0
  26. data/app/controllers/mongoid_forums/admin/groups_controller.rb +83 -0
  27. data/app/controllers/mongoid_forums/admin/topics_controller.rb +48 -0
  28. data/app/controllers/mongoid_forums/admin/users_controller.rb +34 -0
  29. data/app/controllers/mongoid_forums/application_controller.rb +57 -0
  30. data/app/controllers/mongoid_forums/forums_controller.rb +66 -0
  31. data/app/controllers/mongoid_forums/posts_controller.rb +133 -0
  32. data/app/controllers/mongoid_forums/redirect_controller.rb +33 -0
  33. data/app/controllers/mongoid_forums/topics_controller.rb +83 -0
  34. data/app/decorators/lib/mongoid_forums/user_class_decorator.rb +1 -0
  35. data/app/helpers/mongoid_forums/admin/base_helper.rb +4 -0
  36. data/app/helpers/mongoid_forums/admin/categories_helper.rb +4 -0
  37. data/app/helpers/mongoid_forums/admin/forums_helper.rb +4 -0
  38. data/app/helpers/mongoid_forums/admin/groups_helper.rb +4 -0
  39. data/app/helpers/mongoid_forums/admin/users_helper.rb +4 -0
  40. data/app/helpers/mongoid_forums/application_helper.rb +20 -0
  41. data/app/helpers/mongoid_forums/formatting_helper.rb +28 -0
  42. data/app/helpers/mongoid_forums/forums_helper.rb +15 -0
  43. data/app/helpers/mongoid_forums/posts_helper.rb +4 -0
  44. data/app/helpers/mongoid_forums/topics_helper.rb +4 -0
  45. data/app/models/mongoid_forums/ability.rb +65 -0
  46. data/app/models/mongoid_forums/alert.rb +80 -0
  47. data/app/models/mongoid_forums/category.rb +31 -0
  48. data/app/models/mongoid_forums/concerns/subscribable.rb +76 -0
  49. data/app/models/mongoid_forums/concerns/viewable.rb +60 -0
  50. data/app/models/mongoid_forums/forum.rb +67 -0
  51. data/app/models/mongoid_forums/group.rb +15 -0
  52. data/app/models/mongoid_forums/post.rb +40 -0
  53. data/app/models/mongoid_forums/subscription.rb +65 -0
  54. data/app/models/mongoid_forums/topic.rb +55 -0
  55. data/app/models/mongoid_forums/view.rb +30 -0
  56. data/app/views/layouts/mongoid_forums/application.haml +21 -0
  57. data/app/views/mongoid_forums/admin/base/index.haml +6 -0
  58. data/app/views/mongoid_forums/admin/categories/edit.haml +4 -0
  59. data/app/views/mongoid_forums/admin/categories/index.haml +21 -0
  60. data/app/views/mongoid_forums/admin/categories/new.haml +4 -0
  61. data/app/views/mongoid_forums/admin/categories/show.haml +21 -0
  62. data/app/views/mongoid_forums/admin/forums/edit.haml +5 -0
  63. data/app/views/mongoid_forums/admin/forums/index.haml +25 -0
  64. data/app/views/mongoid_forums/admin/forums/new.haml +5 -0
  65. data/app/views/mongoid_forums/admin/forums/show.haml +21 -0
  66. data/app/views/mongoid_forums/admin/groups/edit.haml +4 -0
  67. data/app/views/mongoid_forums/admin/groups/index.haml +23 -0
  68. data/app/views/mongoid_forums/admin/groups/new.haml +5 -0
  69. data/app/views/mongoid_forums/admin/groups/show.haml +26 -0
  70. data/app/views/mongoid_forums/admin/users/index.haml +24 -0
  71. data/app/views/mongoid_forums/forums/index.haml +46 -0
  72. data/app/views/mongoid_forums/forums/new.haml +15 -0
  73. data/app/views/mongoid_forums/forums/show.haml +47 -0
  74. data/app/views/mongoid_forums/posts/_form.haml +4 -0
  75. data/app/views/mongoid_forums/posts/_post.haml +24 -0
  76. data/app/views/mongoid_forums/posts/_quoted.haml +9 -0
  77. data/app/views/mongoid_forums/posts/edit.haml +17 -0
  78. data/app/views/mongoid_forums/posts/new.haml +17 -0
  79. data/app/views/mongoid_forums/topics/_topic.haml +2 -0
  80. data/app/views/mongoid_forums/topics/my_posts.haml +6 -0
  81. data/app/views/mongoid_forums/topics/my_subscriptions.haml +5 -0
  82. data/app/views/mongoid_forums/topics/my_topics.haml +6 -0
  83. data/app/views/mongoid_forums/topics/show.haml +16 -0
  84. data/config/locales/en.yml +196 -0
  85. data/config/routes.rb +62 -0
  86. data/lib/ack_mongoid_forums.rb +1 -0
  87. data/lib/generators/mongoid_forums/install/templates/initializer.rb +5 -0
  88. data/lib/generators/mongoid_forums/install_generator.rb +90 -0
  89. data/lib/generators/mongoid_forums/views_generator.rb +27 -0
  90. data/lib/mongoid_forums.rb +53 -0
  91. data/lib/mongoid_forums/default_permissions.rb +63 -0
  92. data/lib/mongoid_forums/engine.rb +20 -0
  93. data/lib/mongoid_forums/sanitizer.rb +10 -0
  94. data/lib/mongoid_forums/version.rb +3 -0
  95. data/lib/tasks/mongoid_forums_tasks.rake +4 -0
  96. data/test/controllers/mongoid_forums/admin/base_controller_test.rb +11 -0
  97. data/test/controllers/mongoid_forums/admin/categories_controller_test.rb +31 -0
  98. data/test/controllers/mongoid_forums/admin/forums_controller_test.rb +31 -0
  99. data/test/controllers/mongoid_forums/admin/groups_controller_test.rb +41 -0
  100. data/test/controllers/mongoid_forums/admin/users_controller_test.rb +11 -0
  101. data/test/controllers/mongoid_forums/forums_controller_test.rb +16 -0
  102. data/test/controllers/mongoid_forums/posts_controller_test.rb +36 -0
  103. data/test/controllers/mongoid_forums/topics_controller_test.rb +36 -0
  104. data/test/dummy/README.rdoc +28 -0
  105. data/test/dummy/Rakefile +6 -0
  106. data/test/dummy/app/assets/javascripts/application.js +15 -0
  107. data/test/dummy/app/assets/javascripts/welcome.js +2 -0
  108. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  109. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  110. data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
  111. data/test/dummy/app/controllers/application_controller.rb +11 -0
  112. data/test/dummy/app/controllers/welcome_controller.rb +4 -0
  113. data/test/dummy/app/helpers/application_helper.rb +2 -0
  114. data/test/dummy/app/helpers/welcome_helper.rb +2 -0
  115. data/test/dummy/app/models/concerns/zero_oid_fix.rb +10 -0
  116. data/test/dummy/app/models/user.rb +43 -0
  117. data/test/dummy/app/views/layouts/application.haml +13 -0
  118. data/test/dummy/app/views/partials/_nav.haml +6 -0
  119. data/test/dummy/app/views/welcome/index.html.erb +2 -0
  120. data/test/dummy/bin/bundle +3 -0
  121. data/test/dummy/bin/rails +4 -0
  122. data/test/dummy/bin/rake +4 -0
  123. data/test/dummy/bin/setup +29 -0
  124. data/test/dummy/config.ru +4 -0
  125. data/test/dummy/config/application.rb +29 -0
  126. data/test/dummy/config/boot.rb +5 -0
  127. data/test/dummy/config/environment.rb +5 -0
  128. data/test/dummy/config/environments/development.rb +41 -0
  129. data/test/dummy/config/environments/production.rb +76 -0
  130. data/test/dummy/config/environments/test.rb +42 -0
  131. data/test/dummy/config/initializers/assets.rb +11 -0
  132. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  133. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  134. data/test/dummy/config/initializers/devise.rb +259 -0
  135. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  136. data/test/dummy/config/initializers/inflections.rb +16 -0
  137. data/test/dummy/config/initializers/kaminari_config.rb +10 -0
  138. data/test/dummy/config/initializers/mime_types.rb +4 -0
  139. data/test/dummy/config/initializers/mongoid_forums.rb +5 -0
  140. data/test/dummy/config/initializers/session_store.rb +3 -0
  141. data/test/dummy/config/initializers/simple_form.rb +166 -0
  142. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  143. data/test/dummy/config/locales/devise.en.yml +60 -0
  144. data/test/dummy/config/locales/en.yml +23 -0
  145. data/test/dummy/config/locales/simple_form.en.yml +31 -0
  146. data/test/dummy/config/mongoid.yml +69 -0
  147. data/test/dummy/config/routes.rb +7 -0
  148. data/test/dummy/config/secrets.yml +22 -0
  149. data/test/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  150. data/test/dummy/public/404.html +67 -0
  151. data/test/dummy/public/422.html +67 -0
  152. data/test/dummy/public/500.html +66 -0
  153. data/test/dummy/public/favicon.ico +0 -0
  154. data/test/dummy/test/controllers/welcome_controller_test.rb +9 -0
  155. data/test/dummy/test/fixtures/users.yml +11 -0
  156. data/test/dummy/test/models/user_test.rb +7 -0
  157. data/test/fixtures/mongoid_forums/categories.yml +11 -0
  158. data/test/fixtures/mongoid_forums/forums.yml +11 -0
  159. data/test/fixtures/mongoid_forums/posts.yml +11 -0
  160. data/test/fixtures/mongoid_forums/ranks.yml +11 -0
  161. data/test/fixtures/mongoid_forums/topics.yml +11 -0
  162. data/test/integration/navigation_test.rb +9 -0
  163. data/test/models/mongoid_forums/category_test.rb +9 -0
  164. data/test/models/mongoid_forums/forum_test.rb +9 -0
  165. data/test/models/mongoid_forums/post_test.rb +9 -0
  166. data/test/models/mongoid_forums/rank_test.rb +9 -0
  167. data/test/models/mongoid_forums/topic_test.rb +9 -0
  168. data/test/mongoid_forums_test.rb +7 -0
  169. data/test/test_helper.rb +17 -0
  170. metadata +442 -0
@@ -0,0 +1,46 @@
1
+ %h1 Listing all forums
2
+
3
+ - @categories.each do |category|
4
+ %h2
5
+ = category.name
6
+ Category
7
+ - if category.moderator?(mongoid_forums_user)
8
+ %b You are a moderator of this category
9
+ %table{:border => "1"}
10
+ %tr
11
+ %th
12
+ Name
13
+ %th
14
+ Last post
15
+ %th
16
+ Topics
17
+ %th
18
+ Posts
19
+ %th
20
+ Unread topics
21
+ %th
22
+ Views
23
+
24
+ - category.forums.asc(:position).each do |forum|
25
+ %tr
26
+ %td
27
+ = link_to forum.name, forum
28
+ %td
29
+ - if forum.topics.select {|topic| can?(:read, topic) }.last
30
+ - last_topic = forum.topics.select {|topic| can?(:read, topic) }.last
31
+ - last_post = last_topic.posts.last
32
+ = time_ago_in_words ( last_post.created_at )
33
+ ago on
34
+ = link_to last_post.topic.name, last_post.topic
35
+ by
36
+ = last_post.user.forum_display_name
37
+ - else
38
+ No posts yet
39
+ %td
40
+ = topics_count(forum) ? topics_count(forum) : "None"
41
+ %td
42
+ = posts_count(forum) ? posts_count(forum) : "None"
43
+ %td
44
+ = mongoid_forums_user ? forum.unread_topic_count(mongoid_forums_user) : ""
45
+ %td
46
+ = forum.views_count ? forum.views_count : "None"
@@ -0,0 +1,15 @@
1
+ %h3
2
+ New Topic in
3
+ = @forum.category.name
4
+ Category
5
+
6
+ = simple_form_for @topic, :url => forum_create_path do |f|
7
+ = f.label :name
8
+ = f.text_field :name
9
+ %br
10
+ %br
11
+ = f.label :post
12
+ = f.simple_fields_for :posts do |post|
13
+ = render :partial => "mongoid_forums/posts/form", :locals => { :f => post }
14
+ %br
15
+ = f.submit "Create Topic", :class => "btn", :disable_with => "Creating..."
@@ -0,0 +1,47 @@
1
+ %h1 Viewing Forum "#{@forum.name}"
2
+ - if @forum.moderator?(mongoid_forums_user)
3
+ %b You are a moderator on this forum.
4
+ %br
5
+ %br
6
+ = link_to "Add a topic", forum_path(@forum) + '/new'
7
+ %br
8
+ %h2 Topics:
9
+ %table{:border => "1"}
10
+ %tr
11
+ %th
12
+ Name
13
+ %th
14
+ Creator
15
+ %th
16
+ Last post
17
+ %th
18
+ Unread posts
19
+ %th
20
+ Posts
21
+ %th
22
+ Views
23
+ - @topics.each do |topic|
24
+ - if can?(:read, topic)
25
+ %tr
26
+ %td
27
+ - if topic.locked
28
+ &#128274
29
+ - if topic.hidden
30
+
31
+ - if topic.pinned
32
+ *
33
+ = link_to topic.name, topic
34
+ %td
35
+ = topic.user.forum_display_name
36
+ = time_ago_in_words( topic.created_at )
37
+ ago
38
+ %td
39
+ = topic.posts.last.user.forum_display_name
40
+ = time_ago_in_words( topic.posts.last.created_at )
41
+ ago
42
+ %td
43
+ = mongoid_forums_user ? topic.unread_post_count(mongoid_forums_user) : ""
44
+ %td
45
+ = topic.posts.count
46
+ %td
47
+ = topic.views_count ? topic.views_count : "None"
@@ -0,0 +1,4 @@
1
+ = f.text_area :text
2
+ %br
3
+ - if params[:reply_to_id]
4
+ = f.hidden_field :reply_to_id, :value => params[:reply_to_id]
@@ -0,0 +1,24 @@
1
+ = post.user.forum_display_name
2
+ - if post.reply_to_id
3
+ replied to
4
+ = MongoidForums::Post.find(post.reply_to_id).user.forum_display_name
5
+ - else
6
+ created
7
+ = time_ago_in_words(post.created_at)
8
+ ago
9
+
10
+ = link_to 'Quote', new_topic_post_path(post.topic_id, :reply_to_id => post.id)
11
+ - if mongoid_forums_user && post.owner_or_admin?(mongoid_forums_user)
12
+ - if can?(:edit_post, post.topic.forum)
13
+ = link_to "Edit", edit_topic_post_path(post.topic_id, post)
14
+ - if can?(:destroy_post, post.topic.forum)
15
+ = button_to "Delete", topic_post_path(post.topic_id, post), :method => :delete
16
+
17
+
18
+ %br
19
+ - if post.reply_to_id
20
+ = render :partial => 'mongoid_forums/posts/quoted', :locals => {:post => post}
21
+ %br
22
+ = mongoid_forums_format(post.text)
23
+ %br
24
+ %hr
@@ -0,0 +1,9 @@
1
+ %blockquote
2
+ - reply_to = MongoidForums::Post.find(post.reply_to_id)
3
+ = reply_to.user.forum_display_name
4
+ said
5
+ = time_ago_in_words(reply_to.created_at)
6
+ ago
7
+ %br
8
+ >
9
+ = mongoid_forums_format(reply_to.text)
@@ -0,0 +1,17 @@
1
+ %h1 Edit Post
2
+ - if @current_resource[:reply_to_id]
3
+ - replying_to = MongoidForums::Post.find(@current_resource[:reply_to_id])
4
+ This post is a reply to
5
+ = replying_to.user.forum_display_name
6
+ %br
7
+ >
8
+ = replying_to.text
9
+ %br
10
+ %br
11
+
12
+ = form_for ([@current_resource.topic, @current_resource]) do |f|
13
+ = f.label :text
14
+ %br
15
+ = render :partial => "form", :locals => { :f => f }
16
+ %br
17
+ = f.submit "Update post", :class => "btn", :disable_with => "Updating..."
@@ -0,0 +1,17 @@
1
+ %h1 New Post
2
+ - if params[:reply_to_id]
3
+ - replying_to = MongoidForums::Post.find(params[:reply_to_id])
4
+ Replying to
5
+ = replying_to.user.forum_display_name
6
+ %br
7
+ >
8
+ = replying_to.text
9
+ %br
10
+ %br
11
+
12
+ = form_for ([@topic, @post]) do |f|
13
+ = f.label :text
14
+ %br
15
+ = render :partial => "form", :locals => { :f => f }
16
+ %br
17
+ = f.submit "Create Reply", :class => "btn", :disable_with => "Creating..."
@@ -0,0 +1,2 @@
1
+ %br
2
+ = link_to topic.name, topic
@@ -0,0 +1,6 @@
1
+ %h2 Your Posts
2
+
3
+ = paginate @posts
4
+
5
+ - @posts.each do |post|
6
+ = render partial: 'mongoid_forums/posts/post', :locals => {:post => post}
@@ -0,0 +1,5 @@
1
+ %h2 Your subscriptions
2
+ = paginate @topics
3
+
4
+ - @topics.each do |sub|
5
+ = render partial: 'topic', :locals => {:topic => sub.subscribable}
@@ -0,0 +1,6 @@
1
+ %h2 Your Topics
2
+
3
+ = paginate @topics
4
+
5
+ - @topics.each do |topic|
6
+ = render partial: 'topic', :locals => {:topic => topic}
@@ -0,0 +1,16 @@
1
+ %h1 Viewing Topic "#{@topic.name}"
2
+ - if mongoid_forums_admin?
3
+ = link_to t("mongoid_forums.topics.actions.hide.#{@topic.hidden}"), toggle_hide_admin_topic_path(@forum, @topic), :class => "btn"
4
+ = link_to t("mongoid_forums.topics.actions.lock.#{@topic.locked}"), toggle_lock_admin_topic_path(@forum, @topic), :class => "btn"
5
+ = link_to t("mongoid_forums.topics.actions.pin.#{@topic.pinned}"), toggle_pin_admin_topic_path(@forum, @topic), :class => "btn"
6
+
7
+ - if @topic.can_be_replied_to? && can?(:reply, @topic)
8
+ = link_to "Reply to topic", new_topic_post_path(@topic)
9
+ - if mongoid_forums_user && @topic.subscriber?(mongoid_forums_user.id)
10
+ = link_to "Unsubscribe", unsubscribe_topic_path(@topic)
11
+ -elsif mongoid_forums_user
12
+ = link_to "Subscribe", subscribe_topic_path(@topic)
13
+ %br
14
+ = paginate @posts
15
+ %br
16
+ = render @posts
@@ -0,0 +1,196 @@
1
+ en:
2
+ mongoid_forums:
3
+ general:
4
+ forum: Forum
5
+ topics: Topics
6
+ topic: Topic
7
+ posts: Posts
8
+ posts_count:
9
+ zero: No posts
10
+ one: 1 post
11
+ other: "%{count} posts"
12
+ flagged_for_spam: Your account has been flagged for spam.
13
+ cannot_create_topic: You cannot create a new topic at this time.
14
+ cannot_create_post: You cannot create a new post at this time.
15
+
16
+ access_denied: "You are not allowed to do that."
17
+ admin:
18
+ area: Admin Area
19
+ welcome: "Welcome to mongoid_forum's Admin Area."
20
+ forum:
21
+ index: Manage Forums
22
+ new: Creating a new forum
23
+ new_link: New Forum
24
+ deleted: The selected forum has been deleted.
25
+ created: This forum has been created.
26
+ not_created: This forum could not be created.
27
+ updated: That forum has been updated.
28
+ not_updated: This forum could not be updated.
29
+ forums:
30
+ edit: Edit
31
+ delete: Delete
32
+ category: Category
33
+ delete_confirm: Are you sure you want to delete this forum?
34
+ index:
35
+ last_post: Last post
36
+ none: None
37
+ group:
38
+ index: Manage Groups
39
+ created: The group was successfully created.
40
+ not_created: Group could not be created.
41
+ updated: The group was successfully updated.
42
+ not_updated: Group could not be updated.
43
+ deleted: The selected group has been deleted.
44
+ groups:
45
+ show:
46
+ add_member: Add
47
+ category:
48
+ index: Manage Forum Categories
49
+ new: Creating a new Forum Category
50
+ new_link: New Forum Category
51
+ deleted: The selected forum category has been deleted.
52
+ created: This forum category has been created.
53
+ not_created: This forum category could not be created.
54
+ updated: That forum category has been updated.
55
+ not_updated: This forum category could not be updated.
56
+ categories:
57
+ edit: Edit
58
+ delete: Delete
59
+ category: Category
60
+ delete_confirm: Are you sure you want to delete this forum category?
61
+ common:
62
+ pages: Pages
63
+ errors:
64
+ not_signed_in: You must sign in first.
65
+ access_denied: Access denied.
66
+ forum:
67
+ header: "Viewing %{title}"
68
+ forums: Forums
69
+ new: Creating a new forum
70
+ edit: "Editing the %{title} forum"
71
+ topics_count:
72
+ zero: 0 topics
73
+ one: 1 topic
74
+ other: "%{count} topics"
75
+ posts_count:
76
+ zero: 0 posts
77
+ one: 1 post
78
+ other: "%{count} posts"
79
+ moderator_tools: "Moderation Tools"
80
+ forums:
81
+ index:
82
+ title: Forums
83
+ forum: Forum
84
+ views: Views
85
+ last_post: 'Last Post:'
86
+ none: None
87
+ topic:
88
+ headings:
89
+ topic: Topic
90
+ latest: Latest
91
+ posts: Posts
92
+ views: Views
93
+ moderation:
94
+ success: The selected topic has been moderated.
95
+ reply: Reply
96
+ quote: Quote
97
+ delete: Delete
98
+ created: This topic has been created.
99
+ new: Creating a new topic
100
+ edit: Editing topic
101
+ not_created: This topic could not be created.
102
+ deleted: Your topic has been deleted.
103
+ cannot_delete: You cannot delete a topic you do not own.
104
+ updated: This topic has been updated.
105
+ not_updated: This topic could not be updated.
106
+ subscribed: You have subscribed to this topic.
107
+ unsubscribed: You have unsubscribed from this topic.
108
+ none: There are no topics in this forum currently.
109
+ links:
110
+ new: New topic
111
+ back_to_topics: Back to topics
112
+ edit: Edit topic
113
+ not_found: The topic you are looking for could not be found.
114
+ hidden:
115
+ 'true': This topic is now hidden.
116
+ 'false': This topic is now visible.
117
+ locked:
118
+ 'true': This topic is now locked.
119
+ 'false': This topic is now unlocked.
120
+ pinned:
121
+ 'true': This topic is now pinned.
122
+ 'false': This topic is now unpinned.
123
+ topics:
124
+ show:
125
+ reply: Reply
126
+ delete: Delete
127
+ subscribe: Subscribe
128
+ unsubscribe: Unsubscribe
129
+ reply_to_topic: Reply to Topic
130
+ pending_review: This topic is currently pending review. Only the user who created it and moderators can view it.
131
+ actions:
132
+ hide:
133
+ 'true': Show this topic
134
+ 'false': Hide this topic
135
+ lock:
136
+ 'true': Unlock this topic
137
+ 'false': Lock this topic
138
+ pin:
139
+ 'true': Unpin this topic
140
+ 'false': Pin this topic
141
+ post:
142
+ buttons:
143
+ reply: Post Reply
144
+ edit: Edit
145
+ created: Your reply has been posted.
146
+ new: Post reply
147
+ edit: Edit
148
+ not_created: Your reply could not be posted.
149
+ not_created_topic_locked: You cannot reply to a locked topic.
150
+ not_created_quote_original_post: You cannot quote the original post.
151
+ edited: Your post has been edited.
152
+ not_edited: Your post could not be edited.
153
+ deleted: Your post has been deleted.
154
+ deleted_with_topic: Only post in topic deleted. Topic also deleted.
155
+ cannot_delete: You cannot delete a post you do not own.
156
+ cannot_delete_first_post: You cannot delete the first post in a topic.
157
+ in_reply_to: In reply to
158
+ posts:
159
+ moderation:
160
+ moderate: Moderate
161
+ approve: Approve
162
+ success: The selected posts have been moderated.
163
+ post:
164
+ pending_review: This post is currently pending review. Only the user who posted it and moderators can view it.
165
+ moderation:
166
+ title: "Moderation tools for %{forum}"
167
+ helpers:
168
+ submit:
169
+ forum:
170
+ create: Create Forum
171
+ update: Update Forum
172
+ topic:
173
+ create: Create Topic
174
+ update: Update Topic
175
+ simple_form:
176
+ labels:
177
+ forum:
178
+ title: Title
179
+ description: Description
180
+ topic:
181
+ subject: Subject
182
+ locked: Locked
183
+ pinned: Pinned
184
+ hidden: Hidden
185
+ posts:
186
+ text: Text
187
+ post:
188
+ text: Text
189
+
190
+ # General stuff
191
+ time_ago_in_words: "%{time} ago"
192
+ ago: " ago"
193
+ ago_by: " ago by"
194
+ by: by
195
+ started_by: "Started by "
196
+ are_you_sure: Are you sure?
@@ -0,0 +1,62 @@
1
+ MongoidForums::Engine.routes.draw do
2
+
3
+ namespace :admin do
4
+ root :to => 'base#index'
5
+ resources :forums do
6
+ post '/add_group' => 'forums#add_group', as: :add_group
7
+ post '/rem_group' => 'forums#remove_group', as: :rem_group
8
+ end
9
+ resources :categories do
10
+ post '/add_group' => 'categories#add_group', as: :add_group
11
+ post '/rem_group' => 'categories#remove_group', as: :rem_group
12
+ end
13
+ resources :groups do
14
+ post '/add_user' => 'groups#add_member', as: :add_user
15
+ post '/rem_user' => 'groups#remove_member', as: :rem_user
16
+ end
17
+
18
+ resources :topics do
19
+ member do
20
+ get 'toggle_hide' => 'topics#toggle_hide', :as => 'toggle_hide'
21
+ get 'toggle_lock' => 'topics#toggle_lock', :as => 'toggle_lock'
22
+ get 'toggle_pin' => 'topics#toggle_pin', :as => 'toggle_pin'
23
+ end
24
+ end
25
+
26
+ resources :users do
27
+ post '/add' => 'users#add_admin', as: 'add_admin'
28
+ post '/remove' => 'users#remove_admin', as: 'remove_admin'
29
+ end
30
+ end
31
+
32
+ root :to => "forums#index"
33
+
34
+ # REDIRECT OLD ROUTES
35
+ get '/forums/:forum_id/', :to => "redirect#forum"
36
+ get '/forums/:forum_id/topics/:topic_id', :to => "redirect#topic"
37
+ get '/posts/:post_id', :to => "redirect#posts"
38
+ get '/subscriptions', :to => "redirect#subscriptions"
39
+
40
+
41
+ # ME ROUTES
42
+ get 'my_subscriptions', :to => "topics#my_subscriptions"
43
+ get 'my_topics', :to => "topics#my_topics"
44
+ get 'my_posts', :to => "topics#my_posts"
45
+
46
+ # this moves the creation of topics into /forum_id/new
47
+ resources :forums, :path => "/" do
48
+ get 'new'
49
+ post 'create'
50
+ end
51
+
52
+ resources :topics, :path => "/topics" do
53
+ resources :posts
54
+ member do
55
+ get :subscribe
56
+ get :unsubscribe
57
+ end
58
+ end
59
+
60
+ resources :categories
61
+
62
+ end