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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -27
  3. data/app/assets/config/phcdevworks_tutorials_manifest.js +1 -1
  4. data/app/assets/stylesheets/phcdevworks_tutorials/category/posts.css +4 -0
  5. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.css +4 -0
  6. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.css +4 -0
  7. data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +2 -3
  8. data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +5 -6
  9. data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +6 -12
  10. data/app/models/phcdevworks_tutorials/category.rb +7 -0
  11. data/app/models/phcdevworks_tutorials/tutorial/category.rb +3 -3
  12. data/app/models/phcdevworks_tutorials/tutorial/post.rb +8 -8
  13. data/app/models/phcdevworks_tutorials/tutorial/step.rb +1 -1
  14. data/app/views/layouts/phcdevworks_tutorials/application.html.erb +3 -3
  15. data/app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb +27 -5
  16. data/app/views/layouts/phcdevworks_tutorials/frontend.html.erb +0 -0
  17. data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +2 -2
  18. data/app/views/phcdevworks_tutorials/tutorial/categories/index.html.erb +1 -1
  19. data/app/views/phcdevworks_tutorials/tutorial/categories/show.html.erb +1 -1
  20. data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +11 -11
  21. data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +3 -3
  22. data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +10 -12
  23. data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +1 -1
  24. data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +2 -2
  25. data/config/routes.rb +17 -26
  26. data/db/migrate/{20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb → 20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb} +4 -6
  27. data/db/migrate/{20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb → 20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb} +4 -6
  28. data/db/migrate/{20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb → 20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb} +1 -1
  29. data/db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb +8 -0
  30. data/lib/phcdevworks_tutorials/version.rb +1 -1
  31. metadata +19 -12
  32. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee +0 -3
  33. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +0 -3
  34. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss +0 -3
  35. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +0 -3
  36. 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: 28e98221e85ad49edfef5621c659076e890f3d4a77b4aeb3dab88f54a6516543
4
- data.tar.gz: 4a02f1e0c036c93ba92d66c0ff6b12dd8150e2e6f218035d5d7e753c4b43b36f
3
+ metadata.gz: c201886acd054426575703760acd433a6988760793610992321f3278492cfa8e
4
+ data.tar.gz: 06d56fdb5b8116fbeb7448b0d45e9ac25bf28cdc4a393478910a408f5880c352
5
5
  SHA512:
6
- metadata.gz: 5f265968cbf40e6b9160925fb6679f0d5cfebdccb2cbcf0a435c7eae1b90baea74ecf7ab4a4d61f70f31947e1cf018d9794ba737c178c7db5b7494e9351c06a2
7
- data.tar.gz: 7135b90e1b93a46678505b72340793c8482fbdaafa61191419dc8daefc1195ac90ab2118292927062c1a84a7c1bf610599f8ff73648379c8130aa64c223a7d5b
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).
@@ -1,2 +1,2 @@
1
- //= link_directory ../javascripts/phcdevworks_tutorials .js
2
1
  //= link_directory ../stylesheets/phcdevworks_tutorials .scss
