help_center 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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 +3 -2
- data/app/models/support_category.rb +1 -1
- data/app/views/help_center/support_categories/index.html.erb +18 -16
- data/app/views/help_center/support_threads/index.html.erb +0 -19
- data/app/views/layouts/help_center.html.erb +1 -1
- data/config/locales/en.yml +2 -0
- data/lib/help_center/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3534b830bdcd003af94acb86f4cae1d8f280cdd2a8c35fcf819e1cdd1ecaac0
|
4
|
+
data.tar.gz: 29487d7779e372d63f2406e42de48aa75a0853d26062621657689b2d4c7871f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72da7820d7f986691f5cb18b223968317481aab512ff1e124fb056a9f64b707db998c4cbbf19ac25ac069e011bb3d2d6122d24f138e72a0cf52839664e7e45d8
|
7
|
+
data.tar.gz: 35f13cb0c78fcd1caf348d5cd0d4dde93af1b75e384923ca8a562e65cb00a11e328658a60eaeeffe7d806e5fde97d343abfc4b2b6ed53ead1073a6ad8b39a184
|
@@ -1,14 +1,10 @@
|
|
1
1
|
class HelpCenter::SupportCategoriesController < HelpCenter::ApplicationController
|
2
2
|
before_action :authenticate_user!, only: [:edit, :update, :destroy]
|
3
|
-
before_action :set_category, only: [:
|
3
|
+
before_action :set_category, only: [:show, :edit, :update, :destroy]
|
4
4
|
before_action :require_mod_or_author_for_thread!, only: [:edit, :update, :destroy]
|
5
5
|
|
6
6
|
|
7
7
|
def index
|
8
|
-
@support_threads = SupportThread.where(support_category: @category) if @category.present?
|
9
|
-
@support_threads = @support_threads.pinned_first.sorted.includes(:user, :support_category)
|
10
|
-
@pagy, @records = pagy(@support_threads)
|
11
|
-
render "help_center/support_threads/index"
|
12
8
|
end
|
13
9
|
|
14
10
|
def new
|
@@ -49,7 +45,7 @@ class HelpCenter::SupportCategoriesController < HelpCenter::ApplicationControlle
|
|
49
45
|
def set_category
|
50
46
|
@category = SupportCategory.friendly.find(params[:id])
|
51
47
|
rescue ActiveRecord::RecordNotFound
|
52
|
-
redirect_to help_center.
|
48
|
+
redirect_to help_center.support_categories_path, notice: I18n.t('page_not_found')
|
53
49
|
end
|
54
50
|
|
55
51
|
def support_category_params
|
@@ -52,10 +52,12 @@ class HelpCenter::SupportPostsController < HelpCenter::ApplicationController
|
|
52
52
|
redirect_to help_center.support_thread_path(@support_thread, anchor: ActionView::RecordIdentifier.dom_id(@support_post))
|
53
53
|
end
|
54
54
|
|
55
|
-
private
|
56
|
-
|
55
|
+
private
|
56
|
+
|
57
57
|
def set_support_thread
|
58
58
|
@support_thread = SupportThread.friendly.find(params[:support_thread_id])
|
59
|
+
rescue ActiveRecord::RecordNotFound
|
60
|
+
redirect_to help_center.root_path, notice: I18n.t('page_not_found')
|
59
61
|
end
|
60
62
|
|
61
63
|
def set_support_post
|
@@ -4,8 +4,7 @@ class HelpCenter::SupportThreadsController < HelpCenter::ApplicationController
|
|
4
4
|
before_action :require_mod_or_author_for_thread!, only: [:edit, :update]
|
5
5
|
|
6
6
|
def index
|
7
|
-
|
8
|
-
@pagy, @records = pagy(@support_threads)
|
7
|
+
redirect_to help_center.support_categories_path
|
9
8
|
end
|
10
9
|
|
11
10
|
def answered
|
@@ -74,6 +73,8 @@ class HelpCenter::SupportThreadsController < HelpCenter::ApplicationController
|
|
74
73
|
|
75
74
|
def set_support_thread
|
76
75
|
@support_thread = SupportThread.friendly.find(params[:id])
|
76
|
+
rescue ActiveRecord::RecordNotFound
|
77
|
+
redirect_to help_center.support_categories_path, notice: I18n.t('page_not_found')
|
77
78
|
end
|
78
79
|
|
79
80
|
def support_thread_params
|
@@ -1,19 +1,21 @@
|
|
1
|
-
<% if
|
2
|
-
<div><%= t('search_not_found') %>. <%=
|
1
|
+
<% if SupportCategory.none? %>
|
2
|
+
<div><%= t('search_not_found') %>. <%= link_to t('browse_categories'), help_center.support_categories_path %> <%= t('instead') %> </div>
|
3
3
|
<% else %>
|
4
|
-
<div class="
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
+
|
18
20
|
</div>
|
19
21
|
<% end %>
|
@@ -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 %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<% if current_user && (current_user.admin? || current_user.moderator?) %>
|
4
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>
|
5
|
+
<span class="text-base font-normal text-white">Welcome moderator (<%= current_user.email %>)</span>
|
6
6
|
<div>
|
7
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
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" %>
|
data/config/locales/en.yml
CHANGED
data/lib/help_center/version.rb
CHANGED
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.0.8
|
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-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: font-awesome-sass
|