phcdevworks_tutorials 0.4.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +3 -0
  3. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +3 -0
  4. data/app/assets/stylesheets/scaffolds.scss +65 -0
  5. data/app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb +14 -0
  6. data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +3 -2
  7. data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +3 -2
  8. data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +95 -0
  9. data/app/helpers/phcdevworks_tutorials/tutorial/steps_helper.rb +4 -0
  10. data/app/models/phcdevworks_tutorials/tutorial/post.rb +1 -3
  11. data/app/models/phcdevworks_tutorials/tutorial/step.rb +8 -0
  12. data/app/views/layouts/phcdevworks_tutorials/frontend.html.erb +5 -0
  13. data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +6 -2
  14. data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +4 -11
  15. data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +3 -7
  16. data/app/views/phcdevworks_tutorials/tutorial/posts/show.html.erb +0 -15
  17. data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +25 -0
  18. data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +39 -0
  19. data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +67 -0
  20. data/app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb +39 -0
  21. data/app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb +14 -0
  22. data/config/routes.rb +7 -5
  23. data/db/migrate/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb +0 -2
  24. data/db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb +18 -0
  25. data/db/migrate/20190929044403_add_info_to_phcdevworks_tutorials_tutorial_posts.rb +9 -0
  26. data/db/migrate/20190929044505_add_info_to_phcdevworks_tutorials_tutorial_steps.rb +7 -0
  27. data/lib/phcdevworks_tutorials/version.rb +1 -1
  28. metadata +33 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcd0ce05dfbe3900903ae92a916eadc062eb8f671a4b45ae6a0f991925f7e4d4
4
- data.tar.gz: 79184d9aad19bc6bdce434638563f36116a5da63672f78083bc09a829c68e92d
3
+ metadata.gz: '08396c3e31fa52863cd02f3ee048a42ee5c5750e12fa1fbefe0fdcfd01fd886c'
4
+ data.tar.gz: 417b0c4686adeafed8e66c503a0a50aa3fe608ea258a910056403126bcce7e7d
5
5
  SHA512:
