phccodesnipper 1.1.0 → 3.0.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/MIT-LICENSE +1 -1
  3. data/app/controllers/phccodesnipper/application_controller.rb +17 -17
  4. data/app/controllers/phccodesnipper/script/snippets_controller.rb +7 -7
  5. data/app/models/phccodesnipper/script/snippet.rb +9 -12
  6. data/app/models/phccodesnipper/script/url.rb +0 -1
  7. data/app/views/layouts/phccodesnipper/components/backend/footer/_footer.html.erb +5 -5
  8. data/app/views/layouts/phccodesnipper/components/backend/sidebars/_side_menu.html.erb +9 -9
  9. data/app/views/phccodesnipper/script/snippets/_form.html.erb +17 -14
  10. data/app/views/phccodesnipper/script/snippets/edit.html.erb +17 -21
  11. data/app/views/phccodesnipper/script/snippets/index.html.erb +14 -21
  12. data/app/views/phccodesnipper/script/snippets/new.html.erb +18 -22
  13. data/app/views/phccodesnipper/script/snippets/show.html.erb +4 -16
  14. data/app/views/phccodesnipper/script/urls/_form.html.erb +11 -7
  15. data/app/views/phccodesnipper/script/urls/edit.html.erb +10 -6
  16. data/app/views/phccodesnipper/script/urls/index.html.erb +21 -29
  17. data/app/views/phccodesnipper/script/urls/new.html.erb +11 -7
  18. data/app/views/phccodesnipper/script/urls/show.html.erb +4 -16
  19. data/config/initializers/friendly_id.rb +1 -1
  20. data/config/routes.rb +4 -4
  21. data/db/migrate/20190508091330_create_phccodesnipper_script_snippets.rb +1 -1
  22. data/lib/phccodesnipper.rb +0 -1
  23. data/lib/phccodesnipper/engine.rb +16 -16
  24. data/lib/phccodesnipper/version.rb +1 -1
  25. metadata +4 -21
  26. data/app/assets/javascripts/phccodesnipper/script/snippets.coffee +0 -3
  27. data/app/assets/stylesheets/phccodesnipper/script/snippets.scss +0 -3
  28. data/app/assets/stylesheets/scaffolds.scss +0 -65
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3cfec77367132630570e0ca23e89cee35526f25a3fd85f83e0d18fb4f029c0c
4
- data.tar.gz: 880c5cb401453f1d59bc84b5a9d59b7072fc4f132552f9e32817f27fc66cfaf4
3
+ metadata.gz: 2757f1e1dcd5771fa5b29faac81390921dc7a903e55a7e8dd76768fa366bb46c
4
+ data.tar.gz: ab3e0e3edb1e08272ada011b64fd246d463924276f9ee0079321ebcfb7b57910
5
5
  SHA512:
6
- metadata.gz: 77e03ff452b20a3694a0514781cf039cb5cf5ba748b72b3f0b766c23cf2e6b40ea24e50a812437921f46278cbd5f78fcd6fb831d87ddfb778dea4bf75bcb3fa7
7
- data.tar.gz: 9823a4e2a3da3dbd35b219f5b3012b5905b881a14221468cf4792c18e87bc1e74bf3bd0369278bb261e812df30b18c94f82550d5bc8049f0edc025cb05b96ffe
6
+ metadata.gz: 72639c13656a5b210a15b07f07bf6316c68ca00bf80dff80192a72c4bf190e4850c8ab84fdc4b265d16719067bce5a2dd060467259ba996933ab8d31220817e9
7
+ data.tar.gz: 9eba0a78761ef5bae5249278a1605e77dc5fa37a018dc5d60c9c7d2b28403a511233a2097cef964a87e203fecda5b1c13cd828e0dedb2e4b5beadec2d938d28a
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - PHCNetco/PHCDevworks/PHCNetworks
1
+ Copyright 2012-2019 BradPotts - PHCNetCo/PHCDevworks/PHCNetworks
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,22 +1,22 @@
1
1
  module Phccodesnipper
2
- class ApplicationController < ActionController::Base
3
-
4
- # Security Filters
5
- protect_from_forgery with: :exception
6
-
7
- # Load Requried Helper Files
8
- helper Phccorehelpers::Engine.helpers
9
- helper Phcmenus::Engine.helpers
10
- helper Phctitleseo::Engine.helpers
11
- helper Phcnotifi::Engine.helpers
12
- helper Phcaccounts::Engine.helpers
13
-
14
- # Papertrail Whodunnit Username
15
- def user_for_paper_trail
16
- current_user ? current_user.username : 'Public user'
17
- end
2
+ class ApplicationController < ActionController::Base
18
3
 
