help_center 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/LICENSE.txt +21 -21
  4. data/README.md +168 -164
  5. data/Rakefile +10 -10
  6. data/app/assets/stylesheets/help_center.scss +140 -139
  7. data/app/controllers/help_center/application_controller.rb +37 -37
  8. data/app/controllers/help_center/notifications_controller.rb +19 -19
  9. data/app/controllers/help_center/support_categories_controller.rb +58 -58
  10. data/app/controllers/help_center/support_posts_controller.rb +72 -72
  11. data/app/controllers/help_center/support_threads_controller.rb +82 -82
  12. data/app/helpers/help_center/support_posts_helper.rb +29 -29
  13. data/app/helpers/help_center/support_threads_helper.rb +28 -28
  14. data/app/jobs/help_center/support_post_notification_job.rb +42 -42
  15. data/app/jobs/help_center/support_thread_notification_job.rb +40 -40
  16. data/app/mailers/help_center/user_mailer.rb +28 -28
  17. data/app/models/support_category.rb +16 -13
  18. data/app/models/support_post.rb +15 -15
  19. data/app/models/support_subscription.rb +19 -19
  20. data/app/models/support_thread.rb +85 -85
  21. data/app/views/help_center/support_categories/_form.html.erb +39 -35
  22. data/app/views/help_center/support_categories/_support_thread.html.erb +25 -25
  23. data/app/views/help_center/support_categories/edit.html.erb +7 -7
  24. data/app/views/help_center/support_categories/index.html.erb +19 -19
  25. data/app/views/help_center/support_categories/new.html.erb +5 -5
  26. data/app/views/help_center/support_categories/show.html.erb +19 -20
  27. data/app/views/help_center/support_posts/_form.html.erb +47 -47
  28. data/app/views/help_center/support_posts/_support_post.html.erb +57 -57
  29. data/app/views/help_center/support_posts/edit.html.erb +23 -23
  30. data/app/views/help_center/support_threads/_form.html.erb +49 -49
  31. data/app/views/help_center/support_threads/_support_thread.html.erb +25 -25
  32. data/app/views/help_center/support_threads/edit.html.erb +7 -7
  33. data/app/views/help_center/support_threads/index.html.erb +19 -19
  34. data/app/views/help_center/support_threads/new.html.erb +5 -5
  35. data/app/views/help_center/support_threads/show.html.erb +29 -42
  36. data/app/views/help_center/user_mailer/new_post.html.erb +9 -9
  37. data/app/views/help_center/user_mailer/new_thread.html.erb +9 -9
  38. data/app/views/layouts/help_center.html.erb +130 -128
  39. data/app/views/shared/_category_actions.html.erb +16 -0
  40. data/app/views/shared/_spacer.html.erb +1 -1
  41. data/app/views/shared/_thread_actions.html.erb +16 -0
  42. data/bin/console +14 -14
  43. data/bin/setup +8 -8
  44. data/config/locales/en.yml +56 -55
  45. data/config/routes.rb +24 -24
  46. data/db/migrate/20170417012930_create_support_categories.rb +19 -19
  47. data/db/migrate/20170417012931_create_support_threads.rb +18 -18
  48. data/db/migrate/20170417012933_create_support_subscriptions.rb +11 -11
  49. data/help_center.gemspec +27 -29
  50. data/lib/generators/help_center/controllers_generator.rb +13 -13
  51. data/lib/generators/help_center/helpers_generator.rb +13 -13
  52. data/lib/generators/help_center/views_generator.rb +13 -13
  53. data/lib/help_center.rb +23 -23
  54. data/lib/help_center/engine.rb +10 -10
  55. data/lib/help_center/slack.rb +22 -22
  56. data/lib/help_center/support_user.rb +10 -10
  57. data/lib/help_center/version.rb +3 -3
  58. metadata +7 -19
  59. data/help_center-0.0.1.gem +0 -0
