phcdevworks_tutorials 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3195d42bc2b12f68a6193727f9261f3610350595e69daecde898b4bf161a2179
4
- data.tar.gz: fc035c3777c0c86392c62f88599b429c8557f3988491de23b522a05c104a4d0f
3
+ metadata.gz: 3d32d9df3aa7d8e9298f25416c9fc115b1734fa3830ef6a9c4ee7918d1501d80
4
+ data.tar.gz: 18dcdb6180462edf1100626b8f40c7405033d4159df62962b22993a1f842fda9
5
5
  SHA512:
6
- metadata.gz: d8cc8b9cdd6c7585caecb7ee179cb681af0ecd6770b4a097ae71dc387fbb1248b6663b176bae243948debc23d67a2ff276f299997011fc507231ee7e853be426
7
- data.tar.gz: 4870e32d9555d6aafb70219f466686620a5005f5cd4d996b45dba8078b9bf5f166d42ffbd369b293a5f700862d09454a9bfaebce0ecd5ed6772e347bb800e1ca
6
+ metadata.gz: f0731f199c9c95af142ed37ac488b98e6c6cf2ecd8e85818ae6868018b5edbade8d8961c5bf39ac8a62fc8df6193ecd46941bec0270eb1df7564daaef7cdea02
7
+ data.tar.gz: 9a72615547581a12636bd835cd6197ad65637bf8a653095e188fb7a23522889837cbe9f901f9b0bc6af2e97a4dbd03e38dd225cb3eee3ed15db25f7015aa9df9
@@ -88,7 +88,7 @@ module PhcdevworksTutorials
88
88
 
89
89
  # Whitelist
90
90
  def tutorial_step_params