19
- private
4
+ # Security Filters
5
+ protect_from_forgery with: :exception
20
6
 
7
+ # Load Requried Helper Files
8
+ helper Phccorehelpers::Engine.helpers
9
+ helper Phcmenus::Engine.helpers
10
+ helper Phctitleseo::Engine.helpers
11
+ helper Phcnotifi::Engine.helpers
12
+ helper Phcaccounts::Engine.helpers
13
+
14
+ # Papertrail Whodunnit Username
15
+ def user_for_paper_trail
16
+ current_user ? current_user.username : 'Public user'
21
17
  end
18
+
19
+ private
20
+
21
+ end
22
22
  end
@@ -7,25 +7,25 @@ module Phccodesnipper
7
7
  include Phccorehelpers::PhcpluginsHelper
8
8
  before_action :authenticate_user!
9
9
  before_action :set_script_snippet, only: [:show, :edit, :update, :destroy]
10
-
10
+
11
11
  # INDEX
12
12
  def index
13
13
  @script_snippets = Script::Snippet.all
14
14
  end
15
-
15
+
16
16
  # SHOW
17
17
  def show
18
18
  end
19
-
19
+
20
20
  # NEW
21
21
  def new
22
22
  @script_snippet = Script::Snippet.new
23
23
  end
24
-
24
+
25
25
  # EDIT
26
26
  def edit
27
27
  end
28
-
28
+
29
29
  # CREATE
30
30
  def create
31
31
  @script_snippet = Script::Snippet.new(script_snippet_params)
@@ -35,7 +35,7 @@ module Phccodesnipper
35
35
  render :new
36
36
  end
37
37
  end
38
-
38
+
39
39
  # UPDATE
40
40
  def update
41
41
  if @script_snippet.update(script_snippet_params)
@@ -60,7 +60,7 @@ module Phccodesnipper
60
60
 
61
61
  # Whitelist
62
62
  def script_snippet_params
63
- params.require(:script_snippet).permit(:snippet_tittle, :snippet_code)
63
+ params.require(:script_snippet).permit(:snippet_title, :snippet_code)
64
64
  end
65
65
 
66
66
  end
@@ -1,31 +1,28 @@
1
1
  module Phccodesnipper
2
2
  class Script::Snippet < ApplicationRecord
3
-
3
+
4
4
  # Include Core Validations
5
5
  include Phccorehelpers::Validations
6
-
6
+
7
7
  # Clean URL Initialize
8
8
  extend FriendlyId
9
-
9
+
10
10
  # Relationships
11
11
  has_many :urls, class_name: 'Phccodesnipper::Script::Url'
12
-
13
- # Form Fields Validation
14
- validates :snippet_tittle,
15
- presence: true,
16
- length: { minimum: 2 }
12
+
13
+ # Form Fields Validation
14
+ validates :snippet_title,
15
+ presence: true
17
16
 
18
17
  validates :snippet_code,
19
- presence: true,
20
- length: { minimum: 2 }
18
+ presence: true
21
19
 
22
20
  # Clean URL Define
23
21
  friendly_id :phc_nice_url_slug, use: [:slugged, :finders]
24
22
 
25
- # Define for Multiple Records
26
23
  def phc_nice_url_slug
27
24
  [
28
- [:snippet_tittle]
25
+ [:snippet_title]
29
26
  ]
30
27
  end
31
28
 
@@ -10,7 +10,6 @@ module Phccodesnipper
10
10
  # Form Fields Validation
11
11
  validates :script_url,
12
12
  presence: true,
13
- length: { minimum: 5 },
14
13
  format: { :with => phc_domain_regx, message: "Please follow this URL format http or https://www.**********.com" }
15
14
 
16
15
  end
@@ -1,11 +1,11 @@
1
1
  <!-- Footer -->
2
2
  <span class="float-left">
3
- 2012-<%= Time.now.year %> -
4
- <strong>PHC</strong>CodeSnipper -
5
- Engine v<%= Gem.loaded_specs["phccodesnipper"].version.to_s %>
3
+ 2012-<%= Time.now.year %> -
4
+ <strong>PHC</strong>CodeSnipper -
5
+ Engine v<%= Gem.loaded_specs["phccodesnipper"].version.to_s %>
6
6
  </span>
