phcdevworks_tutorials 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +3 -0
- data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +3 -0
- data/app/assets/stylesheets/scaffolds.scss +65 -0
- data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +95 -0
- data/app/helpers/phcdevworks_tutorials/tutorial/steps_helper.rb +4 -0
- data/app/models/phcdevworks_tutorials/tutorial/post.rb +1 -3
- data/app/models/phcdevworks_tutorials/tutorial/step.rb +8 -0
- data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +6 -2
- data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +4 -11
- data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +3 -7
- data/app/views/phcdevworks_tutorials/tutorial/posts/show.html.erb +0 -15
- data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +25 -0
- data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +39 -0
- data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +67 -0
- data/app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb +39 -0
- data/app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb +14 -0
- data/config/routes.rb +7 -5
- data/db/migrate/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb +0 -2
- data/db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb +18 -0
- data/lib/phcdevworks_tutorials/version.rb +1 -1
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a45e1901641ed89f76059cfe021ce3f8b02b585bf7956aaa424ad3e0e31e3fd
|
4
|
+
data.tar.gz: 3e9929250fcb7c624194d78673f720c1b8dd50f1fcd6ba9f57e1e6187b450a11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d069541f5e14f712aa693d7a33d06b45fab873f2a0c57a3a2ded462ff8eb6e6ffe4e1d302c465da1b7b4f8a6d279bc82ef9244a9b07a675b0a2d63f0bdc93ff
|
7
|
+
data.tar.gz: 62778941f02f41342af967d6eaf46f8045848c693be3ad442ab74af5ca2eaf57430f4a3f4c2d2654f7087b8f83568709053e1bb3ebfcf9769bfeeed61ad31beb
|
@@ -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; }
|
@@ -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
|
@@ -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
|
|
@@ -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,
|
6
|
-
<%= form.text_field :tutorial_category_name, placeholder:
|
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
|
57
|
-
<%= link_to
|
58
|
-
<%= link_to
|
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:
|
6
|
-
|
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:
|
18
|
-
resources :categories, defaults: {format:
|
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
|
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: 1.0.
|
4
|
+
version: 1.0.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-09-
|
11
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -241,24 +241,30 @@ files:
|
|
241
241
|
- app/assets/javascripts/phcdevworks_tutorials/blog/tutorials.coffee
|
242
242
|
- app/assets/javascripts/phcdevworks_tutorials/tutorial/categories.coffee
|
243
243
|
- app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee
|
244
|
+
- app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee
|
244
245
|
- app/assets/stylesheets/phcdevworks_tutorials/application.scss
|
245
246
|
- app/assets/stylesheets/phcdevworks_tutorials/blog/tutorials.scss
|
246
247
|
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/categories.scss
|
247
248
|
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss
|
249
|
+
- app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss
|
250
|
+
- app/assets/stylesheets/scaffolds.scss
|
248
251
|
- app/controllers/phcdevworks_tutorials/application_controller.rb
|
249
252
|
- app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb
|
250
253
|
- app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb
|
251
254
|
- app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb
|
255
|
+
- app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb
|
252
256
|
- app/helpers/phcdevworks_tutorials/application_helper.rb
|
253
257
|
- app/helpers/phcdevworks_tutorials/blog/tutorials_helper.rb
|
254
258
|
- app/helpers/phcdevworks_tutorials/tutorial/categories_helper.rb
|
255
259
|
- app/helpers/phcdevworks_tutorials/tutorial/posts_helper.rb
|
260
|
+
- app/helpers/phcdevworks_tutorials/tutorial/steps_helper.rb
|
256
261
|
- app/jobs/phcdevworks_tutorials/application_job.rb
|
257
262
|
- app/mailers/phcdevworks_tutorials/application_mailer.rb
|
258
263
|
- app/models/phcdevworks_tutorials/application_record.rb
|
259
264
|
- app/models/phcdevworks_tutorials/tutorial.rb
|
260
265
|
- app/models/phcdevworks_tutorials/tutorial/category.rb
|
261
266
|
- app/models/phcdevworks_tutorials/tutorial/post.rb
|
267
|
+
- app/models/phcdevworks_tutorials/tutorial/step.rb
|
262
268
|
- app/views/layouts/phcdevworks_tutorials/application.html.erb
|
263
269
|
- app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb
|
264
270
|
- app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb
|
@@ -276,10 +282,16 @@ files:
|
|
276
282
|
- app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb
|
277
283
|
- app/views/phcdevworks_tutorials/tutorial/posts/new.html.erb
|
278
284
|
- app/views/phcdevworks_tutorials/tutorial/posts/show.html.erb
|
285
|
+
- app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb
|
286
|
+
- app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb
|
287
|
+
- app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb
|
288
|
+
- app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
|
289
|
+
- app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
|
279
290
|
- config/initializers/friendly_id.rb
|
280
291
|
- config/routes.rb
|
281
292
|
- db/migrate/20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb
|
282
293
|
- db/migrate/20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb
|
294
|
+
- db/migrate/20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb
|
283
295
|
- lib/phcdevworks_tutorials.rb
|
284
296
|
- lib/phcdevworks_tutorials/engine.rb
|
285
297
|
- lib/phcdevworks_tutorials/version.rb
|