thredded 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.mkdn +63 -0
  3. data/Procfile +1 -0
  4. data/README.mkdn +42 -20
  5. data/app/assets/images/thredded/private-messages.svg +4 -0
  6. data/app/assets/images/thredded/settings.svg +4 -0
  7. data/app/assets/javascripts/thredded.es6 +2 -10
  8. data/app/assets/javascripts/thredded/{currently_online.es6 → components/currently_online.es6} +0 -0
  9. data/app/assets/javascripts/thredded/{post_form.es6 → components/post_form.es6} +0 -0
  10. data/app/assets/javascripts/thredded/{time_stamps.es6 → components/time_stamps.es6} +0 -0
  11. data/app/assets/javascripts/thredded/{topic_form.es6 → components/topic_form.es6} +1 -1
  12. data/app/assets/javascripts/thredded/components/topics.es6 +37 -0
  13. data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +45 -0
  14. data/app/assets/javascripts/thredded/components/users_select.es6 +56 -0
  15. data/app/assets/javascripts/thredded/dependencies.js +9 -0
  16. data/app/assets/javascripts/thredded/thredded.es6 +1 -0
  17. data/app/assets/stylesheets/thredded/_base.scss +3 -2
  18. data/app/assets/stylesheets/thredded/_thredded.scss +4 -1
  19. data/app/assets/stylesheets/thredded/base/_buttons.scss +2 -1
  20. data/app/assets/stylesheets/thredded/base/_forms.scss +23 -18
  21. data/app/assets/stylesheets/thredded/base/_grid.scss +1 -1
  22. data/app/assets/stylesheets/thredded/base/_nav.scss +21 -0
  23. data/app/assets/stylesheets/thredded/base/_tables.scss +5 -14
  24. data/app/assets/stylesheets/thredded/base/_typography.scss +9 -4
  25. data/app/assets/stylesheets/thredded/base/_variables.scss +28 -9
  26. data/app/assets/stylesheets/thredded/components/_alerts.scss +19 -0
  27. data/app/assets/stylesheets/thredded/components/_currently-online.scss +1 -1
  28. data/app/assets/stylesheets/thredded/components/_form-list.scss +2 -4
  29. data/app/assets/stylesheets/thredded/components/_icons.scss +3 -0
  30. data/app/assets/stylesheets/thredded/components/_messageboard.scss +4 -4
  31. data/app/assets/stylesheets/thredded/components/_pagination.scss +2 -2
  32. data/app/assets/stylesheets/thredded/components/_post-form.scss +3 -0
  33. data/app/assets/stylesheets/thredded/components/_post.scss +14 -4
  34. data/app/assets/stylesheets/thredded/components/_select2.scss +79 -9
  35. data/app/assets/stylesheets/thredded/components/_topic-header.scss +11 -1
  36. data/app/assets/stylesheets/thredded/components/_topics.scss +13 -11
  37. data/app/assets/stylesheets/thredded/layout/_main-container.scss +3 -3
  38. data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +11 -17
  39. data/app/assets/stylesheets/thredded/layout/_navigation.scss +72 -0
  40. data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +66 -0
  41. data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +35 -61
  42. data/app/commands/thredded/at_notification_extractor.rb +1 -0
  43. data/app/commands/thredded/members_marked_notified.rb +1 -0
  44. data/app/commands/thredded/messageboard_destroyer.rb +7 -2
  45. data/app/commands/thredded/notify_mentioned_users.rb +8 -21
  46. data/app/commands/thredded/notify_private_topic_users.rb +3 -5
  47. data/app/controllers/thredded/application_controller.rb +76 -41
  48. data/app/controllers/thredded/autocomplete_users_controller.rb +46 -0
  49. data/app/controllers/thredded/messageboards_controller.rb +8 -5
  50. data/app/controllers/thredded/posts_controller.rb +20 -22
  51. data/app/controllers/thredded/preferences_controller.rb +19 -14
  52. data/app/controllers/thredded/private_topics_controller.rb +58 -23
  53. data/app/controllers/thredded/setups_controller.rb +1 -0
  54. data/app/controllers/thredded/theme_previews_controller.rb +24 -53
  55. data/app/controllers/thredded/topics_controller.rb +48 -77
  56. data/app/forms/thredded/private_topic_form.rb +1 -21
  57. data/app/forms/thredded/topic_form.rb +3 -7
  58. data/app/forms/thredded/user_preferences_form.rb +62 -0
  59. data/app/helpers/thredded/application_helper.rb +11 -12
  60. data/app/helpers/thredded/urls_helper.rb +103 -0
  61. data/app/jobs/thredded/activity_updater_job.rb +4 -3
  62. data/app/jobs/thredded/at_notifier_job.rb +1 -0
  63. data/app/jobs/thredded/notify_private_topic_users_job.rb +1 -0
  64. data/app/mailer_previews/thredded/base_mailer_preview.rb +101 -0
  65. data/app/mailer_previews/thredded/post_mailer_preview.rb +11 -0
  66. data/app/mailer_previews/thredded/private_post_mailer_preview.rb +11 -0
  67. data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +15 -0
  68. data/app/mailers/thredded/base_mailer.rb +13 -0
  69. data/app/mailers/thredded/post_mailer.rb +4 -2
  70. data/app/mailers/thredded/private_post_mailer.rb +4 -2
  71. data/app/mailers/thredded/private_topic_mailer.rb +4 -2
  72. data/app/models/concerns/thredded/friendly_id_reserved_words_and_pagination.rb +16 -0
  73. data/app/models/concerns/thredded/post_common.rb +68 -63
  74. data/app/models/concerns/thredded/topic_common.rb +31 -8
  75. data/app/models/concerns/thredded/user_topic_read_state_common.rb +31 -0
  76. data/app/models/thredded/category.rb +1 -0
  77. data/app/models/thredded/messageboard.rb +24 -25
  78. data/app/models/thredded/messageboard_user.rb +1 -0
  79. data/app/models/thredded/null_preference.rb +1 -0
  80. data/app/models/thredded/null_user.rb +1 -6
  81. data/app/models/thredded/null_user_topic_read_state.rb +12 -0
  82. data/app/models/thredded/post.rb +6 -9
  83. data/app/models/thredded/post_notification.rb +1 -0
  84. data/app/models/thredded/private_post.rb +6 -2
  85. data/app/models/thredded/private_topic.rb +46 -32
  86. data/app/models/thredded/private_user.rb +3 -2
  87. data/app/models/thredded/stats.rb +1 -0
  88. data/app/models/thredded/topic.rb +40 -64
  89. data/app/models/thredded/topic_category.rb +1 -0
  90. data/app/models/thredded/user_detail.rb +2 -15
  91. data/app/models/thredded/user_extender.rb +29 -14
  92. data/app/models/thredded/user_messageboard_preference.rb +20 -0
  93. data/app/models/thredded/user_permissions/admin/if_admin_column_true.rb +1 -0
  94. data/app/models/thredded/user_permissions/admin/none.rb +1 -0
  95. data/app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb +1 -0
  96. data/app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb +1 -0
  97. data/app/models/thredded/user_permissions/moderate/none.rb +1 -0
  98. data/app/models/thredded/user_permissions/read/all.rb +1 -0
  99. data/app/models/thredded/user_permissions/write/all.rb +1 -0
  100. data/app/models/thredded/user_permissions/write/none.rb +1 -0
  101. data/app/models/thredded/user_preference.rb +7 -1
  102. data/app/models/thredded/user_private_topic_read_state.rb +12 -0
  103. data/app/models/thredded/user_topic_read_state.rb +12 -0
  104. data/app/policies/thredded/messageboard_policy.rb +27 -0
  105. data/app/policies/thredded/post_policy.rb +33 -0
  106. data/app/policies/thredded/private_post_policy.rb +29 -0
  107. data/app/policies/thredded/private_topic_policy.rb +23 -0
  108. data/app/policies/thredded/topic_policy.rb +32 -0
  109. data/app/view_models/thredded/base_topic_view.rb +56 -0
  110. data/app/view_models/thredded/post_view.rb +44 -0
  111. data/app/view_models/thredded/posts_page_view.rb +27 -0
  112. data/app/view_models/thredded/private_topic_view.rb +9 -0
  113. data/app/{decorators/thredded/topic_email_decorator.rb → view_models/thredded/topic_email_view.rb} +2 -1
  114. data/app/view_models/thredded/topic_view.rb +23 -0
  115. data/app/view_models/thredded/topics_page_view.rb +26 -0
  116. data/app/views/thredded/error_pages/forbidden.html.erb +6 -0
  117. data/app/views/thredded/error_pages/not_found.html.erb +6 -0
  118. data/app/views/thredded/messageboards/_messageboard.html.erb +13 -6
  119. data/app/views/thredded/messageboards/index.html.erb +2 -8
  120. data/app/views/thredded/messageboards/new.html.erb +8 -2
  121. data/app/views/thredded/post_mailer/at_notification.html.erb +3 -3
  122. data/app/views/thredded/post_mailer/at_notification.text.erb +1 -1
  123. data/app/views/thredded/posts/_content_field.html.erb +1 -1
  124. data/app/views/thredded/posts/_form.html.erb +5 -1
  125. data/app/views/thredded/posts/_post.html.erb +3 -1
  126. data/app/views/thredded/posts/edit.html.erb +7 -3
  127. data/app/views/thredded/posts_common/_form.html.erb +1 -1
  128. data/app/views/thredded/posts_common/_post.html.erb +14 -8
  129. data/app/views/thredded/preferences/_form.html.erb +37 -15
  130. data/app/views/thredded/preferences/_header.html.erb +1 -1
  131. data/app/views/thredded/preferences/edit.html.erb +4 -6
  132. data/app/views/thredded/private_post_mailer/at_notification.html.erb +6 -4
  133. data/app/views/thredded/private_posts/_form.html.erb +5 -1
  134. data/app/views/thredded/private_posts/_private_post.html.erb +3 -1
  135. data/app/views/thredded/private_topic_mailer/message_notification.html.erb +3 -7
  136. data/app/views/thredded/private_topic_mailer/message_notification.text.erb +1 -3
  137. data/app/views/thredded/private_topics/_breadcrumbs.html.erb +2 -2
  138. data/app/views/thredded/private_topics/_form.html.erb +15 -10
  139. data/app/views/thredded/private_topics/_header.html.erb +12 -0
  140. data/app/views/thredded/private_topics/_no_private_topics.html.erb +2 -2
  141. data/app/views/thredded/private_topics/_private_topic.html.erb +4 -6
  142. data/app/views/thredded/private_topics/edit.html.erb +32 -0
  143. data/app/views/thredded/private_topics/index.html.erb +5 -5
  144. data/app/views/thredded/private_topics/new.html.erb +1 -2
  145. data/app/views/thredded/private_topics/show.html.erb +12 -7
  146. data/app/views/thredded/search/_form.html.erb +9 -6
  147. data/app/views/thredded/shared/{_messageboard_topics_breadcrumbs.html.erb → _breadcrumbs.html.erb} +2 -2
  148. data/app/views/thredded/shared/_header.html.erb +2 -3
  149. data/app/views/thredded/shared/_nav.html.erb +20 -0
  150. data/app/views/thredded/shared/nav/_notification_preferences.html.erb +6 -0
  151. data/app/views/thredded/shared/nav/_private_topics.html.erb +11 -0
  152. data/app/views/thredded/shared/nav/_standalone.html.erb +12 -0
  153. data/app/views/thredded/theme_previews/_section_title.html.erb +2 -2
  154. data/app/views/thredded/theme_previews/show.html.erb +13 -17
  155. data/app/views/thredded/topics/_form.html.erb +8 -6
  156. data/app/views/thredded/topics/_header.html.erb +12 -0
  157. data/app/views/thredded/topics/_topic.html.erb +4 -8
  158. data/app/views/thredded/topics/_topic_form_admin_options.html.erb +1 -1
  159. data/app/views/thredded/topics/edit.html.erb +22 -18
  160. data/app/views/thredded/topics/index.html.erb +3 -3
  161. data/app/views/thredded/topics/new.html.erb +1 -1
  162. data/app/views/thredded/topics/search.html.erb +17 -5
  163. data/app/views/thredded/topics/show.html.erb +14 -11
  164. data/bin/rails +5 -0
  165. data/config.ru +3 -0
  166. data/config/i18n-tasks.yml +16 -0
  167. data/config/locales/en.yml +90 -0
  168. data/config/routes.rb +29 -15
  169. data/db/migrate/20160329231848_create_thredded.rb +29 -33
  170. data/db/seeds.rb +115 -0
  171. data/db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb +59 -0
  172. data/heroku.gemfile +26 -0
  173. data/heroku.gemfile.lock +282 -0
  174. data/lib/generators/thredded/install/install_generator.rb +1 -0
  175. data/lib/generators/thredded/install/templates/initializer.rb +17 -0
  176. data/lib/html/pipeline/at_mention_filter.rb +2 -1
  177. data/lib/html/pipeline/bbcode_filter.rb +13 -4
  178. data/lib/tasks/thredded_tasks.rake +1 -0
  179. data/lib/thredded.rb +19 -17
  180. data/lib/thredded/at_users.rb +1 -0
  181. data/lib/thredded/engine.rb +14 -5
  182. data/lib/thredded/errors.rb +11 -11
  183. data/lib/thredded/main_app_route_delegator.rb +1 -0
  184. data/lib/thredded/search_parser.rb +2 -1
  185. data/lib/thredded/topics_search.rb +67 -0
  186. data/lib/thredded/version.rb +2 -1
  187. data/thredded.gemspec +12 -8
  188. metadata +146 -82
  189. data/app/assets/javascripts/thredded/users_select.es6 +0 -5
  190. data/app/assets/stylesheets/thredded/layout/_topic-navigation.scss +0 -53
  191. data/app/commands/thredded/user_reads_private_topic.rb +0 -22
  192. data/app/commands/thredded/user_resets_private_topic_to_unread.rb +0 -23
  193. data/app/decorators/thredded/base_topic_decorator.rb +0 -14
  194. data/app/decorators/thredded/base_user_topic_decorator.rb +0 -63
  195. data/app/decorators/thredded/messageboard_decorator.rb +0 -41
  196. data/app/decorators/thredded/post_decorator.rb +0 -40
  197. data/app/decorators/thredded/private_topic_decorator.rb +0 -23
  198. data/app/decorators/thredded/topic_decorator.rb +0 -25
  199. data/app/decorators/thredded/user_private_topic_decorator.rb +0 -13
  200. data/app/decorators/thredded/user_topic_decorator.rb +0 -37
  201. data/app/models/thredded/ability.rb +0 -60
  202. data/app/models/thredded/notification_preference.rb +0 -17
  203. data/app/models/thredded/null_topic.rb +0 -15
  204. data/app/models/thredded/null_topic_read.rb +0 -19
  205. data/app/models/thredded/user_topic_read.rb +0 -10
  206. data/app/views/thredded/shared/_notification_preferences.html.erb +0 -7
  207. data/app/views/thredded/shared/_top_nav.html.erb +0 -36
  208. data/app/views/thredded/shared/_topic_nav.html.erb +0 -22
  209. data/app/views/thredded/topics/_recent_topics_by_user.html.erb +0 -8
  210. data/app/views/thredded/topics/by_category.html.erb +0 -56
  211. data/app/views/thredded/topics_common/_header.html.erb +0 -6
  212. data/lib/thredded/messageboard_user_permissions.rb +0 -22
  213. data/lib/thredded/post_sql_builder.rb +0 -12
  214. data/lib/thredded/post_user_permissions.rb +0 -32
  215. data/lib/thredded/private_topic_user_permissions.rb +0 -26
  216. data/lib/thredded/search_sql_builder.rb +0 -21
  217. data/lib/thredded/seed_database.rb +0 -76
  218. data/lib/thredded/table_sql_builder.rb +0 -41
  219. data/lib/thredded/topic_sql_builder.rb +0 -11
  220. data/lib/thredded/topic_user_permissions.rb +0 -32
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
3
  module Generators