7
7
  <span class="float-right">
8
- Developed with <i class="fas fa-heart hanna_hearts"></i> by
9
- <a class="phcnet_copyright" href="https://phcdevworks.com/"><strong>PHC</strong>Devworks</a>
8
+ Developed with <i class="fas fa-heart hanna_hearts"></i> by
9
+ <a class="phcnet_copyright" href="https://phcdevworks.com/"><strong>PHC</strong>Devworks</a>
10
10
  </span>
11
11
  <!-- Footer -->
@@ -144,14 +144,14 @@
144
144
  <% if current_user && current_user.admin? %>
145
145
  <!-- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
146
146
  <li class="nav-header">User Administration</li>
147
- <li class="has-sub">
148
- <a href="javascript:;">
149
- <b class="caret"></b>
150
- <i class="fas fa-user"></i>
151
- <span>Admin</span>
152
- </a>
153
- <ul class="sub-menu">
154
- <li class="<%= phc_menus_active_controller('phcaccounts/admin/users') %>"><%= link_to 'User List', phcaccounts.admin_users_path %></li>
147
+ <li class="has-sub">
148
+ <a href="javascript:;">
149
+ <b class="caret"></b>
150
+ <i class="fas fa-user"></i>
151
+ <span>Admin</span>
152
+ </a>
153
+ <ul class="sub-menu">
154
+ <li class="<%= phc_menus_active_controller('phcaccounts/admin/users') %>"><%= link_to 'User List', phcaccounts.admin_users_path %></li>
155
155
  </ul>
156
156
  </li>
157
157
  <!-- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
@@ -173,7 +173,7 @@
173
173
  </li>
174
174
  <!-- Sidebar - Sidebar Navigation - PHCAccounts User Options -->
175
175
  <% end %>
176
-
176
+
177
177
  <!-- Sidebar - Sidebar Minifier -->
178
178
  <li>
179
179
  <a href="javascript:;" class="sidebar-minify-btn" data-click="sidebar-minify">
@@ -4,20 +4,23 @@
4
4
  <!-- PHCNotifi Render Validation -->
5
5
  <%= render 'phcnotifi/default/validations', :object => @script_snippet %>
6
6
  <!-- PHCNotifi Render Validation -->
7
-
8
- <div class="form-group field_with_error">
9
- <%= form.label :snippet_tittle, "Snippet Tittle" %>
10
- <%= form.text_field :snippet_tittle, class: 'form-control', placeholder: 'Snippet Tittle' %>
11
- </div>
12
-
13
- <div class="form-group field_with_error">
14
- <%= form.label :snippet_code, "Code Snippet" %>
15
- <%= form.text_area :snippet_code, class: 'form-control', placeholder: 'Code Snippet', rows: '10' %>
16
- </div>
17
-
18
- <div class="actions">
19
- <%= form.submit class: "btn btn-primary" %>
20
- </div>
7
+
8
+ <!-- Form Input Fields -->
9
+ <div class="form-group field_with_errors">
10
+ <%= form.label :snippet_title, "Snippet Title" %>
11
+ <%= form.text_field :snippet_title, class: 'form-control', placeholder: 'Snippet Title' %>
12
+ </div>
13
+ <div class="form-group field_with_errors">
14
+ <%= form.label :snippet_code, "Code Snippet" %>
15
+ <%= form.text_area :snippet_code, class: 'form-control', placeholder: 'Code Snippet', rows: '10' %>
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 -->
21
24
 
22
25
  <% end %>
23
26
  <!-- Form - Script - Snippets -->
@@ -18,26 +18,22 @@
18
18
 
19
19
  <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
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>
30
- </div>
31
- <!-- Panel Heading -->
32
-
33
- <!-- Panel Body -->
34
- <div class="panel-body">
35
- <!-- Edit - Form - Script - Posts -->
36
- <%= render 'form', script_snippet: @script_snippet %>
37
- <!-- Edit - Form - Script - Posts -->
38
- </div>
39
- <!-- Panel Body -->
40
-
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 Script Snippet -->
34
+ <%= render 'form', script_snippet: @script_snippet %>
35
+ <!-- Form to Edit Script Snippet -->
36
+ </div>
37
+ <!-- Panel Body -->
41
38
  </div>
42
39
  <!-- Page & Panel Content -->
43
-
@@ -18,7 +18,6 @@
18
18
 
19
19
  <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
21
-
22
21
  <!-- Panel Heading -->
23
22
  <div class="panel-heading">