@@ -1,35 +1,39 @@
1
- <%= form_for @category,
2
- url: (@category.persisted? ? help_center.support_category_path(@category) : help_center.support_categories_path),
3
- html: { data: {behavior: "comment-form"} } do |f| %>
4
- <% if @category.errors.any? %>
5
- <div id="error_explanation">
6
- <h2><%= pluralize(@category.errors.count, "error") %> prohibited this support_thread from being saved:</h2>
7
- <ul>
8
- <% @category.errors.full_messages.each do |message| %>
9
- <li><%= message %></li>
10
- <% end %>
11
- </ul>
12
- </div>
13
- <% end %>
14
- <div class="mb-4">
15
- <%= f.label t('title') %>
16
- <%= f.text_field :name, placeholder: t('how_do_i'), class: "form-control form-input" %>
17
- </div>
18
- <div class="mb-4">
19
- <%= f.label t('position') %>
20
- <%= f.text_field :position, class: "form-control form-input" %>
21
- </div>
22
- <div class="mb-4">
23
- <%= f.label t('color') %>
24
- <%= f.color_field :color, class: "form-control form-input" %>
25
- </div>
26
- <div class="flex justify-between mb-4 text-right">
27
- <% if f.object.new_record? %>
28
- <%= f.button t('add'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
29
- <% else %>
30
- <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
31
- <% end %>
32
-
33
- <%= link_to "Cancel", :back, class: "btn btn-link" %>
34
- </div>
35
- <% end %>
1
+ <%= form_for @category,
2
+ url: (@category.persisted? ? help_center.support_category_path(@category) : help_center.support_categories_path),
3
+ html: { data: {behavior: "comment-form"} } do |f| %>
4
+ <% if @category.errors.any? %>
5
+ <div id="error_explanation">
6
+ <h2><%= pluralize(@category.errors.count, "error") %> prohibited this support_thread from being saved:</h2>
7
+ <ul>
8
+ <% @category.errors.full_messages.each do |message| %>
9
+ <li><%= message %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
14
+ <div class="mb-4">
15
+ <%= f.label t('title') %>
16
+ <%= f.text_field :name, placeholder: t('how_do_i'), class: "form-control form-input" %>
17
+ </div>
18
+ <div class="mb-4">
19
+ <%= f.label t('position') %>
20
+ <%= f.text_field :position, type: "number", step: "1", min: "0", class: "form-control form-input" %>
21
+ </div>
22
+ <div class="mb-4">
23
+ <%= f.label t('color') %>
24
+ <%= f.color_field :color, class: "form-control form-input" %>
25
+ </div>
26
+ <div class="mb-4">
27
+ <%= f.label t('title') %>
28
+ <%= f.rich_text_area :description, placeholder: t('how_do_i'), class: "form-control form-input" %>
29
+ </div>
30
+ <div class="flex justify-between mb-4 text-right">
31
+ <% if f.object.new_record? %>
32
+ <%= f.button t('add'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
33
+ <% else %>
34
+ <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
35
+ <% end %>
36
+
37
+ <%= link_to "Cancel", :back, class: "btn btn-link" %>
38
+ </div>
39
+ <% end %>
@@ -1,25 +1,25 @@
1
- <%= cache support_thread do %>
2
- <div class="support-thread">
3
- <div class="flex flex-wrap">
4
- <div class="flex-grow mb-2">
5
- <%= link_to help_center.support_thread_path(support_thread) do %>
6
- <h4>
7
- <%= support_thread.title %>
8
- </h4>
9
- <p class="text-gray-500 hover:text-gray-700"><%= truncate(support_thread.content.to_plain_text, length: 200) %></p>
10
- <div class="thread-details mt-2">
11
- <%= t('content_updated_at', update_time: time_ago_in_words(support_thread.created_at)) %>
12
- </div>
13
- <% end %>
14
- </div>
15
- <% if HelpCenter.enable_comments %>
16
- <div class="sm:w-1/6 pr-4 pl-4 text-center">
17
- <%= link_to help_center.support_thread_path(support_thread), class: "thread-posts-count" do %>
18
- <span class="count"><%= support_thread.support_posts_count %></span>
19
- <small><%= t("post", count: support_thread.support_posts_count) %></small>
20
- <% end %>
21
- </div>
22
- <% end %>
23
- </div>
24
- </div>
25
- <% end %>
1
+ <%= cache support_thread do %>
2
+ <div class="support-thread">
3
+ <div class="flex flex-wrap">
4
+ <div class="flex-grow mb-2">
5
+ <%= link_to help_center.support_thread_path(support_thread) do %>
6
+ <h4>
7
+ <%= support_thread.title %>
8
+ </h4>
9
+ <p class="text-gray-500 hover:text-gray-700"><%= truncate(support_thread.content.to_plain_text, length: 200) %></p>
10
+ <div class="thread-details mt-2">
11
+ <%= t('content_updated_at', update_time: time_ago_in_words(support_thread.created_at)) %>
12
+ </div>
13
+ <% end %>
14
+ </div>
15
+ <% if HelpCenter.enable_comments %>
16
+ <div class="sm:w-1/6 pr-4 pl-4 text-center">
17
+ <%= link_to help_center.support_thread_path(support_thread), class: "thread-posts-count" do %>
18
+ <span class="count"><%= support_thread.support_posts_count %></span>
19
+ <small><%= t("post", count: support_thread.support_posts_count) %></small>
20
+ <% end %>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
@@ -1,7 +1,7 @@
1
- <%= content_for :title, "Edit Category" %>
2
-
3
- <h1 class="mb-4 font-bold"><%= t('edit_category') %></h1>
4
-
5
- <div class="support_category">
6
- <%= render 'form', posts: false %>
7
- </div>
1
+ <%= content_for :title, "Edit Category" %>
2
+
3
+ <h1 class="mb-4 font-bold"><%= t('edit_category') %></h1>
4
+
5
+ <div class="support_category">
6
+ <%= render 'form', posts: false %>
7
+ </div>
@@ -1,19 +1,19 @@
1
- <% if @support_threads.none? %>
2
- <div><%= t('search_not_found') %>. <%= t('check_out') %> <%= link_to t('latest_questions'), help_center.support_threads_path %> <%= t('instead') %> </div>
3
- <% else %>
4
- <div class="container mx-auto">
5
- <% if request.url.include?('category') %>
6
- <%# If category, list all articles %>
7
- <div class="w-1/62 text-left p-0">
8
- <h3> <%= @support_threads.first.support_category.name %></h3>
9
- </div>
10
- <hr>
11
- <%= render partial: "help_center/support_threads/support_thread", collection: @support_threads, spacer_template: "shared/spacer" %>
12
- <div class="support-threads-nav text-center">
13
- <%== pagy_nav(@pagy) %>
14
- </div>
15
- <% else %>
16
- <%# Set default index here %>
17
- <% end %>
18
- </div>
19
- <% end %>
1
+ <% if @support_threads.none? %>
2
+ <div><%= t('search_not_found') %>. <%= t('check_out') %> <%= link_to t('latest_questions'), help_center.support_threads_path %> <%= t('instead') %> </div>
3
+ <% else %>
4
+ <div class="container mx-auto">
5
+ <% if request.url.include?('category') %>
6
+ <%# If category, list all articles %>
7
+ <div class="w-1/62 text-left p-0">
8
+ <h3> <%= @support_threads.first.support_category.name %></h3>
9
+ </div>
10
+ <hr>
11
+ <%= render partial: "help_center/support_threads/support_thread", collection: @support_threads, spacer_template: "shared/spacer" %>
12
+ <div class="support-threads-nav text-center">
13
+ <%== pagy_nav(@pagy) %>
14
+ </div>
15
+ <% else %>
16
+ <%# Set default index here %>
17
+ <% end %>
18
+ </div>
19
+ <% end %>
@@ -1,5 +1,5 @@
1
- <h1 class="mb-4 font-bold"><%= t('add_an_article') %></h1>
2
-
3
- <div class="support_post">
4
- <%= render 'form' %>
5
- </div>
1
+ <h1 class="mb-4 font-bold"><%= t('add_category') %></h1>
2
+
3
+ <div class="support_post">
4
+ <%= render 'form' %>
5
+ </div>
@@ -1,20 +1,19 @@
1
- <div class="flex flex-wrap mb-8">
2
- <% if is_moderator_or_owner?(@category) %>
3
- <div class="mb-4 bg-purple-600 flex w-full px-4 py-2 text-sm pr-4 pl-4 justify-end">
4
- <span class="mr-4 text-gray-200"><i class="far fa-sort-amount-down"></i> <%= @category.position %> </span>
5
- <%= link_to icon("fas","pencil") + " Edit", help_center.edit_support_category_path(@category),
6
- class: "text-gray-200",
7
- data: { toggle: "tooltip", placement: "left" },
8
- title: t('edit_this_thread') %>
9
- <%= link_to icon("fas","trash") + " Delete", help_center.support_category_path(@category),
10
- method: :delete,
11
- class: "text-gray-200 ml-4",
12
- data: { toggle: "tooltip", placement: "left", confirm: "Are you sure?" },
13
- title: t('delete_category') %>
14
- </div>
15
- <% end %>
16
- <div class="md:w-full pr-4 pl-41">
17
- <h1 class="mb-4 font-bold"> <%= @category.name %></h1>
18
- </div>
19
-
20
- </div>
1
+ <div class="flex flex-wrap mb-8">
2
+ <%= render partial: "shared/category_actions" if is_moderator_or_owner?(@category)%>
3
+ <div class="md:w-full pr-4 pl-41">
4
+ <h1 class="mb-4 font-bold tracking-normal"> <%= @category.name %></h1>
5
+ <% if @category.description %>
6
+ <%= @category.description %>
7
+ <% end %>
8
+ <div class="flex flex-col items-center">
9
+ <% @category.support_threads.sorted.each do |thread| %>
10
+
11
+ <%= link_to help_center.support_thread_path(thread), class: "text-base font-semibold py-4 border-b w-full flex justify-between hover:bg-gray-200 px-4" do %>
12
+ <%= thread.title %> <i class="fas fa-arrow-right"></i>
13
+ <% end %>
14
+
15
+ <% end %>
16
+ </div>
17
+ </div>
18
+
19
+ </div>
@@ -1,47 +1,47 @@
1
- <%= form_for @support_thread,
2
- url: (@support_thread.persisted? ? help_center.support_thread_path(@support_thread) : help_center.support_threads_path),
3
- html: { data: {behavior: "comment-form"} } do |f| %>
4
- <% if @support_thread.errors.any? %>
5
- <div id="error_explanation">
6
- <h2><%= pluralize(@support_thread.errors.count, "error") %> prohibited this support_thread from being saved:</h2>
7
- <ul>
8
- <% @support_thread.errors.full_messages.each do |message| %>
9
- <li><%= message %></li>
10
- <% end %>
11
- </ul>
12
- </div>
13
- <% end %>
14
- <div class="mb-4">
15
- <%= f.label :support_category_id, t('choose_a_category') %>
16
- <%= f.collection_select :support_category_id, SupportCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "form-control"} %>
17
- </div>
18
- <div class="mb-4">
19
- <%= f.label t('title') %>
20
- <%= f.text_field :title, placeholder: t('how_do_i'), class: "form-control" %>
21
- </div>
22
- <div class="mb-4">
23
- <%= f.label t('position') %>
24
- <%= f.text_field :position, class: "form-control" %>
25
- </div>
26
- <div class="mb-4">
27
- <%= f.label t('content') %>
28
- <%= f.rich_text_area :content %>
29
- </div>
30
- <% if local_assigns.fetch(:posts, true) %>
31
- <% if !f.object.new_record? %>
32
- <%= f.fields_for :support_posts do |p| %>
33
- <div class="mb-4">
34
- <%= p.label :body, t('what_help_needed') %>
35
- <%= p.text_area :body, placeholder: t('add_a_comment'), rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
36
- </div>
37
- <% end %>
38
- <% end %>
39
- <% end %>
40
- <div class="mb-4 text-right">
41
- <% if f.object.new_record? %>
42
- <%= f.button t('add'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
43
- <% else %>
44
- <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
45
- <% end %>
46
- </div>
47
- <% end %>
1
+ <%= form_for @support_thread,
2
+ url: (@support_thread.persisted? ? help_center.support_thread_path(@support_thread) : help_center.support_threads_path),
3
+ html: { data: {behavior: "comment-form"} } do |f| %>
4
+ <% if @support_thread.errors.any? %>
5
+ <div id="error_explanation">
6
+ <h2><%= pluralize(@support_thread.errors.count, "error") %> prohibited this support_thread from being saved:</h2>
7
+ <ul>
8
+ <% @support_thread.errors.full_messages.each do |message| %>
9
+ <li><%= message %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
14
+ <div class="mb-4">
15
+ <%= f.label :support_category_id, t('choose_a_category') %>
16
+ <%= f.collection_select :support_category_id, SupportCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "form-control"} %>
17
+ </div>
18
+ <div class="mb-4">
19
+ <%= f.label t('title') %>
20
+ <%= f.text_field :title, placeholder: t('how_do_i'), class: "form-control" %>
21
+ </div>
22
+ <div class="mb-4">
23
+ <%= f.label t('position') %>
24
+ <%= f.text_field :position, class: "form-control" %>
25
+ </div>
26
+ <div class="mb-4">
27
+ <%= f.label t('content') %>
28
+ <%= f.rich_text_area :content %>
29
+ </div>
30
+ <% if local_assigns.fetch(:posts, true) %>
31
+ <% if !f.object.new_record? %>
32
+ <%= f.fields_for :support_posts do |p| %>
33
+ <div class="mb-4">
34
+ <%= p.label :body, t('what_help_needed') %>
35
+ <%= p.text_area :body, placeholder: t('add_a_comment'), rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
36
+ </div>
37
+ <% end %>
38
+ <% end %>
39
+ <% end %>
40
+ <div class="mb-4 text-right">
41
+ <% if f.object.new_record? %>
42
+ <%= f.button t('add'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
43
+ <% else %>
44
+ <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
45
+ <% end %>
46
+ </div>
47
+ <% end %>
@@ -1,57 +1,57 @@
1
- <%# We don't currently cache the support posts because they have permissions to deal with %>
2
- <%= content_tag :div, id: dom_id(support_post), class: support_post_classes(support_post) do %>
3
- <div class="py-3 px-6 mb-0 bg-grey-lighter border-b-1 border-grey-light text-grey-darkest">
4
- <% if is_moderator_or_owner?(support_post) %>
5
- <div class="float-right">
6
- <%= link_to icon("fas","edit"), simple_discussion.edit_support_thread_support_post_path(@support_thread, support_post),
7
- class: "text-muted",
8
- data: { toggle: "tooltip", placement: "left" },
9
- title: t('edit_this_post')
10
- %>
11
- &nbsp;
12
- <%= link_to icon("fas","trash"), simple_discussion.support_thread_support_post_path(@support_thread, support_post),
13
- class: "text-muted",
14
- method: :delete,
15
- data: { toggle: "tooltip", placement: "left", confirm: "Are you sure you want to delete this post?" },
16
- title: t('edit_this_post')
17
- %>
18
- </div>
19
- <% end %>
20
- <div>
21
- <%= avatar_tag(support_post.user.email) %>
22
- <strong class="support-post-user">
23
- <%= support_post.user.name %> <%= support_user_badge(support_post.user) %>
24
- </strong>
25
- <small>
26
- <%= t('commented_on') %>
27
- <%= link_to support_post.created_at.strftime("%b %d, %Y"), simple_discussion.support_thread_path(@support_thread, anchor: "support_post_#{support_post.id}") %>:
28
- </small>
29
- </div>
30
- </div>
31
- <div class="flex-auto p-6">
32
- <%= formatted_content support_post.body %>
33
- </div>
34
- <% if @support_thread.solved? && support_post.solved? %>
35
- <div class="py-3 px-6 bg-grey-lighter border-t-1 border-grey-light">
36
- <div class="pull-right">
37
- <strong class="text-green"><%= icon("fas","check") %> <%= t('solved') %></strong>
38
- <% if is_moderator_or_owner?(@support_thread) %>
39
- <small>
40
- <%= link_to t('undo'), simple_discussion.unsolved_support_thread_support_post_path(@support_thread, support_post), method: :put %>
41
- </small>
42
- <% end %>
43
- </div>
44
- </div>
45
- <% elsif is_moderator_or_owner?(@support_thread) %>
46
- <div class="py-3 px-6 bg-grey-lighter border-t-1 border-grey-light">
47
- <div class="pull-right">
48
- <small>
49
- <%= link_to simple_discussion.solved_support_thread_support_post_path(@support_thread, support_post), method: :put do %>
50
- <%= icon("fas","fas","check") %>
51
- <%= t('this_solved_my_question') %>
52
- <% end %>
53
- </small>
54
- </div>
55
- </div>
56
- <% end %>
57
- <% end %>
1
+ <%# We don't currently cache the support posts because they have permissions to deal with %>
2
+ <%= content_tag :div, id: dom_id(support_post), class: support_post_classes(support_post) do %>
3
+ <div class="py-3 px-6 mb-0 bg-grey-lighter border-b-1 border-grey-light text-grey-darkest">
4
+ <% if is_moderator_or_owner?(support_post) %>
5
+ <div class="float-right">
6
+ <%= link_to icon("fas","edit"), simple_discussion.edit_support_thread_support_post_path(@support_thread, support_post),
7
+ class: "text-muted",
8
+ data: { toggle: "tooltip", placement: "left" },
9
+ title: t('edit_this_post')
10
+ %>
11
+ &nbsp;
12
+ <%= link_to icon("fas","trash"), simple_discussion.support_thread_support_post_path(@support_thread, support_post),
13
+ class: "text-muted",
14
+ method: :delete,
15
+ data: { toggle: "tooltip", placement: "left", confirm: "Are you sure you want to delete this post?" },
16
+ title: t('edit_this_post')
17
+ %>
18
+ </div>
19
+ <% end %>
20
+ <div>
21
+ <%= avatar_tag(support_post.user.email) %>
22
+ <strong class="support-post-user">
23
+ <%= support_post.user.name %> <%= support_user_badge(support_post.user) %>
24
+ </strong>
25
+ <small>
26
+ <%= t('commented_on') %>
27
+ <%= link_to support_post.created_at.strftime("%b %d, %Y"), simple_discussion.support_thread_path(@support_thread, anchor: "support_post_#{support_post.id}") %>:
28
+ </small>
29
+ </div>
30
+ </div>
31
+ <div class="flex-auto p-6">
32
+ <%= formatted_content support_post.body %>
33
+ </div>
34
+ <% if @support_thread.solved? && support_post.solved? %>
35
+ <div class="py-3 px-6 bg-grey-lighter border-t-1 border-grey-light">
36
+ <div class="pull-right">
37
+ <strong class="text-green"><%= icon("fas","check") %> <%= t('solved') %></strong>
38
+ <% if is_moderator_or_owner?(@support_thread) %>
39
+ <small>
40
+ <%= link_to t('undo'), simple_discussion.unsolved_support_thread_support_post_path(@support_thread, support_post), method: :put %>
41
+ </small>
42
+ <% end %>
43
+ </div>
44
+ </div>
45
+ <% elsif is_moderator_or_owner?(@support_thread) %>
46
+ <div class="py-3 px-6 bg-grey-lighter border-t-1 border-grey-light">
47
+ <div class="pull-right">
48
+ <small>
49
+ <%= link_to simple_discussion.solved_support_thread_support_post_path(@support_thread, support_post), method: :put do %>
50
+ <%= icon("fas","fas","check") %>
51
+ <%= t('this_solved_my_question') %>
52
+ <% end %>
53
+ </small>
54
+ </div>
55
+ </div>
56
+ <% end %>
57
+ <% end %>
@@ -1,23 +1,23 @@
1
- <p><small><%= link_to "← Back to the thread", help_center.support_thread_path(@support_thread) %></small></p>
2
- <h2><%= content_tag :span, "Pinned", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h2>
3
- <p class="thread-details">
4
- <strong><%= category_link(@support_thread.support_category) %></strong>
5
- • <%= t('asked_time_ago', time: time_ago_in_words(@support_thread.created_at), author: @support_thread.user.name) %>
6
- </p>
7
- </p>
8
- <br />
9
- <%= content_tag :div, id: dom_id(@support_post), class: support_post_classes(@support_post) do %>
10
- <div class="py-3 px-6 mb-0 bg-grey-lighter border-b-1 border-grey-light text-grey-darkest">
11
- <div>
12
- <%= avatar_tag(@support_post.user.email) %>
13
- <strong class="support-post-user"><%= @support_post.user.name %></strong>
14
- <small>
15
- <%= t('commented_on')%>
16
- <%= link_to @support_post.created_at.strftime("%b %d, %Y"), simple_discussion.support_thread_url(@support_thread, anchor: "support_post_#{@support_post.id}") %>:
17
- </small>
18
- </div>
19
- </div>
20
- <div class="flex-auto p-6">
21
- <%= render "form" %>
22
- </div>
23
- <% end %>
1
+ <p><small><%= link_to "← Back to the thread", help_center.support_thread_path(@support_thread) %></small></p>
2
+ <h2><%= content_tag :span, "Pinned", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h2>
3
+ <p class="thread-details">
4
+ <strong><%= category_link(@support_thread.support_category) %></strong>
5
+ • <%= t('asked_time_ago', time: time_ago_in_words(@support_thread.created_at), author: @support_thread.user.name) %>
6
+ </p>
7
+ </p>
8
+ <br />
9
+ <%= content_tag :div, id: dom_id(@support_post), class: support_post_classes(@support_post) do %>
10
+ <div class="py-3 px-6 mb-0 bg-grey-lighter border-b-1 border-grey-light text-grey-darkest">
11
+ <div>
12
+ <%= avatar_tag(@support_post.user.email) %>
13
+ <strong class="support-post-user"><%= @support_post.user.name %></strong>
14
+ <small>
15
+ <%= t('commented_on')%>
16
+ <%= link_to @support_post.created_at.strftime("%b %d, %Y"), simple_discussion.support_thread_url(@support_thread, anchor: "support_post_#{@support_post.id}") %>:
17
+ </small>
18
+ </div>
19
+ </div>
20
+ <div class="flex-auto p-6">
21
+ <%= render "form" %>
22
+ </div>
23
+ <% end %>