help_center 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/LICENSE.txt +21 -21
- data/README.md +168 -164
- data/Rakefile +10 -10
- data/app/assets/stylesheets/help_center.scss +140 -139
- data/app/controllers/help_center/application_controller.rb +37 -37
- data/app/controllers/help_center/notifications_controller.rb +19 -19
- data/app/controllers/help_center/support_categories_controller.rb +58 -58
- data/app/controllers/help_center/support_posts_controller.rb +72 -72
- data/app/controllers/help_center/support_threads_controller.rb +82 -82
- data/app/helpers/help_center/support_posts_helper.rb +29 -29
- data/app/helpers/help_center/support_threads_helper.rb +28 -28
- data/app/jobs/help_center/support_post_notification_job.rb +42 -42
- data/app/jobs/help_center/support_thread_notification_job.rb +40 -40
- data/app/mailers/help_center/user_mailer.rb +28 -28
- data/app/models/support_category.rb +16 -13
- data/app/models/support_post.rb +15 -15
- data/app/models/support_subscription.rb +19 -19
- data/app/models/support_thread.rb +85 -85
- data/app/views/help_center/support_categories/_form.html.erb +39 -35
- data/app/views/help_center/support_categories/_support_thread.html.erb +25 -25
- data/app/views/help_center/support_categories/edit.html.erb +7 -7
- data/app/views/help_center/support_categories/index.html.erb +19 -19
- data/app/views/help_center/support_categories/new.html.erb +5 -5
- data/app/views/help_center/support_categories/show.html.erb +19 -20
- data/app/views/help_center/support_posts/_form.html.erb +47 -47
- data/app/views/help_center/support_posts/_support_post.html.erb +57 -57
- data/app/views/help_center/support_posts/edit.html.erb +23 -23
- data/app/views/help_center/support_threads/_form.html.erb +49 -49
- data/app/views/help_center/support_threads/_support_thread.html.erb +25 -25
- data/app/views/help_center/support_threads/edit.html.erb +7 -7
- data/app/views/help_center/support_threads/index.html.erb +19 -19
- data/app/views/help_center/support_threads/new.html.erb +5 -5
- data/app/views/help_center/support_threads/show.html.erb +29 -42
- data/app/views/help_center/user_mailer/new_post.html.erb +9 -9
- data/app/views/help_center/user_mailer/new_thread.html.erb +9 -9
- data/app/views/layouts/help_center.html.erb +130 -128
- data/app/views/shared/_category_actions.html.erb +16 -0
- data/app/views/shared/_spacer.html.erb +1 -1
- data/app/views/shared/_thread_actions.html.erb +16 -0
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/config/locales/en.yml +56 -55
- data/config/routes.rb +24 -24
- data/db/migrate/20170417012930_create_support_categories.rb +19 -19
- data/db/migrate/20170417012931_create_support_threads.rb +18 -18
- data/db/migrate/20170417012933_create_support_subscriptions.rb +11 -11
- data/help_center.gemspec +27 -29
- data/lib/generators/help_center/controllers_generator.rb +13 -13
- data/lib/generators/help_center/helpers_generator.rb +13 -13
- data/lib/generators/help_center/views_generator.rb +13 -13
- data/lib/help_center.rb +23 -23
- data/lib/help_center/engine.rb +10 -10
- data/lib/help_center/slack.rb +22 -22
- data/lib/help_center/support_user.rb +10 -10
- data/lib/help_center/version.rb +3 -3
- metadata +7 -19
- data/help_center-0.0.1.gem +0 -0
@@ -1,49 +1,49 @@
|
|
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 form-input"} %>
|
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 form-input" %>
|
21
|
-
</div>
|
22
|
-
<div class="mb-4">
|
23
|
-
<%= f.label t('position') %>
|
24
|
-
<%= f.text_field :position, class: "form-control form-input" %>
|
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="flex justify-between 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
|
-
|
47
|
-
<%= link_to "Cancel", :back, class: "btn btn-link" %>
|
48
|
-
</div>
|
49
|
-
<% 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 form-input"} %>
|
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 form-input" %>
|
21
|
+
</div>
|
22
|
+
<div class="mb-4">
|
23
|
+
<%= f.label t('position') %>
|
24
|
+
<%= f.text_field :position, type: "number", step: "1", min: "0", class: "form-control form-input" %>
|
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="flex justify-between 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
|
+
|
47
|
+
<%= link_to "Cancel", :back, class: "btn btn-link" %>
|
48
|
+
</div>
|
49
|
+
<% 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 Thread" %>
|
2
|
-
|
3
|
-
<h1 class="mb-4 font-bold"><%= t('edit_thread') %></h1>
|
4
|
-
|
5
|
-
<div class="support_post">
|
6
|
-
<%= render 'form', posts: false %>
|
7
|
-
</div>
|
1
|
+
<%= content_for :title, "Edit Thread" %>
|
2
|
+
|
3
|
+
<h1 class="mb-4 font-bold"><%= t('edit_thread') %></h1>
|
4
|
+
|
5
|
+
<div class="support_post">
|
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('
|
2
|
-
|
3
|
-
<div class="support_post">
|
4
|
-
<%= render 'form' %>
|
5
|
-
</div>
|
1
|
+
<h1 class="mb-4 font-bold"><%= t('add_article') %></h1>
|
2
|
+
|
3
|
+
<div class="support_post">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
@@ -1,42 +1,29 @@
|
|
1
|
-
<div class="container mx-auto">
|
2
|
-
<div class="flex flex-wrap mb-8">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<
|
19
|
-
<
|
20
|
-
<
|
21
|
-
</
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
<p>Did this answer your question?</p>
|
31
|
-
<p class="thread-reaction-links">
|
32
|
-
<a>😞<a>
|
33
|
-
<a>😃<a>
|
34
|
-
</p>
|
35
|
-
<div>
|
36
|
-
-->
|
37
|
-
<% if HelpCenter.enable_comments %>
|
38
|
-
<hr>
|
39
|
-
<%= render partial: "help_center/support_posts/support_post", collection: @support_thread.support_posts.includes(:user).sorted %>
|
40
|
-
<%= render partial: "help_center/support_posts/form" if user_signed_in? %>
|
41
|
-
<% end %>
|
42
|
-
</div>
|
1
|
+
<div class="container mx-auto">
|
2
|
+
<div class="flex flex-wrap mb-8">
|
3
|
+
<%= render partial: "shared/thread_actions" if is_moderator_or_owner?(@support_thread)%>
|
4
|
+
|
5
|
+
<div class="md:w-full pr-4 pl-41">
|
6
|
+
<small class="mb-2 tracking-normal font-normal" style="color: <%= @support_thread.support_category.color %>"><%= link_to @support_thread.support_category.name, help_center.support_category_path(@support_thread.support_category) %> > <%= @support_thread.title %></small>
|
7
|
+
<h1 class="mb-4 font-bold tracking-normal"><%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h1>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<%= @support_thread.content %>
|
13
|
+
|
14
|
+
<p class="mt-6 italic text-gray-400">Last Updated: <%= @support_thread.updated_at.strftime("%B %e, %Y") %> <p>
|
15
|
+
<!--
|
16
|
+
<div class="thread-reaction">
|
17
|
+
<p>Did this answer your question?</p>
|
18
|
+
<p class="thread-reaction-links">
|
19
|
+
<a>😞<a>
|
20
|
+
<a>😃<a>
|
21
|
+
</p>
|
22
|
+
<div>
|
23
|
+
-->
|
24
|
+
<% if HelpCenter.enable_comments %>
|
25
|
+
<hr>
|
26
|
+
<%= render partial: "help_center/support_posts/support_post", collection: @support_thread.support_posts.includes(:user).sorted %>
|
27
|
+
<%= render partial: "help_center/support_posts/form" if user_signed_in? %>
|
28
|
+
<% end %>
|
29
|
+
</div>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div style="position: relative">
|
2
|
-
<%= gravatar_image_tag @support_post.user.email, style: "float: left" %>
|
3
|
-
<div style="margin-left:60px">
|
4
|
-
<p><strong><%= @support_post.user.name %></strong> <small>commented:</small></p>
|
5
|
-
<%= formatted_content @support_post.body %>
|
6
|
-
</div>
|
7
|
-
</div>
|
8
|
-
<br />
|
9
|
-
<p><%= link_to "Reply to this comment", support_thread_url(@support_post.support_thread, anchor: "support_post_#{@support_post.id}"), style: "background:#be2126; color:#fff; text-decoration:none; padding: 10px 20px" %></p>
|
1
|
+
<div style="position: relative">
|
2
|
+
<%= gravatar_image_tag @support_post.user.email, style: "float: left" %>
|
3
|
+
<div style="margin-left:60px">
|
4
|
+
<p><strong><%= @support_post.user.name %></strong> <small>commented:</small></p>
|
5
|
+
<%= formatted_content @support_post.body %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<br />
|
9
|
+
<p><%= link_to "Reply to this comment", support_thread_url(@support_post.support_thread, anchor: "support_post_#{@support_post.id}"), style: "background:#be2126; color:#fff; text-decoration:none; padding: 10px 20px" %></p>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div style="position: relative">
|
2
|
-
<%= gravatar_image_tag @support_post.user.email, style: "float: left" %>
|
3
|
-
<div style="margin-left:60px">
|
4
|
-
<p><strong><%= @support_post.user.name %></strong> <small>commented:</small></p>
|
5
|
-
<%= formatted_content @support_post.body %>
|
6
|
-
</div>
|
7
|
-
</div>
|
8
|
-
<br />
|
9
|
-
<p><%= link_to "Reply to this comment", support_thread_url(@support_post.support_thread, anchor: "support_post_#{@support_post.id}"), style: "background:#be2126; color:#fff; text-decoration:none; padding: 10px 20px" %></p>
|
1
|
+
<div style="position: relative">
|
2
|
+
<%= gravatar_image_tag @support_post.user.email, style: "float: left" %>
|
3
|
+
<div style="margin-left:60px">
|
4
|
+
<p><strong><%= @support_post.user.name %></strong> <small>commented:</small></p>
|
5
|
+
<%= formatted_content @support_post.body %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<br />
|
9
|
+
<p><%= link_to "Reply to this comment", support_thread_url(@support_post.support_thread, anchor: "support_post_#{@support_post.id}"), style: "background:#be2126; color:#fff; text-decoration:none; padding: 10px 20px" %></p>
|
@@ -1,128 +1,130 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= link_to
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<%
|
86
|
-
<%= icon "fa-fw fas", "bell" %>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
</div>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
|
1
|
+
|
2
|
+
|
3
|
+
<% if current_user && (current_user.admin? || current_user.moderator?) %>
|
4
|
+
<div class="container top-0 flex justify-between w-full z-50 bg-blue-600 text-purple-200 text-sm text-center font-brand-semibold px-4 py-3 rounded" role="alert">
|
5
|
+
<span class="text-base font-normal">Welcome moderator (<%= current_user.email %>)</span>
|
6
|
+
<div>
|
7
|
+
<%= link_to t('add_an_article'), help_center.new_support_thread_path, class: "text-gray-100 hover:text-gray-300 hover:no-underline font-semibold underline mr-4 ml-6" %>
|
8
|
+
<%= link_to t('add_category'), help_center.new_support_category_path, class: "text-gray-100 hover:text-gray-300 hover:no-underline font-semibold underline" %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<div class="container mx-auto mt-2">
|
14
|
+
<div class="flex flex-wrap help_center">
|
15
|
+
<div class="md:w-1/4 mb-4">
|
16
|
+
<div class="relative flex flex-col min-w-0 rounded break-words border bg-white border-1 border-grey-light flex-auto p-6">
|
17
|
+
<div class="support-thread-filters">
|
18
|
+
<% SupportCategory.sorted.each do |category| %>
|
19
|
+
<div class="pb-3">
|
20
|
+
<%= support_link_to help_center.support_category_path(category) do %>
|
21
|
+
<div class="mb-2 mt-3">
|
22
|
+
<span class="font-extrabold">
|
23
|
+
<%= category.name %>
|
24
|
+
</span>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
<div class="ml-2 pl-1">
|
28
|
+
<% threads = SupportThread.where(support_category_id: category.id).order(:position) %>
|
29
|
+
<% threads.each do |thread| %>
|
30
|
+
<div class="mb-2">
|
31
|
+
<%= support_link_to help_center.support_thread_path(thread) do %>
|
32
|
+
<%= thread.title %>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
</div>
|
40
|
+
<% if HelpCenter.enable_comments %>
|
41
|
+
<hr />
|
42
|
+
<div class="support-thread-filters">
|
43
|
+
<h5>
|
44
|
+
<strong>
|
45
|
+
<%= t('filters') %>
|
46
|
+
</strong>
|
47
|
+
</h5>
|
48
|
+
<div>
|
49
|
+
<%= support_link_to help_center.support_threads_path, exact: true do %>
|
50
|
+
<%= icon "fa-fw fas", "bars" %>
|
51
|
+
<%= t('.all_threads') %>
|
52
|
+
<% end %>
|
53
|
+
</div>
|
54
|
+
<% if user_signed_in? %>
|
55
|
+
<div>
|
56
|
+
<%= support_link_to help_center.mine_support_threads_path do %><%= icon "fa-fw far", "user-circle" %>
|
57
|
+
<%= t('.my_questions') %>
|
58
|
+
<% end %>
|
59
|
+
</div>
|
60
|
+
<div>
|
61
|
+
<%= support_link_to help_center.participating_support_threads_path do %>
|
62
|
+
<%= icon "fa-fw far", "comments" %>
|
63
|
+
<%= t('.participating') %>
|
64
|
+
<% end %>
|
65
|
+
</div>
|
66
|
+
<% end %>
|
67
|
+
<div>
|
68
|
+
<%= support_link_to help_center.answered_support_threads_path do %>
|
69
|
+
<%= icon "fa-fw fas", "check" %>
|
70
|
+
<%= t('.answered') %>
|
71
|
+
<% end %>
|
72
|
+
</div>
|
73
|
+
<div>
|
74
|
+
<%= support_link_to help_center.unanswered_support_threads_path do %>
|
75
|
+
<%= icon "fa-fw fas", "question" %>
|
76
|
+
<%= t('.unanswered') %>
|
77
|
+
<% end %>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
<% if @support_thread.present? && @support_thread.persisted? %>
|
81
|
+
<hr />
|
82
|
+
<%# User has not posted in the thread or subscribed %>
|
83
|
+
<h5><%= t('.notifications') %></h5>
|
84
|
+
<%= link_to help_center.support_thread_notifications_path(@support_thread), method: :post, class: "btn-secondary btn-sm btn-block mb-2" do %>
|
85
|
+
<% if @support_thread.subscribed? current_user %>
|
86
|
+
<%= icon "fa-fw fas", "bell-slash" %> <%= t('.unsubscribe') %>
|
87
|
+
<% else %>
|
88
|
+
<%= icon "fa-fw fas", "bell" %>
|
89
|
+
<%= t('.suscribe') %>
|
90
|
+
<% end %>
|
91
|
+
<% end %>
|
92
|
+
<small><%= @support_thread.subscribed_reason(current_user) %></small>
|
93
|
+
<% end %>
|
94
|
+
<% end %>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div class="md:w-3/4 pl-4 mb-3">
|
98
|
+
<div class="relative flex flex-col min-w-0 rounded break-words bg-white flex-auto p-6">
|
99
|
+
<%# Show first article by default on home pag %>
|
100
|
+
<% if current_page?(help_center_path) %>
|
101
|
+
<% if SupportCategory.all.count > 0 %>
|
102
|
+
<% @support_thread = SupportCategory.sorted.first.support_threads.sorted.first %>
|
103
|
+
<div class="container mx-auto">
|
104
|
+
<div class="flex flex-wrap mb-8">
|
105
|
+
<% if is_moderator_or_owner?(@support_thread) %>
|
106
|
+
<div class="flex w-full pr-4 pl-4 justify-end">
|
107
|
+
<%= link_to icon("fas","pencil"), help_center.edit_support_thread_path(@support_thread),
|
108
|
+
class: "text-muted",
|
109
|
+
data: { toggle: "tooltip", placement: "left" },
|
110
|
+
title: t('edit_this_thread') %>
|
111
|
+
</div>
|
112
|
+
<% end %>
|
113
|
+
<div class="md:w-full pr-4 pl-41">
|
114
|
+
<small class="mb-2"><%= support_category_link(@support_thread.support_category) %> > <%= @support_thread.title %></small>
|
115
|
+
<h1><%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h1>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
<%= @support_thread.content %>
|
120
|
+
</div>
|
121
|
+
<% end %>
|
122
|
+
<% end %>
|
123
|
+
|
124
|
+
<%= yield %>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<% parent_layout("application") %>
|