2
+ //= link_directory ../stylesheets/phcdevworks_tutorials .js
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -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.friendly.find(params[:id])
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(:tutorial_category_name, :slug, :user_id, :org_id)
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
- respond_to do |format|
64
- format.html { redirect_to tutorial_posts_path, :flash => { :error => 'Tutorial has been Removed.' }}
65
- format.json { head :no_content }
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.friendly.find(params[:id])
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(:tutorial_post_step, :tutorial_post_title, :tutorial_post_text,:tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id, category_ids: [])
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.all
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
- @tutorial_step = Tutorial::Post.friendly.find(params[:post_id])
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 tutorial_post_steps_path, :flash => { :success => 'Tutorial Step has been Added' }}
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 tutorial_post_steps_path, :flash => { :notice => 'Tutorial Step has been Updated.' }}
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 tutorial_post_steps_path, :flash => { :error => 'Tutorial Step has been Removed' }}
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(:tutorial_step_number, :tutorial_step_body, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
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
@@ -0,0 +1,7 @@
1
+ module PhcdevworksTutorials
2
+ module Category
3
+ def self.table_name_prefix
4
+ 'phcdevworks_tutorials_category_'
5
+ end
6
+ end
7
+ 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: 'Tutorial::Post', :join_table => 'categories_posts', :dependent => :destroy
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 :tutorial_category_name,
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
- [:tutorial_category_name]
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 :tutorial_post_image
8
+ has_one_attached :post_image
9
9
 
10
10
  # Relationships
11
- has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "categories_posts", :dependent => :destroy
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 :tutorial_post_title,
16
+ validates :post_title,
17
17
  presence: true
18
18
 
19
- validates :tutorial_post_description,
19
+ validates :post_description,
20
20
  presence: true
21
21
 
22
22
  # Clean URL Define
23
- friendly_id :phcdev_tutorials_post_nice_urls, use: [:slugged, :finders]
23
+ friendly_id :phcdev_tutorial_post_nice_urls, use: [:slugged, :finders]
24
24
 
25
- def phcdev_tutorials_post_nice_urls
26
- [:tutorial_post_title]
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: "PhcdevworksTutorials::Tutorial::Post"
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 Scripts" %>
7
- <% phc_seo_description "Ruby on Rails 6 Script CDN and Code Snippets Listing Management Engine." %>
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="row footer mb-4">
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 -->
@@ -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
- <b class="caret"></b>
190
- <i class="fad fa-chalkboard-teacher"></i>
191
- <span>Tutorial Posts</span>
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
- <li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts") %>"><%= link_to "Tutorial Index", phcdevworks_tutorials.tutorial_posts_path %></li>
195
- <li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts#new") %>"><%= link_to "New Tutorial", phcdevworks_tutorials.new_tutorial_post_path %></li>
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">
@@ -7,8 +7,8 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :tutorial_category_name, "Tutorial Category" %>
11
- <%= form.text_field :tutorial_category_name, placeholder: "Category Name", class: "form-control" %>
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.tutorial_category_name %></td>
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" %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>
4
4
  <strong>Tutorial category name:</strong>
5
- <%= @tutorial_category.tutorial_category_name %>
5
+ <%= @tutorial_category.category_name %>
6
6
  </p>
7
7
 
8
8
  <%= link_to 'Edit', edit_tutorial_category_path(@tutorial_category) %> |
@@ -7,32 +7,32 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :tutorial_post_title, "Tutorial Title" %>
11
- <%= form.text_field :tutorial_post_title, placeholder: "Tutorial Title", class: "form-control" %>
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 :tutorial_post_description, "Tutorial Description" %>
16
- <%= form.text_area :tutorial_post_description, class: "form-control", rows: "10" %>
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 :tutorial_post_status, "Tutorial Status" %>
21
- <%= form.select( :tutorial_post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control form-control"}) %>
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 :tutorial_post_image, "Featured Image" %>
26
- <%= form.file_field :tutorial_post_image, class: "form-control" %>
25
+ <%= form.label :post_image, "Featured Image" %>
26
+ <%= form.file_field :post_image, class: "form-control" %>
27
27
  </div>
28
- <% if form.object.tutorial_post_image.attached? %>
29
- <%= image_tag main_app.url_for(form.object.tutorial_post_image), class: "img-responsive img-thumbnail" %>
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(:tutorial_category_name), :id, :tutorial_category_name do |post_category| %>
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.tutorial_post_title %></td>
52
- <td><%= tutorial_post.tutorial_post_description %></td>
53
- <td><%= tutorial_post.tutorial_post_status %></td>
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: [ @tutorial_post, @tutorial_step], url: form_url, local: true) do |form| %>
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 :tutorial_step_number, "Tutorial Step" %>
11
- <%= form.select( :tutorial_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"}) %>
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 :tutorial_step_title, placeholder: "Step Title" %>
16
- <%= form.text_field :tutorial_step_title, class: "form-control", rows: "10" %>
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 :tutorial_step_description, "Step Text" %>
21
- <%= form.text_area :tutorial_step_description, class: "form-control", rows: "10" %>
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 :tutorial_step_image, "Step Image" %>
26
- <%= form.file_field :tutorial_step_image, class: "form-control" %>
25
+ <%= form.label :step_image, "Step Image" %>
26
+ <%= form.file_field :step_image, class: "form-control" %>
27
27
  </div>
28
- <% if form.object.tutorial_step_image.attached? %>
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 -->
@@ -33,7 +33,7 @@
33
33
  <div class="panel-body">
34
34
 
35
35
  <!-- Edit Form -->
36
- <%= render "form", { form_url: tutorial_post_steps_path } %>
36
+ <%= render "form", { form_url: tutorial_post_step_path } %>
37
37
  <!-- Edit Form -->
38
38
 
39
39
  </div>
@@ -47,8 +47,8 @@
47
47
  <tbody>
48
48
  <% @tutorial_steps.each do |tutorial_step| %>
49
49
  <tr>
50
- <td><%= tutorial_step.tutorial_step_number %></td>
51
- <td><%= tutorial_step.tutorial_step_title %></td>
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 :steps
5
- end
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
- # Frontend Routes
21
- namespace :blog do
22
- resources :tutorials, only: [:index, :show]
23
- end
11
+ # Frontend Routes
12
+ namespace :blog do
13
+ resources :tutorials, only: [:index, :show]
14
+ end
24
15
 
25
- # API Routes
26
- namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
27
- namespace :v1 do
28
- resources :posts, defaults: {format: "json"}
29
- resources :categories, defaults: {format: "json"}
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
- # Mount Routes
34
- mount PhcdevworksAccounts::Engine, :at => "/"
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 :tutorial_post_title
6
- t.text :tutorial_post_description
7
- t.string :tutorial_post_status
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.integer :tutorial_step_number
6
- t.string :tutorial_step_title
7
- t.text :tutorial_step_description
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
@@ -2,7 +2,7 @@ class CreatePhcdevworksTutorialsTutorialCategories < ActiveRecord::Migration[6.0
2
2
  def change
3
3
  create_table :phcdevworks_tutorials_tutorial_categories do |t|
4
4
 
5
- t.string :tutorial_category_name
5
+ t.string :category_name
6
6
 
7
7
  t.string :slug
8
8
  t.string :user_id
@@ -0,0 +1,8 @@
1
+ class CreatePhcdevworksTutorialsCategoriesPosts < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_tutorials_categories_posts do |t|
4
+ t.integer :category_id
5
+ t.integer :post_id
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '2.1.0'
2
+ VERSION = "4.0.1"
3
3
  end
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: 2.1.0
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-15 00:00:00.000000000 Z
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.0
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.0
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.scss
257
- - app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss
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/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb
298
- - db/migrate/20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb
299
- - db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb
300
- - db/migrate/20191003235303_create_join_table_categories_posts.rb
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
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the tutorial::posts controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the tutorial::steps controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,10 +0,0 @@
1
- class CreateJoinTableCategoriesPosts < ActiveRecord::Migration[6.0]
2
- def change
3
- create_join_table :categories, :posts do |t|
4
-
5
- # t.index [:category_id, :post_id]
6
- # t.index [:post_id, :category_id]
7
-
8
- end
9
- end
10
- end