phcdevworks_tutorials 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/phcdevworks_tutorials_manifest.js +1 -1
  3. data/app/assets/stylesheets/phcdevworks_tutorials/category/posts.css +4 -0
  4. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.css +4 -0
  5. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.css +4 -0
  6. data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +1 -2
  7. data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +5 -6
  8. data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +6 -12
  9. data/app/models/phcdevworks_tutorials/category.rb +7 -0
  10. data/app/models/phcdevworks_tutorials/tutorial/post.rb +1 -1
  11. data/app/models/phcdevworks_tutorials/tutorial/step.rb +1 -1
  12. data/app/views/layouts/phcdevworks_tutorials/frontend.html.erb +0 -0
  13. data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +2 -4
  14. data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +1 -1
  15. data/config/routes.rb +3 -12
  16. data/db/migrate/{20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb → 20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb} +1 -3
  17. data/db/migrate/{20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb → 20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb} +2 -4
  18. data/db/migrate/{20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb → 20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb} +0 -0
  19. data/lib/phcdevworks_tutorials/version.rb +1 -1
  20. metadata +10 -9
  21. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee +0 -3
  22. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +0 -3
  23. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss +0 -3
  24. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5803311e5f32f0958b2bbc0b6d0d172dd0b4fe8eaf18cd6edfd4304ed3ae3b4e
4
- data.tar.gz: 3c086bb4acd998cb2dc83298c16ef611b7003a669d6c1d8394f52348b0b3824d
3
+ metadata.gz: 33e27b7f41f07b09e2baff0704a5aba9588b2408eff2c2d1824539e2b804d561
4
+ data.tar.gz: adfd438d8a8b1217fea7e9df4da3f77ccb3581f22dc6112a15e5e50809120b3a
5
5
  SHA512:
6
- metadata.gz: 657bcfe127653a6f81ea449871c285e1a6838242fdd9c862ae2f916a09ff61374ebeec6daca8f18dac227c85b4775b0707656f7055700cda247e7f3140f2df7a
7
- data.tar.gz: be0800ab82ed522b4f1c4ef9a62bd34d62d251ece9e795782bf86ceb0ca2cf20a37c66554c1a66c0e4358957871e6ac1ba708d4abed02c53963576ca42730127
6
+ metadata.gz: 5a24a436b3be0a2026e93abaf93ff77048fe3fbd916ff50d966660d572c91bac5250218338f9bbb862592ccad5e03b5ebe7a6b57a32d20172fef0729f6465022
7
+ data.tar.gz: 541c6f66f94a4850c67b2617894b87ad7f1ff2a632c6bfbf15fcf09b5a04f249b86e0f202ce251f2751be8a50e50f2e728fcc513f83156c8301f68d68384aae7
@@ -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,7 +69,7 @@ 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
@@ -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(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id)
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(:tutorial_step_number, :tutorial_step_title, :tutorial_step_description, :tutorial_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
@@ -1,6 +1,6 @@
1
1
  module PhcdevworksTutorials
2
2
  class Tutorial::Post < ApplicationRecord
3
-
3
+
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
@@ -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
 
@@ -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 %>
@@ -25,9 +25,7 @@
25
25
  <%= form.label :tutorial_step_image, "Step Image" %>
26
26
  <%= form.file_field :tutorial_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>
data/config/routes.rb CHANGED
@@ -1,20 +1,11 @@
1
1
  PhcdevworksTutorials::Engine.routes.draw do
2
2
 
3
- 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
3
  # Tutorial Routs
13
4
  namespace :tutorial do
14
- resources :posts, class_name: "PhcdevworksTutorials::Tutorial::Post" do
15
- resources :steps, class_name: "PhcdevworksTutorials::Tutorial::Step"
5
+ resources :posts, class_name: "Tutorial::Post" do
6
+ resources :steps, class_name: "Tutorial::Step"
16
7
  end
17
- resources :categories, class_name: "PhcdevworksTutorials::Tutorial::Category"
8
+ resources :categories, class_name: "Tutorial::Category"
18
9
  end
19
10
 
20
11
  # Frontend Routes
@@ -3,11 +3,9 @@ class CreatePhcdevworksTutorialsTutorialPosts < ActiveRecord::Migration[6.0]
3
3
  create_table :phcdevworks_tutorials_tutorial_posts do |t|
4
4
 
5
5
  t.string :tutorial_post_title
6
- t.text :tutorial_post_description
6
+ t.string :tutorial_post_description
7
7
  t.string :tutorial_post_status
8
-
9
8
  t.string :tutorial_post_image
10
- t.string :tutorial_post_images
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
5
+ t.string :tutorial_step_number
6
6
  t.string :tutorial_step_title
7
- t.text :tutorial_step_description
8
-
7
+ t.string :tutorial_step_description
9
8
  t.string :tutorial_step_image
10
- t.string :tutorial_step_images
11
9
 
12
10
  t.string :slug
13
11
  t.string :user_id
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
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.1
4
+ version: 2.1.2
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-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -254,13 +254,12 @@ files:
254
254
  - app/assets/javascripts/phcdevworks_tutorials/application.js
255
255
  - app/assets/javascripts/phcdevworks_tutorials/blog/tutorials.coffee
256
256
  - app/assets/javascripts/phcdevworks_tutorials/tutorial/categories.coffee
257
- - app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee
258
- - app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee
259
257
  - app/assets/stylesheets/phcdevworks_tutorials/application.scss
260
258
  - app/assets/stylesheets/phcdevworks_tutorials/blog/tutorials.scss
259
+ - app/assets/stylesheets/phcdevworks_tutorials/category/posts.css
261
260
  - app/assets/stylesheets/phcdevworks_tutorials/tutorial/categories.scss
262
- - app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss
263
- - 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
264
263
  - app/controllers/phcdevworks_tutorials/application_controller.rb
265
264
  - app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb
266
265
  - app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb
@@ -274,6 +273,7 @@ files:
274
273
  - app/jobs/phcdevworks_tutorials/application_job.rb
275
274
  - app/mailers/phcdevworks_tutorials/application_mailer.rb
276
275
  - app/models/phcdevworks_tutorials/application_record.rb
276
+ - app/models/phcdevworks_tutorials/category.rb
277
277
  - app/models/phcdevworks_tutorials/tutorial.rb
278
278
  - app/models/phcdevworks_tutorials/tutorial/category.rb
279
279
  - app/models/phcdevworks_tutorials/tutorial/post.rb
@@ -282,6 +282,7 @@ files:
282
282
  - app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb
283
283
  - app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb
284
284
  - app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb
285
+ - app/views/layouts/phcdevworks_tutorials/frontend.html.erb
285
286
  - app/views/phcdevworks_tutorials/blog/tutorials/index.html.erb
286
287
  - app/views/phcdevworks_tutorials/blog/tutorials/show.html.erb
287
288
  - app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb
@@ -300,10 +301,10 @@ files:
300
301
  - app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
301
302
  - app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
302
303
  - config/routes.rb
303
- - db/migrate/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb
304
- - db/migrate/20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb
305
- - db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb
306
304
  - db/migrate/20191003235303_create_join_table_categories_posts.rb
305
+ - db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb
306
+ - db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
307
+ - db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
307
308
  - lib/phcdevworks_tutorials.rb
308
309
  - lib/phcdevworks_tutorials/engine.rb
309
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/