phcdevworks_tutorials 2.1.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -27
- data/app/assets/config/phcdevworks_tutorials_manifest.js +1 -1
- data/app/assets/stylesheets/phcdevworks_tutorials/category/posts.css +4 -0
- data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.css +4 -0
- data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.css +4 -0
- data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +2 -3
- data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +5 -6
- data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +6 -12
- data/app/models/phcdevworks_tutorials/category.rb +7 -0
- data/app/models/phcdevworks_tutorials/tutorial/category.rb +3 -3
- data/app/models/phcdevworks_tutorials/tutorial/post.rb +8 -8
- data/app/models/phcdevworks_tutorials/tutorial/step.rb +1 -1
- data/app/views/layouts/phcdevworks_tutorials/application.html.erb +3 -3
- data/app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb +27 -5
- data/app/views/layouts/phcdevworks_tutorials/frontend.html.erb +0 -0
- data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +2 -2
- data/app/views/phcdevworks_tutorials/tutorial/categories/index.html.erb +1 -1
- data/app/views/phcdevworks_tutorials/tutorial/categories/show.html.erb +1 -1
- data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +11 -11
- data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +3 -3
- data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +10 -12
- data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +1 -1
- data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +2 -2
- data/config/routes.rb +17 -26
- data/db/migrate/{20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb → 20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb} +4 -6
- data/db/migrate/{20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb → 20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb} +4 -6
- data/db/migrate/{20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb → 20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb} +1 -1
- data/db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb +8 -0
- data/lib/phcdevworks_tutorials/version.rb +1 -1
- metadata +19 -12
- data/app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +0 -3
- data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +0 -3
- data/db/migrate/20191003235303_create_join_table_categories_posts.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c201886acd054426575703760acd433a6988760793610992321f3278492cfa8e
|
4
|
+
data.tar.gz: 06d56fdb5b8116fbeb7448b0d45e9ac25bf28cdc4a393478910a408f5880c352
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba3d237e0c35e111db15376c8ac84a7dcbd8fd17dc33edb890c6b82b3f8a37071fe90270b092d6a49451b9943599f3b8552d37adf0e6e0df7db571c00d4689ba
|
7
|
+
data.tar.gz: e39e584df04df569454758e069475d6d5fa80585f9c8ae738e4c0e5f840c7e13fc429a2375d4040aa374bcb09f9c397e05d3a28b1636ecd29522aadd1f4f0ddf
|
data/README.md
CHANGED
@@ -1,28 +1 @@
|
|
1
1
|
# PhcdevworksTutorials
|
2
|
-
Short description and motivation.
|
3
|
-
|
4
|
-
## Usage
|
5
|
-
How to use my plugin.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
Add this line to your application's Gemfile:
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
gem 'phcdevworks_tutorials'
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
```bash
|
16
|
-
$ bundle
|
17
|
-
```
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
```bash
|
21
|
-
$ gem install phcdevworks_tutorials
|
22
|
-
```
|
23
|
-
|
24
|
-
## Contributing
|
25
|
-
Contribution directions go here.
|
26
|
-
|
27
|
-
## License
|
28
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -16,7 +16,6 @@ module PhcdevworksTutorials
|
|
16
16
|
|
17
17
|
# GET /tutorial/categories/1
|
18
18
|
def show
|
19
|
-
@tutorial_category = Tutorial::Category.friendly.find(params[:id])
|
20
19
|
end
|
21
20
|
|
22
21
|
# GET /tutorial/categories/new
|
@@ -70,12 +69,12 @@ module PhcdevworksTutorials
|
|
70
69
|
|
71
70
|
# Common Callbacks
|
72
71
|
def set_tutorial_category
|
73
|
-
@tutorial_category = Tutorial::Category.
|
72
|
+
@tutorial_category = Tutorial::Category.find(params[:id])
|
74
73
|
end
|
75
74
|
|
76
75
|
# Whitelist
|
77
76
|
def tutorial_category_params
|
78
|
-
params.require(:tutorial_category).permit(:
|
77
|
+
params.require(:tutorial_category).permit(:category_name, :slug, :user_id, :org_id)
|
79
78
|
end
|
80
79
|
|
81
80
|
end
|
@@ -16,7 +16,6 @@ module PhcdevworksTutorials
|
|
16
16
|
|
17
17
|
# GET /tutorial/posts/1
|
18
18
|
def show
|
19
|
-
@tutorial_post = Tutorial::Post.friendly.find(params[:id])
|
20
19
|
end
|
21
20
|
|
22
21
|
# GET /tutorial/posts/new
|
@@ -60,9 +59,9 @@ module PhcdevworksTutorials
|
|
60
59
|
# DELETE /tutorial/posts/1
|
61
60
|
def destroy
|
62
61
|
@tutorial_post.destroy
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
respond_to do |format|
|
63
|
+
format.html { redirect_to tutorial_posts_path, :flash => { :error => 'Tutorial has been Removed.' }}
|
64
|
+
format.json { head :no_content }
|
66
65
|
end
|
67
66
|
end
|
68
67
|
|
@@ -70,12 +69,12 @@ module PhcdevworksTutorials
|
|
70
69
|
|
71
70
|
# Common Callbacks
|
72
71
|
def set_tutorial_post
|
73
|
-
@tutorial_post = Tutorial::Post.
|
72
|
+
@tutorial_post = Tutorial::Post.find(params[:id])
|
74
73
|
end
|
75
74
|
|
76
75
|
# Whitelist
|
77
76
|
def tutorial_post_params
|
78
|
-
params.require(:tutorial_post).permit(:
|
77
|
+
params.require(:tutorial_post).permit(:post_title, :post_description, :post_status, :post_image, :slug, :user_id, :org_id, category_ids: [])
|
79
78
|
end
|
80
79
|
|
81
80
|
end
|
@@ -10,13 +10,11 @@ module PhcdevworksTutorials
|
|
10
10
|
before_action :set_tutorial_step, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
12
|
# GET /tutorial/steps
|
13
|
-
# GET /tutorial/steps.json
|
14
13
|
def index
|
15
|
-
@tutorial_steps = tutorial_post.steps.
|
14
|
+
@tutorial_steps = tutorial_post.steps.order("tutorial_step_number")
|
16
15
|
end
|
17
16
|
|
18
17
|
# GET /tutorial/steps/1
|
19
|
-
# GET /tutorial/steps/1.json
|
20
18
|
def show
|
21
19
|
@tutorial_step = tutorial_post.steps.find(params[:id])
|
22
20
|
end
|
@@ -28,18 +26,17 @@ module PhcdevworksTutorials
|
|
28
26
|
|
29
27
|
# GET /tutorial/steps/1/edit
|
30
28
|
def edit
|
31
|
-
@
|
29
|
+
@tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
|
32
30
|
end
|
33
31
|
|
34
32
|
# POST /tutorial/steps
|
35
|
-
# POST /tutorial/steps.json
|
36
33
|
def create
|
37
34
|
@tutorial_step = tutorial_post.steps.create(tutorial_step_params)
|
38
35
|
@tutorial_step.user_id = current_user.id
|
39
36
|
@tutorial_step.org_id = current_user.org_id
|
40
37
|
respond_to do |format|
|
41
38
|
if @tutorial_step.save
|
42
|
-
format.html { redirect_to
|
39
|
+
format.html { redirect_to tutorial_post_steps_url, :flash => { :success => 'Member Listing has been Added' }}
|
43
40
|
format.json { render :show, status: :created, location: @tutorial_step }
|
44
41
|
else
|
45
42
|
format.html { render :new }
|
@@ -49,12 +46,11 @@ module PhcdevworksTutorials
|
|
49
46
|
end
|
50
47
|
|
51
48
|
# PATCH/PUT /tutorial/steps/1
|
52
|
-
# PATCH/PUT /tutorial/steps/1.json
|
53
49
|
def update
|
54
50
|
@tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
|
55
51
|
respond_to do |format|
|
56
52
|
if @tutorial_step.update(tutorial_step_params)
|
57
|
-
format.html { redirect_to
|
53
|
+
format.html { redirect_to tutorial_post_steps_url, :flash => { :notice => 'Member Listing has been Updated.' }}
|
58
54
|
format.json { render :show, status: :ok, location: @tutorial_step }
|
59
55
|
else
|
60
56
|
format.html { render :edit }
|
@@ -64,12 +60,11 @@ module PhcdevworksTutorials
|
|
64
60
|
end
|
65
61
|
|
66
62
|
# DELETE /tutorial/steps/1
|
67
|
-
# DELETE /tutorial/steps/1.json
|
68
63
|
def destroy
|
69
64
|
@tutorial_step = tutorial_post.steps.find(params[:id])
|
70
65
|
@tutorial_step.destroy
|
71
66
|
respond_to do |format|
|
72
|
-
format.html { redirect_to
|
67
|
+
format.html { redirect_to tutorial_post_steps_url, :flash => { :error => 'Member Listing has been Removed' }}
|
73
68
|
format.json { head :no_content }
|
74
69
|
end
|
75
70
|
end
|
@@ -77,7 +72,6 @@ module PhcdevworksTutorials
|
|
77
72
|
private
|
78
73
|
|
79
74
|
# Common Callbacks
|
80
|
-
|
81
75
|
def set_tutorial_step
|
82
76
|
@tutorial_step = Tutorial::Step.find(params[:id])
|
83
77
|
end
|
@@ -88,7 +82,7 @@ module PhcdevworksTutorials
|
|
88
82
|
|
89
83
|
# Whitelist
|
90
84
|
def tutorial_step_params
|
91
|
-
params.require(:tutorial_step).permit(:
|
85
|
+
params.require(:tutorial_step).permit(:step_number, :step_title, :step_description, :step_image, :post_id, :slug, :user_id, :org_id)
|
92
86
|
end
|
93
87
|
|
94
88
|
end
|
@@ -5,10 +5,10 @@ module PhcdevworksTutorials
|
|
5
5
|
extend FriendlyId
|
6
6
|
|
7
7
|
#Relationships
|
8
|
-
has_and_belongs_to_many :posts, class_name:
|
8
|
+
has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
9
9
|
|
10
10
|
# Form Fields Validation
|
11
|
-
validates :
|
11
|
+
validates :category_name,
|
12
12
|
presence: true,
|
13
13
|
uniqueness: true
|
14
14
|
|
@@ -16,7 +16,7 @@ module PhcdevworksTutorials
|
|
16
16
|
friendly_id :phcdev_tutorials_category_nice_urls, use: [:slugged, :finders]
|
17
17
|
|
18
18
|
def phcdev_tutorials_category_nice_urls
|
19
|
-
[:
|
19
|
+
[:category_name]
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -1,29 +1,29 @@
|
|
1
1
|
module PhcdevworksTutorials
|
2
2
|
class Tutorial::Post < ApplicationRecord
|
3
|
-
|
3
|
+
|
4
4
|
# Clean URL Initialize
|
5
5
|
extend FriendlyId
|
6
6
|
|
7
7
|
# Image Upload
|
8
|
-
has_one_attached :
|
8
|
+
has_one_attached :post_image
|
9
9
|
|
10
10
|
# Relationships
|
11
|
-
has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "
|
11
|
+
has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
12
12
|
has_many :steps, class_name: "Tutorial::Step"
|
13
13
|
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
14
14
|
|
15
15
|
# Form Fields Validation
|
16
|
-
validates :
|
16
|
+
validates :post_title,
|
17
17
|
presence: true
|
18
18
|
|
19
|
-
validates :
|
19
|
+
validates :post_description,
|
20
20
|
presence: true
|
21
21
|
|
22
22
|
# Clean URL Define
|
23
|
-
friendly_id :
|
23
|
+
friendly_id :phcdev_tutorial_post_nice_urls, use: [:slugged, :finders]
|
24
24
|
|
25
|
-
def
|
26
|
-
[:
|
25
|
+
def phcdev_tutorial_post_nice_urls
|
26
|
+
[:post_title]
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
@@ -5,7 +5,7 @@ module PhcdevworksTutorials
|
|
5
5
|
has_one_attached :tutorial_step_image
|
6
6
|
|
7
7
|
# Relationships
|
8
|
-
belongs_to :post, class_name: "
|
8
|
+
belongs_to :post, class_name: "Tutorial::Post"
|
9
9
|
has_many :categories, class_name: "Tutorial::Category", :through => :post
|
10
10
|
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
11
11
|
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<head>
|
4
4
|
|
5
5
|
<!-- SEO System -->
|
6
|
-
<% phc_seo_title "PHCDevworks
|
7
|
-
<% phc_seo_description "Ruby on Rails 6
|
6
|
+
<% phc_seo_title "PHCDevworks Tutorials" %>
|
7
|
+
<% phc_seo_description "Ruby on Rails 6 Engine to Manage Online Tutorials." %>
|
8
8
|
<!-- SEO System -->
|
9
9
|
|
10
10
|
<!-- SEO and Site Description -->
|
@@ -55,7 +55,7 @@
|
|
55
55
|
<!-- Page Content -->
|
56
56
|
|
57
57
|
<!-- Footer Content -->
|
58
|
-
<div id="footer" class="
|
58
|
+
<div id="footer" class="footer mb-4">
|
59
59
|
<%= render "layouts/phcdevworks_tutorials/components/backend/footer/footer" %>
|
60
60
|
</div>
|
61
61
|
<!-- Footer Content -->
|
data/app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb
CHANGED
@@ -81,6 +81,28 @@
|
|
81
81
|
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Project", phcdevworks_portfolio.new_project_post_path) %></li>
|
82
82
|
</ul>
|
83
83
|
</li>
|
84
|
+
<li class="has-sub">
|
85
|
+
<a href="javascript:;">
|
86
|
+
<b class="caret"></b>
|
87
|
+
<i class="fad fa-sitemap"></i>
|
88
|
+
<span>Project Categories</span>
|
89
|
+
</a>
|
90
|
+
<ul class="sub-menu">
|
91
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project Category", phcdevworks_portfolio.project_categories_path) %></li>
|
92
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Category", phcdevworks_portfolio.new_project_category_path) %></li>
|
93
|
+
</ul>
|
94
|
+
</li>
|
95
|
+
<li class="has-sub">
|
96
|
+
<a href="javascript:;">
|
97
|
+
<b class="caret"></b>
|
98
|
+
<i class="fad fa-folders"></i>
|
99
|
+
<span>Project Types</span>
|
100
|
+
</a>
|
101
|
+
<ul class="sub-menu">
|
102
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project Type", phcdevworks_portfolio.project_types_path) %></li>
|
103
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Types", phcdevworks_portfolio.new_project_type_path) %></li>
|
104
|
+
</ul>
|
105
|
+
</li>
|
84
106
|
<!-- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
85
107
|
<% end %>
|
86
108
|
|
@@ -186,13 +208,13 @@
|
|
186
208
|
<li class="nav-header">Tutorial Posts</li>
|
187
209
|
<li class="has-sub">
|
188
210
|
<a href="javascript:;">
|
189
|
-
|
190
|
-
|
191
|
-
|
211
|
+
<b class="caret"></b>
|
212
|
+
<i class="fad fa-chalkboard-teacher"></i>
|
213
|
+
<span>Tutorial Posts</span>
|
192
214
|
</a>
|
193
215
|
<ul class="sub-menu">
|
194
|
-
|
195
|
-
|
216
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts") %>"><%= link_to "Tutorial Index", phcdevworks_tutorials.tutorial_posts_path %></li>
|
217
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts#new") %>"><%= link_to "New Tutorial", phcdevworks_tutorials.new_tutorial_post_path %></li>
|
196
218
|
</ul>
|
197
219
|
</li>
|
198
220
|
<li class="has-sub">
|
File without changes
|
@@ -7,8 +7,8 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.text_field :
|
10
|
+
<%= form.label :category_name, "Tutorial Category" %>
|
11
|
+
<%= form.text_field :category_name, placeholder: "Category Name", class: "form-control" %>
|
12
12
|
</div>
|
13
13
|
<!-- Form Input Fields -->
|
14
14
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<tbody>
|
47
47
|
<% @tutorial_categories.each do |tutorial_category| %>
|
48
48
|
<tr>
|
49
|
-
<td><%= tutorial_category.
|
49
|
+
<td><%= tutorial_category.category_name %></td>
|
50
50
|
<td>
|
51
51
|
<div class="btn-group d-flex" role="group">
|
52
52
|
<%= link_to "Category Details", tutorial_category, class: "btn btn-purple btn-xs" %>
|
@@ -7,32 +7,32 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.text_field :
|
10
|
+
<%= form.label :post_title, "Tutorial Title" %>
|
11
|
+
<%= form.text_field :post_title, placeholder: "Tutorial Title", class: "form-control" %>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="form-group field_with_errors">
|
15
|
-
<%= form.label :
|
16
|
-
<%= form.text_area :
|
15
|
+
<%= form.label :post_description, "Tutorial Description" %>
|
16
|
+
<%= form.text_area :post_description, class: "form-control", rows: "10" %>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<div class="form-group field_with_errors">
|
20
|
-
<%= form.label :
|
21
|
-
<%= form.select( :
|
20
|
+
<%= form.label :post_status, "Tutorial Status" %>
|
21
|
+
<%= form.select( :post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control"}) %>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<div class="form-group field_with_errors">
|
25
|
-
<%= form.label :
|
26
|
-
<%= form.file_field :
|
25
|
+
<%= form.label :post_image, "Featured Image" %>
|
26
|
+
<%= form.file_field :post_image, class: "form-control" %>
|
27
27
|
</div>
|
28
|
-
<% if form.object.
|
29
|
-
<%= image_tag main_app.url_for(form.object.
|
28
|
+
<% if form.object.post_image.attached? %>
|
29
|
+
<%= image_tag main_app.url_for(form.object.post_image), class: "img-responsive img-thumbnail" %>
|
30
30
|
<% end %>
|
31
31
|
|
32
32
|
<div class="form-group field_with_errors">
|
33
33
|
<label>Select a Category</label>
|
34
34
|
<div class="panel-body">
|
35
|
-
<%= form.collection_check_boxes :category_ids, PhcdevworksTutorials::Tutorial::Category.order(:
|
35
|
+
<%= form.collection_check_boxes :category_ids, PhcdevworksTutorials::Tutorial::Category.order(:category_name), :id, :category_name do |post_category| %>
|
36
36
|
<%= post_category.check_box %>
|
37
37
|
<%= post_category.label %><br>
|
38
38
|
<% end %>
|
@@ -48,9 +48,9 @@
|
|
48
48
|
<tbody>
|
49
49
|
<% @tutorial_posts.each do |tutorial_post| %>
|
50
50
|
<tr>
|
51
|
-
<td><%= tutorial_post.
|
52
|
-
<td><%= tutorial_post.
|
53
|
-
<td><%= tutorial_post.
|
51
|
+
<td><%= tutorial_post.post_title %></td>
|
52
|
+
<td><%= tutorial_post.post_description %></td>
|
53
|
+
<td><%= tutorial_post.post_status.capitalize %></td>
|
54
54
|
<td>
|
55
55
|
<div class="btn-group d-flex" role="group">
|
56
56
|
<%= link_to "Tutorial Details", tutorial_post, class: "btn btn-purple btn-xs" %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<!-- Form - Tutorial - Posts -->
|
2
|
-
<%= form_with(model: [
|
2
|
+
<%= form_with(model: [@tutorial_post, @tutorial_step], url: form_url, local: true) do |form| %>
|
3
3
|
|
4
4
|
<!-- PHCNotifi Render Validation -->
|
5
5
|
<%= render "phcdevworks_notifications/bootstrap/validations", :object => @tutorial_step %>
|
@@ -7,27 +7,25 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.select( :
|
10
|
+
<%= form.label :step_number, "Tutorial Step" %>
|
11
|
+
<%= form.select( :step_number, [["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"]], {}, {class: "form-control"}) %>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="form-group field_with_errors">
|
15
|
-
<%= form.label :
|
16
|
-
<%= form.text_field :
|
15
|
+
<%= form.label :step_title, placeholder: "Step Title" %>
|
16
|
+
<%= form.text_field :step_title, class: "form-control", rows: "10" %>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<div class="form-group field_with_errors">
|
20
|
-
<%= form.label :
|
21
|
-
<%= form.text_area :
|
20
|
+
<%= form.label :step_description, "Step Text" %>
|
21
|
+
<%= form.text_area :step_description, class: "form-control", rows: "10" %>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<div class="form-group field_with_errors">
|
25
|
-
<%= form.label :
|
26
|
-
<%= form.file_field :
|
25
|
+
<%= form.label :step_image, "Step Image" %>
|
26
|
+
<%= form.file_field :step_image, class: "form-control" %>
|
27
27
|
</div>
|
28
|
-
|
29
|
-
<%= image_tag main_app.url_for(form.object.tutorial_step_image), class: "img-responsive img-thumbnail" %>
|
30
|
-
<% end %>
|
28
|
+
|
31
29
|
<!-- Form Input Fields -->
|
32
30
|
|
33
31
|
<!-- Form Submition Button -->
|
@@ -47,8 +47,8 @@
|
|
47
47
|
<tbody>
|
48
48
|
<% @tutorial_steps.each do |tutorial_step| %>
|
49
49
|
<tr>
|
50
|
-
<td><%= tutorial_step.
|
51
|
-
<td><%= tutorial_step.
|
50
|
+
<td><%= tutorial_step.step_number %></td>
|
51
|
+
<td><%= tutorial_step.step_title %></td>
|
52
52
|
<td>
|
53
53
|
<div class="btn-group d-flex" role="group">
|
54
54
|
<%= link_to "Step Details", tutorial_post_step_path(tutorial_step.post, tutorial_step), class: "btn btn-purple btn-xs" %>
|
data/config/routes.rb
CHANGED
@@ -1,36 +1,27 @@
|
|
1
1
|
PhcdevworksTutorials::Engine.routes.draw do
|
2
2
|
|
3
|
+
# Tutorial Routs
|
3
4
|
namespace :tutorial do
|
4
|
-
resources :
|
5
|
-
|
6
|
-
namespace :tutorial do
|
7
|
-
resources :posts
|
8
|
-
end
|
9
|
-
namespace :tutorial do
|
10
|
-
resources :categories
|
11
|
-
end
|
12
|
-
# Tutorial Routs
|
13
|
-
namespace :tutorial do
|
14
|
-
resources :posts, class_name: "PhcdevworksTutorials::Tutorial::Post" do
|
15
|
-
resources :steps, class_name: "PhcdevworksTutorials::Tutorial::Step"
|
16
|
-
end
|
17
|
-
resources :categories, class_name: "PhcdevworksTutorials::Tutorial::Category"
|
5
|
+
resources :posts, class_name: "Tutorial::Post" do
|
6
|
+
resources :steps, class_name: "Tutorial::Step"
|
18
7
|
end
|
8
|
+
resources :categories, class_name: "Tutorial::Category"
|
9
|
+
end
|
19
10
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
# Frontend Routes
|
12
|
+
namespace :blog do
|
13
|
+
resources :tutorials, only: [:index, :show]
|
14
|
+
end
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
16
|
+
# API Routes
|
17
|
+
namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
|
18
|
+
namespace :v1 do
|
19
|
+
resources :posts, defaults: {format: "json"}
|
20
|
+
resources :categories, defaults: {format: "json"}
|
31
21
|
end
|
22
|
+
end
|
32
23
|
|
33
|
-
|
34
|
-
|
24
|
+
# Mount Routes
|
25
|
+
mount PhcdevworksAccounts::Engine, :at => "/"
|
35
26
|
|
36
27
|
end
|
@@ -2,12 +2,10 @@ class CreatePhcdevworksTutorialsTutorialPosts < ActiveRecord::Migration[6.0]
|
|
2
2
|
def change
|
3
3
|
create_table :phcdevworks_tutorials_tutorial_posts do |t|
|
4
4
|
|
5
|
-
t.string :
|
6
|
-
t.
|
7
|
-
t.string :
|
8
|
-
|
9
|
-
t.string :tutorial_post_image
|
10
|
-
t.string :tutorial_post_images
|
5
|
+
t.string :post_title
|
6
|
+
t.string :post_description
|
7
|
+
t.string :post_status
|
8
|
+
t.string :post_image
|
11
9
|
|
12
10
|
t.string :slug
|
13
11
|
t.string :user_id
|
@@ -2,12 +2,10 @@ class CreatePhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
|
|
2
2
|
def change
|
3
3
|
create_table :phcdevworks_tutorials_tutorial_steps do |t|
|
4
4
|
|
5
|
-
t.
|
6
|
-
t.string :
|
7
|
-
t.
|
8
|
-
|
9
|
-
t.string :tutorial_step_image
|
10
|
-
t.string :tutorial_step_images
|
5
|
+
t.string :step_number
|
6
|
+
t.string :step_title
|
7
|
+
t.string :step_description
|
8
|
+
t.string :step_image
|
11
9
|
|
12
10
|
t.string :slug
|
13
11
|
t.string :user_id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_tutorials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -212,14 +212,20 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 1.3
|
215
|
+
version: '1.3'
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 1.3.1
|
216
219
|
type: :runtime
|
217
220
|
prerelease: false
|
218
221
|
version_requirements: !ruby/object:Gem::Requirement
|
219
222
|
requirements:
|
220
223
|
- - "~>"
|
221
224
|
- !ruby/object:Gem::Version
|
222
|
-
version: 1.3
|
225
|
+
version: '1.3'
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: 1.3.1
|
223
229
|
- !ruby/object:Gem::Dependency
|
224
230
|
name: sqlite3
|
225
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,13 +254,12 @@ files:
|
|
248
254
|
- app/assets/javascripts/phcdevworks_tutorials/application.js
|
249
255
|
- app/assets/javascripts/phcdevworks_tutorials/blog/tutorials.coffee
|
250
256
|
- app/assets/javascripts/phcdevworks_tutorials/tutorial/categories.coffee
|
251
|
-
- app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee
|
252
|
-
- app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee
|
253
257
|
- app/assets/stylesheets/phcdevworks_tutorials/application.scss
|
254
258
|
- app/assets/stylesheets/phcdevworks_tutorials/blog/tutorials.scss
|
259
|
+
- app/assets/stylesheets/phcdevworks_tutorials/category/posts.css
|
255
260
|
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/categories.scss
|
256
|
-
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.
|
257
|
-
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.
|
261
|
+
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.css
|
262
|
+
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.css
|
258
263
|
- app/controllers/phcdevworks_tutorials/application_controller.rb
|
259
264
|
- app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb
|
260
265
|
- app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb
|
@@ -268,6 +273,7 @@ files:
|
|
268
273
|
- app/jobs/phcdevworks_tutorials/application_job.rb
|
269
274
|
- app/mailers/phcdevworks_tutorials/application_mailer.rb
|
270
275
|
- app/models/phcdevworks_tutorials/application_record.rb
|
276
|
+
- app/models/phcdevworks_tutorials/category.rb
|
271
277
|
- app/models/phcdevworks_tutorials/tutorial.rb
|
272
278
|
- app/models/phcdevworks_tutorials/tutorial/category.rb
|
273
279
|
- app/models/phcdevworks_tutorials/tutorial/post.rb
|
@@ -276,6 +282,7 @@ files:
|
|
276
282
|
- app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb
|
277
283
|
- app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb
|
278
284
|
- app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb
|
285
|
+
- app/views/layouts/phcdevworks_tutorials/frontend.html.erb
|
279
286
|
- app/views/phcdevworks_tutorials/blog/tutorials/index.html.erb
|
280
287
|
- app/views/phcdevworks_tutorials/blog/tutorials/show.html.erb
|
281
288
|
- app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb
|
@@ -294,10 +301,10 @@ files:
|
|
294
301
|
- app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
|
295
302
|
- app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
|
296
303
|
- config/routes.rb
|
297
|
-
- db/migrate/
|
298
|
-
- db/migrate/
|
299
|
-
- db/migrate/
|
300
|
-
- db/migrate/
|
304
|
+
- db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb
|
305
|
+
- db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
|
306
|
+
- db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
|
307
|
+
- db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb
|
301
308
|
- lib/phcdevworks_tutorials.rb
|
302
309
|
- lib/phcdevworks_tutorials/engine.rb
|
303
310
|
- lib/phcdevworks_tutorials/version.rb
|