help_center 0.0.4 → 0.0.5
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 +12 -12
- data/.gitignore +10 -10
- data/CHANGELOG.md +1 -1
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +164 -155
- data/Rakefile +10 -10
- data/app/assets/stylesheets/help_center.scss +139 -119
- 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 -17
- data/app/controllers/help_center/support_posts_controller.rb +72 -72
- data/app/controllers/help_center/support_threads_controller.rb +16 -6
- 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 +13 -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 +35 -0
- data/app/views/help_center/support_categories/_support_thread.html.erb +25 -0
- data/app/views/help_center/support_categories/edit.html.erb +7 -0
- data/app/views/help_center/support_categories/index.html.erb +19 -0
- data/app/views/help_center/support_categories/new.html.erb +5 -0
- data/app/views/help_center/support_categories/show.html.erb +20 -0
- data/app/views/help_center/support_threads/_form.html.erb +6 -4
- data/app/views/help_center/support_threads/edit.html.erb +7 -7
- data/app/views/help_center/support_threads/index.html.erb +1 -1
- data/app/views/help_center/support_threads/new.html.erb +5 -5
- data/app/views/help_center/support_threads/show.html.erb +42 -1
- data/app/views/layouts/help_center.html.erb +37 -13
- data/app/views/shared/_spacer.html.erb +1 -1
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/config/locales/en.yml +55 -52
- 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/20170417012932_create_support_posts.rb +12 -12
- data/db/migrate/20170417012933_create_support_subscriptions.rb +11 -11
- data/help_center.gemspec +29 -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 -24
- 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 +11 -8
- data/.travis.yml +0 -5
- data/app/views/help_center/support_threads/_article.html.erb +0 -32
- data/lib/help_center/will_paginate.rb +0 -53
data/.travis.yml
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<div class="container mx-auto">
|
|
2
|
-
<div class="flex flex-wrap mb-8">
|
|
3
|
-
<% if current_user && current_user.admin? %>
|
|
4
|
-
<div class="flex w-full pr-4 pl-4 justify-end">
|
|
5
|
-
<%= link_to icon("fas","pencil"), help_center.edit_support_thread_path(@support_thread),
|
|
6
|
-
class: "text-muted",
|
|
7
|
-
data: { toggle: "tooltip", placement: "left" },
|
|
8
|
-
title: t('edit_this_thread') %>
|
|
9
|
-
</div>
|
|
10
|
-
<% end %>
|
|
11
|
-
<div class="md:w-full pr-4 pl-41">
|
|
12
|
-
<small class="mb-2"><%= support_category_link(@support_thread.support_category) %> > <%= @support_thread.title %></small>
|
|
13
|
-
<h1><%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %></h1>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
<%= @support_thread.content %>
|
|
18
|
-
<!--
|
|
19
|
-
<div class="thread-reaction">
|
|
20
|
-
<p>Did this answer your question?</p>
|
|
21
|
-
<p class="thread-reaction-links">
|
|
22
|
-
<a>😞<a>
|
|
23
|
-
<a>😃<a>
|
|
24
|
-
</p>
|
|
25
|
-
<div>
|
|
26
|
-
-->
|
|
27
|
-
<% if HelpCenter.enable_comments %>
|
|
28
|
-
<hr>
|
|
29
|
-
<%= render partial: "help_center/support_posts/support_post", collection: @support_thread.support_posts.includes(:user).sorted %>
|
|
30
|
-
<%= render partial: "help_center/support_posts/form" if user_signed_in? %>
|
|
31
|
-
<% end %>
|
|
32
|
-
</div>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
require 'will_paginate/view_helpers/action_view'
|
|
2
|
-
|
|
3
|
-
module HelpCenter
|
|
4
|
-
# This code serves two purposes
|
|
5
|
-
# 1. It patches will_paginate to work with scoped and mounted Rails engines
|
|
6
|
-
# by adding in the url_builder option
|
|
7
|
-
# 2. It adds Bootstrap 4 styling to will_paginate
|
|
8
|
-
|
|
9
|
-
class BootstrapLinkRenderer < WillPaginate::ActionView::LinkRenderer
|
|
10
|
-
|
|
11
|
-
# This method adds the `url_builder` option so we can pass in the
|
|
12
|
-
# mounted Rails engine's scope for will_paginate
|
|
13
|
-
def url(page)
|
|
14
|
-
@base_url_params ||= begin
|
|
15
|
-
url_params = merge_get_params(default_url_params)
|
|
16
|
-
merge_optional_params(url_params)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
url_params = @base_url_params.dup
|
|
20
|
-
add_current_page_param(url_params, page)
|
|
21
|
-
|
|
22
|
-
# Add optional url_builder support
|
|
23
|
-
(@options[:url_builder] || @template).url_for(url_params)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
protected
|
|
27
|
-
def html_container(html)
|
|
28
|
-
tag :nav, tag(:ul, html, class: ul_class)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def page_number(page)
|
|
32
|
-
item_class = if(page == current_page)
|
|
33
|
-
'active page-item'
|
|
34
|
-
else
|
|
35
|
-
'page-item'
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
tag :li, link(page, page, :rel => rel_value(page), :class => 'page-link'), :class => item_class
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def gap
|
|
42
|
-
tag :li, link('…'.html_safe, '#', :class => 'page-link'), :class => 'page-item disabled'
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def previous_or_next_page(page, text, classname)
|
|
46
|
-
tag :li, link(text, page || '#', :class => 'page-link'), :class => [(classname[0..3] if @options[:page_links]), (classname if @options[:page_links]), ('disabled' unless page), 'page-item'].join(' ')
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def ul_class
|
|
50
|
-
["pagination", container_attributes[:class]].compact.join(" ")
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|