help_center 0.0.6 → 0.1.0
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.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -1
- data/.gitignore +3 -0
- data/CHANGELOG.md +23 -0
- data/README.md +162 -168
- data/app/controllers/help_center/support_categories_controller.rb +2 -6
- data/app/controllers/help_center/support_posts_controller.rb +4 -2
- data/app/controllers/help_center/support_threads_controller.rb +4 -2
- data/app/models/support_category.rb +1 -1
- data/app/views/help_center/support_categories/_form.html.erb +11 -11
- data/app/views/help_center/support_categories/edit.html.erb +7 -3
- data/app/views/help_center/support_categories/index.html.erb +44 -19
- data/app/views/help_center/support_categories/new.html.erb +7 -3
- data/app/views/help_center/support_categories/show.html.erb +39 -16
- data/app/views/help_center/support_threads/_form.html.erb +50 -49
- data/app/views/help_center/support_threads/edit.html.erb +6 -2
- data/app/views/help_center/support_threads/index.html.erb +0 -19
- data/app/views/help_center/support_threads/new.html.erb +9 -5
- data/app/views/help_center/support_threads/show.html.erb +14 -29
- data/app/views/layouts/help_center.html.erb +58 -130
- data/app/views/shared/_admin_actions.html.erb +9 -0
- data/app/views/shared/_category_actions.html.erb +6 -6
- data/app/views/shared/_sidebar_actions.html.erb +22 -0
- data/app/views/shared/_thread_actions.html.erb +15 -15
- data/config/locales/en.yml +2 -0
- data/lib/help_center/version.rb +3 -3
- metadata +5 -4
- data/app/assets/stylesheets/help_center.scss +0 -140
@@ -1,19 +1,42 @@
|
|
1
|
-
|
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 %>
|
1
|
+
<%= render partial: "shared/category_actions" if is_moderator_or_owner?(@category)%>
|
14
2
|
|
3
|
+
<div class="px-4 py-10 mb-6 text-white bg-gray-100 text-4xl text-4xl md:px-20 lg:px-40 xl:px-56 font-bold">
|
4
|
+
<h1 class="text-gray-900"><%= @category.name %></h1>
|
5
|
+
<%= @category.description if @category.description %>
|
6
|
+
</div>
|
7
|
+
<div class="px-4 pt-4 md:px-20 lg:px-40 xl:px-56">
|
8
|
+
<%= link_to help_center.support_categories_path, class: "flex text-base mb-6 font-medium text-gray-600" do %>
|
9
|
+
← Back
|
15
10
|
<% end %>
|
16
|
-
|
11
|
+
<div class="bg-white shadow overflow-hidden sm:rounded-md">
|
12
|
+
<ul role="list" class="divide-y divide-gray-200">
|
13
|
+
<% @category.support_threads.sorted.each do |thread| %>
|
14
|
+
<li>
|
15
|
+
<%= link_to help_center.support_thread_path(thread), class: "block hover:bg-gray-50" do %>
|
16
|
+
<div class="flex items-center px-4 py-4 sm:px-6">
|
17
|
+
<div class="min-w-0 flex-1 flex items-center">
|
18
|
+
<div class="flex-shrink-0">
|
19
|
+
</div>
|
20
|
+
<div class="min-w-0 flex-1 px-4 md:grid md:grid-cols-2 md:gap-4">
|
21
|
+
<div>
|
22
|
+
<p class="text-base font-medium text-gray-600 truncate"><%= thread.title %></p>
|
23
|
+
<p class="mt-2 flex items-center text-sm text-gray-400">
|
24
|
+
<span class="truncate"><%#= category.description %></span>
|
25
|
+
</p>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<div>
|
31
|
+
<!-- Heroicon name: solid/chevron-right -->
|
32
|
+
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
33
|
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
34
|
+
</svg>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
</li>
|
39
|
+
<% end %>
|
40
|
+
</ul>
|
17
41
|
</div>
|
18
|
-
|
19
|
-
</div>
|
42
|
+
</div>
|
@@ -1,49 +1,50 @@
|
|
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: "
|
17
|
-
</div>
|
18
|
-
<div class="mb-4">
|
19
|
-
<%= f.label t('title') %>
|
20
|
-
<%= f.text_field :title, placeholder: t('how_do_i'), class: "
|
21
|
-
</div>
|
22
|
-
<div class="mb-4">
|
23
|
-
<%= f.label t('position') %>
|
24
|
-
<%= f.text_field :position, type: "number", step: "1", min: "0", class: "
|
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: "
|
43
|
-
<% else %>
|
44
|
-
<%= f.button t('update'), class: "
|
45
|
-
<% end %>
|
46
|
-
|
47
|
-
<%= link_to "Cancel", :back, class: "
|
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'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-2" %>
|
16
|
+
<%= f.collection_select :support_category_id, SupportCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border border-gray-300 rounded-md p-2"} %>
|
17
|
+
</div>
|
18
|
+
<div class="mb-4">
|
19
|
+
<%= f.label t('title'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-2" %>
|
20
|
+
<%= f.text_field :title, placeholder: t('how_do_i'), class: "shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm border border-gray-300 rounded-md p-2" %>
|
21
|
+
</div>
|
22
|
+
<div class="mb-4">
|
23
|
+
<%= f.label t('position'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-2" %>
|
24
|
+
<%= f.text_field :position, type: "number", step: "1", min: "0", class: "shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm border border-gray-300 rounded-md p-2" %>
|
25
|
+
</div>
|
26
|
+
<div class="mb-4">
|
27
|
+
<%= f.label t('content'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-2" %>
|
28
|
+
<%= f.rich_text_area :content, class: "shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md" %>
|
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'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2" %>
|
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: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
|
43
|
+
<% else %>
|
44
|
+
<%= f.button t('update'), class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
|
45
|
+
<% end %>
|
46
|
+
|
47
|
+
<%= link_to "Cancel", :back, class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %>
|
48
|
+
</div>
|
49
|
+
<% end %>
|
50
|
+
</div>
|
@@ -1,7 +1,11 @@
|
|
1
1
|
<%= content_for :title, "Edit Thread" %>
|
2
2
|
|
3
|
-
<
|
3
|
+
<div class="px-4 py-10 mb-6 text-white bg-gray-100 text-4xl text-4xl md:px-20 lg:px-40 xl:px-56 font-bold">
|
4
|
+
<h1 class="text-gray-900"><%= t('edit_thread') %></h1>
|
5
|
+
</div>
|
4
6
|
|
5
|
-
<div class="
|
7
|
+
<div class="px-4 pt-4 md:px-20 lg:px-40 xl:px-56">
|
8
|
+
<div class="max-w-5xl text-gray-700">
|
6
9
|
<%= render 'form', posts: false %>
|
10
|
+
</div>
|
7
11
|
</div>
|
@@ -1,19 +0,0 @@
|
|
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,9 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<div class="px-4 py-10 mb-6 text-white bg-gray-100 text-4xl text-4xl md:px-20 lg:px-40 xl:px-56 font-bold">
|
2
|
+
<h1 class="text-gray-900"><%= t('add_article') %></h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="px-4 pt-4 md:px-20 lg:px-40 xl:px-56">
|
6
|
+
<div class="max-w-5xl text-gray-700">
|
7
|
+
<%= render 'form' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
@@ -1,29 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
+
|
2
|
+
<%= render partial: "shared/thread_actions" if is_moderator_or_owner?(@support_thread)%>
|
3
|
+
|
4
|
+
<div class="px-4 py-10 mb-6 text-white bg-gray-100 text-4xl text-4xl md:px-20 lg:px-40 xl:px-56 font-bold">
|
5
|
+
<p class="text-sm font-normal text-gray-400 mb-4"><%= link_to @support_thread.support_category.name, help_center.support_category_path(@support_thread.support_category) %> / <%= @support_thread.title %></p>
|
6
|
+
<h1 class="text-gray-900"><%= @support_thread.title %></h1>
|
7
|
+
</div>
|
8
|
+
<div class="px-4 pt-4 md:px-20 lg:px-40 xl:px-56">
|
9
|
+
<div class="max-w-5xl text-gray-700">
|
10
|
+
<div class="mb-10">
|
11
|
+
<p class="leading-normal mb-4"><%= @support_thread.content %></p>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -1,130 +1,58 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<div class="flex flex-
|
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
|
-
</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") %>
|
1
|
+
|
2
|
+
<style>
|
3
|
+
[data-toggle-open-value="false"] .fa-sort-down {
|
4
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
|
5
|
+
-webkit-transform: rotate(270deg);
|
6
|
+
transform: rotate(270deg);
|
7
|
+
}
|
8
|
+
</style>
|
9
|
+
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
10
|
+
<script defer src="https://use.fontawesome.com/releases/v5.15.4/js/all.js" crossorigin="anonymous"></script>
|
11
|
+
|
12
|
+
<div class="flex flex-wrap flex-grow items-start justify-between main">
|
13
|
+
<%= render partial: "shared/admin_actions" %>
|
14
|
+
<div class="flex flex-col w-full px-4 pt-4 md:w-1/5 lg:px-8">
|
15
|
+
<div class="text-lg mb-4">
|
16
|
+
<%= link_to help_center_path do %>
|
17
|
+
<h3 class="font-bold">Docs</h3>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<div>
|
21
|
+
<%= render partial: "shared/sidebar_actions" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="flex flex-col w-full h-full bg-white border-l border-gray-300 md:w-4/5 docs-main">
|
25
|
+
<% if current_page?(help_center_path) %>
|
26
|
+
<% if SupportCategory.all.count > 0 %>
|
27
|
+
<% @support_thread = SupportCategory.sorted.first.support_threads.sorted.first %>
|
28
|
+
<div class="container mx-auto">
|
29
|
+
<div class="flex flex-wrap mb-8">
|
30
|
+
<% if is_moderator_or_owner?(@support_thread) %>
|
31
|
+
<div class="flex w-full pr-4 pl-4 justify-end">
|
32
|
+
<%= link_to icon("fas","pencil"), help_center.edit_support_thread_path(@support_thread),
|
33
|
+
class: "text-muted",
|
34
|
+
data: { toggle: "tooltip", placement: "left" },
|
35
|
+
title: t('edit_this_thread') %>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
<div class="md:w-full pr-4 pl-41">
|
39
|
+
<small class="mb-2"><%= support_category_link(@support_thread.support_category) %> > <%= @support_thread.title %></small>
|
40
|
+
<h1><%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h1>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
</div>
|
44
|
+
<%= @support_thread.content %>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
47
|
+
<% else %>
|
48
|
+
<%= yield %>
|
49
|
+
<% end %>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<link rel="stylesheet" href="//unpkg.com/@highlightjs/cdn-assets@11.3.1/styles/default.min.css">
|
55
|
+
<script src="//unpkg.com/@highlightjs/cdn-assets@11.3.1/highlight.min.js"></script>
|
56
|
+
<script>hljs.highlightAll();</script>
|
57
|
+
|
58
|
+
<% parent_layout("application") %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% if current_user && (current_user.admin? || current_user.moderator?) %>
|
2
|
+
<div class="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" role="alert">
|
3
|
+
<span class="text-base font-normal text-white">Welcome moderators (<%= current_user.email %>)</span>
|
4
|
+
<div>
|
5
|
+
<%= 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" %>
|
6
|
+
<%= 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" %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
|
2
|
-
<div class="
|
3
|
-
<span class="mr-4 text-gray-
|
2
|
+
<div class="bg-blue-400 flex justify-between w-full px-4 py-2 text-base items-center">
|
3
|
+
<span class="mr-4 text-gray-100"><i class="fas fa-sort"></i> <%= @category.position %> </span>
|
4
4
|
|
5
5
|
<div>
|
6
|
-
<%= link_to
|
7
|
-
class: "text-gray-
|
6
|
+
<%= link_to "Edit Category Details", help_center.edit_support_category_path(@category),
|
7
|
+
class: "text-gray-100 underline text-sm",
|
8
8
|
data: { toggle: "tooltip", placement: "left" },
|
9
9
|
title: t('edit_this_thread') %>
|
10
|
-
<%= link_to
|
10
|
+
<%= link_to "Delete", help_center.support_category_path(@category),
|
11
11
|
method: :delete,
|
12
|
-
class: "text-gray-
|
12
|
+
class: "text-gray-100 ml-4 underline text-sm",
|
13
13
|
data: { toggle: "tooltip", placement: "left", confirm: "Are you sure?" },
|
14
14
|
title: t('delete_category') %>
|
15
15
|
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div>
|
2
|
+
<% SupportCategory.sorted.each do |category| %>
|
3
|
+
<div data-controller="toggle" class="py-2 my-1 overflow-x-auto bg-white rounded shadow-inner-sm" data-toggle-open-value="<%= (@category.present? && @category == category) ? "true" : "false" %>">
|
4
|
+
<button class="mb-0 text-gray-700 font-medium text-base hover:text-gray-900" data-action="click->toggle#toggle">
|
5
|
+
<i class="fas fa-sort-down mr-2"></i>
|
6
|
+
<%= category.name %>
|
7
|
+
</button>
|
8
|
+
<div data-toggle-target="toggleable" class="<%= (@category.present? && @category == category) ? "" : "hidden" %>" >
|
9
|
+
<ul class="list-none leading-loose pl-6">
|
10
|
+
<% threads = SupportThread.where(support_category_id: category.id).order(:position) %>
|
11
|
+
<% threads.each do |thread| %>
|
12
|
+
<li>
|
13
|
+
<%= link_to help_center.support_thread_path(thread), class: "text-base font-normal text-gray-500 hover:text-gray-700" do %>
|
14
|
+
<%= thread.title %>
|
15
|
+
<% end %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
@@ -1,16 +1,16 @@
|
|
1
|
-
<div class="
|
2
|
-
<span class="mr-4 text-gray-
|
3
|
-
|
4
|
-
<div>
|
5
|
-
<%= link_to
|
6
|
-
class: "text-gray-
|
7
|
-
data: { toggle: "tooltip", placement: "left" },
|
8
|
-
title: t('edit_this_thread') %>
|
9
|
-
|
10
|
-
<%= link_to
|
11
|
-
method: :delete,
|
12
|
-
class: "text-gray-
|
13
|
-
data: {
|
14
|
-
title: t('delete_category') %>
|
15
|
-
</div>
|
1
|
+
<div class="bg-blue-400 flex justify-between w-full px-4 py-2 text-base items-center">
|
2
|
+
<span class="mr-4 text-gray-100"><i class="fas fa-sort"></i> <%= @support_thread.position %> </span>
|
3
|
+
|
4
|
+
<div>
|
5
|
+
<%= link_to "Edit Article", help_center.edit_support_thread_path(@support_thread),
|
6
|
+
class: "text-gray-100 underline text-sm",
|
7
|
+
data: { toggle: "tooltip", placement: "left" },
|
8
|
+
title: t('edit_this_thread') %>
|
9
|
+
|
10
|
+
<%= link_to "Delete", help_center.support_thread_path(@support_thread),
|
11
|
+
method: :delete,
|
12
|
+
class: "text-gray-100 ml-4 underline text-sm",
|
13
|
+
data: { confirm: "Are you sure?" },
|
14
|
+
title: t('delete_category') %>
|
15
|
+
</div>
|
16
16
|
</div>
|
data/config/locales/en.yml
CHANGED
data/lib/help_center/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module HelpCenter
|
2
|
-
VERSION = "0.0
|
3
|
-
end
|
1
|
+
module HelpCenter
|
2
|
+
VERSION = "0.1.0"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: help_center
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ugurcan Kaya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: font-awesome-sass
|
@@ -82,7 +82,6 @@ files:
|
|
82
82
|
- LICENSE.txt
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
|
-
- app/assets/stylesheets/help_center.scss
|
86
85
|
- app/controllers/help_center/application_controller.rb
|
87
86
|
- app/controllers/help_center/notifications_controller.rb
|
88
87
|
- app/controllers/help_center/support_categories_controller.rb
|
@@ -115,7 +114,9 @@ files:
|
|
115
114
|
- app/views/help_center/user_mailer/new_post.html.erb
|
116
115
|
- app/views/help_center/user_mailer/new_thread.html.erb
|
117
116
|
- app/views/layouts/help_center.html.erb
|
117
|
+
- app/views/shared/_admin_actions.html.erb
|
118
118
|
- app/views/shared/_category_actions.html.erb
|
119
|
+
- app/views/shared/_sidebar_actions.html.erb
|
119
120
|
- app/views/shared/_spacer.html.erb
|
120
121
|
- app/views/shared/_thread_actions.html.erb
|
121
122
|
- bin/console
|
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
155
|
- !ruby/object:Gem::Version
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
|
-
rubygems_version: 3.2.
|
158
|
+
rubygems_version: 3.2.22
|
158
159
|
signing_key:
|
159
160
|
specification_version: 4
|
160
161
|
summary: A wiki gem for creating documentation & help centers in your Rails app
|