24
23
  <div class="panel-heading-btn">
@@ -29,47 +28,41 @@
29
28
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
30
29
  </div>
31
30
  <!-- Panel Heading -->
32
-
33
31
  <!-- Panel Body -->
34
32
  <div class="panel-body">
35
-
36
33
  <!-- Table - Snippet Index -->
37
34
  <div class="table-responsive">
38
35
  <table class="table table-striped table-bordered">
39
-
40
36
  <thead>
41
37
  <tr>
42
- <th>Snippet Tittle</th>
38
+ <th>Snippet Title</th>
43
39
  <th>Snippet Summary</th>
44
- <th colspan="3"></th>
40
+ <th></th>
45
41
  </tr>
46
42
  </thead>
47
43
  <tbody>
48
44
  <% @script_snippets.each do |script_snippet| %>
49
45
  <tr>
50
- <td><%= script_snippet.snippet_tittle %></td>
46
+ <td><%= script_snippet.snippet_title %></td>
51
47
  <td><%= truncate(script_snippet.snippet_code, :length => 80) %></td>
52
- <td>
53
- <div class="btn-group d-flex" role="group">
54
- <%= link_to 'Details', script_snippet, class: "btn btn-purple btn-xs" %>
55
- <%= link_to 'Update', edit_script_snippet_path(script_snippet), class: "btn btn-primary btn-xs" %>
56
- <%= link_to 'Remmove', script_snippet, method: :delete, data: { confirm: 'Are you sure? This will aslo delte the snippet urls.' }, class: "btn btn-danger btn-xs" %>
57
- </div>
58
- </td>
48
+ <td>
49
+ <div class="btn-group d-flex" role="group">
50
+ <%= link_to 'Details', script_snippet, class: "btn btn-purple btn-xs" %>
51
+ <%= link_to 'Update', edit_script_snippet_path(script_snippet), class: "btn btn-primary btn-xs" %>
52
+ <%= link_to 'Remmove', script_snippet, method: :delete, data: { confirm: 'Are you sure? This will aslo delte the snippet urls.' }, class: "btn btn-danger btn-xs" %>
53
+ </div>
54
+ </td>
59
55
  </tr>
60
56
  <% end %>
61
57
  </tbody>
62
-
63
58
  </table>
64
- <%= link_to phccodesnipper.new_script_snippet_path, class: "btn btn-primary btn-sm" do %>
65
- <i class="fas fa-plus-circle"></i>
66
- Add a New Code Snippet
67
- <% end %>
59
+ <%= link_to phccodesnipper.new_script_snippet_path, class: "btn btn-primary btn-sm" do %>
60
+ <i class="fas fa-plus-circle"></i>
61
+ Add a New Code Snippet
62
+ <% end %>
68
63
  </div>
69
64
  <!-- Table - Snippet Index -->
70
-
71
65
  </div>
72
66
  <!-- Panel Body -->
73
-
74
67
  </div>
75
68
  <!-- Page & Panel Content -->
@@ -1,6 +1,6 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Code Snippet Manager" %>
3
- <% phc_title_tagline "New Code Snippet" %>
3
+ <% phc_title_tagline "Create a New Code Snippet" %>
4
4
  <% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.script_snippets_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
@@ -18,26 +18,22 @@
18
18
 
19
19
  <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
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>
30
- </div>
31
- <!-- Panel Heading -->
32
-
33
- <!-- Panel Body -->
34
- <div class="panel-body">
35
- <!-- New - Form - Script - Posts -->
36
- <%= render 'form', script_snippet: @script_snippet %>
37
- <!-- New - Form - Script - Posts -->
38
- </div>
39
- <!-- Panel Body -->
40
-
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 for New Script Snippet -->
34
+ <%= render 'form', script_snippet: @script_snippet %>
35
+ <!-- Form for New Script Snippet -->
36
+ </div>
37
+ <!-- Panel Body -->
41
38
  </div>
42
39
  <!-- Page & Panel Content -->
43
-
@@ -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
 
@@ -21,39 +21,30 @@
21
21
 
22
22
  <!-- Button Area -->
23
23
  <div class="col-lg-4">
24
-
25
24
  <!-- Button Panel -->
26
25
  <div class="panel panel-inverse">
27
-
28
26
  <!-- Panel Heading -->
29
27
  <div class="panel-heading">
30
28
  <h4 class="panel-title">Options Panel</h4>
31
29
  </div>
32
30
  <!-- Panel Heading -->
