help_center 0.0.5 → 0.0.6
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/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
@@ -0,0 +1,16 @@
|
|
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>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<%= link_to icon("fas","pencil") + " Edit Category Details", help_center.edit_support_category_path(@category),
|
7
|
+
class: "text-gray-500",
|
8
|
+
data: { toggle: "tooltip", placement: "left" },
|
9
|
+
title: t('edit_this_thread') %>
|
10
|
+
<%= link_to icon("fas","trash") + " Delete", help_center.support_category_path(@category),
|
11
|
+
method: :delete,
|
12
|
+
class: "text-gray-500 ml-4",
|
13
|
+
data: { toggle: "tooltip", placement: "left", confirm: "Are you sure?" },
|
14
|
+
title: t('delete_category') %>
|
15
|
+
</div>
|
16
|
+
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<hr/>
|
1
|
+
<hr/>
|
@@ -0,0 +1,16 @@
|
|
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>
|
3
|
+
|
4
|
+
<div>
|
5
|
+
<%= link_to icon("fas","pencil") + " Edit Article", help_center.edit_support_thread_path(@support_thread),
|
6
|
+
class: "text-gray-500",
|
7
|
+
data: { toggle: "tooltip", placement: "left" },
|
8
|
+
title: t('edit_this_thread') %>
|
9
|
+
|
10
|
+
<%= link_to icon("fas","trash") + " Delete", help_center.support_thread_path(@support_thread),
|
11
|
+
method: :delete,
|
12
|
+
class: "text-gray-500 ml-4",
|
13
|
+
data: { toggle: "tooltip", placement: "left", confirm: "Are you sure?" },
|
14
|
+
title: t('delete_category') %>
|
15
|
+
</div>
|
16
|
+
</div>
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "help_center"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "help_center"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
data/config/locales/en.yml
CHANGED
@@ -1,55 +1,56 @@
|
|
1
|
-
en:
|
2
|
-
start_a_discussion: Start A Discussion
|
3
|
-
add: Add
|
4
|
-
update: Update
|
5
|
-
add_a_comment: Add A Comment
|
6
|
-
add_an_article: Add Article
|
7
|
-
ask_a_question: Ask A Question
|
8
|
-
asked_time_ago: "Asked %{time} ago by %{author}"
|
9
|
-
choose_a_category: Choose a Category
|
10
|
-
comment: Comment
|
11
|
-
commented_on: Commented on
|
12
|
-
documentation: Documentation
|
13
|
-
edit_this_post: Edit this post
|
14
|
-
edit_this_thread: Edit this thread
|
15
|
-
edit_thread: Edit thread
|
16
|
-
edit_category: Edit category
|
17
|
-
filters: Filters
|
18
|
-
how_do_i: How do I...?
|
19
|
-
ignoring_thread: You're ignoring this thread.
|
20
|
-
not_receiving_notifications: You’re not receiving notifications from this thread.
|
21
|
-
layouts:
|
22
|
-
simple_discussion:
|
23
|
-
all_threads: All Threads
|
24
|
-
answered: Answered
|
25
|
-
by_category: By Category
|
26
|
-
my_questions: My Questions
|
27
|
-
notifications: Notifications
|
28
|
-
participating: Participating
|
29
|
-
suscribe: Subscribe
|
30
|
-
unsubscribe: Unsubscribe
|
31
|
-
unanswered: Unanswered
|
32
|
-
pick_a_category: Pick a category...
|
33
|
-
post:
|
34
|
-
one: post
|
35
|
-
other: posts
|
36
|
-
receiving_notifications_because_subscribed: You're receiving notifications because you've subscribed to this thread.
|
37
|
-
receiving_notifications_because_posted: You're receiving notifications because you've posted in this thread.
|
38
|
-
saving_comment: Saving comment...
|
39
|
-
saving: Saving
|
40
|
-
this_solved_my_question: This solved my question
|
41
|
-
title: title
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
1
|
+
en:
|
2
|
+
start_a_discussion: Start A Discussion
|
3
|
+
add: Add
|
4
|
+
update: Update
|
5
|
+
add_a_comment: Add A Comment
|
6
|
+
add_an_article: Add Article
|
7
|
+
ask_a_question: Ask A Question
|
8
|
+
asked_time_ago: "Asked %{time} ago by %{author}"
|
9
|
+
choose_a_category: Choose a Category
|
10
|
+
comment: Comment
|
11
|
+
commented_on: Commented on
|
12
|
+
documentation: Documentation
|
13
|
+
edit_this_post: Edit this post
|
14
|
+
edit_this_thread: Edit this thread
|
15
|
+
edit_thread: Edit thread
|
16
|
+
edit_category: Edit category
|
17
|
+
filters: Filters
|
18
|
+
how_do_i: How do I...?
|
19
|
+
ignoring_thread: You're ignoring this thread.
|
20
|
+
not_receiving_notifications: You’re not receiving notifications from this thread.
|
21
|
+
layouts:
|
22
|
+
simple_discussion:
|
23
|
+
all_threads: All Threads
|
24
|
+
answered: Answered
|
25
|
+
by_category: By Category
|
26
|
+
my_questions: My Questions
|
27
|
+
notifications: Notifications
|
28
|
+
participating: Participating
|
29
|
+
suscribe: Subscribe
|
30
|
+
unsubscribe: Unsubscribe
|
31
|
+
unanswered: Unanswered
|
32
|
+
pick_a_category: Pick a category...
|
33
|
+
post:
|
34
|
+
one: post
|
35
|
+
other: posts
|
36
|
+
receiving_notifications_because_subscribed: You're receiving notifications because you've subscribed to this thread.
|
37
|
+
receiving_notifications_because_posted: You're receiving notifications because you've posted in this thread.
|
38
|
+
saving_comment: Saving comment...
|
39
|
+
saving: Saving
|
40
|
+
this_solved_my_question: This solved my question
|
41
|
+
title: title
|
42
|
+
description: description
|
43
|
+
content: content
|
44
|
+
position: position
|
45
|
+
color: color
|
46
|
+
what_help_needed: What do you need help with?
|
47
|
+
ask_your_question: Ask Your Question
|
48
|
+
update_comment: Update comment
|
49
|
+
your_changes_were_saved: Your changes were saved
|
50
|
+
successfully_deleted: Successfully deleted
|
51
|
+
search_not_found: No results found for your search
|
52
|
+
check_out: Check out
|
53
|
+
latest_questions: the latest questions
|
54
|
+
instead: instead?
|
55
|
+
written_by_author: "Written by %{author}"
|
56
|
+
content_updated_at: "Updated %{update_time} ago"
|
data/config/routes.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
HelpCenter::Engine.routes.draw do
|
2
|
-
scope module: :help_center do
|
3
|
-
resources :support_categories, path: :categories
|
4
|
-
resources :support_threads, path: :articles do
|
5
|
-
collection do
|
6
|
-
get :answered
|
7
|
-
get :unanswered
|
8
|
-
get :mine
|
9
|
-
get :participating
|
10
|
-
end
|
11
|
-
|
12
|
-
resources :support_posts, path: :posts do
|
13
|
-
member do
|
14
|
-
put :solved
|
15
|
-
put :unsolved
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
resource :notifications
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
root to: "help_center/support_threads#index"
|
24
|
-
end
|
1
|
+
HelpCenter::Engine.routes.draw do
|
2
|
+
scope module: :help_center do
|
3
|
+
resources :support_categories, path: :categories
|
4
|
+
resources :support_threads, path: :articles do
|
5
|
+
collection do
|
6
|
+
get :answered
|
7
|
+
get :unanswered
|
8
|
+
get :mine
|
9
|
+
get :participating
|
10
|
+
end
|
11
|
+
|
12
|
+
resources :support_posts, path: :posts do
|
13
|
+
member do
|
14
|
+
put :solved
|
15
|
+
put :unsolved
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
resource :notifications
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
root to: "help_center/support_threads#index"
|
24
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
class CreateSupportCategories < ActiveRecord::Migration[4.2]
|
2
|
-
def change
|
3
|
-
create_table :support_categories do |t|
|
4
|
-
t.string :name, null: false
|
5
|
-
t.string :slug, null: false
|
6
|
-
t.string :color, default: "000000"
|
7
|
-
t.integer :position, default: 0
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
|
12
|
-
SupportCategory.reset_column_information
|
13
|
-
|
14
|
-
SupportCategory.create(
|
15
|
-
name: "Getting Started",
|
16
|
-
color: "#4ea1d3",
|
17
|
-
)
|
18
|
-
end
|
19
|
-
end
|
1
|
+
class CreateSupportCategories < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :support_categories do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :slug, null: false
|
6
|
+
t.string :color, default: "000000"
|
7
|
+
t.integer :position, default: 0
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
|
12
|
+
SupportCategory.reset_column_information
|
13
|
+
|
14
|
+
SupportCategory.create(
|
15
|
+
name: "Getting Started",
|
16
|
+
color: "#4ea1d3",
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
class CreateSupportThreads < ActiveRecord::Migration[4.2]
|
2
|
-
def change
|
3
|
-
create_table :support_threads do |t|
|
4
|
-
t.references :support_category, foreign_key: true
|
5
|
-
t.references :user, foreign_key: true
|
6
|
-
t.string :title, null: false
|
7
|
-
t.string :slug, null: false
|
8
|
-
t.integer :support_posts_count, default: 0
|
9
|
-
t.integer :like_count, default: 0
|
10
|
-
t.integer :dislike_count, default: 0
|
11
|
-
t.boolean :pinned, default: false
|
12
|
-
t.boolean :solved, default: false
|
13
|
-
t.integer :position, default: 0
|
14
|
-
|
15
|
-
t.timestamps
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
class CreateSupportThreads < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :support_threads do |t|
|
4
|
+
t.references :support_category, foreign_key: true
|
5
|
+
t.references :user, foreign_key: true
|
6
|
+
t.string :title, null: false
|
7
|
+
t.string :slug, null: false
|
8
|
+
t.integer :support_posts_count, default: 0
|
9
|
+
t.integer :like_count, default: 0
|
10
|
+
t.integer :dislike_count, default: 0
|
11
|
+
t.boolean :pinned, default: false
|
12
|
+
t.boolean :solved, default: false
|
13
|
+
t.integer :position, default: 0
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
class CreateSupportSubscriptions < ActiveRecord::Migration[4.2]
|
2
|
-
def change
|
3
|
-
create_table :support_subscriptions do |t|
|
4
|
-
t.references :support_thread, foreign_key: true
|
5
|
-
t.references :user, foreign_key: true
|
6
|
-
t.string :subscription_type
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
class CreateSupportSubscriptions < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :support_subscriptions do |t|
|
4
|
+
t.references :support_thread, foreign_key: true
|
5
|
+
t.references :user, foreign_key: true
|
6
|
+
t.string :subscription_type
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/help_center.gemspec
CHANGED
@@ -1,29 +1,27 @@
|
|
1
|
-
|
2
|
-
lib
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
spec.
|
8
|
-
spec.
|
9
|
-
spec.
|
10
|
-
|
11
|
-
|
12
|
-
spec.
|
13
|
-
spec.
|
14
|
-
spec.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
spec.
|
21
|
-
spec.
|
22
|
-
|
23
|
-
|
24
|
-
spec.add_dependency '
|
25
|
-
spec.add_dependency '
|
26
|
-
spec.add_dependency '
|
27
|
-
|
28
|
-
spec.add_dependency 'will_paginate', '>= 3.1.0'
|
29
|
-
end
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "help_center/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "help_center"
|
7
|
+
spec.version = HelpCenter::VERSION
|
8
|
+
spec.authors = ["Ugurcan Kaya"]
|
9
|
+
spec.email = ["support@pasilobus.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{A wiki gem for creating documentation & help centers in your Rails app}
|
12
|
+
spec.description = %q{Knowledge Base, User Docs, API Docs, Community discussions and more for Rails apps}
|
13
|
+
spec.homepage = "https://github.com/uurcank/help_center"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "exe"
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_dependency 'font-awesome-sass', '>= 5.13.0'
|
24
|
+
spec.add_dependency 'friendly_id', '>= 5.2.0'
|
25
|
+
spec.add_dependency 'gravatar_image_tag'
|
26
|
+
spec.add_dependency 'rails', '>= 6.0.0'
|
27
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
|
3
|
-
module HelpCenter
|
4
|
-
module Generators
|
5
|
-
class ControllersGenerator < Rails::Generators::Base
|
6
|
-
source_root File.expand_path("../../../..", __FILE__)
|
7
|
-
|
8
|
-
def copy_controllers
|
9
|
-
directory 'app/controllers/help_center', 'app/controllers/help_center'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module HelpCenter
|
4
|
+
module Generators
|
5
|
+
class ControllersGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../../../..", __FILE__)
|
7
|
+
|
8
|
+
def copy_controllers
|
9
|
+
directory 'app/controllers/help_center', 'app/controllers/help_center'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
|
3
|
-
module HelpCenter
|
4
|
-
module Generators
|
5
|
-
class HelpersGenerator < Rails::Generators::Base
|
6
|
-
source_root File.expand_path("../../../..", __FILE__)
|
7
|
-
|
8
|
-
def copy_views
|
9
|
-
directory 'app/helpers', 'app/helpers'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module HelpCenter
|
4
|
+
module Generators
|
5
|
+
class HelpersGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../../../..", __FILE__)
|
7
|
+
|
8
|
+
def copy_views
|
9
|
+
directory 'app/helpers', 'app/helpers'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|