thredded 0.1.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.mkdn +202 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.mkdn +391 -0
  5. data/app/assets/images/thredded/breadcrumb-chevron.svg +1 -0
  6. data/app/assets/javascripts/thredded/currently_online.es6 +25 -0
  7. data/app/assets/javascripts/thredded/post_form.es6 +20 -0
  8. data/app/assets/javascripts/thredded/time_stamps.es6 +8 -0
  9. data/app/assets/javascripts/thredded/topic_form.es6 +55 -0
  10. data/app/assets/javascripts/thredded/users_select.es6 +5 -0
  11. data/app/assets/javascripts/thredded.es6 +10 -0
  12. data/app/assets/stylesheets/thredded/_base.scss +11 -0
  13. data/app/assets/stylesheets/thredded/_dependencies.scss +1 -0
  14. data/app/assets/stylesheets/thredded/_thredded.scss +27 -0
  15. data/app/assets/stylesheets/thredded/base/_alerts.scss +40 -0
  16. data/app/assets/stylesheets/thredded/base/_buttons.scss +39 -0
  17. data/app/assets/stylesheets/thredded/base/_forms.scss +79 -0
  18. data/app/assets/stylesheets/thredded/base/_grid.scss +19 -0
  19. data/app/assets/stylesheets/thredded/base/_lists.scss +31 -0
  20. data/app/assets/stylesheets/thredded/base/_tables.scss +25 -0
  21. data/app/assets/stylesheets/thredded/base/_typography.scss +36 -0
  22. data/app/assets/stylesheets/thredded/base/_variables.scss +54 -0
  23. data/app/assets/stylesheets/thredded/components/_base.scss +13 -0
  24. data/app/assets/stylesheets/thredded/components/_currently-online.scss +48 -0
  25. data/app/assets/stylesheets/thredded/components/_empty.scss +11 -0
  26. data/app/assets/stylesheets/thredded/components/_flash-message.scss +19 -0
  27. data/app/assets/stylesheets/thredded/components/_form-list.scss +35 -0
  28. data/app/assets/stylesheets/thredded/components/_main-section.scss +3 -0
  29. data/app/assets/stylesheets/thredded/components/_messageboard.scss +55 -0
  30. data/app/assets/stylesheets/thredded/components/_pagination.scss +26 -0
  31. data/app/assets/stylesheets/thredded/components/_post-form.scss +21 -0
  32. data/app/assets/stylesheets/thredded/components/_post.scss +66 -0
  33. data/app/assets/stylesheets/thredded/components/_preferences.scss +6 -0
  34. data/app/assets/stylesheets/thredded/components/_select2.scss +42 -0
  35. data/app/assets/stylesheets/thredded/components/_topic-delete.scss +9 -0
  36. data/app/assets/stylesheets/thredded/components/_topic-header.scss +20 -0
  37. data/app/assets/stylesheets/thredded/components/_topics.scss +113 -0
  38. data/app/assets/stylesheets/thredded/layout/_main-container.scss +15 -0
  39. data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +45 -0
  40. data/app/assets/stylesheets/thredded/layout/_topic-navigation.scss +53 -0
  41. data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +87 -0
  42. data/app/assets/stylesheets/thredded/utilities/_is-compact.scss +26 -0
  43. data/app/assets/stylesheets/thredded/utilities/_is-expanded.scss +16 -0
  44. data/app/assets/stylesheets/thredded.scss +3 -0
  45. data/app/commands/thredded/at_notification_extractor.rb +15 -0
  46. data/app/commands/thredded/members_marked_notified.rb +18 -0
  47. data/app/commands/thredded/messageboard_destroyer.rb +60 -0
  48. data/app/commands/thredded/notify_mentioned_users.rb +68 -0
  49. data/app/commands/thredded/notify_private_topic_users.rb +51 -0
  50. data/app/commands/thredded/user_reads_private_topic.rb +22 -0
  51. data/app/commands/thredded/user_resets_private_topic_to_unread.rb +23 -0
  52. data/app/controllers/thredded/application_controller.rb +105 -0
  53. data/app/controllers/thredded/messageboards_controller.rb +58 -0
  54. data/app/controllers/thredded/posts_controller.rb +78 -0
  55. data/app/controllers/thredded/preferences_controller.rb +28 -0
  56. data/app/controllers/thredded/private_topics_controller.rb +65 -0
  57. data/app/controllers/thredded/setups_controller.rb +53 -0
  58. data/app/controllers/thredded/theme_previews_controller.rb +59 -0
  59. data/app/controllers/thredded/topics_controller.rb +153 -0
  60. data/app/decorators/thredded/base_topic_decorator.rb +14 -0
  61. data/app/decorators/thredded/base_user_topic_decorator.rb +63 -0
  62. data/app/decorators/thredded/messageboard_decorator.rb +41 -0
  63. data/app/decorators/thredded/post_decorator.rb +40 -0
  64. data/app/decorators/thredded/private_topic_decorator.rb +23 -0
  65. data/app/decorators/thredded/topic_decorator.rb +25 -0
  66. data/app/decorators/thredded/topic_email_decorator.rb +24 -0
  67. data/app/decorators/thredded/user_private_topic_decorator.rb +13 -0
  68. data/app/decorators/thredded/user_topic_decorator.rb +37 -0
  69. data/app/forms/thredded/private_topic_form.rb +126 -0
  70. data/app/forms/thredded/topic_form.rb +94 -0
  71. data/app/helpers/thredded/application_helper.rb +41 -0
  72. data/app/jobs/thredded/activity_updater_job.rb +20 -0
  73. data/app/jobs/thredded/at_notifier_job.rb +11 -0
  74. data/app/jobs/thredded/notify_private_topic_users_job.rb +11 -0
  75. data/app/mailers/thredded/base_mailer.rb +4 -0
  76. data/app/mailers/thredded/post_mailer.rb +15 -0
  77. data/app/mailers/thredded/private_post_mailer.rb +15 -0
  78. data/app/mailers/thredded/private_topic_mailer.rb +15 -0
  79. data/app/models/concerns/thredded/post_common.rb +105 -0
  80. data/app/models/concerns/thredded/topic_common.rb +48 -0
  81. data/app/models/thredded/ability.rb +60 -0
  82. data/app/models/thredded/category.rb +12 -0
  83. data/app/models/thredded/messageboard.rb +50 -0
  84. data/app/models/thredded/messageboard_user.rb +12 -0
  85. data/app/models/thredded/notification_preference.rb +17 -0
  86. data/app/models/thredded/null_preference.rb +11 -0
  87. data/app/models/thredded/null_topic.rb +15 -0
  88. data/app/models/thredded/null_topic_read.rb +19 -0
  89. data/app/models/thredded/null_user.rb +51 -0
  90. data/app/models/thredded/post.rb +37 -0
  91. data/app/models/thredded/post_notification.rb +17 -0
  92. data/app/models/thredded/private_post.rb +25 -0
  93. data/app/models/thredded/private_topic.rb +60 -0
  94. data/app/models/thredded/private_user.rb +6 -0
  95. data/app/models/thredded/stats.rb +37 -0
  96. data/app/models/thredded/topic.rb +104 -0
  97. data/app/models/thredded/topic_category.rb +6 -0
  98. data/app/models/thredded/user_detail.rb +26 -0
  99. data/app/models/thredded/user_extender.rb +33 -0
  100. data/app/models/thredded/user_permissions/admin/if_admin_column_true.rb +12 -0
  101. data/app/models/thredded/user_permissions/admin/none.rb +12 -0
  102. data/app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb +13 -0
  103. data/app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb +25 -0
  104. data/app/models/thredded/user_permissions/moderate/none.rb +25 -0
  105. data/app/models/thredded/user_permissions/read/all.rb +25 -0
  106. data/app/models/thredded/user_permissions/write/all.rb +25 -0
  107. data/app/models/thredded/user_permissions/write/none.rb +25 -0
  108. data/app/models/thredded/user_preference.rb +6 -0
  109. data/app/models/thredded/user_topic_read.rb +10 -0
  110. data/app/views/layouts/thredded/application.html.erb +15 -0
  111. data/app/views/thredded/categories/_category.html.erb +1 -0
  112. data/app/views/thredded/kaminari/_first_page.html.erb +11 -0
  113. data/app/views/thredded/kaminari/_gap.html.erb +8 -0
  114. data/app/views/thredded/kaminari/_last_page.html.erb +11 -0
  115. data/app/views/thredded/kaminari/_next_page.html.erb +11 -0
  116. data/app/views/thredded/kaminari/_page.html.erb +12 -0
  117. data/app/views/thredded/kaminari/_paginator.html.erb +23 -0
  118. data/app/views/thredded/kaminari/_prev_page.html.erb +11 -0
  119. data/app/views/thredded/messageboards/_messageboard.html.erb +15 -0
  120. data/app/views/thredded/messageboards/index.html.erb +20 -0
  121. data/app/views/thredded/messageboards/new.html.erb +18 -0
  122. data/app/views/thredded/post_mailer/at_notification.html.erb +14 -0
  123. data/app/views/thredded/post_mailer/at_notification.text.erb +10 -0
  124. data/app/views/thredded/posts/_content_field.html.erb +4 -0
  125. data/app/views/thredded/posts/_form.html.erb +1 -0
  126. data/app/views/thredded/posts/_post.html.erb +1 -0
  127. data/app/views/thredded/posts/_user.html.erb +3 -0
  128. data/app/views/thredded/posts/edit.html.erb +13 -0
  129. data/app/views/thredded/posts_common/_form.html.erb +10 -0
  130. data/app/views/thredded/posts_common/_post.html.erb +20 -0
  131. data/app/views/thredded/preferences/_form.html.erb +28 -0
  132. data/app/views/thredded/preferences/_header.html.erb +1 -0
  133. data/app/views/thredded/preferences/edit.html.erb +12 -0
  134. data/app/views/thredded/private_post_mailer/at_notification.html.erb +11 -0
  135. data/app/views/thredded/private_posts/_form.html.erb +1 -0
  136. data/app/views/thredded/private_posts/_private_post.html.erb +1 -0
  137. data/app/views/thredded/private_topic_mailer/message_notification.html.erb +17 -0
  138. data/app/views/thredded/private_topic_mailer/message_notification.text.erb +13 -0
  139. data/app/views/thredded/private_topics/_breadcrumbs.html.erb +4 -0
  140. data/app/views/thredded/private_topics/_form.html.erb +24 -0
  141. data/app/views/thredded/private_topics/_no_private_topics.html.erb +6 -0
  142. data/app/views/thredded/private_topics/_private_topic.html.erb +22 -0
  143. data/app/views/thredded/private_topics/index.html.erb +23 -0
  144. data/app/views/thredded/private_topics/new.html.erb +13 -0
  145. data/app/views/thredded/private_topics/show.html.erb +14 -0
  146. data/app/views/thredded/search/_form.html.erb +7 -0
  147. data/app/views/thredded/shared/_currently_online.html.erb +16 -0
  148. data/app/views/thredded/shared/_flash_messages.html.erb +7 -0
  149. data/app/views/thredded/shared/_header.html.erb +4 -0
  150. data/app/views/thredded/shared/_messageboard_topics_breadcrumbs.html.erb +6 -0
  151. data/app/views/thredded/shared/_notification_preferences.html.erb +7 -0
  152. data/app/views/thredded/shared/_page.html.erb +6 -0
  153. data/app/views/thredded/shared/_time_ago.html.erb +7 -0
  154. data/app/views/thredded/shared/_top_nav.html.erb +36 -0
  155. data/app/views/thredded/shared/_topic_nav.html.erb +22 -0
  156. data/app/views/thredded/theme_previews/_section_title.html.erb +3 -0
  157. data/app/views/thredded/theme_previews/show.html.erb +108 -0
  158. data/app/views/thredded/topics/_form.html.erb +23 -0
  159. data/app/views/thredded/topics/_recent_topics_by_user.html.erb +8 -0
  160. data/app/views/thredded/topics/_topic.html.erb +29 -0
  161. data/app/views/thredded/topics/_topic_form_admin_options.html.erb +12 -0
  162. data/app/views/thredded/topics/by_category.html.erb +56 -0
  163. data/app/views/thredded/topics/edit.html.erb +38 -0
  164. data/app/views/thredded/topics/index.html.erb +18 -0
  165. data/app/views/thredded/topics/menu/_new_topic.html.erb +3 -0
  166. data/app/views/thredded/topics/new.html.erb +11 -0
  167. data/app/views/thredded/topics/search.html.erb +9 -0
  168. data/app/views/thredded/topics/show.html.erb +31 -0
  169. data/app/views/thredded/topics_common/_header.html.erb +6 -0
  170. data/app/views/thredded/users/_link.html.erb +9 -0
  171. data/config/routes.rb +28 -0
  172. data/db/migrate/20160329231848_create_thredded.rb +173 -0
  173. data/lib/generators/thredded/install/USAGE +13 -0
  174. data/lib/generators/thredded/install/install_generator.rb +23 -0
  175. data/lib/generators/thredded/install/templates/initializer.rb +51 -0
  176. data/lib/html/pipeline/at_mention_filter.rb +20 -0
  177. data/lib/html/pipeline/bbcode_filter.rb +19 -0
  178. data/lib/tasks/thredded_tasks.rake +18 -0
  179. data/lib/thredded/at_users.rb +19 -0
  180. data/lib/thredded/engine.rb +35 -0
  181. data/lib/thredded/errors.rb +67 -0
  182. data/lib/thredded/main_app_route_delegator.rb +24 -0
  183. data/lib/thredded/messageboard_user_permissions.rb +22 -0
  184. data/lib/thredded/post_sql_builder.rb +12 -0
  185. data/lib/thredded/post_user_permissions.rb +32 -0
  186. data/lib/thredded/private_topic_user_permissions.rb +26 -0
  187. data/lib/thredded/search_parser.rb +45 -0
  188. data/lib/thredded/search_sql_builder.rb +21 -0
  189. data/lib/thredded/seed_database.rb +76 -0
  190. data/lib/thredded/table_sql_builder.rb +41 -0
  191. data/lib/thredded/topic_sql_builder.rb +11 -0
  192. data/lib/thredded/topic_user_permissions.rb +32 -0
  193. data/lib/thredded/version.rb +3 -0
  194. data/lib/thredded.rb +85 -0
  195. data/thredded.gemspec +68 -0
  196. metadata +248 -122