3
4
  class InstallGenerator < Rails::Generators::Base
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Thredded configuration
2
3
 
3
4
  # ==> User Configuration
@@ -18,6 +19,9 @@ Thredded.user_path = lambda do |user|
18
19
  main_app.respond_to?(user_path) ? main_app.send(user_path, user) : "/users/#{user.to_param}"
19
20
  end
20
21
 
22
+ # This method is used by Thredded controllers and views to fetch the currently signed-in user
23
+ Thredded.current_user_method = :"current_#{Thredded.user_class.name.underscore}"
24
+
21
25
  # User avatar URL. rb-gravatar gem is used by default:
22
26
  Thredded.avatar_url = ->(user) { Gravatar.src(user.email, 128, 'mm') }
23
27
 
@@ -49,3 +53,16 @@ Thredded.admin_column = :admin
49
53
  # ==> View Configuration
50
54
  # Set the layout for rendering the thredded views.
51
55
  Thredded.layout = 'thredded/application'
56
+
57
+ # ==> Error Handling
58
+ # By default Thredded just renders a flash alert on errors such as Topic not found, or Login required.
59
+ # Below is an example of overriding the default behavior on LoginRequired:
60
+ #
61
+ # Rails.application.config.to_prepare do
62
+ # Thredded::ApplicationController.module_eval do
63
+ # rescue_from Thredded::Errors::LoginRequired do |exception|
64
+ # @message = exception.message
65
+ # render template: 'sessions/new', status: :forbidden
66
+ # end
67
+ # end
68
+ # end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'thredded/at_users'
2
3
 