33
-
34
31
  <!-- Panel Body -->
35
32
  <div class="panel-body">
36
-
37
33
  <div class="btn-group d-flex" role="group">
38
34
  <%= link_to 'Update', phccodesnipper.edit_script_snippet_path, class: "btn btn-primary" %>
39
35
  <%= link_to 'Remove', phccodesnipper.script_snippet_path, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
40
- </div>
41
-
36
+ </div>
42
37
  </div>
43
38
  <!-- Panel Body -->
44
-
45
39
  </div>
46
40
  <!-- Button Panel -->
47
-
48
41
  </div>
49
42
  <!-- Button Area -->
50
43
 
51
44
  <!-- Main Area -->
52
45
  <div class="col-lg-8">
53
-
54
46
  <!-- Main Panel -->
55
47
  <div class="panel panel-inverse">
56
-
57
48
  <!-- Panel Heading -->
58
49
  <div class="panel-heading">
59
50
  <div class="panel-heading-btn">
@@ -64,18 +55,15 @@
64
55
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
65
56
  </div>
66
57
  <!-- Panel Heading -->
67
-
68
58
  <!-- Panel Body -->
69
59
  <div class="panel-body">
70
- <p class="h3"><%= @script_snippet.snippet_tittle %></p>
60
+ <p class="h3"><%= @script_snippet.snippet_title %></p>
71
61
  <hr>
72
62
  <pre><code><%= @script_snippet.snippet_code %></code></pre>
73
63
  </div>
74
64
  <!-- Panel Body -->
75
-
76
65
  </div>
77
66
  <!-- Main Panel -->
78
-
79
67
  </div>
80
68
  <!-- Main Area -->
81
69
 
@@ -5,14 +5,18 @@
5
5
  <%= render 'phcnotifi/default/validations', :object => @script_url %>
6
6
  <!-- PHCNotifi Render Validation -->
7
7
 
8
- <div class="form-group field_with_errors">
9
- <%= form.label :script_url %>
10
- <%= form.text_field :script_url, class: 'form-control', placeholder: 'Script Url' %>
11
- </div>
8
+ <!-- Form Input Fields -->
9
+ <div class="form-group field_with_errors">
10
+ <%= form.label :script_url %>
11
+ <%= form.text_field :script_url, class: 'form-control', placeholder: 'Script Url' %>
12
+ </div>
13
+ <!-- Form Input Fields -->
12
14
 
13
- <div class="actions">
14
- <%= form.submit class: "btn btn-primary" %>
15
- </div>
15
+ <!-- Form Submition Button -->
16
+ <div class="actions">
17
+ <%= form.submit class: "btn btn-primary" %>
18
+ </div>
19
+ <!-- For Submition Button -->
16
20
 
17
21
  <% end %>
18
22
  <!-- Form - Script - Url -->
@@ -1,6 +1,6 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Code Snippet Manager" %>
3
- <% phc_title_tagline "Update Code URL" %>
3
+ <% phc_title_tagline "Update Asset URL" %>
4
4
  <% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.script_snippets_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
@@ -16,8 +16,9 @@
16
16
  <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
17
  <!-- Page Header -->
18
18
 
19
- <!-- Page Content -->
19
+ <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
21
+ <!-- Panel Heading -->
21
22
  <div class="panel-heading">
22
23
  <div class="panel-heading-btn">
23
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>
@@ -26,10 +27,13 @@
26
27
  </div>
27
28
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
28
29
  </div>
30
+ <!-- Panel Heading -->
31
+ <!-- Panel Body -->
29
32
  <div class="panel-body">
30
- <!-- Edit - Form - Script - Posts -->
31
- <%= render 'form', { form_url: script_snippet_url_path } %>
32
- <!-- Edit - Form - Script - Posts -->
33
+ <!-- Form to Edit Script Snippet Asset URLS -->
34
+ <%= render 'form', { form_url: script_snippet_url_path } %>
35
+ <!-- Form to Edit Script Snippet Asset URLS -->
33
36
  </div>
37
+ <!-- Panel Body -->
34
38
  </div>
35
- <!-- Page Content -->
39
+ <!-- Page & Panel Content -->
@@ -1,6 +1,6 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Code Snippet Manager" %>
3
- <% phc_title_tagline "Code Snippet Index" %>
3
+ <% phc_title_tagline "Update Asset Index" %>
4
4
  <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
5
  <% phc_breadcrumb_two link_to "Code Snippet Index", phccodesnipper.script_snippets_path %>
