phccodesnipper 1.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/controllers/phccodesnipper/application_controller.rb +17 -17
- data/app/controllers/phccodesnipper/script/snippets_controller.rb +7 -7
- data/app/models/phccodesnipper/script/snippet.rb +9 -12
- data/app/models/phccodesnipper/script/url.rb +0 -1
- data/app/views/layouts/phccodesnipper/components/backend/footer/_footer.html.erb +5 -5
- data/app/views/layouts/phccodesnipper/components/backend/sidebars/_side_menu.html.erb +9 -9
- data/app/views/phccodesnipper/script/snippets/_form.html.erb +17 -14
- data/app/views/phccodesnipper/script/snippets/edit.html.erb +17 -21
- data/app/views/phccodesnipper/script/snippets/index.html.erb +14 -21
- data/app/views/phccodesnipper/script/snippets/new.html.erb +18 -22
- data/app/views/phccodesnipper/script/snippets/show.html.erb +4 -16
- data/app/views/phccodesnipper/script/urls/_form.html.erb +11 -7
- data/app/views/phccodesnipper/script/urls/edit.html.erb +10 -6
- data/app/views/phccodesnipper/script/urls/index.html.erb +21 -29
- data/app/views/phccodesnipper/script/urls/new.html.erb +11 -7
- data/app/views/phccodesnipper/script/urls/show.html.erb +4 -16
- data/config/initializers/friendly_id.rb +1 -1
- data/config/routes.rb +4 -4
- data/db/migrate/20190508091330_create_phccodesnipper_script_snippets.rb +1 -1
- data/lib/phccodesnipper.rb +0 -1
- data/lib/phccodesnipper/engine.rb +16 -16
- data/lib/phccodesnipper/version.rb +1 -1
- metadata +4 -21
- data/app/assets/javascripts/phccodesnipper/script/snippets.coffee +0 -3
- data/app/assets/stylesheets/phccodesnipper/script/snippets.scss +0 -3
- data/app/assets/stylesheets/scaffolds.scss +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2757f1e1dcd5771fa5b29faac81390921dc7a903e55a7e8dd76768fa366bb46c
|
4
|
+
data.tar.gz: ab3e0e3edb1e08272ada011b64fd246d463924276f9ee0079321ebcfb7b57910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72639c13656a5b210a15b07f07bf6316c68ca00bf80dff80192a72c4bf190e4850c8ab84fdc4b265d16719067bce5a2dd060467259ba996933ab8d31220817e9
|
7
|
+
data.tar.gz: 9eba0a78761ef5bae5249278a1605e77dc5fa37a018dc5d60c9c7d2b28403a511233a2097cef964a87e203fecda5b1c13cd828e0dedb2e4b5beadec2d938d28a
|
data/MIT-LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
module Phccodesnipper
|
2
|
-
|
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
|
-
|
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(:
|
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 :
|
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
|
-
[:
|
25
|
+
[:snippet_title]
|
29
26
|
]
|
30
27
|
end
|
31
28
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<!-- Footer -->
|
2
2
|
<span class="float-left">
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
9
|
-
|
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
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
38
|
+
<th>Snippet Title</th>
|
43
39
|
<th>Snippet Summary</th>
|
44
|
-
<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.
|
46
|
+
<td><%= script_snippet.snippet_title %></td>
|
51
47
|
<td><%= truncate(script_snippet.snippet_code, :length => 80) %></td>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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.
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
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
|
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
|
-
|
31
|
-
|
32
|
-
|
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 "
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
<tr>
|
38
|
+
<th>Script Url</th>
|
39
|
+
<th colspan="3"></th>
|
40
|
+
</tr>
|
45
41
|
</thead>
|
46
|
-
|
47
42
|
<tbody>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
4
|
-
<% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipper.
|
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
|
-
|
31
|
-
|
32
|
-
|
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 "
|
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.
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Phccodesnipper::Engine.routes.draw do
|
2
2
|
|
3
|
-
#
|
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
|
data/lib/phccodesnipper.rb
CHANGED
@@ -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
|
-
#
|
21
|
+
|
22
|
+
# PHCHelper Dependencies
|
22
23
|
require 'phccorehelpers'
|
23
24
|
require 'phcmenus'
|
24
25
|
require 'phcnotifi'
|
25
26
|
require 'phctitleseo'
|
26
|
-
|
27
|
-
#
|
28
|
-
require 'i18n'
|
27
|
+
|
28
|
+
# Frontend Dependencies
|
29
29
|
require 'gravtastic'
|
30
30
|
require 'friendly_id'
|
31
|
-
|
32
|
-
#
|
31
|
+
|
32
|
+
# Upload Dependencies
|
33
33
|
require 'aws-sdk-s3'
|
34
34
|
require 'google-cloud-storage'
|
35
35
|
require 'mini_magick'
|
36
|
-
|
37
|
-
# Database
|
36
|
+
|
37
|
+
# Database Dependencies
|
38
38
|
require 'paper_trail'
|
39
39
|
require 'pg'
|
40
|
-
|
41
|
-
#
|
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
|
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:
|
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-
|
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: '
|
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: '
|
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,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; }
|