thredded 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.mkdn +63 -0
- data/Procfile +1 -0
- data/README.mkdn +42 -20
- data/app/assets/images/thredded/private-messages.svg +4 -0
- data/app/assets/images/thredded/settings.svg +4 -0
- data/app/assets/javascripts/thredded.es6 +2 -10
- data/app/assets/javascripts/thredded/{currently_online.es6 → components/currently_online.es6} +0 -0
- data/app/assets/javascripts/thredded/{post_form.es6 → components/post_form.es6} +0 -0
- data/app/assets/javascripts/thredded/{time_stamps.es6 → components/time_stamps.es6} +0 -0
- data/app/assets/javascripts/thredded/{topic_form.es6 → components/topic_form.es6} +1 -1
- data/app/assets/javascripts/thredded/components/topics.es6 +37 -0
- data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +45 -0
- data/app/assets/javascripts/thredded/components/users_select.es6 +56 -0
- data/app/assets/javascripts/thredded/dependencies.js +9 -0
- data/app/assets/javascripts/thredded/thredded.es6 +1 -0
- data/app/assets/stylesheets/thredded/_base.scss +3 -2
- data/app/assets/stylesheets/thredded/_thredded.scss +4 -1
- data/app/assets/stylesheets/thredded/base/_buttons.scss +2 -1
- data/app/assets/stylesheets/thredded/base/_forms.scss +23 -18
- data/app/assets/stylesheets/thredded/base/_grid.scss +1 -1
- data/app/assets/stylesheets/thredded/base/_nav.scss +21 -0
- data/app/assets/stylesheets/thredded/base/_tables.scss +5 -14
- data/app/assets/stylesheets/thredded/base/_typography.scss +9 -4
- data/app/assets/stylesheets/thredded/base/_variables.scss +28 -9
- data/app/assets/stylesheets/thredded/components/_alerts.scss +19 -0
- data/app/assets/stylesheets/thredded/components/_currently-online.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_form-list.scss +2 -4
- data/app/assets/stylesheets/thredded/components/_icons.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_messageboard.scss +4 -4
- data/app/assets/stylesheets/thredded/components/_pagination.scss +2 -2
- data/app/assets/stylesheets/thredded/components/_post-form.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_post.scss +14 -4
- data/app/assets/stylesheets/thredded/components/_select2.scss +79 -9
- data/app/assets/stylesheets/thredded/components/_topic-header.scss +11 -1
- data/app/assets/stylesheets/thredded/components/_topics.scss +13 -11
- data/app/assets/stylesheets/thredded/layout/_main-container.scss +3 -3
- data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +11 -17
- data/app/assets/stylesheets/thredded/layout/_navigation.scss +72 -0
- data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +66 -0
- data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +35 -61
- data/app/commands/thredded/at_notification_extractor.rb +1 -0
- data/app/commands/thredded/members_marked_notified.rb +1 -0
- data/app/commands/thredded/messageboard_destroyer.rb +7 -2
- data/app/commands/thredded/notify_mentioned_users.rb +8 -21
- data/app/commands/thredded/notify_private_topic_users.rb +3 -5
- data/app/controllers/thredded/application_controller.rb +76 -41
- data/app/controllers/thredded/autocomplete_users_controller.rb +46 -0
- data/app/controllers/thredded/messageboards_controller.rb +8 -5
- data/app/controllers/thredded/posts_controller.rb +20 -22
- data/app/controllers/thredded/preferences_controller.rb +19 -14
- data/app/controllers/thredded/private_topics_controller.rb +58 -23
- data/app/controllers/thredded/setups_controller.rb +1 -0
- data/app/controllers/thredded/theme_previews_controller.rb +24 -53
- data/app/controllers/thredded/topics_controller.rb +48 -77
- data/app/forms/thredded/private_topic_form.rb +1 -21
- data/app/forms/thredded/topic_form.rb +3 -7
- data/app/forms/thredded/user_preferences_form.rb +62 -0
- data/app/helpers/thredded/application_helper.rb +11 -12
- data/app/helpers/thredded/urls_helper.rb +103 -0
- data/app/jobs/thredded/activity_updater_job.rb +4 -3
- data/app/jobs/thredded/at_notifier_job.rb +1 -0
- data/app/jobs/thredded/notify_private_topic_users_job.rb +1 -0
- data/app/mailer_previews/thredded/base_mailer_preview.rb +101 -0
- data/app/mailer_previews/thredded/post_mailer_preview.rb +11 -0
- data/app/mailer_previews/thredded/private_post_mailer_preview.rb +11 -0
- data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +15 -0
- data/app/mailers/thredded/base_mailer.rb +13 -0
- data/app/mailers/thredded/post_mailer.rb +4 -2
- data/app/mailers/thredded/private_post_mailer.rb +4 -2
- data/app/mailers/thredded/private_topic_mailer.rb +4 -2
- data/app/models/concerns/thredded/friendly_id_reserved_words_and_pagination.rb +16 -0
- data/app/models/concerns/thredded/post_common.rb +68 -63
- data/app/models/concerns/thredded/topic_common.rb +31 -8
- data/app/models/concerns/thredded/user_topic_read_state_common.rb +31 -0
- data/app/models/thredded/category.rb +1 -0
- data/app/models/thredded/messageboard.rb +24 -25
- data/app/models/thredded/messageboard_user.rb +1 -0
- data/app/models/thredded/null_preference.rb +1 -0
- data/app/models/thredded/null_user.rb +1 -6
- data/app/models/thredded/null_user_topic_read_state.rb +12 -0
- data/app/models/thredded/post.rb +6 -9
- data/app/models/thredded/post_notification.rb +1 -0
- data/app/models/thredded/private_post.rb +6 -2
- data/app/models/thredded/private_topic.rb +46 -32
- data/app/models/thredded/private_user.rb +3 -2
- data/app/models/thredded/stats.rb +1 -0
- data/app/models/thredded/topic.rb +40 -64
- data/app/models/thredded/topic_category.rb +1 -0
- data/app/models/thredded/user_detail.rb +2 -15
- data/app/models/thredded/user_extender.rb +29 -14
- data/app/models/thredded/user_messageboard_preference.rb +20 -0
- data/app/models/thredded/user_permissions/admin/if_admin_column_true.rb +1 -0
- data/app/models/thredded/user_permissions/admin/none.rb +1 -0
- data/app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb +1 -0
- data/app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb +1 -0
- data/app/models/thredded/user_permissions/moderate/none.rb +1 -0
- data/app/models/thredded/user_permissions/read/all.rb +1 -0
- data/app/models/thredded/user_permissions/write/all.rb +1 -0
- data/app/models/thredded/user_permissions/write/none.rb +1 -0
- data/app/models/thredded/user_preference.rb +7 -1
- data/app/models/thredded/user_private_topic_read_state.rb +12 -0
- data/app/models/thredded/user_topic_read_state.rb +12 -0
- data/app/policies/thredded/messageboard_policy.rb +27 -0
- data/app/policies/thredded/post_policy.rb +33 -0
- data/app/policies/thredded/private_post_policy.rb +29 -0
- data/app/policies/thredded/private_topic_policy.rb +23 -0
- data/app/policies/thredded/topic_policy.rb +32 -0
- data/app/view_models/thredded/base_topic_view.rb +56 -0
- data/app/view_models/thredded/post_view.rb +44 -0
- data/app/view_models/thredded/posts_page_view.rb +27 -0
- data/app/view_models/thredded/private_topic_view.rb +9 -0
- data/app/{decorators/thredded/topic_email_decorator.rb → view_models/thredded/topic_email_view.rb} +2 -1
- data/app/view_models/thredded/topic_view.rb +23 -0
- data/app/view_models/thredded/topics_page_view.rb +26 -0
- data/app/views/thredded/error_pages/forbidden.html.erb +6 -0
- data/app/views/thredded/error_pages/not_found.html.erb +6 -0
- data/app/views/thredded/messageboards/_messageboard.html.erb +13 -6
- data/app/views/thredded/messageboards/index.html.erb +2 -8
- data/app/views/thredded/messageboards/new.html.erb +8 -2
- data/app/views/thredded/post_mailer/at_notification.html.erb +3 -3
- data/app/views/thredded/post_mailer/at_notification.text.erb +1 -1
- data/app/views/thredded/posts/_content_field.html.erb +1 -1
- data/app/views/thredded/posts/_form.html.erb +5 -1
- data/app/views/thredded/posts/_post.html.erb +3 -1
- data/app/views/thredded/posts/edit.html.erb +7 -3
- data/app/views/thredded/posts_common/_form.html.erb +1 -1
- data/app/views/thredded/posts_common/_post.html.erb +14 -8
- data/app/views/thredded/preferences/_form.html.erb +37 -15
- data/app/views/thredded/preferences/_header.html.erb +1 -1
- data/app/views/thredded/preferences/edit.html.erb +4 -6
- data/app/views/thredded/private_post_mailer/at_notification.html.erb +6 -4
- data/app/views/thredded/private_posts/_form.html.erb +5 -1
- data/app/views/thredded/private_posts/_private_post.html.erb +3 -1
- data/app/views/thredded/private_topic_mailer/message_notification.html.erb +3 -7
- data/app/views/thredded/private_topic_mailer/message_notification.text.erb +1 -3
- data/app/views/thredded/private_topics/_breadcrumbs.html.erb +2 -2
- data/app/views/thredded/private_topics/_form.html.erb +15 -10
- data/app/views/thredded/private_topics/_header.html.erb +12 -0
- data/app/views/thredded/private_topics/_no_private_topics.html.erb +2 -2
- data/app/views/thredded/private_topics/_private_topic.html.erb +4 -6
- data/app/views/thredded/private_topics/edit.html.erb +32 -0
- data/app/views/thredded/private_topics/index.html.erb +5 -5
- data/app/views/thredded/private_topics/new.html.erb +1 -2
- data/app/views/thredded/private_topics/show.html.erb +12 -7
- data/app/views/thredded/search/_form.html.erb +9 -6
- data/app/views/thredded/shared/{_messageboard_topics_breadcrumbs.html.erb → _breadcrumbs.html.erb} +2 -2
- data/app/views/thredded/shared/_header.html.erb +2 -3
- data/app/views/thredded/shared/_nav.html.erb +20 -0
- data/app/views/thredded/shared/nav/_notification_preferences.html.erb +6 -0
- data/app/views/thredded/shared/nav/_private_topics.html.erb +11 -0
- data/app/views/thredded/shared/nav/_standalone.html.erb +12 -0
- data/app/views/thredded/theme_previews/_section_title.html.erb +2 -2
- data/app/views/thredded/theme_previews/show.html.erb +13 -17
- data/app/views/thredded/topics/_form.html.erb +8 -6
- data/app/views/thredded/topics/_header.html.erb +12 -0
- data/app/views/thredded/topics/_topic.html.erb +4 -8
- data/app/views/thredded/topics/_topic_form_admin_options.html.erb +1 -1
- data/app/views/thredded/topics/edit.html.erb +22 -18
- data/app/views/thredded/topics/index.html.erb +3 -3
- data/app/views/thredded/topics/new.html.erb +1 -1
- data/app/views/thredded/topics/search.html.erb +17 -5
- data/app/views/thredded/topics/show.html.erb +14 -11
- data/bin/rails +5 -0
- data/config.ru +3 -0
- data/config/i18n-tasks.yml +16 -0
- data/config/locales/en.yml +90 -0
- data/config/routes.rb +29 -15
- data/db/migrate/20160329231848_create_thredded.rb +29 -33
- data/db/seeds.rb +115 -0
- data/db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb +59 -0
- data/heroku.gemfile +26 -0
- data/heroku.gemfile.lock +282 -0
- data/lib/generators/thredded/install/install_generator.rb +1 -0
- data/lib/generators/thredded/install/templates/initializer.rb +17 -0
- data/lib/html/pipeline/at_mention_filter.rb +2 -1
- data/lib/html/pipeline/bbcode_filter.rb +13 -4
- data/lib/tasks/thredded_tasks.rake +1 -0
- data/lib/thredded.rb +19 -17
- data/lib/thredded/at_users.rb +1 -0
- data/lib/thredded/engine.rb +14 -5
- data/lib/thredded/errors.rb +11 -11
- data/lib/thredded/main_app_route_delegator.rb +1 -0
- data/lib/thredded/search_parser.rb +2 -1
- data/lib/thredded/topics_search.rb +67 -0
- data/lib/thredded/version.rb +2 -1
- data/thredded.gemspec +12 -8
- metadata +146 -82
- data/app/assets/javascripts/thredded/users_select.es6 +0 -5
- data/app/assets/stylesheets/thredded/layout/_topic-navigation.scss +0 -53
- data/app/commands/thredded/user_reads_private_topic.rb +0 -22
- data/app/commands/thredded/user_resets_private_topic_to_unread.rb +0 -23
- data/app/decorators/thredded/base_topic_decorator.rb +0 -14
- data/app/decorators/thredded/base_user_topic_decorator.rb +0 -63
- data/app/decorators/thredded/messageboard_decorator.rb +0 -41
- data/app/decorators/thredded/post_decorator.rb +0 -40
- data/app/decorators/thredded/private_topic_decorator.rb +0 -23
- data/app/decorators/thredded/topic_decorator.rb +0 -25
- data/app/decorators/thredded/user_private_topic_decorator.rb +0 -13
- data/app/decorators/thredded/user_topic_decorator.rb +0 -37
- data/app/models/thredded/ability.rb +0 -60
- data/app/models/thredded/notification_preference.rb +0 -17
- data/app/models/thredded/null_topic.rb +0 -15
- data/app/models/thredded/null_topic_read.rb +0 -19
- data/app/models/thredded/user_topic_read.rb +0 -10
- data/app/views/thredded/shared/_notification_preferences.html.erb +0 -7
- data/app/views/thredded/shared/_top_nav.html.erb +0 -36
- data/app/views/thredded/shared/_topic_nav.html.erb +0 -22
- data/app/views/thredded/topics/_recent_topics_by_user.html.erb +0 -8
- data/app/views/thredded/topics/by_category.html.erb +0 -56
- data/app/views/thredded/topics_common/_header.html.erb +0 -6
- data/lib/thredded/messageboard_user_permissions.rb +0 -22
- data/lib/thredded/post_sql_builder.rb +0 -12
- data/lib/thredded/post_user_permissions.rb +0 -32
- data/lib/thredded/private_topic_user_permissions.rb +0 -26
- data/lib/thredded/search_sql_builder.rb +0 -21
- data/lib/thredded/seed_database.rb +0 -76
- data/lib/thredded/table_sql_builder.rb +0 -41
- data/lib/thredded/topic_sql_builder.rb +0 -11
- data/lib/thredded/topic_user_permissions.rb +0 -32
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
<%=
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<%= form_tag search_path(messageboard), class: 'thredded--form thredded--navigation--search', method: 'get' do %>
|
2
|
+
<%= label_tag :q, t('thredded.search.form.label') %>
|
3
|
+
<%= text_field_tag :q, @query,
|
4
|
+
type: 'search',
|
5
|
+
required: true,
|
6
|
+
# If there are no results the user will likely want to change the query, so auto-focus.
|
7
|
+
autofocus: @query.presence && !@topics.presence,
|
8
|
+
placeholder: t('thredded.search.form.placeholder') %>
|
9
|
+
<button type="submit"><%= t 'thredded.search.form.btn_submit' %></button>
|
7
10
|
<% end %>
|
data/app/views/thredded/shared/{_messageboard_topics_breadcrumbs.html.erb → _breadcrumbs.html.erb}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
<ul class="thredded--navigation-breadcrumbs">
|
2
|
-
<li><%= link_to '
|
3
|
-
<% if
|
2
|
+
<li><%= link_to t('thredded.nav.all_messageboards'), messageboards_path %></li>
|
3
|
+
<% if messageboard_or_nil.try(:persisted?) %>
|
4
4
|
<li><%= link_to messageboard.name, messageboard_topics_path(messageboard) %></li>
|
5
5
|
<% end %>
|
6
6
|
</ul>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<nav class="thredded--navigation" role="navigation">
|
2
|
+
<ul class="thredded--user-navigation<%= ' thredded--user-navigation-standalone' if Thredded.standalone_layout? %>">
|
3
|
+
<% if signed_in? && Thredded.standalone_layout? %>
|
4
|
+
<li class="thredded--user-navigation--profile thredded--user-navigation--item">
|
5
|
+
<%= link_to thredded_current_user, user_path(thredded_current_user) %>
|
6
|
+
</li>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= render 'thredded/shared/nav/notification_preferences', messageboard: messageboard_or_nil %>
|
10
|
+
<%= render 'thredded/shared/nav/private_topics' %>
|
11
|
+
|
12
|
+
<% if Thredded.standalone_layout? %>
|
13
|
+
<%= render 'thredded/shared/nav/standalone' %>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
<div class="thredded--main-navigation">
|
17
|
+
<%= yield :thredded_breadcrumbs %>
|
18
|
+
<%= render 'thredded/search/form', messageboard: messageboard_or_nil %>
|
19
|
+
</div>
|
20
|
+
</nav>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<li class="thredded--user-navigation--item thredded--user-navigation--private-topics">
|
2
|
+
<%= link_to private_topics_path do %>
|
3
|
+
<%= inline_svg 'thredded/private-messages.svg', class: 'thredded--icon' %>
|
4
|
+
<%= t('thredded.nav.private_topics') %>
|
5
|
+
<% if unread_private_topics_count > 0 -%>
|
6
|
+
<span class="thredded--user-navigation--private-topics--unread">
|
7
|
+
<%= unread_private_topics_count %>
|
8
|
+
</span>
|
9
|
+
<% end -%>
|
10
|
+
<% end -%>
|
11
|
+
</li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<li class="thredded--user-navigation--standalone thredded--user-navigation--item">
|
2
|
+
<% resource_name = Thredded.user_class.name.underscore %>
|
3
|
+
<% if signed_in? %>
|
4
|
+
<%= link_to main_app.send(:"destroy_#{resource_name}_session_path"), method: :delete do %>
|
5
|
+
<span>Sign Out</span>
|
6
|
+
<% end %>
|
7
|
+
<% else %>
|
8
|
+
<%= link_to main_app.send(:"new_#{resource_name}_session_path") do %>
|
9
|
+
<span>Sign In / Register</span>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
</li>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<h2 style="margin-top:
|
2
|
-
<a href="<%= href %>"><code><%= label %></code></a>
|
1
|
+
<h2 style="margin-top: 2rem" id="<%= label.parameterize %>">
|
2
|
+
<a class="thredded--link" href="<%= href %>"><code><%= label %></code></a>
|
3
3
|
</h2>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
topic: @new_topic,
|
24
24
|
css_class: 'thredded--is-compact',
|
25
25
|
placeholder: 'Start a New Topic' %>
|
26
|
-
<%= render @
|
26
|
+
<%= render @topics %>
|
27
27
|
<% end %>
|
28
28
|
<footer>
|
29
29
|
<%= paginate @topics %>
|
@@ -31,15 +31,15 @@
|
|
31
31
|
<br>
|
32
32
|
|
33
33
|
|
34
|
-
<%= render 'section_title', label: 'topics#show', href:
|
35
|
-
<%=
|
36
|
-
<%= render 'thredded/
|
34
|
+
<%= render 'section_title', label: 'topics#show', href: @topic.path %>
|
35
|
+
<%= content_tag :section, id: dom_id(@topic), class: ['thredded--thredded--main-section', topic_css_classes(@topic)] do %>
|
36
|
+
<%= render 'thredded/topics/header', topic: @topic %>
|
37
37
|
<%= render @posts %>
|
38
38
|
<%= render 'thredded/posts/form',
|
39
39
|
messageboard: @messageboard,
|
40
40
|
topic: @topic,
|
41
41
|
post: @new_post,
|
42
|
-
button_text: '
|
42
|
+
button_text: t('thredded.posts.form.create_btn')
|
43
43
|
%>
|
44
44
|
<% end %>
|
45
45
|
|
@@ -57,7 +57,7 @@
|
|
57
57
|
messageboard: @messageboard,
|
58
58
|
topic: @topic,
|
59
59
|
post: @post,
|
60
|
-
button_text: '
|
60
|
+
button_text: t('thredded.posts.form.update_btn')
|
61
61
|
%>
|
62
62
|
<% end %>
|
63
63
|
|
@@ -72,36 +72,32 @@
|
|
72
72
|
<%= render 'thredded/private_topics/form',
|
73
73
|
private_topic: @new_private_topic,
|
74
74
|
css_class: 'thredded--is-compact',
|
75
|
-
placeholder: '
|
76
|
-
|
77
|
-
<%= render @decorated_private_topics %>
|
75
|
+
placeholder: t('thredded.private_topics.form.title_placeholder_start') %>
|
76
|
+
<%= render @private_topics %>
|
78
77
|
<% end %>
|
79
78
|
|
80
79
|
<%= render 'section_title', label: 'private_topics#new', href: new_private_topic_path %>
|
81
80
|
<section class="thredded--thredded--main-section">
|
82
81
|
<%= render 'thredded/private_topics/form',
|
83
82
|
private_topic: @new_private_topic,
|
84
|
-
placeholder: '
|
85
|
-
button_text: 'Create New Private Topic' %>
|
83
|
+
placeholder: t('thredded.private_topics.form.title_placeholder_new') %>
|
86
84
|
</section>
|
87
85
|
|
88
86
|
<%= render 'section_title', label: 'private_topics#show', href: private_topic_path(@private_topic) %>
|
89
87
|
<section class="thredded--thredded--main-section">
|
90
|
-
<%= render 'thredded/
|
91
|
-
<%= render @
|
88
|
+
<%= render 'thredded/private_topics/header', topic: @private_topic %>
|
89
|
+
<%= render @private_posts %>
|
92
90
|
<%= render 'thredded/private_posts/form',
|
93
91
|
topic: @private_topic,
|
94
92
|
post: @private_post,
|
95
|
-
button_text: '
|
93
|
+
button_text: t('thredded.private_posts.form.create_btn')
|
96
94
|
%>
|
97
95
|
</section>
|
98
96
|
|
99
97
|
<%= render 'section_title', label: 'preferences#edit', href: edit_messageboard_preferences_path(@messageboard) %>
|
100
98
|
<%= content_tag :section, class: 'thredded--thredded--main-section preferences' do %>
|
101
99
|
<%= render 'thredded/preferences/header' %>
|
102
|
-
<%= render 'thredded/preferences/form',
|
103
|
-
messageboard: @messageboard,
|
104
|
-
preference: @preference %>
|
100
|
+
<%= render 'thredded/preferences/form', preferences: @preferences %>
|
105
101
|
<% end %>
|
106
102
|
|
107
103
|
<%= render 'thredded/shared/currently_online' %>
|
@@ -2,20 +2,22 @@
|
|
2
2
|
html: { class: "thredded--form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
|
3
3
|
<ul class="thredded--form-list on-top">
|
4
4
|
<li class="title">
|
5
|
-
<%= form.label :title %>
|
6
|
-
<%= form.text_field :title,
|
5
|
+
<%= form.label :title, t('thredded.topics.form.title_label') %>
|
6
|
+
<%= form.text_field :title, placeholder: placeholder, required: true %>
|
7
7
|
</li>
|
8
8
|
|
9
9
|
<% if form.object.categories.any? %>
|
10
10
|
<li class="category">
|
11
11
|
<%= form.select :category_ids,
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
form.object.category_options,
|
13
|
+
{},
|
14
|
+
{ multiple: true, 'data-placeholder' => t('thredded.topics.form.categories_placeholder') } %>
|
15
15
|
</li>
|
16
16
|
<% end %>
|
17
17
|
|
18
|
-
<%= render 'thredded/posts/content_field',
|
18
|
+
<%= render 'thredded/posts/content_field',
|
19
|
+
form: form,
|
20
|
+
content_label: t('thredded.topics.form.content_label') %>
|
19
21
|
<%= render 'thredded/topics/topic_form_admin_options', form: form %>
|
20
22
|
|
21
23
|
<li><%= form.submit 'Create New Topic', class: 'thredded--form--submit' %></li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<header class="thredded--topic-header">
|
2
|
+
<h1 class="thredded--topic-header--title"><%= topic.title %></h1>
|
3
|
+
<cite class="thredded--topic-header--started-by">
|
4
|
+
<%= t 'thredded.topics.started_by_html',
|
5
|
+
time_ago: time_ago(topic.created_at),
|
6
|
+
user: user_link(topic.user) %>
|
7
|
+
</cite>
|
8
|
+
<% if topic.can_update? %>
|
9
|
+
<%= link_to t('thredded.topics.edit'), topic.edit_path,
|
10
|
+
class: 'thredded--topic-header--edit-topic' %>
|
11
|
+
<% end %>
|
12
|
+
</header>
|
@@ -1,14 +1,10 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag :article,
|
2
|
+
id: dom_id(topic),
|
3
|
+
class: ['thredded--topics--topic', topic_css_classes(topic)] do %>
|
2
4
|
<div class="thredded--topics--posts-count"><%= topic.posts_count %></div>
|
3
5
|
|
4
6
|
<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
|
-
%>
|
7
|
+
<%= link_to topic.title, topic.path %>
|
12
8
|
</h1>
|
13
9
|
|
14
10
|
<% if topic.categories.any? %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% topic = form.object.respond_to?(:topic) ? form.object.topic : form.object %>
|
2
|
-
<% if
|
2
|
+
<% if policy(topic).moderate? %>
|
3
3
|
<li class="thredded--form-list--admin-options">
|
4
4
|
<%= form.label :locked do %>
|
5
5
|
<%= form.check_box :locked %> Locked
|
@@ -1,38 +1,42 @@
|
|
1
|
-
<% content_for :thredded_page_title,
|
1
|
+
<% content_for :thredded_page_title, t('thredded.nav.edit_private_topic') %>
|
2
2
|
<% content_for :thredded_page_id, 'thredded--edit-topic' %>
|
3
|
-
|
4
|
-
<% content_for :thredded_breadcrumbs, capture { %>
|
3
|
+
<% content_for :thredded_breadcrumbs do %>
|
5
4
|
<ul class="thredded--navigation-breadcrumbs">
|
6
|
-
<li><%= link_to '
|
7
|
-
<li><%= link_to messageboard.name, messageboard_topics_path(messageboard, topic) %></li>
|
8
|
-
<li>
|
9
|
-
|
10
|
-
</li>
|
5
|
+
<li><%= link_to t('thredded.nav.all_messageboards'), messageboards_path %></li>
|
6
|
+
<li><%= link_to messageboard.name, messageboard_topics_path(@topic.messageboard, @topic) %></li>
|
7
|
+
<li><%= link_to @topic.title, topic_path(@topic) %></li>
|
8
|
+
<li><%= link_to t('thredded.nav.edit_topic'), edit_messageboard_topic_path(@topic.messageboard, @topic) %></li>
|
11
9
|
</ul>
|
12
|
-
<%
|
10
|
+
<% end %>
|
13
11
|
|
14
12
|
<%= thredded_page do %>
|
15
|
-
<%= form_for [messageboard, @topic],
|
13
|
+
<%= form_for [@topic.messageboard, @topic],
|
16
14
|
html: { class: 'thredded--form thredded--is-expanded', 'data-thredded-topic-form' => true } do |form| %>
|
17
15
|
<ul class="thredded--form-list on-top">
|
18
16
|
|
19
17
|
<li class="title">
|
20
|
-
<%= form.label :title %>
|
21
|
-
<%= form.text_field :title,
|
18
|
+
<%= form.label :title, t('thredded.topics.form.title_label') %>
|
19
|
+
<%= form.text_field :title,
|
20
|
+
placeholder: t('thredded.topics.form.title_placeholder'),
|
21
|
+
autofocus: true,
|
22
|
+
required: true %>
|
22
23
|
</li>
|
23
24
|
|
24
|
-
<% if
|
25
|
+
<% if form.object.categories.any? %>
|
25
26
|
<li class="category">
|
26
|
-
<%= form.select :category_ids,
|
27
|
-
|
28
|
-
|
29
|
-
{ multiple: true, 'data-placeholder' => 'Categories' } %>
|
27
|
+
<%= form.select :category_ids, form.object.category_options, {},
|
28
|
+
multiple: true,
|
29
|
+
'data-placeholder' => t('thredded.topics.form.categories_placeholder') %>
|
30
30
|
</li>
|
31
31
|
<% end %>
|
32
32
|
|
33
33
|
<%= render 'thredded/topics/topic_form_admin_options', form: form %>
|
34
34
|
|
35
|
-
<li
|
35
|
+
<li>
|
36
|
+
<button type="submit" class="thredded--form--submit">
|
37
|
+
<%= t('thredded.topics.form.update_btn') %>
|
38
|
+
</button>
|
39
|
+
</li>
|
36
40
|
<% end %>
|
37
41
|
</ul>
|
38
42
|
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<% content_for :thredded_page_title, 'Topics' %>
|
2
2
|
<% content_for :thredded_page_id, 'thredded--topics-index' %>
|
3
|
-
<% content_for :thredded_breadcrumbs, render('thredded/shared/
|
3
|
+
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
|
4
4
|
|
5
5
|
<%= thredded_page do %>
|
6
|
-
<%= content_tag :section, class: 'thredded--main-section thredded--topics' do %>
|
6
|
+
<%= content_tag :section, class: 'thredded--main-section thredded--topics', 'data-thredded-topics' => true do %>
|
7
7
|
<%= render 'thredded/topics/form',
|
8
8
|
messageboard: messageboard,
|
9
9
|
topic: @new_topic,
|
10
10
|
css_class: 'thredded--is-compact',
|
11
11
|
placeholder: 'Start a New Topic' if @new_topic %>
|
12
|
-
<%= render @
|
12
|
+
<%= render @topics %>
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<footer>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% content_for :thredded_page_title, 'Create a New Topic' %>
|
2
2
|
<% content_for :thredded_page_id, 'thredded--new-topic' %>
|
3
|
-
<% content_for :thredded_breadcrumbs, render('thredded/shared/
|
3
|
+
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
|
4
4
|
|
5
5
|
<%= thredded_page do %>
|
6
6
|
<%= render 'thredded/topics/form',
|
@@ -1,9 +1,21 @@
|
|
1
|
-
<% content_for :thredded_page_title, '
|
1
|
+
<% content_for :thredded_page_title, t('thredded.topics.search.page_title') %>
|
2
2
|
<% content_for :thredded_page_id, 'thredded--topic-search-results' %>
|
3
|
-
<% content_for :thredded_breadcrumbs, render('thredded/shared/
|
3
|
+
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
|
4
4
|
|
5
5
|
<%= thredded_page do %>
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
<% if @topics.present? %>
|
7
|
+
<p class="thredded--alert thredded--alert-success">
|
8
|
+
<%= t 'thredded.topics.search.results_message', query: "'#{@query}'" %>
|
9
|
+
</p>
|
10
|
+
<section class="thredded--main-section thredded--topics">
|
11
|
+
<%= render @topics %>
|
12
|
+
</section>
|
13
|
+
<footer>
|
14
|
+
<%= paginate @topics %>
|
15
|
+
</footer>
|
16
|
+
<% else %>
|
17
|
+
<p class="thredded--alert thredded--alert-danger">
|
18
|
+
<%= t 'thredded.topics.search.no_results_message', query: "'#{@query}'" %>
|
19
|
+
</p>
|
20
|
+
<% end %>
|
9
21
|
<% end %>
|
@@ -1,24 +1,27 @@
|
|
1
|
+
<% topic = @posts.topic %>
|
1
2
|
<% content_for :thredded_page_title, topic.title %>
|
2
|
-
<% content_for :thredded_page_id, 'thredded--
|
3
|
-
<% content_for :thredded_breadcrumbs, render('thredded/shared/
|
3
|
+
<% content_for :thredded_page_id, 'thredded--topic-show' %>
|
4
|
+
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
|
4
5
|
|
5
6
|
<%= thredded_page do %>
|
6
|
-
<%=
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
<%= content_tag :section,
|
8
|
+
id: dom_id(topic),
|
9
|
+
class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(topic)] do %>
|
10
|
+
<%= render 'thredded/topics/header', topic: topic %>
|
11
|
+
<%= render partial: 'thredded/posts/post', collection: @posts, cached: true %>
|
12
|
+
<% if policy(@new_post).create? %>
|
10
13
|
<div class="thredded--post-form--wrapper">
|
11
14
|
<h3 class="thredded--post-form--title">Add a post</h3>
|
12
15
|
<%= render 'thredded/posts/form',
|
13
|
-
topic:
|
14
|
-
post:
|
15
|
-
button_text:
|
16
|
+
topic: topic,
|
17
|
+
post: @new_post,
|
18
|
+
button_text: t('thredded.posts.form.create_btn') %>
|
16
19
|
</div>
|
17
20
|
<% end %>
|
18
21
|
|
19
|
-
<% if
|
22
|
+
<% if topic.can_destroy? %>
|
20
23
|
<div class="thredded--topic-delete--wrapper">
|
21
|
-
<%= form_tag
|
24
|
+
<%= form_tag topic.destroy_path, method: :delete, class: 'thredded--topic-delete-form' do %>
|
22
25
|
<%= submit_tag 'Delete Topic', class: 'thredded--form--submit' %>
|
23
26
|
<% end %>
|
24
27
|
</div>
|
data/bin/rails
ADDED
data/config.ru
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# i18n-tasks finds and manages missing and unused translations
|
2
|
+
# See https://github.com/glebm/i18n-tasks/blob/master/templates/config/i18n-tasks.yml
|
3
|
+
|
4
|
+
# Do not consider these keys missing:
|
5
|
+
ignore_missing:
|
6
|
+
# The kaminari gem keys
|
7
|
+
- views.pagination.*
|
8
|
+
|
9
|
+
search:
|
10
|
+
paths:
|
11
|
+
- app/
|
12
|
+
- lib/
|
13
|
+
data:
|
14
|
+
yaml:
|
15
|
+
write:
|
16
|
+
line_width: 110
|
@@ -0,0 +1,90 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
thredded:
|
4
|
+
errors:
|
5
|
+
login_required: Please sign in first.
|
6
|
+
not_authorized: You are not authorized to access this page.
|
7
|
+
private_topic_create_denied: You are not authorized to create private topics.
|
8
|
+
private_topic_not_found: This private topic does not exist.
|
9
|
+
messageboard:
|
10
|
+
last_updated_by_html: Updated %{time_ago} <cite>by %{user}</cite>
|
11
|
+
topics_and_posts_counts: "%{topics_count} topics / %{posts_count} posts"
|
12
|
+
nav:
|
13
|
+
all_messageboards: All Messageboards
|
14
|
+
edit_post: Edit Post
|
15
|
+
edit_private_topic: :thredded.nav.edit_topic
|
16
|
+
edit_topic: Edit
|
17
|
+
private_topics: Private Messages
|
18
|
+
settings: Notification Settings
|
19
|
+
posts:
|
20
|
+
delete: Delete Post
|
21
|
+
delete_confirm: Are you sure you want to delete this post?
|
22
|
+
deleted_notice: Your post has been deleted.
|
23
|
+
edit: :thredded.nav.edit_post
|
24
|
+
form:
|
25
|
+
content_label: Content
|
26
|
+
create_btn: Submit Reply
|
27
|
+
update_btn: Update Post
|
28
|
+
preferences:
|
29
|
+
edit:
|
30
|
+
page_title: :thredded.nav.settings
|
31
|
+
form:
|
32
|
+
global_preferences_label: Global Settings
|
33
|
+
messageboard_notify_on_mention:
|
34
|
+
hint: >-
|
35
|
+
When someone mentions you by your username (eg: @sam) in this messageboard you will receive an email
|
36
|
+
with the contents of that post.
|
37
|
+
label: :thredded.preferences.form.notify_on_mention.label
|
38
|
+
messageboard_preferences_label_html: Notification Settings for <em>%{messageboard}</em>
|
39
|
+
notify_on_mention:
|
40
|
+
hint: >-
|
41
|
+
When someone mentions you by your username (eg: @sam) you will receive an email with the contents of
|
42
|
+
that post.
|
43
|
+
label: "@ Notifications"
|
44
|
+
notify_on_message:
|
45
|
+
hint: When you are added to a private conversation you will receive an email with its content.
|
46
|
+
label: Private Message Notifications
|
47
|
+
submit_btn: Update Settings
|
48
|
+
title: Settings
|
49
|
+
updated_notice: Your settings have been updated.
|
50
|
+
private_posts:
|
51
|
+
form:
|
52
|
+
content_label: Message
|
53
|
+
create_btn: Send Message
|
54
|
+
private_topics:
|
55
|
+
edit: Edit
|
56
|
+
errors:
|
57
|
+
user_ids_length: Please specify at least one other user.
|
58
|
+
form:
|
59
|
+
content_label: :thredded.private_posts.form.content_label
|
60
|
+
create_btn: :thredded.private_posts.form.create_btn
|
61
|
+
title_label: :thredded.topics.form.title_label
|
62
|
+
title_placeholder_new: Write the subject of this conversation
|
63
|
+
title_placeholder_start: Start a new conversation
|
64
|
+
update_btn: Update
|
65
|
+
users_label: Participants
|
66
|
+
users_placeholder: Select users to participate in this conversation
|
67
|
+
no_private_topics:
|
68
|
+
create_btn: Start your first private conversation
|
69
|
+
title: You have no private messages.
|
70
|
+
updated_notice: Title updated
|
71
|
+
search:
|
72
|
+
form:
|
73
|
+
btn_submit: :thredded.search.form.label
|
74
|
+
label: Search
|
75
|
+
placeholder: Search Topics and Posts
|
76
|
+
topics:
|
77
|
+
deleted_notice: Topic deleted
|
78
|
+
edit: Edit Topic
|
79
|
+
form:
|
80
|
+
categories_placeholder: Categories
|
81
|
+
content_label: :thredded.posts.form.content_label
|
82
|
+
title_label: Title
|
83
|
+
title_placeholder: :thredded.topics.form.title_label
|
84
|
+
update_btn: Update Topic
|
85
|
+
search:
|
86
|
+
no_results_message: There are no results for your search - %{query}
|
87
|
+
page_title: Topics Search Results
|
88
|
+
results_message: Search Results for %{query}
|
89
|
+
started_by_html: Started %{time_ago} by %{user}
|
90
|
+
updated_notice: Topic updated
|