3
4
  module HTML
@@ -5,7 +6,7 @@ module HTML
5
6
  class AtMentionFilter < Filter
6
7
  def initialize(text, context = nil, result = nil)
7
8
  super text, context, result
8
- @text = text.to_s.gsub "\r", ''
9
+ @text = text.to_s.delete("\r")
9
10
  @post = context[:post]
10
11
  @view_context = context[:view_context]
11
12
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'bbcoder'
2
3
 
3
4
  module HTML
@@ -5,14 +6,22 @@ module HTML
5
6
  class BbcodeFilter < TextFilter
6
7
  def initialize(text, context = {}, result = nil)
7
8
  super text, context, result
8
- @context = context
9
- @text = @text.gsub "\r", ''
10
9
  end
11
10
 
12
11
  def call
13
- html = BBCoder.new(@text).to_html.gsub(/\n|\r\n/, '<br />')
12
+ html = BBCoder.new(@text).to_html
13
+ html = remove_url_link_contents(html)
14
+ html.delete('<br>')
14
15
  html.rstrip!
15
- "<p>#{html}</p>"
16
+ html
17
+ end
18
+
19
+ def remove_url_link_contents(html)
20
+ doc = Nokogiri::HTML::DocumentFragment.parse(html)
21
+ doc.css('a').each do |link|
22
+ link.content = link.content.gsub(%r{https?://}, '')
23
+ end
24
+ doc.to_html
16
25
  end
17
26
  end
18
27
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  namespace :thredded do
2
3
  desc 'Destroy messageboard and all related data'
3
4
  task :destroy, [:slug] => :environment do |_, args|
@@ -1,13 +1,18 @@
1
+ # frozen_string_literal: true
1
2
  # Backend
2
- require 'cancan'
3
+ require 'pundit'
4
+ require 'active_record_union'
3
5
  require 'db_text_search'
4
6
  require 'friendly_id'
5
7
  require 'html/pipeline'
6
8
  require 'html/pipeline/at_mention_filter'
7
9
  require 'html/pipeline/bbcode_filter'
10
+ require 'html/pipeline/vimeo/vimeo_filter'
11
+ require 'html/pipeline/youtube/youtube_filter'
8
12
  require 'kaminari'
9
13
  require 'rb-gravatar'
10
14
  require 'active_job'
15
+ require 'inline_svg'
11
16
 
12
17
  # Asset compilation
13
18
  require 'autoprefixer-rails'
@@ -18,25 +23,22 @@ require 'select2-rails'
18
23
  require 'sprockets/es6'
19
24
 
20
25
  require 'thredded/engine'
21
- require 'thredded/errors'
22
- require 'thredded/messageboard_user_permissions'
23
- require 'thredded/post_user_permissions'
24
- require 'thredded/private_topic_user_permissions'
25
- require 'thredded/topic_user_permissions'
26
- require 'thredded/search_sql_builder'
27
- require 'thredded/main_app_route_delegator'
28
26
 
29
27
  module Thredded
30
- mattr_accessor :user_class,
31
- :user_name_column,
28
+ mattr_accessor \
29
+ :active_user_threshold,
32
30
  :avatar_url,
33
- :email_incoming_host,
34
31
  :email_from,
32
+ :email_incoming_host,
35
33
  :email_outgoing_prefix,
36
34
  :email_reply_to,
37
- :user_path,
38
35
  :layout,
39
- :active_user_threshold
36
+ :user_class,
37
+ :user_name_column,
38
+ :user_path
39
+
40
+ # @return [Symbol] The name of the method used by Thredded controllers and views to fetch the currently signed-in user
41
+ mattr_accessor :current_user_method
40
42
 
41
43
  # @return [Symbol] The name of the moderator flag column on the users table for the default permissions model
42
44
  mattr_accessor :moderator_column
@@ -44,13 +46,13 @@ module Thredded
44
46
  # @return [Symbol] The name of the admin flag column on the users table for the default permissions model
45
47
  mattr_accessor :admin_column
46
48
 
47
- self.user_name_column = :name
48
- self.avatar_url = ->(user) { Gravatar.src(user.email, 128, 'mm') }
49
49
  self.active_user_threshold = 5.minutes
50
- self.layout = 'thredded/application'
50
+ self.admin_column = :admin
51
+ self.avatar_url = ->(user) { Gravatar.src(user.email, 128, 'mm') }
51
52
  self.email_reply_to = -> postable { "#{postable.hash_id}@#{Thredded.email_incoming_host}" }
53
+ self.layout = 'thredded/application'
52
54
  self.moderator_column = :admin
53
- self.admin_column = :admin
55
+ self.user_name_column = :name
54
56
 
55
57
  # @return [Class<Thredded::UserExtender>] the user class from the host application.
56
58
  def self.user_class
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
3
  class AtUsers
3
4
  def self.render(content, post, view_context)
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
2
+ require_dependency 'thredded/main_app_route_delegator'
1
3
  module Thredded
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace Thredded
4
6
 
5
- config.autoload_paths << File.expand_path('../../../app/decorators', __FILE__)
6
- config.autoload_paths << File.expand_path('../../../app/forms', __FILE__)
7
- config.autoload_paths << File.expand_path('../../../app/commands', __FILE__)
8
- config.autoload_paths << File.expand_path('../../../app/jobs', __FILE__)
7
+ %w(app/view_models app/forms app/commands app/jobs lib).each do |path|
8
+ config.autoload_paths << File.expand_path("../../#{path}", File.dirname(__FILE__))
9
+ end
9
10
 
10
11
  config.generators do |g|
11
12
  g.test_framework :rspec, fixture: true
@@ -28,8 +29,16 @@ module Thredded
28
29
  Thredded::Engine.config.assets.precompile += %w(
29
30
  thredded.js
30
31
  thredded.css
31
- thredded/breadcrumb-chevron.svg
32
+ thredded/*.svg
32
33
  )
33
34
  end
35
+
36
+ initializer 'thredded.setup_bbcoder' do
37
+ BBCoder.configure do
38
+ tag :img, match: %r{^https?://.*(png|bmp|jpe?g|gif)$}, singular: false do
39
+ %(<img src="#{singular? ? meta : content}" />)
40
+ end
41
+ end
42
+ end
34
43
  end
35
44
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
3
  class Error < StandardError
3
4
  end
@@ -5,7 +6,13 @@ module Thredded
5
6
  module Errors
6
7
  class DatabaseEmpty < Thredded::Error
7
8
  def message
8
- 'Seed the database with "rake thredded:dev:seed".'
9
+ 'Seed the database with "rake db:seed".'
10
+ end
11
+ end
12
+
13
+ class LoginRequired < Thredded::Error
14
+ def message
15
+ I18n.t('thredded.errors.login_required')
9
16
  end
10
17
  end
11
18
 
@@ -17,7 +24,7 @@ module Thredded
17
24
 
18
25
  class PrivateTopicNotFound < Thredded::Error
19
26
  def message
20
- 'This private topic does not exist.'
27
+ I18n.t('thredded.errors.private_topic_not_found')
21
28
  end
22
29
  end
23
30
 
@@ -51,16 +58,9 @@ module Thredded
51
58
  end
52
59
  end
53
60
 
54
- class PrivateTopicCreateDenied < TopicCreateDenied
55
- end
56
-
57
- class EmptySearchResults < Thredded::Error
58
- def initialize(query)
59
- @query = query
60
- end
61
-
61
+ class PrivateTopicCreateDenied < Thredded::Error
62
62
  def message
63
- "There are no results for your search - '#{@query}'"
63
+ I18n.t('thredded.errors.private_topic_create_denied')
64
64
  end
65
65
  end
66
66
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
3
  # If thredded is rendered within an application layout, this module allows
3
4
  # referring to the routes in the layout directly, without having to use `main_app.`.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
3
  class SearchParser
3
4
  def initialize(query)
@@ -21,7 +22,7 @@ module Thredded
21
22
 
22
23
  if keyword_scan.present?
23
24
  keyword_scan.each do |term|
24
- keyword_term = term.gsub(' ', '').split(':')
25
+ keyword_term = term.delete(' ').split(':')
25
26
 
26
27
  if found_terms_hash[keyword].nil?
27
28
  found_terms_hash[keyword] = []
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+ require_dependency 'thredded/search_parser'
3
+ module Thredded
4
+ class TopicsSearch
5
+ def initialize(query, scope)
6
+ @terms = SearchParser.new(query).parse
7
+ @scope = scope
8
+
9
+ @search_categories = @search_users = @search_text = nil
10
+ end
11
+
12
+ # @return [ActiveRecord::Relation<Thredded::Topic>]
13
+ def search
14
+ if categories.present?
15
+ @scope = @scope.joins(:topic_categories).merge(TopicCategory.where(category_id: categories))
16
+ end
17
+ if text.present? || users.present?
18
+ [search_topics, search_posts].compact.reduce(:union)
19
+ else
20
+ @scope
21
+ end
22
+ end
23
+
24
+ protected
25
+
26
+ def search_topics
27
+ scope = @scope
28
+ scope = @scope.where(user_id: users) if users.present?
29
+ scope = DbTextSearch::FullText.new(scope, :title).search(text) if text.present?
30
+ scope
31
+ end
32
+
33
+ def search_posts
34
+ posts_scope = Thredded::Post
35
+ posts_scope = posts_scope.where(user_id: users) if users.present?
36
+ posts_scope = DbTextSearch::FullText.new(posts_scope, :content).search(text) if text.present?
37
+ @scope.joins(:posts).merge(posts_scope)
38
+ end
39
+
40
+ def categories
41
+ @search_categories ||=
42
+ if @terms['in'].present?
43
+ DbTextSearch::CaseInsensitive
44
+ .new(Category, :name)
45
+ .in(@terms['in']).pluck(:id)
46
+ else
47
+ []
48
+ end
49
+ end
50
+
51
+ def users
52
+ @search_users ||=
53
+ if @terms['by']
54
+ DbTextSearch::CaseInsensitive
55
+ .new(Thredded.user_class, Thredded.user_name_column)
56
+ .in(@terms['by']).pluck(:id)
57
+ else
58
+ []
59
+ end
60
+ end
61
+
62
+ # @return [Array<String>]
63
+ def text
64
+ @terms['text']
65
+ end
66
+ end
67
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Thredded
2
- VERSION = '0.2.2'
3
+ VERSION = '0.3.0'
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  $LOAD_PATH.push File.expand_path('../lib', __FILE__)
2
3
 
3
4
  require 'thredded/version'
@@ -18,15 +19,19 @@ Gem::Specification.new do |s|
18
19
 
19
20
  # backend
20
21
  s.add_dependency 'bbcoder', '~> 1.0'
21
- s.add_dependency 'cancancan'
22
- s.add_dependency 'db_text_search', '~> 0.1.1'
22
+ s.add_dependency 'pundit', '>= 1.1.0'
23
+ s.add_dependency 'active_record_union', '>= 1.1.1'
24
+ s.add_dependency 'db_text_search', '~> 0.2.0'
23
25
  s.add_dependency 'friendly_id'
24
26
  s.add_dependency 'html-pipeline'
27
+ s.add_dependency 'html-pipeline-vimeo'
28
+ s.add_dependency 'html-pipeline-youtube'
25
29
  s.add_dependency 'htmlentities'
26
30
  s.add_dependency 'kaminari'
27
31
  s.add_dependency 'nokogiri'
28
- s.add_dependency 'rails', '>= 4.1.0'
32
+ s.add_dependency 'rails', '>= 4.2.0'
29
33
  s.add_dependency 'rb-gravatar'
34
+ s.add_dependency 'inline_svg'
30
35
 
31
36
  # html-pipeline dependencies, see https://github.com/jch/html-pipeline#dependencies
32
37
  s.add_dependency 'gemoji'
@@ -45,22 +50,21 @@ Gem::Specification.new do |s|
45
50
 
46
51
  # test dependencies
47
52
  s.add_development_dependency 'capybara', '~> 2.4'
48
- s.add_development_dependency 'chronic'
49
53
  s.add_development_dependency 'database_cleaner'
50
54
  s.add_development_dependency 'factory_girl_rails'
51
- s.add_development_dependency 'faker'
55
+ s.add_development_dependency 'faker', '>= 1.6.2'
52
56
  s.add_development_dependency 'launchy'
53
57
  s.add_development_dependency 'rspec-rails'
54
- s.add_development_dependency 'rubocop', '0.32.0'
55
- s.add_development_dependency 'shoulda-matchers', '~> 2.7'
58
+ s.add_development_dependency 'rubocop', '~> 0.39'
56
59
  s.add_development_dependency 'test-unit'
57
- s.add_development_dependency 'timecop'
58
60
 
59
61
  # dummy app dependencies
60
62
  s.add_development_dependency 'mysql2'
61
63
  s.add_development_dependency 'pg'
62
64
  s.add_development_dependency 'sqlite3'
63
65
  s.add_development_dependency 'puma'
66
+ s.add_development_dependency 'rails_email_preview', '>= 1.0.3'
67
+ s.add_development_dependency 'i18n-tasks'
64
68
 
65
69
  # dummy app frontend
66
70
  s.add_development_dependency 'jquery-turbolinks'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-04 00:00:00.000000000 Z
12
+ date: 2016-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bbcoder
@@ -26,33 +26,47 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: cancancan
29
+ name: pundit
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '0'
34
+ version: 1.1.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: 1.1.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: active_record_union
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 1.1.1
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.1.1
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: db_text_search
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
60
  - - "~>"
47
61
  - !ruby/object:Gem::Version
48
- version: 0.1.1
62
+ version: 0.2.0
49
63
  type: :runtime
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: 0.1.1
69
+ version: 0.2.0
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: friendly_id
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +95,34 @@ dependencies:
81
95
  - - ">="
82
96
  - !ruby/object:Gem::Version
83
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: html-pipeline-vimeo
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: html-pipeline-youtube
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
84
126
  - !ruby/object:Gem::Dependency
85
127
  name: htmlentities
86
128
  requirement: !ruby/object:Gem::Requirement
@@ -129,14 +171,14 @@ dependencies:
129
171
  requirements:
130
172
  - - ">="
131
173
  - !ruby/object:Gem::Version
132
- version: 4.1.0
174
+ version: 4.2.0
133
175
  type: :runtime
134
176
  prerelease: false
135
177
  version_requirements: !ruby/object:Gem::Requirement
136
178
  requirements:
137
179
  - - ">="
138
180
  - !ruby/object:Gem::Version
139
- version: 4.1.0
181
+ version: 4.2.0
140
182
  - !ruby/object:Gem::Dependency
141
183
  name: rb-gravatar
142
184
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +193,20 @@ dependencies:
151
193
  - - ">="
152
194
  - !ruby/object:Gem::Version
153
195
  version: '0'
196
+ - !ruby/object:Gem::Dependency
197
+ name: inline_svg
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ type: :runtime
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
154
210
  - !ruby/object:Gem::Dependency
155
211
  name: gemoji
156
212
  requirement: !ruby/object:Gem::Requirement
@@ -319,20 +375,6 @@ dependencies:
319
375
  - - "~>"
320
376
  - !ruby/object:Gem::Version
321
377
  version: '2.4'
322
- - !ruby/object:Gem::Dependency
323
- name: chronic
324
- requirement: !ruby/object:Gem::Requirement
325
- requirements:
326
- - - ">="
327
- - !ruby/object:Gem::Version
328
- version: '0'
329
- type: :development
330
- prerelease: false
331
- version_requirements: !ruby/object:Gem::Requirement
332
- requirements:
333
- - - ">="
334
- - !ruby/object:Gem::Version
335
- version: '0'
336
378
  - !ruby/object:Gem::Dependency
337
379
  name: database_cleaner
338
380
  requirement: !ruby/object:Gem::Requirement
@@ -367,14 +409,14 @@ dependencies:
367
409
  requirements:
368
410
  - - ">="
369
411
  - !ruby/object:Gem::Version
370
- version: '0'
412
+ version: 1.6.2
371
413
  type: :development
372
414
  prerelease: false
373
415
  version_requirements: !ruby/object:Gem::Requirement
374
416
  requirements:
375
417
  - - ">="
376
418
  - !ruby/object:Gem::Version
377
- version: '0'
419
+ version: 1.6.2
378
420
  - !ruby/object:Gem::Dependency
379
421
  name: launchy
380
422
  requirement: !ruby/object:Gem::Requirement
@@ -407,32 +449,32 @@ dependencies:
407
449
  name: rubocop
408
450
  requirement: !ruby/object:Gem::Requirement
409
451
  requirements:
410
- - - '='
452
+ - - "~>"
411
453
  - !ruby/object:Gem::Version
412
- version: 0.32.0
454
+ version: '0.39'
413
455
  type: :development
414
456
  prerelease: false
415
457
  version_requirements: !ruby/object:Gem::Requirement
416
458
  requirements:
417
- - - '='
459
+ - - "~>"
418
460
  - !ruby/object:Gem::Version
419
- version: 0.32.0
461
+ version: '0.39'
420
462
  - !ruby/object:Gem::Dependency
421
- name: shoulda-matchers
463
+ name: test-unit
422
464
  requirement: !ruby/object:Gem::Requirement
423
465
  requirements:
424
- - - "~>"
466
+ - - ">="
425
467
  - !ruby/object:Gem::Version
426
- version: '2.7'
468
+ version: '0'
427
469
  type: :development
428
470
  prerelease: false
429
471
  version_requirements: !ruby/object:Gem::Requirement
430
472
  requirements:
431
- - - "~>"
473
+ - - ">="
432
474
  - !ruby/object:Gem::Version
433
- version: '2.7'
475
+ version: '0'
434
476
  - !ruby/object:Gem::Dependency
435
- name: test-unit
477
+ name: mysql2
436
478
  requirement: !ruby/object:Gem::Requirement
437
479
  requirements:
438
480
  - - ">="
@@ -446,7 +488,7 @@ dependencies:
446
488
  - !ruby/object:Gem::Version
447
489
  version: '0'
448
490
  - !ruby/object:Gem::Dependency
449
- name: timecop
491
+ name: pg
450
492
  requirement: !ruby/object:Gem::Requirement
451
493
  requirements:
452
494
  - - ">="
@@ -460,7 +502,7 @@ dependencies:
460
502
  - !ruby/object:Gem::Version
461
503
  version: '0'
462
504
  - !ruby/object:Gem::Dependency
463
- name: mysql2
505
+ name: sqlite3
464
506
  requirement: !ruby/object:Gem::Requirement
465
507
  requirements:
466
508
  - - ">="
@@ -474,7 +516,7 @@ dependencies:
474
516
  - !ruby/object:Gem::Version
475
517
  version: '0'
476
518
  - !ruby/object:Gem::Dependency
477
- name: pg
519
+ name: puma
478
520
  requirement: !ruby/object:Gem::Requirement
479
521
  requirements:
480
522
  - - ">="
@@ -488,21 +530,21 @@ dependencies:
488
530
  - !ruby/object:Gem::Version
489
531
  version: '0'
490
532
  - !ruby/object:Gem::Dependency
491
- name: sqlite3
533
+ name: rails_email_preview
492
534
  requirement: !ruby/object:Gem::Requirement
493
535
  requirements:
494
536
  - - ">="
495
537
  - !ruby/object:Gem::Version
496
- version: '0'
538
+ version: 1.0.3
497
539
  type: :development
498
540
  prerelease: false
499
541
  version_requirements: !ruby/object:Gem::Requirement
500
542
  requirements:
501
543
  - - ">="
502
544
  - !ruby/object:Gem::Version
503
- version: '0'
545
+ version: 1.0.3
504
546
  - !ruby/object:Gem::Dependency
505
- name: puma
547
+ name: i18n-tasks
506
548
  requirement: !ruby/object:Gem::Requirement
507
549
  requirements:
508
550
  - - ">="
@@ -553,14 +595,21 @@ extra_rdoc_files: []
553
595
  files:
554
596
  - CHANGELOG.mkdn
555
597
  - MIT-LICENSE
598
+ - Procfile
556
599
  - README.mkdn
557
600
  - app/assets/images/thredded/breadcrumb-chevron.svg
601
+ - app/assets/images/thredded/private-messages.svg
602
+ - app/assets/images/thredded/settings.svg
558
603
  - app/assets/javascripts/thredded.es6
559
- - app/assets/javascripts/thredded/currently_online.es6
560
- - app/assets/javascripts/thredded/post_form.es6
561
- - app/assets/javascripts/thredded/time_stamps.es6
562
- - app/assets/javascripts/thredded/topic_form.es6
563
- - app/assets/javascripts/thredded/users_select.es6
604
+ - app/assets/javascripts/thredded/components/currently_online.es6
605
+ - app/assets/javascripts/thredded/components/post_form.es6
606
+ - app/assets/javascripts/thredded/components/time_stamps.es6
607
+ - app/assets/javascripts/thredded/components/topic_form.es6
608
+ - app/assets/javascripts/thredded/components/topics.es6
609
+ - app/assets/javascripts/thredded/components/user_preferences_form.es6
610
+ - app/assets/javascripts/thredded/components/users_select.es6
611
+ - app/assets/javascripts/thredded/dependencies.js
612
+ - app/assets/javascripts/thredded/thredded.es6
564
613
  - app/assets/stylesheets/thredded.scss
565
614
  - app/assets/stylesheets/thredded/_base.scss
566
615
  - app/assets/stylesheets/thredded/_dependencies.scss
@@ -570,14 +619,17 @@ files:
570
619
  - app/assets/stylesheets/thredded/base/_forms.scss
571
620
  - app/assets/stylesheets/thredded/base/_grid.scss
572
621
  - app/assets/stylesheets/thredded/base/_lists.scss
622
+ - app/assets/stylesheets/thredded/base/_nav.scss
573
623
  - app/assets/stylesheets/thredded/base/_tables.scss
574
624
  - app/assets/stylesheets/thredded/base/_typography.scss
575
625
  - app/assets/stylesheets/thredded/base/_variables.scss
626
+ - app/assets/stylesheets/thredded/components/_alerts.scss
576
627
  - app/assets/stylesheets/thredded/components/_base.scss
577
628
  - app/assets/stylesheets/thredded/components/_currently-online.scss
578
629
  - app/assets/stylesheets/thredded/components/_empty.scss
579
630
  - app/assets/stylesheets/thredded/components/_flash-message.scss
580
631
  - app/assets/stylesheets/thredded/components/_form-list.scss
632
+ - app/assets/stylesheets/thredded/components/_icons.scss
581
633
  - app/assets/stylesheets/thredded/components/_main-section.scss
582
634
  - app/assets/stylesheets/thredded/components/_messageboard.scss
583
635
  - app/assets/stylesheets/thredded/components/_pagination.scss
@@ -590,7 +642,8 @@ files:
590
642
  - app/assets/stylesheets/thredded/components/_topics.scss
591
643
  - app/assets/stylesheets/thredded/layout/_main-container.scss
592
644
  - app/assets/stylesheets/thredded/layout/_main-navigation.scss
593
- - app/assets/stylesheets/thredded/layout/_topic-navigation.scss
645
+ - app/assets/stylesheets/thredded/layout/_navigation.scss
646
+ - app/assets/stylesheets/thredded/layout/_search-navigation.scss
594
647
  - app/assets/stylesheets/thredded/layout/_user-navigation.scss
595
648
  - app/assets/stylesheets/thredded/utilities/_is-compact.scss
596
649
  - app/assets/stylesheets/thredded/utilities/_is-expanded.scss
@@ -599,9 +652,8 @@ files:
599
652
  - app/commands/thredded/messageboard_destroyer.rb
600
653
  - app/commands/thredded/notify_mentioned_users.rb
601
654
  - app/commands/thredded/notify_private_topic_users.rb
602
- - app/commands/thredded/user_reads_private_topic.rb
603
- - app/commands/thredded/user_resets_private_topic_to_unread.rb
604
655
  - app/controllers/thredded/application_controller.rb
656
+ - app/controllers/thredded/autocomplete_users_controller.rb
605
657
  - app/controllers/thredded/messageboards_controller.rb
606
658
  - app/controllers/thredded/posts_controller.rb
607
659
  - app/controllers/thredded/preferences_controller.rb
@@ -609,36 +661,32 @@ files:
609
661
  - app/controllers/thredded/setups_controller.rb
610
662
  - app/controllers/thredded/theme_previews_controller.rb
611
663
  - app/controllers/thredded/topics_controller.rb
612
- - app/decorators/thredded/base_topic_decorator.rb
613
- - app/decorators/thredded/base_user_topic_decorator.rb
614
- - app/decorators/thredded/messageboard_decorator.rb
615
- - app/decorators/thredded/post_decorator.rb
616
- - app/decorators/thredded/private_topic_decorator.rb
617
- - app/decorators/thredded/topic_decorator.rb
618
- - app/decorators/thredded/topic_email_decorator.rb
619
- - app/decorators/thredded/user_private_topic_decorator.rb
620
- - app/decorators/thredded/user_topic_decorator.rb
621
664
  - app/forms/thredded/private_topic_form.rb
622
665
  - app/forms/thredded/topic_form.rb
666
+ - app/forms/thredded/user_preferences_form.rb
623
667
  - app/helpers/thredded/application_helper.rb
668
+ - app/helpers/thredded/urls_helper.rb
624
669
  - app/jobs/thredded/activity_updater_job.rb
625
670
  - app/jobs/thredded/at_notifier_job.rb
626
671
  - app/jobs/thredded/notify_private_topic_users_job.rb
672
+ - app/mailer_previews/thredded/base_mailer_preview.rb
673
+ - app/mailer_previews/thredded/post_mailer_preview.rb
674
+ - app/mailer_previews/thredded/private_post_mailer_preview.rb
675
+ - app/mailer_previews/thredded/private_topic_mailer_preview.rb
627
676
  - app/mailers/thredded/base_mailer.rb
628
677
  - app/mailers/thredded/post_mailer.rb
629
678
  - app/mailers/thredded/private_post_mailer.rb
630
679
  - app/mailers/thredded/private_topic_mailer.rb
680
+ - app/models/concerns/thredded/friendly_id_reserved_words_and_pagination.rb
631
681
  - app/models/concerns/thredded/post_common.rb
632
682
  - app/models/concerns/thredded/topic_common.rb
633
- - app/models/thredded/ability.rb
683
+ - app/models/concerns/thredded/user_topic_read_state_common.rb
634
684
  - app/models/thredded/category.rb
635
685
  - app/models/thredded/messageboard.rb
636
686
  - app/models/thredded/messageboard_user.rb
637
- - app/models/thredded/notification_preference.rb
638
687
  - app/models/thredded/null_preference.rb
639
- - app/models/thredded/null_topic.rb
640
- - app/models/thredded/null_topic_read.rb
641
688
  - app/models/thredded/null_user.rb
689
+ - app/models/thredded/null_user_topic_read_state.rb
642
690
  - app/models/thredded/post.rb
643
691
  - app/models/thredded/post_notification.rb
644
692
  - app/models/thredded/private_post.rb
@@ -649,6 +697,7 @@ files:
649
697
  - app/models/thredded/topic_category.rb
650
698
  - app/models/thredded/user_detail.rb
651
699
  - app/models/thredded/user_extender.rb
700
+ - app/models/thredded/user_messageboard_preference.rb
652
701
  - app/models/thredded/user_permissions/admin/if_admin_column_true.rb
653
702
  - app/models/thredded/user_permissions/admin/none.rb
654
703
  - app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb
@@ -658,9 +707,24 @@ files:
658
707
  - app/models/thredded/user_permissions/write/all.rb
659
708
  - app/models/thredded/user_permissions/write/none.rb
660
709
  - app/models/thredded/user_preference.rb
661
- - app/models/thredded/user_topic_read.rb
710
+ - app/models/thredded/user_private_topic_read_state.rb
711
+ - app/models/thredded/user_topic_read_state.rb
712
+ - app/policies/thredded/messageboard_policy.rb
713
+ - app/policies/thredded/post_policy.rb
714
+ - app/policies/thredded/private_post_policy.rb
715
+ - app/policies/thredded/private_topic_policy.rb
716
+ - app/policies/thredded/topic_policy.rb
717
+ - app/view_models/thredded/base_topic_view.rb
718
+ - app/view_models/thredded/post_view.rb
719
+ - app/view_models/thredded/posts_page_view.rb
720
+ - app/view_models/thredded/private_topic_view.rb
721
+ - app/view_models/thredded/topic_email_view.rb
722
+ - app/view_models/thredded/topic_view.rb
723
+ - app/view_models/thredded/topics_page_view.rb
662
724
  - app/views/layouts/thredded/application.html.erb
663
725
  - app/views/thredded/categories/_category.html.erb
726
+ - app/views/thredded/error_pages/forbidden.html.erb
727
+ - app/views/thredded/error_pages/not_found.html.erb
664
728
  - app/views/thredded/kaminari/_first_page.html.erb
665
729
  - app/views/thredded/kaminari/_gap.html.erb
666
730
  - app/views/thredded/kaminari/_last_page.html.erb
@@ -690,38 +754,47 @@ files:
690
754
  - app/views/thredded/private_topic_mailer/message_notification.text.erb
691
755
  - app/views/thredded/private_topics/_breadcrumbs.html.erb
692
756
  - app/views/thredded/private_topics/_form.html.erb
757
+ - app/views/thredded/private_topics/_header.html.erb
693
758
  - app/views/thredded/private_topics/_no_private_topics.html.erb
694
759
  - app/views/thredded/private_topics/_private_topic.html.erb
760
+ - app/views/thredded/private_topics/edit.html.erb
695
761
  - app/views/thredded/private_topics/index.html.erb
696
762
  - app/views/thredded/private_topics/new.html.erb
697
763
  - app/views/thredded/private_topics/show.html.erb
698
764
  - app/views/thredded/search/_form.html.erb
765
+ - app/views/thredded/shared/_breadcrumbs.html.erb
699
766
  - app/views/thredded/shared/_currently_online.html.erb
700
767
  - app/views/thredded/shared/_flash_messages.html.erb
701
768
  - app/views/thredded/shared/_header.html.erb
702
- - app/views/thredded/shared/_messageboard_topics_breadcrumbs.html.erb
703
- - app/views/thredded/shared/_notification_preferences.html.erb
769
+ - app/views/thredded/shared/_nav.html.erb
704
770
  - app/views/thredded/shared/_page.html.erb
705
771
  - app/views/thredded/shared/_time_ago.html.erb
706
- - app/views/thredded/shared/_top_nav.html.erb
707
- - app/views/thredded/shared/_topic_nav.html.erb
772
+ - app/views/thredded/shared/nav/_notification_preferences.html.erb
773
+ - app/views/thredded/shared/nav/_private_topics.html.erb
774
+ - app/views/thredded/shared/nav/_standalone.html.erb
708
775
  - app/views/thredded/theme_previews/_section_title.html.erb
709
776
  - app/views/thredded/theme_previews/show.html.erb
710
777
  - app/views/thredded/topics/_form.html.erb
711
- - app/views/thredded/topics/_recent_topics_by_user.html.erb
778
+ - app/views/thredded/topics/_header.html.erb
712
779
  - app/views/thredded/topics/_topic.html.erb
713
780
  - app/views/thredded/topics/_topic_form_admin_options.html.erb
714
- - app/views/thredded/topics/by_category.html.erb
715
781
  - app/views/thredded/topics/edit.html.erb
716
782
  - app/views/thredded/topics/index.html.erb
717
783
  - app/views/thredded/topics/menu/_new_topic.html.erb
718
784
  - app/views/thredded/topics/new.html.erb
719
785
  - app/views/thredded/topics/search.html.erb
720
786
  - app/views/thredded/topics/show.html.erb
721
- - app/views/thredded/topics_common/_header.html.erb
722
787
  - app/views/thredded/users/_link.html.erb
788
+ - bin/rails
789
+ - config.ru
790
+ - config/i18n-tasks.yml
791
+ - config/locales/en.yml
723
792
  - config/routes.rb
724
793
  - db/migrate/20160329231848_create_thredded.rb
794
+ - db/seeds.rb
795
+ - db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb
796
+ - heroku.gemfile
797
+ - heroku.gemfile.lock
725
798
  - lib/generators/thredded/install/USAGE
726
799
  - lib/generators/thredded/install/install_generator.rb
727
800
  - lib/generators/thredded/install/templates/initializer.rb
@@ -733,16 +806,8 @@ files:
733
806
  - lib/thredded/engine.rb
734
807
  - lib/thredded/errors.rb
735
808
  - lib/thredded/main_app_route_delegator.rb
736
- - lib/thredded/messageboard_user_permissions.rb
737
- - lib/thredded/post_sql_builder.rb
738
- - lib/thredded/post_user_permissions.rb
739
- - lib/thredded/private_topic_user_permissions.rb
740
809
  - lib/thredded/search_parser.rb
741
- - lib/thredded/search_sql_builder.rb
742
- - lib/thredded/seed_database.rb
743
- - lib/thredded/table_sql_builder.rb
744
- - lib/thredded/topic_sql_builder.rb
745
- - lib/thredded/topic_user_permissions.rb
810
+ - lib/thredded/topics_search.rb
746
811
  - lib/thredded/version.rb
747
812
  - thredded.gemspec
748
813
  homepage: https://www.thredded.com
@@ -765,9 +830,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
765
830
  version: '0'
766
831
  requirements: []
767
832
  rubyforge_project:
768
- rubygems_version: 2.4.5
833
+ rubygems_version: 2.5.1
769
834
  signing_key:
770
835
  specification_version: 4
771
836
  summary: A messageboard engine
772
837
  test_files: []
773
- has_rdoc: