phcdevworks_tutorials 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +1 -1
- data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +1 -1
- data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +1 -1
- data/app/models/phcdevworks_tutorials/tutorial/category.rb +2 -2
- data/app/models/phcdevworks_tutorials/tutorial/post.rb +6 -6
- 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 +8 -8
- data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +2 -2
- data/db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb +4 -4
- data/db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb +4 -4
- data/db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb +1 -1
- data/lib/phcdevworks_tutorials/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: 5b899d94a785c234b3d0ce62692b41b83a5587d6d575fdea8d695ca4b7193dac
|
4
|
+
data.tar.gz: 74920ac5eec073d6478121ed3e8db5b07a79c54a522f50558d5cd10bc5d40de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77f565f907e0e6e277ebd10704059dbb990a00edeb30107757bf25edcc9f6cf2fe6f81456d12649674c0436ef53562fc9a2357207448c5051c05caf9a6b93708
|
7
|
+
data.tar.gz: 3d63b438fc6d1fa743b6d4f59d3e65e03b9985c29bd319323108971220924722cbf5b0732c0529370d39bab118ff4f58f19fa1f752c25282235ec56c0c623ed8
|
@@ -74,7 +74,7 @@ module PhcdevworksTutorials
|
|
74
74
|
|
75
75
|
# Whitelist
|
76
76
|
def tutorial_category_params
|
77
|
-
params.require(:tutorial_category).permit(:
|
77
|
+
params.require(:tutorial_category).permit(:category_name, :slug, :user_id, :org_id)
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
@@ -74,7 +74,7 @@ module PhcdevworksTutorials
|
|
74
74
|
|
75
75
|
# Whitelist
|
76
76
|
def tutorial_post_params
|
77
|
-
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: [])
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
@@ -82,7 +82,7 @@ module PhcdevworksTutorials
|
|
82
82
|
|
83
83
|
# Whitelist
|
84
84
|
def tutorial_step_params
|
85
|
-
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)
|
86
86
|
end
|
87
87
|
|
88
88
|
end
|
@@ -8,7 +8,7 @@ module PhcdevworksTutorials
|
|
8
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
|
@@ -5,7 +5,7 @@ module PhcdevworksTutorials
|
|
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
11
|
has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
@@ -13,17 +13,17 @@ module PhcdevworksTutorials
|
|
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
|
@@ -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" %>
|
@@ -7,23 +7,23 @@
|
|
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
28
|
|
29
29
|
<!-- Form Input Fields -->
|
@@ -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" %>
|
@@ -2,10 +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.string :
|
7
|
-
t.string :
|
8
|
-
t.string :
|
5
|
+
t.string :post_title
|
6
|
+
t.string :post_description
|
7
|
+
t.string :post_status
|
8
|
+
t.string :post_image
|
9
9
|
|
10
10
|
t.string :slug
|
11
11
|
t.string :user_id
|
@@ -2,10 +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.string :
|
6
|
-
t.string :
|
7
|
-
t.string :
|
8
|
-
t.string :
|
5
|
+
t.string :step_number
|
6
|
+
t.string :step_title
|
7
|
+
t.string :step_description
|
8
|
+
t.string :step_image
|
9
9
|
|
10
10
|
t.string :slug
|
11
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.0
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|