help_center 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3534b830bdcd003af94acb86f4cae1d8f280cdd2a8c35fcf819e1cdd1ecaac0
4
- data.tar.gz: 29487d7779e372d63f2406e42de48aa75a0853d26062621657689b2d4c7871f8
3
+ metadata.gz: a00a78bdd79c176569db629519e3e35d23077ae1997b45220b4ea1a7299a0773
4
+ data.tar.gz: 3d26e2002c404e7584e53a9e2abff88e0ea6d7e586553fbc1d71432dcad3ea52
5
5
  SHA512:
6
- metadata.gz: 72da7820d7f986691f5cb18b223968317481aab512ff1e124fb056a9f64b707db998c4cbbf19ac25ac069e011bb3d2d6122d24f138e72a0cf52839664e7e45d8
7
- data.tar.gz: 35f13cb0c78fcd1caf348d5cd0d4dde93af1b75e384923ca8a562e65cb00a11e328658a60eaeeffe7d806e5fde97d343abfc4b2b6ed53ead1073a6ad8b39a184
6
+ metadata.gz: 1f566db782b1e4aca5955226a1e05ae24fb6834a427251659b5011d9ee67675a7554cb6828c658a943f002797cc49c124cdcf8c7653765fe30e306397cecad25
7
+ data.tar.gz: 30604d9022de9695cf01e4878cf58142887fc959c66e13d8e9ef045630f47bca22a5c58247191d8be990af42fbe76e2523d22acaeed2cc709644dccec0718127
data/.gitignore CHANGED
@@ -8,3 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .DS_Store
11
+
12
+ # Ignore all files with the .gem extension
13
+ *.gem
@@ -73,6 +73,7 @@ class HelpCenter::SupportThreadsController < HelpCenter::ApplicationController
73
73
 
74
74
  def set_support_thread
75
75
  @support_thread = SupportThread.friendly.find(params[:id])
76
+ @category = @support_thread.support_category
76
77
  rescue ActiveRecord::RecordNotFound
77
78
  redirect_to help_center.support_categories_path, notice: I18n.t('page_not_found')
78
79
  end
@@ -12,28 +12,28 @@
12
12
  </div>
13
13
  <% end %>
