help_center 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c229690f4ea2200eaac22205e66d776fdc1590f05ae1aca8fa6498ddf5d5fa53
|
4
|
+
data.tar.gz: 269c19131ea7c54b07c70ebc46f744926b270880a94bc5368a5a8ea3aa4274fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a7e667e6010ae88cb43a5bfbdae856f270c5fdbc9a31b57e3092129d353e4c15ff43897eb25bfdf2fc47ebdbea8de8209d2efd875c4bfd5e920a1e46c8a0b9
|
7
|
+
data.tar.gz: 0a5c782fc528a571356f620506a91a750da997ecec8571ad9c7f774df51517f1bfc47add6c367fb9b402128a2253b6a9c38a04b54fefbaf238b945a03a062dcc
|
data/.github/FUNDING.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# These are supported funding model platforms
|
2
2
|
|
3
|
-
github: [
|
3
|
+
github: [uurcank, pasilobus] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
4
|
patreon: # Replace with a single Patreon username
|
5
5
|
open_collective: # Replace with a single Open Collective username
|
6
6
|
ko_fi: # Replace with a single Ko-fi username
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
### Unreleased
|
2
2
|
|
3
|
+
* Fixes in form labels
|
4
|
+
* Styling improvements
|
5
|
+
|
6
|
+
### 0.1.0
|
7
|
+
|
8
|
+
* Inherit application layout
|
9
|
+
* Remove logo requirement removed (add the layout file to your views to customize)
|
10
|
+
* Refactor partials
|
11
|
+
|
12
|
+
### 0.0.9
|
13
|
+
|
14
|
+
* [BREAKING] No longer inherits application layout
|
15
|
+
* [BREAKING] Use CDN to install required libraries, skipping asset pipeline
|
16
|
+
* [BREAKING] Layout file requires a logo.svg file in assets, otherwise will break
|
17
|
+
* Upgrade to Tailwind v2.0
|
18
|
+
* New layout design
|
19
|
+
* Togglable sidebar menu
|
20
|
+
* Use Highlight.js for syntax highlighting
|
21
|
+
|
22
|
+
### 0.0.7
|
23
|
+
|
24
|
+
* Improve default styling
|
25
|
+
|
3
26
|
### 0.0.6
|
4
27
|
|
5
28
|
* Bug fixes
|
data/README.md
CHANGED
@@ -1,168 +1,162 @@
|
|
1
|
-
# HelpCenter
|
2
|
-
|
3
|
-
### 📖 Knowledge Base for your Ruby on Rails App
|
4
|
-
|
5
|
-
HelpCenter is a Rails wiki gem with Trix editor support for creating a knowledge base for your project. It includes
|
6
|
-
|
7
|
-
Out of the box, HelpCenter comes with styling for TailwindCSS 2.0 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
|
8
|
-
|
9
|
-
## Requirements
|
10
|
-
|
11
|
-
```
|
12
|
-
Rails >= 6.
|
13
|
-
|
14
|
-
```
|
15
|
-
|
16
|
-
## Installation
|
17
|
-
|
18
|
-
Before you get started, HelpCenter requires a `User` model in your application (for now).
|
19
|
-
|
20
|
-
Add this line to your application's Gemfile:
|
21
|
-
|
22
|
-
```ruby
|
23
|
-
gem 'help_center'
|
24
|
-
```
|
25
|
-
|
26
|
-
And then execute:
|
27
|
-
|
28
|
-
```bash
|
29
|
-
bundle
|
30
|
-
```
|
31
|
-
|
32
|
-
Install the migrations and migrate:
|
33
|
-
|
34
|
-
```bash
|
35
|
-
rails help_center:install:migrations
|
36
|
-
rails db:migrate
|
37
|
-
```
|
38
|
-
|
39
|
-
Add HelpCenter to your `User` model. The model **must** have `name` method which will be used to display the user's name on comments & discussions (if enabled). Currently only a model named `User` will work.
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
class User < ActiveRecord::Base
|
43
|
-
include HelpCenter::SupportUser
|
44
|
-
|
45
|
-
def name
|
46
|
-
"#{first_name} #{last_name}"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
```
|
50
|
-
|
51
|
-
Next add a `moderator`
|
52
|
-
|
53
|
-
```bash
|
54
|
-
rails g migration AddModeratorToUsers moderator:boolean
|
55
|
-
rails db:migrate
|
56
|
-
```
|
57
|
-
Only moderators or admins can
|
58
|
-
|
59
|
-
```
|
60
|
-
if current_user.admin? || current_user.moderator?
|
61
|
-
```
|
62
|
-
|
63
|
-
Add the following line to your `config/routes.rb` file:
|
64
|
-
|
65
|
-
```ruby
|
66
|
-
mount HelpCenter::Engine => "/docs"
|
67
|
-
```
|
68
|
-
|
69
|
-
Add routes for active storage with your custom prefix
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
get "/
|
73
|
-
"active_storage/blobs#show"
|
74
|
-
get "/
|
75
|
-
"active_storage/representations#show"
|
76
|
-
```
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
```
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
```bash
|
99
|
-
rails g help_center:
|
100
|
-
```
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
```bash
|
105
|
-
rails g help_center:
|
106
|
-
```
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
```
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
##
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
165
|
-
|
166
|
-
## Code of Conduct
|
167
|
-
|
168
|
-
Everyone interacting in the HelpCenter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pasilobus/help_center/blob/master/CODE_OF_CONDUCT.md).
|
1
|
+
# HelpCenter
|
2
|
+
|
3
|
+
### 📖 Knowledge Base for your Ruby on Rails App
|
4
|
+
|
5
|
+
HelpCenter is a Rails wiki gem with Trix editor support for creating a knowledge base for your project. It includes categories, articles, simple moderation, the ability to leave comments to docs and more.
|
6
|
+
|
7
|
+
Out of the box, HelpCenter comes with styling for TailwindCSS 2.0 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
|
8
|
+
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
```
|
12
|
+
Rails >= 6.1.4
|
13
|
+
|
14
|
+
```
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Before you get started, HelpCenter requires a `User` model in your application (for now).
|
19
|
+
|
20
|
+
Add this line to your application's Gemfile:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
gem 'help_center'
|
24
|
+
```
|
25
|
+
|
26
|
+
And then execute:
|
27
|
+
|
28
|
+
```bash
|
29
|
+
bundle
|
30
|
+
```
|
31
|
+
|
32
|
+
Install the migrations and migrate:
|
33
|
+
|
34
|
+
```bash
|
35
|
+
rails help_center:install:migrations
|
36
|
+
rails db:migrate
|
37
|
+
```
|
38
|
+
|
39
|
+
Add HelpCenter to your `User` model. The model **must** have `name` method which will be used to display the user's name on comments & discussions (if enabled). Currently only a model named `User` will work.
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
class User < ActiveRecord::Base
|
43
|
+
include HelpCenter::SupportUser
|
44
|
+
|
45
|
+
def name
|
46
|
+
"#{first_name} #{last_name}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
Next add a `moderator` and `admin` flag to the `User` model.
|
52
|
+
|
53
|
+
```bash
|
54
|
+
rails g migration AddModeratorToUsers admin:boolean moderator:boolean
|
55
|
+
rails db:migrate
|
56
|
+
```
|
57
|
+
Only moderators or admins can manage articles.
|
58
|
+
|
59
|
+
```
|
60
|
+
if current_user.admin? || current_user.moderator?
|
61
|
+
```
|
62
|
+
|
63
|
+
Add the following line to your `config/routes.rb` file:
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
mount HelpCenter::Engine => "/docs"
|
67
|
+
```
|
68
|
+
|
69
|
+
Add routes for active storage with your custom prefix
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
get "/docs/rails/active_storage/blobs/:signed_id/*filename" =>
|
73
|
+
"active_storage/blobs#show"
|
74
|
+
get "/docs/rails/active_storage/representations/:signed_blob_id/:variation_key/*filename" =>
|
75
|
+
"active_storage/representations#show"
|
76
|
+
```
|
77
|
+
|
78
|
+
## Usage
|
79
|
+
|
80
|
+
To get all the basic functionality, the only thing you need to do is add a link to HelpCenter in your navbar.
|
81
|
+
|
82
|
+
```erb
|
83
|
+
<%= link_to "Docs", help_center_path %>
|
84
|
+
```
|
85
|
+
|
86
|
+
This will take the user to the views inside the Rails engine and that's all you have to do!
|
87
|
+
|
88
|
+
### Customizing
|
89
|
+
|
90
|
+
If you'd like to customize the views that HelpCenter uses, you can install the views to your Rails app:
|
91
|
+
|
92
|
+
```bash
|
93
|
+
rails g help_center:views
|
94
|
+
```
|
95
|
+
|
96
|
+
You can also install a copy of the HelpCenter controllers for advanced customization:
|
97
|
+
|
98
|
+
```bash
|
99
|
+
rails g help_center:controllers
|
100
|
+
```
|
101
|
+
|
102
|
+
Helpers are available for override as well. They are used for rendering the user avatars, text formatting, and more.
|
103
|
+
|
104
|
+
```bash
|
105
|
+
rails g help_center:helpers
|
106
|
+
```
|
107
|
+
|
108
|
+
**NOTE:** Keep in mind that the more customization you do, the tougher gem upgrades will be in the future.
|
109
|
+
|
110
|
+
### User comments & Notifications
|
111
|
+
|
112
|
+
You can enable user comments and questions for support articles. HelpCenter will attempt to send email and slack notifications for users who leave comments when a new reply posted.
|
113
|
+
|
114
|
+
To turn these off you can do the following in `config/initializers/help_center.rb`
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
HelpCenter.setup do |config|
|
118
|
+
config.article_dicussions = false # Default: false
|
119
|
+
config.send_email_notifications = false # Default: true
|
120
|
+
config.send_slack_notifications = false # Default: true
|
121
|
+
end
|
122
|
+
```
|
123
|
+
|
124
|
+
Slack notifications require you to set `help_center_slack_url` in your `config/secrets.yml`. If you don't have this value set, it will not attempt Slack notifications even if they are enabled.
|
125
|
+
|
126
|
+
|
127
|
+
## Development
|
128
|
+
|
129
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
130
|
+
|
131
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
132
|
+
|
133
|
+
## Roadmap / Upcoming features
|
134
|
+
Your support is appreciated for this project. Consider backing the project via GitHub Sponsors.
|
135
|
+
|
136
|
+
We plan to release following features:
|
137
|
+
|
138
|
+
- Contact form
|
139
|
+
- Built-in search
|
140
|
+
- Versioning Support
|
141
|
+
- Themes
|
142
|
+
- Dark Mode Support
|
143
|
+
|
144
|
+
## Acknowledgment
|
145
|
+
|
146
|
+
[simple_discussion](https://github.com/excid3/simple_discussion) by [Chris Oliver](https://github.com/excid3)
|
147
|
+
|
148
|
+
[Trix editor](https://github.com/basecamp/trix) by [Basecamp](https://github.com/basecamp)
|
149
|
+
|
150
|
+
[TailwindCSS](https://github.com/basecamp/trix) by [Tailwind Labs](https://github.com/tailwindlabs/tailwindcss)
|
151
|
+
|
152
|
+
## Contributing
|
153
|
+
|
154
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/uurcank/help_center This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
155
|
+
|
156
|
+
## License
|
157
|
+
|
158
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
159
|
+
|
160
|
+
## Code of Conduct
|
161
|
+
|
162
|
+
Everyone interacting in the HelpCenter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pasilobus/help_center/blob/master/CODE_OF_CONDUCT.md).
|
@@ -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,9 @@ class HelpCenter::SupportThreadsController < HelpCenter::ApplicationController
|
|
74
73
|
|
75
74
|
def set_support_thread
|
76
75
|
@support_thread = SupportThread.friendly.find(params[:id])
|
76
|
+
@category = @support_thread.support_category
|
77
|
+
rescue ActiveRecord::RecordNotFound
|
78
|
+
redirect_to help_center.support_categories_path, notice: I18n.t('page_not_found')
|
77
79
|
end
|
78
80
|
|
79
81
|
def support_thread_params
|
@@ -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: "
|
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: "
|
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: "
|
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: "
|
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: "
|
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: "
|
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: "
|
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
|
-
<
|
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,19 +1,44 @@
|
|
1
|
-
<% if
|
2
|
-
<div><%= t('search_not_found') %>. <%=
|
3
|
-
<% else %>
|
4
|
-
<div class="
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
<
|
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="
|
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>
|
5
9
|
</div>
|