91
- params.require(:tutorial_step).permit(:steps_number, :steps_body, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
91
+ params.require(:tutorial_step).permit(:tutorial_step_number, :tutorial_step_body, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
92
92
  end
93
93
 
94
94
  end
@@ -8,9 +8,9 @@ module PhcdevworksTutorials
8
8
  has_one_attached :tutorial_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 => "categories_posts", :dependent => :destroy
12
12
  has_many :steps, class_name: "Tutorial::Step"
13
- belongs_to :user, class_name: 'PhcdevworksAccounts::User'
13
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
14
14
 
15
15
  # Form Fields Validation
16
16
  validates :tutorial_post_title,
@@ -6,6 +6,8 @@ module PhcdevworksTutorials
6
6
 
7
7
  # Relationships
8
8
  belongs_to :post, class_name: "PhcdevworksTutorials::Tutorial::Post"
9
+ has_many :categories, class_name: "Tutorial::Category", :through => :post
10
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
9
11
 
10
12
  end
11
13
  end
@@ -10,11 +10,26 @@
10
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
11
  </div>
12
12
 
13
+ <div class="form-group field_with_errors">
14
+ <%= form.label :tutorial_step_title, "Step Title" %>
15
+ <%= form.text_area :tutorial_step_title, class: "form-control", rows: "10" %>
16
+ </div>
17
+
13
18
  <div class="form-group field_with_errors">
14
19
  <%= form.label :tutorial_step_body, "Step Text" %>
15
20
  <%= form.text_area :tutorial_step_body, class: "form-control", rows: "10" %>
16
21
  </div>
17
22
 
23
+ <div class="form-group field_with_errors">
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" %>
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 %>
31
+ </div>
32
+
18
33
  <div class="form-group field_with_errors">
19
34
  <div class="form-group field_with_errors">
20
35
  <%= form.label :tutorial_step_image, "Step Image" %>
@@ -7,8 +7,8 @@
7
7
 
8
8
  <!-- Page Bradcrumbs -->
9
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>
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
12
  </ol>
13
13
  <!-- Page Bradcrumbs -->
14
14
 
@@ -18,50 +18,60 @@
18
18
 
19
19
  <!-- Page & Panel Content -->
20
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>
21
+
22
+ <!-- Panel Heading -->
23
+ <div class="panel-heading">
24
+ <div class="panel-heading-btn">
25
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
26
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
27
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
28
+ </div>
29
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
27
30
  </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">
31
+ <!-- Panel Heading -->
32
+
33
+ <!-- Panel Body -->
34
+ <div class="panel-body">
35
+
36
+ <!-- Table - Snippet Index -->
37
+ <div class="table-responsive">
38
+ <table class="table table-striped table-bordered">
36
39
 
37
- <thead>
38
- <tr>
39
- <th>Tutorial Step Number</th>
40
- <th>Tutorial Step Body</th>
41
- <th></th>
42
- </tr>
43
- </thead>
40
+ <thead>
41
+ <tr>
42
+ <th>Tutorial Step Number</th>
43
+ <th>Tutorial Step Title</th>
44
+ <th></th>
45
+ </tr>
46
+ </thead>
44
47
 
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_post_step_path(tutorial_step.post, tutorial_step) %></td>
51
- <td><%= link_to 'Edit', edit_tutorial_post_step_path(tutorial_step.post, tutorial_step) %></td>
52
- <td><%= link_to 'Destroy', tutorial_post_step_path(tutorial_step.post, tutorial_step), method: :delete, data: { confirm: 'Are you sure?' } %></td>
53
- </tr>
54
- <% end %>
55
- </tbody>
48
+ <tbody>
49
+ <% @tutorial_steps.each do |tutorial_step| %>
50
+ <tr>
51
+ <td><%= tutorial_step.tutorial_step_number %></td>
52
+ <td><%= tutorial_step.tutorial_step_title %></td>
53
+ <td>
54
+ <div class="btn-group d-flex" role="group">
55
+ <%= link_to 'Show', tutorial_post_step_path(tutorial_step.post, tutorial_step), class: "btn btn-purple btn-xs" %>
56
+ <%= link_to 'Update', edit_tutorial_post_step_path(tutorial_step.post, tutorial_step), class: "btn btn-primary btn-xs" %>
57
+ <%= link_to "Update", edit_tutorial_post_path(tutorial_post) %>
58
+ <%= link_to 'Destroy', tutorial_post_step_path(tutorial_step.post, tutorial_step), method: :delete, data: { confirm: 'Are you sure? This Action Cannot be Reversed.' }, class: "btn btn-danger btn-xs" %>
59
+ </div>
60
+ </td>
61
+ </tr>
62
+ <% end %>
63
+ </tbody>
64
+
65
+ </table>
66
+ <%= link_to phcdevworks_tutorials.new_tutorial_post_step_path, class: "btn btn-primary btn-sm" do %>
67
+ <i class="fas fa-plus-circle"></i>
68
+ Add a New Step for Tutorial
69
+ <% end %>
70
+ </div>
71
+ <!-- Table - Snippet Index -->
56
72
 
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
73
  </div>
63
- <!-- Table - Snippet Index -->
64
- </div>
65
- <!-- Panel Body -->
74
+ <!-- Panel Body -->
75
+
66
76
  </div>
67
77
  <!-- Page & Panel Content -->
@@ -1,14 +0,0 @@
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 %>
@@ -1,4 +1,4 @@
1
- class AddImageToPhcdevworksTutorialsTutorialPosts < ActiveRecord::Migration[6.0]
1
+ class AddImageToPhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
 
4
4
  add_column :phcdevworks_tutorials_tutorial_steps, :tutorial_step_image, :string
@@ -0,0 +1,7 @@
1
+ class AddTittleToPhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_tutorials_tutorial_steps, :tutorial_step_title, :string
5
+
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '1.2.3'
2
+ VERSION = '1.2.5'
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: 1.2.3
4
+ version: 1.2.5
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-05 00:00:00.000000000 Z
11
+ date: 2019-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -290,6 +290,7 @@ files:
290
290
  - db/migrate/20190929044505_add_info_to_phcdevworks_tutorials_tutorial_steps.rb
291
291
  - db/migrate/20191002093451_add_image_to_phcdevworks_tutorials_tutorial_posts.rb
292
292
  - db/migrate/20191003235303_create_join_table_categories_posts.rb
293
+ - db/migrate/20191006054657_add_tittle_to_phcdevworks_tutorials_tutorial_steps.rb
293
294
  - lib/phcdevworks_tutorials.rb
294
295
  - lib/phcdevworks_tutorials/engine.rb
295
296
  - lib/phcdevworks_tutorials/version.rb