6
6
  <!-- Title System -->
@@ -18,7 +18,6 @@
18
18
 
19
19
  <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
21
-
22
21
  <!-- Panel Heading -->
23
22
  <div class="panel-heading">
24
23
  <div class="panel-heading-btn">
@@ -29,46 +28,39 @@
29
28
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
30
29
  </div>
31
30
  <!-- Panel Heading -->
32
-
33
31
  <!-- Panel Body -->
34
32
  <div class="panel-body">
35
-
36
33
  <!-- Table - Snippet Index -->
37
34
  <div class="table-responsive">
38
35
  <table class="table table-striped table-bordered">
39
-
40
36
  <thead>
41
- <tr>
42
- <th>Script Url</th>
43
- <th colspan="3"></th>
44
- </tr>
37
+ <tr>
38
+ <th>Script Url</th>
39
+ <th colspan="3"></th>
40
+ </tr>
45
41
  </thead>
46
-
47
42
  <tbody>
48
- <% @script_urls.each do |script_url| %>
49
- <tr>
50
- <td><%= script_url.script_url %></td>
51
- <td>
52
- <div class="btn-group d-flex" role="group">
53
- <%= link_to 'Details', script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-purple btn-xs" %>
54
- <%= link_to 'Update', edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
55
- <%= link_to 'Remove', script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: 'Are you sure? This action cannot be reversed.' }, class: "btn btn-danger btn-xs" %>
56
- </div>
57
- </td>
58
- </tr>
59
- <% end %>
43
+ <% @script_urls.each do |script_url| %>
44
+ <tr>
45
+ <td><%= script_url.script_url %></td>
46
+ <td>
47
+ <div class="btn-group d-flex" role="group">
48
+ <%= link_to 'Details', script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-purple btn-xs" %>
49
+ <%= link_to 'Update', edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
50
+ <%= link_to 'Remove', script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: 'Are you sure? This action cannot be reversed.' }, class: "btn btn-danger btn-xs" %>
51
+ </div>
52
+ </td>
53
+ </tr>
54
+ <% end %>
60
55
  </tbody>
61
-
62
56
  </table>
63
- <%= link_to phccodesnipper.new_script_snippet_url_path, class: "btn btn-primary btn-sm" do %>
64
- <i class="fas fa-plus-circle"></i>
65
- Add a New Script URL
66
- <% end %>
57
+ <%= link_to phccodesnipper.new_script_snippet_url_path, class: "btn btn-primary btn-sm" do %>
58
+ <i class="fas fa-plus-circle"></i>
59
+ Add a New Script URL
60
+ <% end %>
67
61
  </div>
68
62
  <!-- Table - Snippet Index -->
69
-
70
63
  </div>
71
64
  <!-- Panel Body -->
72
-
73
65
  </div>
74
66
  <!-- Page & Panel Content -->
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Code Snippet Manager" %>
3
- <% phc_title_tagline "New Code URL" %>
4
- <% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.script_snippet_urls_path %>
3
+ <% phc_title_tagline "Create a New Asset URL" %>
4
+ <% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.script_snippets_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -16,8 +16,9 @@
16
16
  <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
17
  <!-- Page Header -->
18
18
 
19
- <!-- Page Content -->
19
+ <!-- Page & Panel Content -->
20
20
  <div class="panel panel-inverse">
21
+ <!-- Panel Heading -->
21
22
  <div class="panel-heading">
22
23
  <div class="panel-heading-btn">
23
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>
@@ -26,10 +27,13 @@
26
27
  </div>
27
28
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
28
29
  </div>
30
+ <!-- Panel Heading -->
31
+ <!-- Panel Body -->
29
32
  <div class="panel-body">
30
- <!-- Edit - Form - Script - Posts -->
31
- <%= render 'form', { form_url: script_snippet_urls_path } %>
32
- <!-- Edit - Form - Script - Posts -->
33
+ <!-- Form for New Script Asset URL -->
34
+ <%= render 'form', { form_url: script_snippet_urls_path } %>
35
+ <!-- Form for New Script Asset URL -->
33
36
  </div>
37
+ <!-- Panel Body -->
34
38
  </div>
35
- <!-- Page Content -->
39
+ <!-- Page & Panel Content -->
@@ -1,14 +1,14 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Code Snippet Manager" %>
3
- <% phc_title_tagline "Url Details" %>
3
+ <% phc_title_tagline "Asset URL Details" %>
4
4
  <% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.script_snippets_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
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
 