@@ -0,0 +1,28 @@
1
+ <%= form_for [messageboard, preference], url: messageboard_preferences_path(messageboard),
2
+ html: { class: 'thredded--form thredded--notification-preferences-form' } do |f| %>
3
+ <ul class="thredded--form-list">
4
+ <li>
5
+ <%= f.label :notify_on_mention do %>
6
+ <%= f.check_box :notify_on_mention %>
7
+ @ Notifications
8
+ <p class="thredded--form-list--hint">
9
+ When someone mentions you by your username (eg: @sam)
10
+ you will receive an email with the contents of that post.
11
+ </p>
12
+ <% end %>
13
+ </li>
14
+ <li>
15
+ <%= f.label :notify_on_message do %>
16
+ <%= f.check_box :notify_on_message %>
17
+ Private Topic Notification
18
+ <p class="thredded--form-list--hint">
19
+ When you are first added to a private topic's discussion
20
+ you will receive an email with the contents of that initial
21
+ post.
22
+ </p>
23
+ <% end %>
24
+ </li>
25
+ <li><%= f.submit 'Update Settings', class: 'thredded--form--submit' %></li>
26
+ </ul>
27
+ <% end %>
28
+
@@ -0,0 +1 @@
1
+ <h1 class="thredded--preferences-header--title">Notification Settings For <em><%= messageboard.name %></em></h1>
@@ -0,0 +1,12 @@
1
+ <% content_for :thredded_page_title, 'Notification Preferences' %>
2
+ <% content_for :thredded_page_id, 'thredded--preferences-new' %>
3
+ <% content_for :thredded_breadcrumbs, render('thredded/shared/messageboard_topics_breadcrumbs') %>
4
+
5
+ <%= thredded_page do %>
6
+ <section class="thredded--main-section preferences">
7
+ <%= render 'thredded/preferences/header' %>
8
+ <%= render 'thredded/preferences/form',
9
+ messageboard: messageboard,
10
+ preference: preference %>
11
+ </section>
12
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= @post.filtered_content(self) %>
2
+
3
+ <hr />
4
+
5
+ <p>
6
+ This email was sent to you because <%= @post.user %> mentioned you in
7
+ "<%= link_to @post.postable.title, private_topic_private_post_url(@post.postable, @post, anchor: "post_#{@post.id}") %>".
8
+ <%= link_to 'View the conversation here.', private_topic_url(@post.postable) %>
9
+ </p>
10
+
11
+ <% # TODO: implement global notification preferences for private topics. %>
@@ -0,0 +1 @@
1
+ <%= render 'thredded/posts_common/form', topic: topic, post: post, button_text: button_text %>
@@ -0,0 +1 @@
1
+ <%= render 'thredded/posts_common/post', post: private_post %>
@@ -0,0 +1,17 @@
1
+ <%= @topic.posts.first.filtered_content(self) %>
2
+
3
+ <hr />
4
+
5
+ <p>
6
+ This email was sent to you because <%= @topic.user %> included you in a
7
+ private topic, "<%= link_to @topic.title, @topic %>".
8
+ <%= link_to 'Go here', @topic %>
9
+ to view the conversation.
10
+ </p>
11
+
12
+ <% if false # TODO: implement global notification preferences for private topics. %>
13
+ <p>
14
+ To unsubscribe from these emails, update your
15
+ <%= link_to 'preferences', edit_messageboard_preferences_url(@topic.messageboard) %>.
16
+ </p>
17
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%= @topic.posts.first.content %>
2
+
3
+ ---
4
+
5
+ This email was sent to you because <%= @topic.user %>
6
+ included you in the private topic "<%= @topic.title %>".
7
+ Go here to view the conversation:
8
+ <%= url_for @topic %>
9
+
10
+ <% if false # TODO: implement global notification preferences for private topics. %>
11
+ To unsubscribe from these emails, update your preferences here:
12
+ <%= edit_messageboard_preferences_url(@topic.messageboard) %>
13
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <ul class="thredded--navigation-breadcrumbs">
2
+ <li><%= link_to 'All Message Boards', messageboards_path %></li>
3
+ <li><%= link_to 'Private Topics', private_topics_path %></li>
4
+ </ul>
@@ -0,0 +1,24 @@
1
+ <%= form_for private_topic,
2
+ url: private_topics_path(@private_topic),
3
+ html: { class: "thredded--form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
4
+
5
+ <ul class="thredded--form-list on-top">
6
+ <li class="title">
7
+ <%= form.label :title, 'Private Topic Title' %>
8
+ <%= form.text_field :title, { placeholder: placeholder, required: true, 'data-thredded-topic-form-title' => true } %>
9
+ </li>
10
+
11
+ <li>
12
+ <%= form.label :user_id, 'Users in Private Topic' %>
13
+ <%= form.select :user_ids,
14
+ form.object.users_for_select,
15
+ form.object.users_selected_options,
16
+ form.object.users_select_html_options %>
17
+ </li>
18
+
19
+ <%= render 'thredded/posts/content_field', form: form %>
20
+
21
+ <li><%= form.submit button_text, class: 'thredded--form--submit' %></li>
22
+ </ul>
23
+ <% end %>
24
+
@@ -0,0 +1,6 @@
1
+ <div class="thredded--empty">
2
+ <h3 class="thredded--empty--title">You have no private topics.</h3>
3
+ <a class="thredded--button" href="<%= new_private_topic_path(messageboard) %>">
4
+ Create your first private topic
5
+ </a>
6
+ </div>
@@ -0,0 +1,22 @@
1
+ <%= content_tag_for :article, private_topic, class: "thredded--topics--topic #{private_topic.css_class}" do %>
2
+ <div class="thredded--topics--posts-count"><%= private_topic.posts_count %></div>
3
+
4
+ <h1 class="thredded--topics--title">
5
+ <%= link_to private_topic.title, private_topic.original %>
6
+ </h1>
7
+
8
+ <cite class="thredded--topics--updated-by">
9
+ <%= time_ago private_topic.updated_at %>
10
+ <%= user_link private_topic.last_user %>
11
+ </cite>
12
+
13
+ <cite class="thredded--topics--started-by">
14
+ <%= time_ago private_topic.created_at %>
15
+ <%= user_link private_topic.user %>
16
+ </cite>
17
+
18
+ <ul class="thredded--topics--categories">
19
+ <%= render private_topic.categories %>
20
+ </ul>
21
+ <% end %>
22
+
@@ -0,0 +1,23 @@
1
+ <% content_for :thredded_page_title, 'Private Topics' %>
2
+ <% content_for :thredded_page_id, 'thredded--private-topics-index' %>
3
+ <% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
4
+
5
+ <%= thredded_page do %>
6
+ <%= content_tag :section, class: 'thredded--main-section thredded--private-topics' do %>
7
+ <% if @private_topics.empty? -%>
8
+ <%= render 'thredded/private_topics/no_private_topics' %>
9
+ <% else -%>
10
+ <%= render 'thredded/private_topics/form',
11
+ messageboard: messageboard,
12
+ private_topic: @new_private_topic,
13
+ css_class: 'thredded--is-compact',
14
+ placeholder: 'Start a New Private Topic',
15
+ button_text: 'Create New Private Topic' %>
16
+ <%= render @decorated_private_topics %>
17
+ <% end -%>
18
+ <% end %>
19
+
20
+ <footer>
21
+ <%= paginate @private_topics %>
22
+ </footer>
23
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <% content_for :thredded_page_title, 'Create a New Private Topic' %>
2
+ <% content_for :thredded_page_id, 'thredded--new-private-topic' %>
3
+ <% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
4
+
5
+ <%= thredded_page do %>
6
+ <section class="thredded--main-section">
7
+ <%= render 'thredded/private_topics/form',
8
+ messageboard: messageboard,
9
+ private_topic: @private_topic,
10
+ placeholder: 'New Private Topic Title',
11
+ button_text: 'Create New Private Topic' %>
12
+ </section>
13
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <% content_for :thredded_page_title, private_topic.title %>
2
+ <% content_for :thredded_page_id, 'thredded--posts' %>
3
+ <% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
4
+
5
+ <%= thredded_page do %>
6
+ <%= content_tag_for :section, private_topic, class: 'thredded--main-section thredded--topic thredded--private-topic' do %>
7
+ <%= render 'thredded/topics_common/header', topic: private_topic %>
8
+ <%= render @posts %>
9
+ <%= render 'thredded/private_posts/form',
10
+ topic: private_topic,
11
+ post: @post,
12
+ button_text: 'Submit Reply' %>
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <% if messageboard.try(:persisted?) %>
2
+ <%= form_tag messageboard_topics_path(messageboard), method: 'get' do %>
3
+ <%= label :q, :search, 'Search', for: 'q', class: 'show-for-small', data: {toggle: '#q'} %>
4
+ <%= text_field_tag(:q, params[:q], { placeholder: 'Search Topics and Posts', type: 'search', class: 'input-search' }) %>
5
+ <%= submit_tag('Search', name: '') %>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <% if (users = active_users).present? %>
2
+ <aside data-thredded-currently-online class="thredded--currently-online">
3
+ <header>
4
+ <h3 class="thredded--currently-online--title open">Currently Online</h3>
5
+ </header>
6
+
7
+ <ul class="thredded--currently-online--users">
8
+ <% users.each do |user| %>
9
+ <li class="thredded--currently-online--user">
10
+ <img class="thredded--currently-online--avatar" src="<%= Thredded.avatar_url.call(user) %>" alt=""/>
11
+ <%= user %>
12
+ </li>
13
+ <% end %>
14
+ </ul>
15
+ </aside>
16
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <% [:success, :error, :notice, :alert].each do |key| %>
2
+ <% if flash[key] %>
3
+ <div class="thredded--flash-message thredded--flash-message--<%= key %>" id="flash">
4
+ <%= flash[key] %>
5
+ </div>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <header class="thredded--navigation" role="banner">
2
+ <%= render 'thredded/shared/top_nav' %>
3
+ <%= render 'thredded/shared/topic_nav' %>
4
+ </header>
@@ -0,0 +1,6 @@
1
+ <ul class="thredded--navigation-breadcrumbs">
2
+ <li><%= link_to 'All Message Boards', messageboards_path %></li>
3
+ <% if messageboard %>
4
+ <li><%= link_to messageboard.name, messageboard_topics_path(messageboard) %></li>
5
+ <% end %>
6
+ </ul>
@@ -0,0 +1,7 @@
1
+ <% if messageboard.try(:persisted?) %>
2
+ <li>
3
+ <%= link_to edit_messageboard_preferences_path(messageboard) do %>
4
+ <span>Notification Settings</span>
5
+ <% end %>
6
+ </li>
7
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <div id="thredded--container" class="thredded--main-container <%= yield(:thredded_page_id) %>" data-thredded-page-id="<%= yield(:thredded_page_id) %>">
2
+ <%= render 'thredded/shared/header' %>
3
+ <%= render 'thredded/shared/flash_messages' %>
4
+ <%= yield :thredded_page_content %>
5
+ <%= render 'thredded/shared/currently_online' %>
6
+ </div>
@@ -0,0 +1,7 @@
1
+ <% if datetime.nil? %>
2
+ <abbr>a little while ago</abbr>
3
+ <% else %>
4
+ <abbr class="timeago" title="<%= datetime.getutc.iso8601 %>">
5
+ <%= datetime.to_s %>
6
+ </abbr>
7
+ <% end %>
@@ -0,0 +1,36 @@
1
+ <% unless !messageboard.try(:persisted?) && !Thredded.standalone_layout? %>
2
+ <nav class="thredded--user-navigation" role="navigation">
3
+ <div class="thredded--user-navigation--search">
4
+ <%= render 'thredded/search/form' %>
5
+ </div>
6
+
7
+ <ul class="thredded--user-navigation--actions">
8
+ <% if signed_in? %>
9
+ <% if Thredded.standalone_layout? %>
10
+ <li>
11
+ <%= link_to user_path(thredded_current_user) do %>
12
+ <span><%= thredded_current_user %></span>
13
+ <% end %>
14
+ </li>
15
+ <% end %>
16
+
17
+ <%= render 'thredded/shared/notification_preferences',
18
+ messageboard: messageboard %>
19
+
20
+ <% if Thredded.standalone_layout? %>
21
+ <li>
22
+ <%= link_to main_app.session_path, method: :delete do %>
23
+ <span>Sign Out</span>
24
+ <% end %>
25
+ </li>
26
+ <% end %>
27
+ <% elsif Thredded.standalone_layout? %>
28
+ <li>
29
+ <%= link_to main_app.sessions_new_path do %>
30
+ <span>Sign In / Register</span>
31
+ <% end %>
32
+ </li>
33
+ <% end %>
34
+ </ul>
35
+ </nav>
36
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <div class="thredded--main-navigation">
2
+ <%= yield :thredded_breadcrumbs %>
3
+
4
+ <ul class="thredded--topic-navigation">
5
+ <% if messageboard.try(:persisted?) -%>
6
+ <li class="thredded--topic-navigation--public">
7
+ <%= link_to 'Topics', messageboard_topics_path(messageboard) %>
8
+ </li>
9
+ <% end -%>
10
+
11
+ <li class="thredded--topic-navigation--private">
12
+ <%= link_to private_topics_path do %>
13
+ Private Topics
14
+ <% if unread_private_topics_count > 0 -%>
15
+ <span class="thredded--topic-navigation--unread">
16
+ <%= unread_private_topics_count %>
17
+ </span>
18
+ <% end -%>
19
+ <% end -%>
20
+ </li>
21
+ </ul>
22
+ </div>
@@ -0,0 +1,3 @@
1
+ <h2 style="margin-top: 4em" id="<%= label.parameterize %>">
2
+ <a href="<%= href %>"><code><%= label %></code></a>
3
+ </h2>
@@ -0,0 +1,108 @@
1
+ <% content_for :thredded_page_title, 'Theme Preview' %>
2
+ <% content_for :thredded_page_id, 'thredded--theme' %>
3
+ <% content_for :thredded_breadcrumbs do %>
4
+ <ul class="thredded--navigation-breadcrumbs">
5
+ <li><%= link_to 'Theme Preview', theme_preview_path %></li>
6
+ </ul>
7
+ <% end %>
8
+
9
+ <%= thredded_page do %>
10
+ <%= render 'section_title', label: 'messageboards#index', href: messageboards_path %>
11
+ <%= content_tag :section, class: 'thredded--thredded--main-section thredded--messageboards' do %>
12
+ <%= render @messageboards %>
13
+ <div class="thredded--messageboard--create">
14
+ <a class="thredded--button" href="<%= new_messageboard_path %>">Create a New Messageboard</a>
15
+ </div>
16
+ <% end %>
17
+
18
+
19
+ <%= render 'section_title', label: 'topics#index', href: messageboard_topics_path(@messageboard) %>
20
+ <%= content_tag :section, class: 'thredded--thredded--main-section topics' do %>
21
+ <%= render 'thredded/topics/form',
22
+ messageboard: @messageboard,
23
+ topic: @new_topic,
24
+ css_class: 'thredded--is-compact',
25
+ placeholder: 'Start a New Topic' %>
26
+ <%= render @decorated_topics %>
27
+ <% end %>
28
+ <footer>
29
+ <%= paginate @topics %>
30
+ </footer>
31
+ <br>
32
+
33
+
34
+ <%= render 'section_title', label: 'topics#show', href: messageboard_topic_posts_path(@messageboard, @topic) %>
35
+ <%= content_tag_for :section, @topic, class: "thredded--thredded--main-section #{@user_topic.css_class}" do %>
36
+ <%= render 'thredded/topics_common/header', topic: @topic %>
37
+ <%= render @posts %>
38
+ <%= render 'thredded/posts/form',
39
+ messageboard: @messageboard,
40
+ topic: @topic,
41
+ post: @new_post,
42
+ button_text: 'Submit Reply'
43
+ %>
44
+ <% end %>
45
+
46
+ <%= render 'section_title', label: 'topics#new', href: new_messageboard_topic_path(@messageboard) %>
47
+ <%= render 'thredded/topics/form',
48
+ messageboard: @messageboard,
49
+ topic: @new_topic,
50
+ placeholder: 'Start a New Topic' %>
51
+
52
+ <%= render 'section_title', label: 'posts#edit', href: edit_messageboard_topic_post_path(@messageboard, @post.postable, @post) %>
53
+ <%= content_tag :section, class: 'thredded--thredded--main-section posts-form' do %>
54
+ <h3 class="thredded--post-form--title">Edit Post</h3>
55
+
56
+ <%= render 'thredded/posts/form',
57
+ messageboard: @messageboard,
58
+ topic: @topic,
59
+ post: @post,
60
+ button_text: 'Update Post'
61
+ %>
62
+ <% end %>
63
+
64
+ <%= render 'section_title', label: 'private_topics#index', href: private_topics_path %>
65
+ <%= content_tag :section, class: 'thredded--thredded--main-section private-topics' do %>
66
+ <p><em>If the user has no private topics:</em></p>
67
+ <%= render 'thredded/private_topics/no_private_topics' %>
68
+
69
+ <hr>
70
+
71
+ <p><em>If the user has private topics:</em></p>
72
+ <%= render 'thredded/private_topics/form',
73
+ private_topic: @new_private_topic,
74
+ css_class: 'thredded--is-compact',
75
+ placeholder: 'Start a New Private Topic',
76
+ button_text: 'Create New Private Topic' %>
77
+ <%= render @decorated_private_topics %>
78
+ <% end %>
79
+
80
+ <%= render 'section_title', label: 'private_topics#new', href: new_private_topic_path %>
81
+ <section class="thredded--thredded--main-section">
82
+ <%= render 'thredded/private_topics/form',
83
+ private_topic: @new_private_topic,
84
+ placeholder: 'New Private Topic Title',
85
+ button_text: 'Create New Private Topic' %>
86
+ </section>
87
+
88
+ <%= render 'section_title', label: 'private_topics#show', href: private_topic_path(@private_topic) %>
89
+ <section class="thredded--thredded--main-section">
90
+ <%= render 'thredded/topics_common/header', topic: @private_topic %>
91
+ <%= render @private_topic.posts.first(3) %>
92
+ <%= render 'thredded/private_posts/form',
93
+ topic: @private_topic,
94
+ post: @private_post,
95
+ button_text: 'Submit Reply'
96
+ %>
97
+ </section>
98
+
99
+ <%= render 'section_title', label: 'preferences#edit', href: edit_messageboard_preferences_path(@messageboard) %>
100
+ <%= content_tag :section, class: 'thredded--thredded--main-section preferences' do %>
101
+ <%= render 'thredded/preferences/header' %>
102
+ <%= render 'thredded/preferences/form',
103
+ messageboard: @messageboard,
104
+ preference: @preference %>
105
+ <% end %>
106
+
107
+ <%= render 'thredded/shared/currently_online' %>
108
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <%= form_for [messageboard, topic],
2
+ html: { class: "thredded--form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
3
+ <ul class="thredded--form-list on-top">
4
+ <li class="title">
5
+ <%= form.label :title %>
6
+ <%= form.text_field :title, { placeholder: placeholder, required: true, 'data-thredded-topic-form-title' => true } %>
7
+ </li>
8
+
9
+ <% if form.object.categories.any? %>
10
+ <li class="category">
11
+ <%= form.select :category_ids,
12
+ form.object.category_options,
13
+ {},
14
+ { multiple: true, 'data-placeholder' => 'Categories' } %>
15
+ </li>
16
+ <% end %>
17
+
18
+ <%= render 'thredded/posts/content_field', form: form %>
19
+ <%= render 'thredded/topics/topic_form_admin_options', form: form %>
20
+
21
+ <li><%= form.submit 'Create New Topic', class: 'thredded--form--submit' %></li>
22
+ </ul>
23
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% if current_ability.can? :read, topic %>
2
+ <tr>
3
+ <td class="title table-first-column"> <%= topic.title %> </td>
4
+ <td class="replies"> <%= topic.posts_count %> </td>
5
+ <td class="created"> <%= formatted_user_profile_date(topic.created_at) %> </td>
6
+ <td class="updated"> <%= formatted_user_profile_date(topic.updated_at) %> </td>
7
+ </tr>
8
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <%= content_tag_for :article, topic, class: "thredded--topics--topic #{topic.css_class}" do %>
2
+ <div class="thredded--topics--posts-count"><%= topic.posts_count %></div>
3
+
4
+ <h1 class="thredded--topics--title">
5
+ <%= link_to topic.title,
6
+ paged_messageboard_topic_posts_path(
7
+ messageboard.slug,
8
+ topic.slug,
9
+ topic.farthest_page
10
+ )
11
+ %>
12
+ </h1>
13
+
14
+ <% if topic.categories.any? %>
15
+ <ul class="thredded--topics--categories">
16
+ <%= render topic.categories %>
17
+ </ul>
18
+ <% end %>
19
+
20
+ <cite class="thredded--topics--updated-by">
21
+ <%= time_ago topic.updated_at %>
22
+ <%= user_link topic.last_user %>
23
+ </cite>
24
+
25
+ <cite class="thredded--topics--started-by">
26
+ <%= time_ago topic.created_at %>
27
+ <%= user_link topic.user %>
28
+ </cite>
29
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% topic = form.object.respond_to?(:topic) ? form.object.topic : form.object %>
2
+ <% if current_ability.can? :admin, topic %>
3
+ <li class="thredded--form-list--admin-options">
4
+ <%= form.label :locked do %>
5
+ <%= form.check_box :locked %> Locked
6
+ <% end %>
7
+
8
+ <%= form.label :sticky do %>
9
+ <%= form.check_box :sticky %> Sticky
10
+ <% end %>
11
+ </li>
12
+ <% end %>
@@ -0,0 +1,56 @@
1
+ <% content_for :thredded_page_title, 'Topic Categories' %>
2
+ <% content_for :thredded_page_id, 'thredded--topic-categories' %>
3
+
4
+ <% content_for :breadcrumbs do %>
5
+ <ul class="breadcrumbs">
6
+ <li><%= link_to 'Forums', root_path %></li>
7
+ <li><%= link_to messageboard.title, messageboard_topics_path(messageboard) %></li>
8
+ <li><span>Category</span></li>
9
+ </ul>
10
+ <% end %>
11
+
12
+ <% content_for :actions do %>
13
+ <ul class="actions">
14
+ <%= render 'thredded/search/form' %>
15
+
16
+ <% if current_ability.can? :create, Thredded::Topic %>
17
+ <li class='new_topic'>
18
+ <%= link_to 'new topic', new_messageboard_topic_path(messageboard) %>
19
+ </li>
20
+ <li class='new_private_topic'>
21
+ <%= link_to 'private topic', new_messageboard_topic_path(messageboard) %>
22
+ </li>
23
+ <% end %>
24
+ </ul>
25
+ <% end %>
26
+
27
+ <%= thredded_page do %>
28
+ <header>
29
+ <nav>
30
+ <%= yield :breadcrumbs %>
31
+ <%= yield :actions %>
32
+ </nav>
33
+
34
+ <%= render 'thredded/shared/currently_online' %>
35
+ </header>
36
+
37
+ <section class="topics">
38
+ <% if @sticky.any? %>
39
+ <div class="stuck">
40
+ <%= render partial: 'thredded/topics/topic_condensed', collection: @sticky, as: :t %>
41
+ </div>
42
+ <% end %>
43
+
44
+ <div class="currently">
45
+ <%= render partial: 'thredded/topics/topic_condensed', collection: @topics, as: :t %>
46
+ </div>
47
+ </section>
48
+
49
+ <footer>
50
+ <%= paginate @topics %>
51
+ <nav>
52
+ <%= yield :actions %>
53
+ <%= yield :breadcrumbs %>
54
+ </nav>
55
+ </footer>
56
+ <% end %>
@@ -0,0 +1,38 @@
1
+ <% content_for :thredded_page_title, "Edit \"#{topic.title}\"" %>
2
+ <% content_for :thredded_page_id, 'thredded--edit-topic' %>
3
+
4
+ <% content_for :thredded_breadcrumbs, capture { %>
5
+ <ul class="thredded--navigation-breadcrumbs">
6
+ <li><%= link_to 'All Message Boards', messageboards_path %></li>
7
+ <li><%= link_to messageboard.name, messageboard_topics_path(messageboard, topic) %></li>
8
+ <li>
9
+ <a href="<%= edit_messageboard_topic_path(messageboard, topic) %>">Editing Topic <em><%= topic.title %></em></a>
10
+ </li>
11
+ </ul>
12
+ <% } %>
13
+
14
+ <%= thredded_page do %>
15
+ <%= form_for [messageboard, @topic],
16
+ html: { class: 'thredded--form thredded--is-expanded', 'data-thredded-topic-form' => true } do |form| %>
17
+ <ul class="thredded--form-list on-top">
18
+
19
+ <li class="title">
20
+ <%= form.label :title %>
21
+ <%= form.text_field :title, { placeholder: 'Title', autofocus: 'autofocus', } %>
22
+ </li>
23
+
24
+ <% if messageboard.categories.any? %>
25
+ <li class="category">
26
+ <%= form.select :category_ids,
27
+ form.object.decorate.category_options,
28
+ {},
29
+ { multiple: true, 'data-placeholder' => 'Categories' } %>
30
+ </li>
31
+ <% end %>
32
+
33
+ <%= render 'thredded/topics/topic_form_admin_options', form: form %>
34
+
35
+ <li><%= form.submit 'Update Topic', class: 'thredded--form--submit' %></li>
36
+ <% end %>
37
+ </ul>
38
+ <% end %>