14
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" %>
15
+ <%= f.label t('title'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-2" %>
16
+ <%= f.text_field :name, placeholder: t('how_do_i'), class: "shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md p-2" %>
17
17
  </div>
18
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" %>
19
+ <%= f.label t('position'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-4" %>
20
+ <%= f.text_field :position, type: "number", step: "1", min: "0", class: "shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md p-2" %>
21
21
  </div>
22
22
  <div class="mb-4">
23
- <%= f.label t('color') %>
24
- <%= f.color_field :color, class: "form-control form-input" %>
23
+ <%= f.label t('color'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-4" %>
24
+ <%= f.color_field :color, class: "max-w-xs shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md" %>
25
25
  </div>
26
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" %>
27
+ <%= f.label t('title'), class: "block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2 mb-4" %>
28
+ <%= f.rich_text_area :description, placeholder: t('how_do_i'), class: "shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md p-2" %>
29
29
  </div>
30
30
  <div class="flex justify-between mb-4 text-right">
31
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')}"} %>
32
+ <%= 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')}"} %>
33
33
  <% else %>
34
- <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
34
+ <%= 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')}"} %>
35
35
  <% end %>
36
36
 
37
- <%= link_to "Cancel", :back, class: "btn btn-link" %>
37
+ <%= 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" %>
38
38
  </div>
39
39
  <% end %>
@@ -1,7 +1,11 @@
1
1
  <%= content_for :title, "Edit Category" %>
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"><%= t('edit_category') %></h1>
5
+ </div>
2
6
 
3
- <h1 class="mb-4 font-bold"><%= t('edit_category') %></h1>
4
-
5
- <div class="support_category">
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,21 +1,44 @@
1
- <% if SupportCategory.none? %>
2
- <div><%= t('search_not_found') %>. <%= link_to t('browse_categories'), help_center.support_categories_path %> <%= t('instead') %> </div>
3
- <% else %>
4
- <div class="flex flex-wrap mb-8">
5
-
6
- <div class="md:w-full pr-4 pl-41">
7
- <h1 class="mb-4 font-bold tracking-normal"> Categories</h1>
8
-
9
- <div class="flex flex-col items-center">
10
- <% SupportCategory.all.sorted.each do |category| %>
11
-
12
- <%= link_to help_center.support_category_path(category), class: "text-base font-semibold py-4 border-b w-full flex justify-between hover:bg-gray-200 px-4" do %>
13
- <%= category.name %> <i class="fas fa-arrow-right"></i>
14
- <% end %>
15
-
16
- <% end %>
17
- </div>
18
- </div>
19
-
20
- </div>
21
- <% end %>
1
+ <% if SupportCategory.none? %>
2
+ <div><%= t('search_not_found') %>. <%= link_to t('browse_categories'), help_center.support_categories_path %> <%= t('instead') %> </div>
3
+ <% else %>
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
+ <h1 class="text-gray-900">Documentation</h1>
6
+ <p class="text-2xl text-gray-500 font-normal mt-4">Explore our guides and examples</p>
7
+ </div>
8
+ <div class="px-4 pt-4 md:px-20 lg:px-40 xl:px-56">
9
+ <div class="bg-white shadow overflow-hidden sm:rounded-md">
10
+ <ul role="list" class="divide-y divide-gray-200">
11
+ <% SupportCategory.sorted.each do |category| %>
12
+ <li>
13
+ <%= link_to help_center.support_category_path(category), class: "block hover:bg-gray-50" do %>
14
+ <div class="flex items-center px-4 py-4 sm:px-6">
15
+ <div class="min-w-0 flex-1 flex items-center">
16
+ <div class="flex-shrink-0">
17
+ </div>
18
+ <div class="min-w-0 flex-1 px-4 md:grid md:grid-cols-2 md:gap-4">
19
+ <div>
20
+ <p class="text-base font-medium text-gray-600 truncate"><%= category.name %></p>
21
+ <p class="mt-2 flex items-center text-sm text-gray-400">
22
+ <span class="truncate"><%= category.description %></span>
23
+ </p>
24
+ </div>
25
+
26
+ </div>
27
+ </div>
28
+ <div>
29
+ <!-- Heroicon name: solid/chevron-right -->
30
+ <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">
31
+ <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" />
32
+ </svg>
33
+ </div>
34
+ </div>
35
+ <% end %>
36
+ </li>
37
+ <% end %>
38
+ </ul>
39
+ </div>
40
+ </div>
41
+ <% end %>
42
+
43
+
44
+
@@ -1,5 +1,9 @@
1
- <h1 class="mb-4 font-bold"><%= t('add_category') %></h1>
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_category') %></h1>
3
+ </div>
2
4
 
3
- <div class="support_post">
4
- <%= render 'form' %>
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>
5
9
  </div>
@@ -1,19 +1,42 @@
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 %>
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
- </div>
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: "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
+ <%= 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
- <h1 class="mb-4 font-bold"><%= t('edit_thread') %></h1>
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="support_post">
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,5 +1,9 @@
1
- <h1 class="mb-4 font-bold"><%= t('add_article') %></h1>
2
-
3
- <div class="support_post">
4
- <%= render 'form' %>
5
- </div>
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
- <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
+
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,74 @@
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 text-white">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 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 border bg-white flex-1 flex-auto p-6 md:mx-4">
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
+ <!DOCTYPE html>
2
+ <html class="h-full antialiased">
3
+ <head>
4
+ <style>
5
+ [data-toggle-open-value="false"] .fa-sort-down {
6
+ -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
7
+ -webkit-transform: rotate(270deg);
8
+ transform: rotate(270deg);
9
+ }
10
+ </style>
11
+ <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
12
+ <script defer src="https://use.fontawesome.com/releases/v5.15.4/js/all.js" crossorigin="anonymous"></script>
13
+ <script defer src="https://cdnjs.cloudflare.com/ajax/libs/trix/1.3.1/trix.js" crossorigin="anonymous"></script>
14
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/trix/1.3.1/trix.css" rel="stylesheet">
15
+ </head>
16
+
17
+ <body class="flex h-full overflow-x-hidden font-sans font-normal leading-normal bg-offwhite">
18
+ <div class="flex flex-wrap flex-grow items-start justify-between main">
19
+ <% if current_user && (current_user.admin? || current_user.moderator?) %>
20
+ <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">
21
+ <span class="text-base font-normal text-white">Welcome moderators (<%= current_user.email %>)</span>
22
+ <div>
23
+ <%= 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" %>
24
+ <%= 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" %>
25
+ </div>
26
+ </div>
27
+ <% end %>
28
+ <div class="flex flex-col w-full px-4 pt-4 md:w-1/5 lg:px-8">
29
+ <div class="text-lg mb-4">
30
+ <%= link_to help_center_path do %>
31
+ <%= render_svg "logo" %>
32
+ <% end %>
33
+ </div>
34
+ <div>
35
+ <%= render partial: "shared/sidebar" %>
36
+ </div>
37
+ </div>
38
+ <div class="flex flex-col w-full h-full bg-white border-l border-gray-300 md:w-4/5 docs-main">
39
+ <% if current_page?(help_center_path) %>
40
+ <% if SupportCategory.all.count > 0 %>
41
+ <% @support_thread = SupportCategory.sorted.first.support_threads.sorted.first %>
42
+ <div class="container mx-auto">
43
+ <div class="flex flex-wrap mb-8">
44
+ <% if is_moderator_or_owner?(@support_thread) %>
45
+ <div class="flex w-full pr-4 pl-4 justify-end">
46
+ <%= link_to icon("fas","pencil"), help_center.edit_support_thread_path(@support_thread),
47
+ class: "text-muted",
48
+ data: { toggle: "tooltip", placement: "left" },
49
+ title: t('edit_this_thread') %>
50
+ </div>
51
+ <% end %>
52
+ <div class="md:w-full pr-4 pl-41">
53
+ <small class="mb-2"><%= support_category_link(@support_thread.support_category) %> > <%= @support_thread.title %></small>
54
+ <h1><%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h1>
55
+ </div>
56
+
57
+ </div>
58
+ <%= @support_thread.content %>
59
+ </div>
60
+ <% end %>
61
+ <% else %>
62
+ <%= yield %>
63
+ <% end %>
64
+
65
+ </div>
66
+ </div>
67
+
68
+ <link rel="stylesheet"
69
+ href="//unpkg.com/@highlightjs/cdn-assets@11.3.1/styles/default.min.css">
70
+ <script src="//unpkg.com/@highlightjs/cdn-assets@11.3.1/highlight.min.js"></script>
71
+ <script>hljs.highlightAll();</script>
72
+ </body>
73
+ <html>
74
+
@@ -1,15 +1,15 @@
1
1
 
2
- <div class="mb-4 bg-blue-50 border border-gray-300 rounded flex justify-between w-full px-4 py-2 text-base items-center">
3
- <span class="mr-4 text-gray-500"><i class="far fa-sort-amount-down"></i> <%= @category.position %> </span>
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 icon("fas","pencil") + " Edit Category Details", help_center.edit_support_category_path(@category),
7
- class: "text-gray-500",
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 icon("fas","trash") + " Delete", help_center.support_category_path(@category),
10
+ <%= link_to "Delete", help_center.support_category_path(@category),
11
11
  method: :delete,
12
- class: "text-gray-500 ml-4",
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,66 @@
1
+ <script type="module">
2
+ import { Application, Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js"
3
+ window.Stimulus = Application.start()
4
+
5
+ Stimulus.register("toggle", class extends Controller {
6
+ static targets = [ "name" ]
7
+ static targets = ['toggleable']
8
+ static values = { open: Boolean }
9
+
10
+ connect() {
11
+ this.toggleClass = this.data.get('class') || 'hidden'
12
+ }
13
+
14
+ toggle(event) {
15
+ event.preventDefault()
16
+
17
+ this.openValue = !this.openValue
18
+ }
19
+
20
+ hide(event) {
21
+ event.preventDefault();
22
+
23
+ this.openValue = false;
24
+ }
25
+
26
+ show(event) {
27
+ event.preventDefault();
28
+
29
+ this.openValue = true;
30
+ }
31
+
32
+ openValueChanged() {
33
+ if (!this.toggleClass) { return }
34
+
35
+ this.toggleableTargets.forEach(target => {
36
+ target.classList.toggle(this.toggleClass)
37
+ })
38
+ }
39
+
40
+ })
41
+ </script>
42
+
43
+ <div data-controller="toggle">
44
+ <% SupportCategory.sorted.each do |category| %>
45
+ <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" %>">
46
+ <button class="mb-0 text-gray-700 font-medium text-base hover:text-gray-900" data-action="click->toggle#toggle">
47
+ <i class="fas fa-sort-down mr-2"></i>
48
+ <%= category.name %>
49
+ </button>
50
+ <div data-toggle-target="toggleable" class="<%= (@category.present? && @category == category) ? "" : "hidden" %>" >
51
+ <ul class="list-none leading-loose pl-6">
52
+ <% threads = SupportThread.where(support_category_id: category.id).order(:position) %>
53
+ <% threads.each do |thread| %>
54
+ <li>
55
+ <%= link_to help_center.support_thread_path(thread), class: "text-base font-normal text-gray-500 hover:text-gray-700" do %>
56
+ <%= thread.title %>
57
+ <% end %>
58
+ </li>
59
+ <% end %>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+
64
+ <% end %>
65
+ </div>
66
+
@@ -1,15 +1,15 @@
1
- <div class="mb-4 bg-blue-50 flex justify-between w-full px-4 py-2 text-base items-center">
2
- <span class="mr-4 text-gray-500"><i class="far fa-sort-amount-down"></i> <%= @support_thread.position %> </span>
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
3
 
4
4
  <div>
5
- <%= link_to icon("fas","pencil") + " Edit Article", help_center.edit_support_thread_path(@support_thread),
6
- class: "text-gray-500",
5
+ <%= link_to "Edit Article", help_center.edit_support_thread_path(@support_thread),
6
+ class: "text-gray-100 underline text-sm",
7
7
  data: { toggle: "tooltip", placement: "left" },
8
8
  title: t('edit_this_thread') %>
9
9
 
10
- <%= link_to icon("fas","trash") + " Delete", help_center.support_thread_path(@support_thread),
10
+ <%= link_to "Delete", help_center.support_thread_path(@support_thread),
11
11
  method: :delete,
12
- class: "text-gray-500 ml-4",
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>
@@ -1,3 +1,3 @@
1
- module HelpCenter
2
- VERSION = "0.0.8"
3
- end
1
+ module HelpCenter
2
+ VERSION = "0.0.9"
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.8
4
+ version: 0.0.9
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-06-28 00:00:00.000000000 Z
11
+ date: 2021-12-07 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
@@ -116,6 +115,7 @@ files:
116
115
  - app/views/help_center/user_mailer/new_thread.html.erb
117
116
  - app/views/layouts/help_center.html.erb
118
117
  - app/views/shared/_category_actions.html.erb
118
+ - app/views/shared/_sidebar.html.erb
119
119
  - app/views/shared/_spacer.html.erb
120
120
  - app/views/shared/_thread_actions.html.erb
121
121
  - bin/console
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.2.15
157
+ rubygems_version: 3.2.22
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: A wiki gem for creating documentation & help centers in your Rails app
@@ -1,140 +0,0 @@
1
- @import "font-awesome-sprockets";
2
- @import "font-awesome";
3
-
4
- /* Allow pagination to be centered */
5
- .help_center .support-threads-nav nav {
6
- display: inline-block;
7
- }
8
-
9
- /* Highlight the active navigation item in the sidebar */
10
- .help_center .support-thread-filters {
11
- a {
12
- color: #555;
13
- }
14
-
15
- .active {
16
- color: #2a326d;
17
- font-weight: 500;
18
- padding: 0.25rem;
19
- }
20
- }
21
-
22
- /* Formatting for the support threads */
23
- .help_center .support-thread {
24
- margin-bottom: -20px;
25
-
26
- h4 {
27
- margin-bottom: 4px;
28
-
29
- a {
30
- color: #222;
31
- font-size: 16px;
32
- font-weight: normal;
33
- line-height: 1.1;
34
- }
35
- }
36
- }
37
-
38
- .help_center .support-thread-filters a {
39
- color: #555555;
40
- display: block;
41
-
42
- &:hover {
43
- color: #bfbfbf;
44
- text-decoration: none
45
- }
46
- }
47
-
48
- .help_center .thread-details {
49
- color: #999;
50
- font-size: 12px;
51
- text-transform: uppercase;
52
- display: flex;
53
- flex-direction: column;
54
- }
55
-
56
- .help_center .thread-reaction {
57
- background: #eeeeee;
58
- padding: 1rem;
59
- text-align: center;
60
- border-radius: 0.5rem;
61
- margin-top: 2rem;
62
- }
63
-
64
- .help_center .thread-reaction-links {
65
- font-size: 2rem;
66
- margin: 0.25rem;
67
- }
68
-
69
- /* Display the support post count above the "posts" text on the index page */
70
- .help_center .thread-posts-count {
71
- color: #222;
72
- text-align: center;
73
-
74
- span, small {
75
- display: block;
76
- }
77
-
78
- .count {
79
- font-size: 1.5em;
80
- font-weight: 300;
81
- line-height: 1em;
82
- }
83
-
84
- &:hover {
85
- color: #222;
86
- text-decoration: none;
87
- }
88
- }
89
-
90
- /* Formatting for the support posts themselves */
91
- .help_center .support-post {
92
- position: relative;
93
-
94
- /* When the URL anchor matches a post id, highlight that item */
95
- &:target {
96
- background-color: rgb(248, 238, 199);
97
- }
98
-
99
- /* Fill this out if you want to highlight the OPs posts */
100
- &.original-poster {
101
- }
102
-
103
- &.solved {
104
- border: 2px solid #5cb85c;
105
- }
106
- }
107
-
108
- /* Formatting for the support hr to match card border */
109
- .help_center hr {
110
- border: 0;
111
- border-top: 1px solid rgba(0, 0, 0, 0.125);
112
- margin: 24px -20px;
113
- }
114
-
115
- // Forms
116
- .help_center label {
117
- margin-bottom: 0.5rem;
118
- }
119
-
120
- .help_center .form-input, .form-select {
121
- display: block;
122
- width: 100%;
123
- font-size: 0.875rem;
124
- line-height: 1.25rem;
125
- }
126
-
127
- .help_center input[type="color" i] {
128
- appearance: square-button;
129
- width: 44px;
130
- height: 23px;
131
- background-color: -internal-light-dark(rgb(239, 239, 239), rgb(74, 74, 74));
132
- cursor: default;
133
- border-width: 1px;
134
- border-style: solid;
135
- border-color: -internal-light-dark(rgb(118, 118, 118), rgb(195, 195, 195));
136
- border-image: initial;
137
- padding: 1px 2px;
138
- }
139
-
140
-