6
- metadata.gz: 620326c3839bc41b6e0e3dc62e41785eae68a842abdc858a15841e6df50cf4a4bed556fc17e8df4e7cc5b7127898bc3966a4ea9beb0b6dfbea9246960abf608e
7
- data.tar.gz: 5f9fa81875b042e31b8b6f8ca8e2e6433a045a5b34c371d7a49d05ea49ed7dcd2700bd04782f71145be6a56893d386be79e050e2794a83defbefe60bf78f2f75
6
+ metadata.gz: aa8cecbe28424e0700b533a43c629b4a2f34df37d409955d306a96a17039757eb9b2fc3dc887f0aaa5c3b03e6cc7ee9846b6e4a0a94594bff77fb9ce04ac8471
7
+ data.tar.gz: e76c31a7754b25cbff079168a3fcee1b0cdf26105a5a316e136229bc256fe2603c30fc2b35ed3291b90fa1694a02f27013ac4bb48e79dff931b71a33acfa936c
@@ -0,0 +1,3 @@
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/
@@ -0,0 +1,3 @@
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/
@@ -0,0 +1,65 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ margin: 33px; }
5
+
6
+ body, p, ol, ul, td {
7
+ font-family: verdana, arial, helvetica, sans-serif;
8
+ font-size: 13px;
9
+ line-height: 18px; }
10
+
11
+ pre {
12
+ background-color: #eee;
13
+ padding: 10px;
14
+ font-size: 11px; }
15
+
16
+ a {
17
+ color: #000; }
18
+
19
+ a:visited {
20
+ color: #666; }
21
+
22
+ a:hover {
23
+ color: #fff;
24
+ background-color: #000; }
25
+
26
+ th {
27
+ padding-bottom: 5px; }
28
+
29
+ td {
30
+ padding: 0 5px 7px; }
31
+
32
+ div.field,
33
+ div.actions {
34
+ margin-bottom: 10px; }
35
+
36
+ #notice {
37
+ color: green; }
38
+
39
+ .field_with_errors {
40
+ padding: 2px;
41
+ background-color: red;
42
+ display: table; }
43
+
44
+ #error_explanation {
45
+ width: 450px;
46
+ border: 2px solid red;
47
+ padding: 7px 7px 0;
48
+ margin-bottom: 20px;
49
+ background-color: #f0f0f0; }
50
+
51
+ #error_explanation h2 {
52
+ text-align: left;
53
+ font-weight: bold;
54
+ padding: 5px 5px 5px 15px;
55
+ font-size: 12px;
56
+ margin: -7px -7px 0;
57
+ background-color: #c00;
58
+ color: #fff; }
59
+
60
+ #error_explanation ul li {
61
+ font-size: 12px;
62
+ list-style: square; }
63
+
64
+ label {
65
+ display: block; }
@@ -2,5 +2,19 @@ require_dependency "phcdevworks_tutorials/application_controller"
2
2
 
3
3
  module PhcdevworksTutorials
4
4
  class Blog::TutorialsController < ApplicationController
5
+
6
+ # Layout
7
+ layout 'phcdevworks_tutorials/frontend'
8
+
9
+ # INDEX
10
+ def index
11
+ @phcdevworks_tutorials_index = Tutorial::Post.where(tutorial_post_status: "published")
12
+ end
13
+
14
+ # SHOW
15
+ def show
16
+ @phcdevworks_tutorials_single = Tutorial::Post.friendly.find(params[:id])
17
+ end
18
+
5
19
  end
6
20
  end
@@ -16,6 +16,7 @@ module PhcdevworksTutorials
16
16
 
17
17
  # GET /tutorial/categories/1
18
18
  def show
19
+ @tutorial_category = Tutorial::Category.friendly.find(params[:id])
19
20
  end
20
21
 
21
22
  # GET /tutorial/categories/new
@@ -69,12 +70,12 @@ module PhcdevworksTutorials
69
70
 
70
71
  # Common Callbacks
71
72
  def set_tutorial_category
72
- @tutorial_category = Tutorial::Category.find(params[:id])
73
+ @tutorial_category = Tutorial::Category.friendly.find(params[:id])
73
74
  end
74
75
 
75
76
  # Whitelist
76
77
  def tutorial_category_params
77
- params.require(:tutorial_category).permit(:tutorial_category_name)
78
+ params.require(:tutorial_category).permit(:tutorial_category_name, :slug, :user_id, :org_id)
78
79
  end
79
80
 
80
81
  end
@@ -16,6 +16,7 @@ module PhcdevworksTutorials
16
16
 
17
17
  # GET /tutorial/posts/1
18
18
  def show
19
+ @tutorial_post = Tutorial::Post.friendly.find(params[:id])
19
20
  end
20
21
 
21
22
  # GET /tutorial/posts/new
@@ -69,12 +70,12 @@ module PhcdevworksTutorials
69
70
 
70
71
  # Common Callbacks
71
72
  def set_tutorial_post
72
- @tutorial_post = Tutorial::Post.find(params[:id])
73
+ @tutorial_post = Tutorial::Post.friendly.find(params[:id])
73
74
  end
74
75
 
75
76
  # Whitelist
76
77
  def tutorial_post_params
77
- params.require(:tutorial_post).permit(:tutorial_post_step, :tutorial_post_title, :tutorial_post_text, :category_id)
78
+ params.require(:tutorial_post).permit(:tutorial_post_step, :tutorial_post_title, :tutorial_post_text, :category_id, :slug, :user_id, :org_id)
78
79
  end
79
80
 
80
81
  end
@@ -0,0 +1,95 @@
1
+ require_dependency "phcdevworks_tutorials/application_controller"
2
+
3
+ module PhcdevworksTutorials
4
+ class Tutorial::StepsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ #include PhcdevworksCore::PhcpluginsHelper
8
+ before_action :authenticate_user!
9
+ before_action :set_paper_trail_whodunnit
10
+ before_action :set_tutorial_step, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /tutorial/steps
13
+ # GET /tutorial/steps.json
14
+ def index
15
+ @tutorial_steps = tutorial_post.steps.all
16
+ end
17
+
18
+ # GET /tutorial/steps/1
19
+ # GET /tutorial/steps/1.json
20
+ def show
21
+ @tutorial_step = tutorial_post.steps.find(params[:id])
22
+ end
23
+
24
+ # GET /tutorial/steps/new
25
+ def new
26
+ @tutorial_step = tutorial_post.steps.build
27
+ end
28
+
29
+ # GET /tutorial/steps/1/edit
30
+ def edit
31
+ @tutorial_step = Tutorial::Post.friendly.find(params[:post_id])
32
+ end
33
+
34
+ # POST /tutorial/steps
35
+ # POST /tutorial/steps.json
36
+ def create
37
+ @tutorial_step = tutorial_post.steps.create(tutorial_step_params)
38
+ @tutorial_step.user_id = current_user.id
39
+ @tutorial_step.org_id = current_user.org_id
40
+ respond_to do |format|
41
+ if @tutorial_step.save
42
+ format.html { redirect_to tutorial_post_steps_path, notice: 'Step was successfully created.' }
43
+ format.json { render :show, status: :created, location: @tutorial_step }
44
+ else
45
+ format.html { render :new }
46
+ format.json { render json: @tutorial_step.errors, status: :unprocessable_entity }
47
+ end
48
+ end
49
+ end
50
+
51
+ # PATCH/PUT /tutorial/steps/1
52
+ # PATCH/PUT /tutorial/steps/1.json
53
+ def update
54
+ @tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
55
+ respond_to do |format|
56
+ if @tutorial_step.update(tutorial_step_params)
57
+ format.html { redirect_to @tutorial_step, notice: 'Step was successfully updated.' }
58
+ format.json { render :show, status: :ok, location: @tutorial_step }
59
+ else
60
+ format.html { render :edit }
61
+ format.json { render json: @tutorial_step.errors, status: :unprocessable_entity }
62
+ end
63
+ end
64
+ end
65
+
66
+ # DELETE /tutorial/steps/1
67
+ # DELETE /tutorial/steps/1.json
68
+ def destroy
69
+ @tutorial_step = tutorial_post.steps.find(params[:id])
70
+ @tutorial_step.destroy
71
+ respond_to do |format|
72
+ format.html { redirect_to tutorial_steps_url, notice: 'Step was successfully destroyed.' }
73
+ format.json { head :no_content }
74
+ end
75
+ end
76
+
77
+ private
78
+
79
+ # Common Callbacks
80
+
81
+ def set_tutorial_step
82
+ @tutorial_step = Tutorial::Step.friendly.find(params[:id])
83
+ end
84
+
85
+ def tutorial_post
86
+ @tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
87
+ end
88
+
89
+ # Whitelist
90
+ def tutorial_step_params
91
+ params.require(:tutorial_step).permit(:steps_number, :steps_body, :post_id, :slug, :user_id, :org_id)
92
+ end
93
+
94
+ end
95
+ end
@@ -0,0 +1,4 @@
1
+ module PhcdevworksTutorials
2
+ module Tutorial::StepsHelper
3
+ end
4
+ end
@@ -6,14 +6,12 @@ module PhcdevworksTutorials
6
6
 
7
7
  # Relationships
8
8
  belongs_to :category, class_name: 'PhcdevworksTutorials::Tutorial::Category'
9
+ has_many :steps, class_name: "PhcdevworksTutorials::Tutorial::Step"
9
10
 
10
11
  # Form Fields Validation
11
12
  validates :tutorial_post_title,
12
13
  presence: true
13
14
 
14
- validates :tutorial_post_text,
15
- presence: true
16
-
17
15
  # Clean URL Define
18
16
  friendly_id :phcdev_tutorials_post_nice_urls, use: [:slugged, :finders]
19
17
 
@@ -0,0 +1,8 @@
1
+ module PhcdevworksTutorials
2
+ class Tutorial::Step < ApplicationRecord
3
+
4
+ # Relationships
5
+ belongs_to :post, class_name: "PhcdevworksTutorials::Tutorial::Post"
6
+
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ <!-- Page Content -->
2
+ <div id="content" class="content">
3
+ <%= yield %>
4
+ </div>
5
+ <!-- Page Content -->
@@ -1,9 +1,13 @@
1
1
  <%= form_with(model: tutorial_category, local: true) do |form| %>
2
2
 
3
+ <!-- PHCNotifi Render Validation -->
4
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @tutorial_category %>
5
+ <!-- PHCNotifi Render Validation -->
6
+
3
7
  <!-- Form Input Fields -->
4
8
  <div class="form-group field_with_errors">
5
- <%= form.label :tutorial_category_name, 'Tutorial Category' %>
6
- <%= form.text_field :tutorial_category_name, placeholder: 'Category Name', class: 'form-control' %>
9
+ <%= form.label :tutorial_category_name, "Tutorial Category" %>
10
+ <%= form.text_field :tutorial_category_name, placeholder: "Category Name", class: "form-control" %>
7
11
  </div>
8
12
  <!-- Form Input Fields -->
9
13
 
@@ -1,21 +1,14 @@
1
1
  <%= form_with(model: tutorial_post, local: true) do |form| %>
2
2
 
3
+ <!-- PHCNotifi Render Validation -->
4
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @tutorial_post %>
5
+ <!-- PHCNotifi Render Validation -->
6
+
3
7
  <!-- Form Input Fields -->
4
- <div class="form-group field_with_errors">
5
- <%= form.label :tutorial_post_step, "Tutorial Step" %>
6
- <%= form.select( :tutorial_post_step, [["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"]], {}, {class: "form-control"}) %>
7
- </div>
8
-
9
8
  <div class="form-group field_with_errors">
10
9
  <%= form.label :tutorial_post_title, "Tutorial Title" %>
11
10
  <%= form.text_field :tutorial_post_title, placeholder: "Tutorial Title", class: "form-control" %>
12
11
  </div>
13
-
14
- <!-- Form Input Fields -->
15
- <div class="form-group field_with_errors">
16
- <%= form.label :tutorial_post_text, "Tutorial Text" %>
17
- <%= form.text_area :tutorial_post_text, placeholder: "Tutorial Text", class: "form-control" %>
18
- </div>
19
12
 
20
13
  <div class="form-group field_with_errors">
21
14
  <label>Select a Category</label>
@@ -36,9 +36,7 @@
36
36
 
37
37
  <thead>
38
38
  <tr>
39
- <th>Tutorial Step</th>
40
39
  <th>Tutorial Title</th>
41
- <th>Tutorial Text</th>
42
40
  <th>Tutorial Category</th>
43
41
  <th></th>
44
42
  </tr>
@@ -47,15 +45,13 @@
47
45
  <tbody>
48
46
  <% @tutorial_posts.each do |tutorial_post| %>
49
47
  <tr>
50
- <td><%= tutorial_post.tutorial_post_step %></td>
51
48
  <td><%= tutorial_post.tutorial_post_title %></td>
52
- <td><%= tutorial_post.tutorial_post_text %></td>
53
49
  <td><%= tutorial_post.category.tutorial_category_name %></td>
54
50
  <td>
55
51
  <div class="btn-group d-flex" role="group">
56
- <%= link_to 'Details', tutorial_post, class: "btn btn-purple btn-xs" %>
57
- <%= link_to 'Update', edit_tutorial_post_path(tutorial_post), class: "btn btn-primary btn-xs" %>
58
- <%= link_to 'Remove', tutorial_post, method: :delete, data: { confirm: 'Are you sure? This action cannot be reversed.' }, class: "btn btn-danger btn-xs" %>
52
+ <%= link_to "Details", tutorial_post, class: "btn btn-purple btn-xs" %>
53
+ <%= link_to "Update", edit_tutorial_post_path(tutorial_post), class: "btn btn-primary btn-xs" %>
54
+ <%= link_to "Remove", tutorial_post, method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
59
55
  </div>
60
56
  </td>
61
57
  </tr>
@@ -1,19 +1,4 @@
1
1
  <p id="notice"><%= notice %></p>
2
2
 
3
- <p>
4
- <strong>Tutorial post step:</strong>
5
- <%= @tutorial_post.tutorial_post_step %>
6
- </p>
7
-
8
- <p>
9
- <strong>Tutorial post text:</strong>
10
- <%= @tutorial_post.tutorial_post_text %>
11
- </p>
12
-
13
- <p>
14
- <strong>Category:</strong>
15
- <%= @tutorial_post.category_id %>
16
- </p>
17
-
18
3
  <%= link_to 'Edit', edit_tutorial_post_path(@tutorial_post) %> |
19
4
  <%= link_to 'Back', tutorial_posts_path %>
@@ -0,0 +1,25 @@
1
+ <%= form_with(model: [ @tutorial_post, @tutorial_step], url: form_url, local: true) do |form| %>
2
+
3
+ <!-- PHCNotifi Render Validation -->
4
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @tutorial_step %>
5
+ <!-- PHCNotifi Render Validation -->
6
+
7
+ <!-- Form Input Fields -->
8
+ <div class="form-group field_with_errors">
9
+ <%= form.label :tutorial_step_number, "Tutorial Step" %>
10
+ <%= 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"}) %>
11
+ </div>
12
+
13
+ <div class="field">
14
+ <%= form.label :tutorial_step_body %>
15
+ <%= form.text_area :tutorial_step_body %>
16
+ </div>
17
+ <!-- Form Input Fields -->
18
+
19
+ <!-- Form Submition Button -->
20
+ <div class="actions">
21
+ <%= form.submit class: "btn btn-primary" %>
22
+ </div>
23
+ <!-- For Submition Button -->
24
+
25
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <!-- Title System -->
2
+ <% phc_title "Tutorial Post Manager" %>
3
+ <% phc_title_tagline "Update Tutorial Step" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Step Index", phcdevworks_tutorials.tutorial_categories_path %>
6
+ <!-- Title System -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page & Panel Content -->
20
+ <div class="panel panel-inverse">
21
+ <!-- Panel Heading -->
22
+ <div class="panel-heading">
23
+ <div class="panel-heading-btn">
24
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
25
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
26
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
27
+ </div>
28
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
29
+ </div>
30
+ <!-- Panel Heading -->
31
+ <!-- Panel Body -->
32
+ <div class="panel-body">
33
+ <!-- Form to Edit Member Address -->
34
+ <%= render "form", { form_url: tutorial_post_steps_path } %>
35
+ <!-- Form to Edit Member Address -->
36
+ </div>
37
+ <!-- Panel Body -->
38
+ </div>
39
+ <!-- Page & Panel Content -->
@@ -0,0 +1,67 @@
1
+ <!-- Title System -->
2
+ <% phc_title "Tutorial Post Manager" %>
3
+ <% phc_title_tagline "Tutorial Index" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Tutorial Index", phcdevworks_tutorials.tutorial_post_steps_path %>
6
+ <!-- Title System -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page & Panel Content -->
20
+ <div class="panel panel-inverse">
21
+ <!-- Panel Heading -->
22
+ <div class="panel-heading">
23
+ <div class="panel-heading-btn">
24
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
25
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
26
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
27
+ </div>
28
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
29
+ </div>
30
+ <!-- Panel Heading -->
31
+ <!-- Panel Body -->
32
+ <div class="panel-body">
33
+ <!-- Table - Snippet Index -->
34
+ <div class="table-responsive">
35
+ <table class="table table-striped table-bordered">
36
+
37
+ <thead>
38
+ <tr>
39
+ <th>Tutorial Step Number</th>
40
+ <th>Tutorial Step Body</th>
41
+ <th></th>
42
+ </tr>
43
+ </thead>
44
+
45
+ <tbody>
46
+ <% @tutorial_steps.each do |tutorial_step| %>
47
+ <tr>
48
+ <td><%= tutorial_step.tutorial_step_number %></td>
49
+ <td><%= tutorial_step.tutorial_step_body %></td>
50
+ <td><%= link_to 'Show', tutorial_step %></td>
51
+ <td><%= link_to 'Edit', edit_tutorial_step_path(tutorial_step) %></td>
52
+ <td><%= link_to 'Destroy', tutorial_step, method: :delete, data: { confirm: 'Are you sure?' } %></td>
53
+ </tr>
54
+ <% end %>
55
+ </tbody>
56
+
57
+ </table>
58
+ <%= link_to phcdevworks_tutorials.new_tutorial_post_step_path, class: "btn btn-primary btn-sm" do %>
59
+ <i class="fas fa-plus-circle"></i>
60
+ Add a New Step for Tutorial
61
+ <% end %>
62
+ </div>
63
+ <!-- Table - Snippet Index -->
64
+ </div>
65
+ <!-- Panel Body -->
66
+ </div>
67
+ <!-- Page & Panel Content -->
@@ -0,0 +1,39 @@
1
+ <!-- Title System -->
2
+ <% phc_title "Tutorial Post Manager" %>
3
+ <% phc_title_tagline "Add a New Step" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Tutorial Step Index", phcdevworks_tutorials.tutorial_post_steps_path %>
6
+ <!-- Title System -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page & Panel Content -->
20
+ <div class="panel panel-inverse">
21
+ <!-- Panel Heading -->
22
+ <div class="panel-heading">
23
+ <div class="panel-heading-btn">
24
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
25
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
26
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
27
+ </div>
28
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
29
+ </div>
30
+ <!-- Panel Heading -->
31
+ <!-- Panel Body -->
32
+ <div class="panel-body">
33
+ <!-- Form to Edit Member Address -->
34
+ <%= render "form", { form_url: tutorial_post_steps_path } %>
35
+ <!-- Form to Edit Member Address -->
36
+ </div>
37
+ <!-- Panel Body -->
38
+ </div>
39
+ <!-- Page & Panel Content -->
@@ -0,0 +1,14 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Tutorial step number:</strong>
5
+ <%= @tutorial_step.tutorial_step_number %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Tutorial step body:</strong>
10
+ <%= @tutorial_step.tutorial_step_body %>
11
+ </p>
12
+
13
+ <%= link_to 'Edit', edit_tutorial_step_path(@tutorial_step) %> |
14
+ <%= link_to 'Back', tutorial_steps_path %>
data/config/routes.rb CHANGED
@@ -2,8 +2,10 @@ PhcdevworksTutorials::Engine.routes.draw do
2
2
 
3
3
  # Tutorial Routs
4
4
  namespace :tutorial do
5
- resources :posts, class_name: 'PhcdevworksTutorials::Tutorial::Post'
6
- resources :categories, class_name: 'PhcdevworksTutorials::Tutorial::Category'
5
+ resources :posts, class_name: "PhcdevworksTutorials::Tutorial::Post" do
6
+ resources :steps, class_name: "PhcdevworksTutorials::Tutorial::Step"
7
+ end
8
+ resources :categories, class_name: "PhcdevworksTutorials::Tutorial::Category"
7
9
  end
8
10
 
9
11
  # Frontend Routes
@@ -14,12 +16,12 @@ PhcdevworksTutorials::Engine.routes.draw do
14
16
  # API Routes
15
17
  namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
16
18
  namespace :v1 do
17
- resources :posts, defaults: {format: 'json'}
18
- resources :categories, defaults: {format: 'json'}
19
+ resources :posts, defaults: {format: "json"}
20
+ resources :categories, defaults: {format: "json"}
19
21
  end
20
22
  end
21
23
 
22
24
  # Mount Routes
23
- mount PhcdevworksAccounts::Engine, :at => '/'
25
+ mount PhcdevworksAccounts::Engine, :at => "/"
24
26
 
25
27
  end
@@ -2,9 +2,7 @@ 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_step
6
5
  t.string :tutorial_post_title
7
- t.text :tutorial_post_text
8
6
 
9
7
  t.references :category
10
8
 
@@ -0,0 +1,18 @@
1
+ class CreatePhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_tutorials_tutorial_steps do |t|
4
+
5
+ t.integer :tutorial_step_number
6
+ t.text :tutorial_step_body
7
+
8
+ t.string :slug
9
+ t.string :user_id
10
+ t.string :org_id
11
+
12
+ t.references :post
13
+
14
+ t.timestamps
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ class AddInfoToPhcdevworksTutorialsTutorialPosts < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_tutorials_tutorial_posts, :tutorial_post_images, :string
5
+ add_column :phcdevworks_tutorials_tutorial_posts, :tutorial_post_description, :text
6
+ add_column :phcdevworks_tutorials_tutorial_posts, :tutorial_post_status, :string
7
+
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ class AddInfoToPhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_tutorials_tutorial_steps, :tutorial_step_images, :string
5
+
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '0.4.0'
2
+ VERSION = '1.1.0'
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: 0.4.0
4
+ version: 1.1.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-09-15 00:00:00.000000000 Z
11
+ date: 2019-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,84 +58,84 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
61
+ version: 1.2.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.0'
68
+ version: 1.2.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: phcthemes_web_theme_pack
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: 1.1.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: 1.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: phcdevworks_active_menus
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.0'
89
+ version: 1.0.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.0'
96
+ version: 1.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: phcdevworks_notifications
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.0'
103
+ version: 1.0.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.0'
110
+ version: 1.0.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: phcdevworks_titleseo
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.0'
117
+ version: 1.0.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.0'
124
+ version: 1.0.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: friendly_id
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '5.2'
131
+ version: '5.3'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '5.2'
138
+ version: '5.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: gravtastic
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.46'
159
+ version: '1.48'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.46'
166
+ version: '1.48'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: google-cloud-storage
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 1.1.0
201
+ version: 1.2.0
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 1.1.0
208
+ version: 1.2.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: sqlite3
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -213,9 +213,6 @@ dependencies:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
215
  version: '1.4'
216
- - - ">="
217
- - !ruby/object:Gem::Version
218
- version: 1.4.1
219
216
  type: :development
220
217
  prerelease: false
221
218
  version_requirements: !ruby/object:Gem::Requirement
@@ -223,9 +220,6 @@ dependencies:
223
220
  - - "~>"
224
221
  - !ruby/object:Gem::Version
225
222
  version: '1.4'
226
- - - ">="
227
- - !ruby/object:Gem::Version
228
- version: 1.4.1
229
223
  description: Ruby on Rails 6 Tutorial engine to manage and post tutorials.
230
224
  email:
231
225
  - developers@phcdevworks.com
@@ -241,28 +235,35 @@ files:
241
235
  - app/assets/javascripts/phcdevworks_tutorials/blog/tutorials.coffee
242
236
  - app/assets/javascripts/phcdevworks_tutorials/tutorial/categories.coffee
243
237
  - app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee
238
+ - app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee
244
239
  - app/assets/stylesheets/phcdevworks_tutorials/application.scss
245
240
  - app/assets/stylesheets/phcdevworks_tutorials/blog/tutorials.scss
246
241
  - app/assets/stylesheets/phcdevworks_tutorials/tutorial/categories.scss
247
242
  - app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss
243
+ - app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss
244
+ - app/assets/stylesheets/scaffolds.scss
248
245
  - app/controllers/phcdevworks_tutorials/application_controller.rb
249
246
  - app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb
250
247
  - app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb
251
248
  - app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb
249
+ - app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb
252
250
  - app/helpers/phcdevworks_tutorials/application_helper.rb
253
251
  - app/helpers/phcdevworks_tutorials/blog/tutorials_helper.rb
254
252
  - app/helpers/phcdevworks_tutorials/tutorial/categories_helper.rb
255
253
  - app/helpers/phcdevworks_tutorials/tutorial/posts_helper.rb
254
+ - app/helpers/phcdevworks_tutorials/tutorial/steps_helper.rb
256
255
  - app/jobs/phcdevworks_tutorials/application_job.rb
257
256
  - app/mailers/phcdevworks_tutorials/application_mailer.rb
258
257
  - app/models/phcdevworks_tutorials/application_record.rb
259
258
  - app/models/phcdevworks_tutorials/tutorial.rb
260
259
  - app/models/phcdevworks_tutorials/tutorial/category.rb
261
260
  - app/models/phcdevworks_tutorials/tutorial/post.rb
261
+ - app/models/phcdevworks_tutorials/tutorial/step.rb
262
262
  - app/views/layouts/phcdevworks_tutorials/application.html.erb
263
263
  - app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb
264
264
  - app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb
265
265
  - app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb
266
+ - app/views/layouts/phcdevworks_tutorials/frontend.html.erb
266
267
  - app/views/phcdevworks_tutorials/blog/tutorials/index.html.erb
267
268
  - app/views/phcdevworks_tutorials/blog/tutorials/show.html.erb
268
269
  - app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb
@@ -275,10 +276,18 @@ files:
275
276
  - app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb
276
277
  - app/views/phcdevworks_tutorials/tutorial/posts/new.html.erb
277
278
  - app/views/phcdevworks_tutorials/tutorial/posts/show.html.erb
279
+ - app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb
280
+ - app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb
281
+ - app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb
282
+ - app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
283
+ - app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
278
284
  - config/initializers/friendly_id.rb
279
285
  - config/routes.rb
280
286
  - db/migrate/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb
281
287
  - db/migrate/20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb
288
+ - db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb
289
+ - db/migrate/20190929044403_add_info_to_phcdevworks_tutorials_tutorial_posts.rb
290
+ - db/migrate/20190929044505_add_info_to_phcdevworks_tutorials_tutorial_steps.rb
282
291
  - lib/phcdevworks_tutorials.rb
283
292
  - lib/phcdevworks_tutorials/engine.rb
284
293
  - lib/phcdevworks_tutorials/version.rb