@@ -21,39 +21,30 @@
21
21
 
22
22
  <!-- Button Area -->
23
23
  <div class="col-lg-4">
24
-
25
24
  <!-- Button Panel -->
26
25
  <div class="panel panel-inverse">
27
-
28
26
  <!-- Panel Heading -->
29
27
  <div class="panel-heading">
30
28
  <h4 class="panel-title">Options Panel</h4>
31
29
  </div>
32
30
  <!-- Panel Heading -->
33
-
34
31
  <!-- Panel Body -->
35
32
  <div class="panel-body">
36
-
37
33
  <div class="btn-group d-flex" role="group">
38
34
  <%= link_to 'Update', phccodesnipper.edit_script_snippet_url_path, class: "btn btn-primary" %>
39
35
  <%= link_to 'Remove', phccodesnipper.script_snippet_urls_path, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
40
- </div>
41
-
36
+ </div>
42
37
  </div>
43
38
  <!-- Panel Body -->
44
-
45
39
  </div>
46
40
  <!-- Button Panel -->
47
-
48
41
  </div>
49
42
  <!-- Button Area -->
50
43
 
51
44
  <!-- Main Area -->
52
45
  <div class="col-lg-8">
53
-
54
46
  <!-- Main Panel -->
55
47
  <div class="panel panel-inverse">
56
-
57
48
  <!-- Panel Heading -->
58
49
  <div class="panel-heading">
59
50
  <div class="panel-heading-btn">
@@ -64,7 +55,6 @@
64
55
  <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
65
56
  </div>
66
57
  <!-- Panel Heading -->
67
-
68
58
  <!-- Panel Body -->
69
59
  <div class="panel-body">
70
60
  <p class="h3">Script Snippet URL</p>
@@ -72,10 +62,8 @@
72
62
  <pre><code><%= @script_url.script_url %></code></pre>
73
63
  </div>
74
64
  <!-- Panel Body -->
75
-
76
65
  </div>
77
66
  <!-- Main Panel -->
78
-
79
67
  </div>
80
68
  <!-- Main Area -->
81
69
 
@@ -18,7 +18,7 @@ FriendlyId.defaults do |config|
18
18
 
19
19
  config.reserved_words = %w(new edit index session login logout users admin
20
20
  stylesheets assets javascripts images)
21
-
21
+
22
22
  # This adds an option to treat reserved words as conflicts rather than exceptions.
23
23
  # When there is no good candidate, a UUID will be appended, matching the existing
24
24
  # conflict behavior.
@@ -1,13 +1,13 @@
1
1
  Phccodesnipper::Engine.routes.draw do
2
2
 
3
- # Routes - User Accounts
4
- mount Phcaccounts::Engine, :at => '/'
5
-
6
- # Routes - Engine
3
+ # Script Snippet Routes
7
4
  namespace :script do
8
5
  resources :snippets, class_name: 'Phccodesnipper::Script::Snippet' do
9
6
  resources :urls, class_name: 'Phccodesnipper::Script::Url'
10
7
  end
11
8
  end
12
9
 
10
+ # PHCAccounts Routes
11
+ mount Phcaccounts::Engine, :at => '/'
12
+
13
13
  end
@@ -3,7 +3,7 @@ class CreatePhccodesnipperScriptSnippets < ActiveRecord::Migration[5.2]
3
3
 
4
4
  create_table :phccodesnipper_script_snippets do |t|
5
5
 
6
- t.string :snippet_tittle
6
+ t.string :snippet_title
7
7
  t.text :snippet_code
8
8
 
9
9
  t.string :slug
@@ -1,5 +1,4 @@
1
1
  require "phccodesnipper/engine"
2
2
 
3
3
  module Phccodesnipper
4
- # Your code goes here...
5
4
  end
@@ -1,6 +1,6 @@
1
1
  module Phccodesnipper
2
2
  class Engine < ::Rails::Engine
3
-
3
+
4
4
  # PHCTheme Dependencies
5
5
  require 'phctheme1'
6
6
  require 'phctheme2'
@@ -9,7 +9,8 @@ module Phccodesnipper
9
9
  require 'phctheme5'
10
10
  require 'phctheme6'
11
11
  require 'phctheme7'
12
-
12
+
13
+ # PHCAdmin Dependencies
13
14
  require 'phcadmin1'
14
15
  require 'phcadmin2'
15
16
  require 'phcadmin3'
@@ -17,33 +18,32 @@ module Phccodesnipper
17
18
  require 'phcadmin5'
18
19
  require 'phcadmin6'
19
20
  require 'phcadmin7'
20
-
21
- # PHC Helper Dependencies
21
+
22
+ # PHCHelper Dependencies
22
23
  require 'phccorehelpers'
23
24
  require 'phcmenus'
24
25
  require 'phcnotifi'
25
26
  require 'phctitleseo'
26
-
27
- # UI & URL Frontend Dependencies
28
- require 'i18n'
27
+
28
+ # Frontend Dependencies
29
29
  require 'gravtastic'
30
30
  require 'friendly_id'
31
-
32
- # File Upload & Service Dependencies
31
+
32
+ # Upload Dependencies
33
33
  require 'aws-sdk-s3'
34
34
  require 'google-cloud-storage'
35
35
  require 'mini_magick'
36
-
37
- # Database & Paper Trail Dependencies
36
+
37
+ # Database Dependencies
38
38
  require 'paper_trail'
39
39
  require 'pg'
40
-
41
- # Security Dependencies
40
+
41
+ # Payment Dependencies
42
42
  require 'phcaccounts'
43
43
 
44
44
  # Isolate Namespace
45
45
  isolate_namespace Phccodesnipper
46
-
46
+
47
47
  # Testing Generator
48
48
  config.generators do |g|
49
49
  g.test_framework :rspec,
@@ -56,7 +56,7 @@ module Phccodesnipper
56
56
  g.fixture_replacement :factory_bot,
57
57
  dir: "spec/factories"
58
58
  end
59
-
59
+
60
60
  # Load Requried Helper Files
61
61
  config.to_prepare do
62
62
  Phcaccounts::ApplicationController.helper(ApplicationHelper)
@@ -65,6 +65,6 @@ module Phccodesnipper
65
65
  Phcnotifi::ApplicationController.helper(ApplicationHelper)
66
66
  Phctitleseo::ApplicationController.helper(ApplicationHelper)
67
67
  end
68
-
68
+
69
69
  end
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module Phccodesnipper
2
- VERSION = '1.1.0'
2
+ VERSION = '3.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phccodesnipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -282,20 +282,6 @@ dependencies:
282
282
  - - "~>"
283
283
  - !ruby/object:Gem::Version
284
284
  version: '46.0'
285
- - !ruby/object:Gem::Dependency
286
- name: i18n
287
- requirement: !ruby/object:Gem::Requirement
288
- requirements:
289
- - - "~>"
290
- - !ruby/object:Gem::Version
291
- version: '1.6'
292
- type: :runtime
293
- prerelease: false
294
- version_requirements: !ruby/object:Gem::Requirement
295
- requirements:
296
- - - "~>"
297
- - !ruby/object:Gem::Version
298
- version: '1.6'
299
285
  - !ruby/object:Gem::Dependency
300
286
  name: friendly_id
301
287
  requirement: !ruby/object:Gem::Requirement
@@ -470,14 +456,14 @@ dependencies:
470
456
  requirements:
471
457
  - - "~>"
472
458
  - !ruby/object:Gem::Version
473
- version: '38.2'
459
+ version: '39.0'
474
460
  type: :runtime
475
461
  prerelease: false
476
462
  version_requirements: !ruby/object:Gem::Requirement
477
463
  requirements:
478
464
  - - "~>"
479
465
  - !ruby/object:Gem::Version
480
- version: '38.2'
466
+ version: '39.0'
481
467
  - !ruby/object:Gem::Dependency
482
468
  name: sqlite3
483
469
  requirement: !ruby/object:Gem::Requirement
@@ -650,10 +636,7 @@ files:
650
636
  - Rakefile
651
637
  - app/assets/config/phccodesnipper_manifest.js
652
638
  - app/assets/javascripts/phccodesnipper/application.js
653
- - app/assets/javascripts/phccodesnipper/script/snippets.coffee
654
639
  - app/assets/stylesheets/phccodesnipper/application.scss
655
- - app/assets/stylesheets/phccodesnipper/script/snippets.scss
656
- - app/assets/stylesheets/scaffolds.scss
657
640
  - app/controllers/phccodesnipper/application_controller.rb
658
641
  - app/controllers/phccodesnipper/script/snippets_controller.rb
659
642
  - app/controllers/phccodesnipper/script/urls_controller.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 styles related to the script::snippets controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,65 +0,0 @@
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; }