phccodesnipperpro 4.4.0 → 5.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/README.md +28 -0
- data/Rakefile +4 -18
- data/app/assets/config/phccodesnipperpro_manifest.js +2 -2
- data/app/controllers/phccodesnipperpro/application_controller.rb +14 -15
- data/app/controllers/phccodesnipperpro/script/snippets_controller.rb +1 -1
- data/app/controllers/phccodesnipperpro/script/urls_controller.rb +1 -1
- data/app/models/phccodesnipperpro/script/snippet.rb +0 -3
- data/app/views/layouts/phccodesnipperpro/application.html.erb +73 -79
- data/app/views/layouts/phccodesnipperpro/components/backend/footer/_footer.html.erb +14 -8
- data/app/views/layouts/phccodesnipperpro/components/backend/navigation/_top_menu.html.erb +41 -37
- data/app/views/layouts/phccodesnipperpro/components/backend/sidebars/_side_menu.html.erb +921 -189
- data/app/views/phccodesnipperpro/script/snippets/_form.html.erb +15 -15
- data/app/views/phccodesnipperpro/script/snippets/edit.html.erb +21 -21
- data/app/views/phccodesnipperpro/script/snippets/index.html.erb +57 -57
- data/app/views/phccodesnipperpro/script/snippets/new.html.erb +19 -21
- data/app/views/phccodesnipperpro/script/snippets/show.html.erb +63 -58
- data/app/views/phccodesnipperpro/script/urls/_form.html.erb +12 -12
- data/app/views/phccodesnipperpro/script/urls/edit.html.erb +16 -16
- data/app/views/phccodesnipperpro/script/urls/index.html.erb +55 -55
- data/app/views/phccodesnipperpro/script/urls/new.html.erb +21 -21
- data/app/views/phccodesnipperpro/script/urls/show.html.erb +61 -57
- data/config/routes.rb +6 -9
- data/db/migrate/20190504104048_create_phccodesnipperpro_script_urls.rb +19 -0
- data/db/migrate/20190504104101_create_phccodesnipperpro_script_snippets.rb +19 -0
- data/lib/phccodesnipperpro/engine.rb +30 -56
- data/lib/phccodesnipperpro/version.rb +1 -1
- data/lib/phccodesnipperpro.rb +2 -0
- metadata +62 -390
- data/app/assets/javascripts/phccodesnipperpro/application.js +0 -2
- data/app/assets/stylesheets/phccodesnipperpro/application.scss +0 -2
- data/config/initializers/friendly_id.rb +0 -107
@@ -1,66 +1,66 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Code Snippet Manager" %>
|
3
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", phccodesnipperpro.script_snippets_path %>
|
6
|
-
<!-- Title
|
6
|
+
<!-- -PHCDEV- Title Variables -->
|
7
7
|
|
8
|
-
<!--
|
9
|
-
<ol class="breadcrumb
|
10
|
-
|
11
|
-
|
8
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
9
|
+
<ol class="breadcrumb float-xl-end">
|
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
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
14
14
|
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Header -->
|
16
16
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Panel -->
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
21
|
+
|
22
|
+
<!-- -PHCDEV- Panel - Heading -->
|
23
|
+
<div class="panel-heading">
|
24
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
25
|
+
</div>
|
26
|
+
<!-- -PHCDEV- Panel - Heading -->
|
27
|
+
|
28
|
+
<!-- -PHCDEV- Panel - Body -->
|
29
|
+
<div class="panel-body">
|
30
|
+
|
31
|
+
<!-- -PHCDEV- Table - Snippet Index -->
|
32
|
+
<div class="table-responsive">
|
33
|
+
<table class="table table-striped table-bordered">
|
34
|
+
<thead>
|
35
|
+
<tr>
|
36
|
+
<th>Script Url</th>
|
37
|
+
<th colspan="3"></th>
|
38
|
+
</tr>
|
39
|
+
</thead>
|
40
|
+
<tbody>
|
41
|
+
<% @script_urls.each do |script_url| %>
|
42
|
+
<tr>
|
43
|
+
<td><%= script_url.script_url %></td>
|
44
|
+
<td>
|
45
|
+
<div class="btn-group d-flex" role="group">
|
46
|
+
<%= link_to "Details", script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-purple btn-xs" %>
|
47
|
+
<%= link_to "Update", edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
|
48
|
+
<%= 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" %>
|
49
|
+
</div>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<% end %>
|
53
|
+
</tbody>
|
54
|
+
</table>
|
55
|
+
<%= link_to phccodesnipperpro.new_script_snippet_url_path, class: "btn btn-primary btn-sm" do %>
|
56
|
+
<i class="fas fa-plus-circle"></i>
|
57
|
+
Add a New Script URL
|
58
|
+
<% end %>
|
59
|
+
</div>
|
60
|
+
<!-- -PHCDEV- Table - Snippet Index -->
|
61
|
+
|
62
|
+
</div>
|
63
|
+
<!-- -PHCDEV- Panel - Body -->
|
64
|
+
|
65
65
|
</div>
|
66
|
-
<!--
|
66
|
+
<!-- -PHCDEV- Panel -->
|
@@ -1,39 +1,39 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Code Snippet Manager" %>
|
3
3
|
<% phc_title_tagline "Create a New Asset URL" %>
|
4
4
|
<% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipperpro.script_snippets_path %>
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
|
-
<!-- Title
|
6
|
+
<!-- -PHCDEV- Title Variables -->
|
7
7
|
|
8
|
-
<!--
|
9
|
-
<ol class="breadcrumb
|
8
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
9
|
+
<ol class="breadcrumb float-xl-end">
|
10
10
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
11
11
|
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
|
12
12
|
</ol>
|
13
|
-
<!--
|
13
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
14
14
|
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Header -->
|
16
16
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Panel -->
|
20
20
|
<div class="panel panel-inverse">
|
21
|
-
|
21
|
+
|
22
|
+
<!-- -PHCDEV- Panel - Heading -->
|
22
23
|
<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
24
|
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
29
25
|
</div>
|
30
|
-
<!-- Panel Heading -->
|
31
|
-
|
26
|
+
<!-- -PHCDEV- Panel - Heading -->
|
27
|
+
|
28
|
+
<!-- -PHCDEV- Panel - Body -->
|
32
29
|
<div class="panel-body">
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
|
31
|
+
<!-- -PHCDEV- Form for New Script Asset URL -->
|
32
|
+
<%= render "form", { form_url: script_snippet_urls_path } %>
|
33
|
+
<!-- -PHCDEV- Form for New Script Asset URL -->
|
34
|
+
|
36
35
|
</div>
|
37
|
-
<!-- Panel Body -->
|
36
|
+
<!-- -PHCDEV- Panel - Body -->
|
37
|
+
|
38
38
|
</div>
|
39
|
-
<!--
|
39
|
+
<!-- -PHCDEV- Panel -->
|
@@ -1,71 +1,75 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Code Snippet Manager" %>
|
3
3
|
<% phc_title_tagline "Asset URL Details" %>
|
4
4
|
<% phc_breadcrumb_one link_to "Code Snippet Index", phccodesnipperpro.script_snippets_path %>
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
|
-
<!-- Title
|
6
|
+
<!-- -PHCDEV- Title Variables -->
|
7
7
|
|
8
|
-
<!--
|
9
|
-
<ol class="breadcrumb
|
10
|
-
|
11
|
-
|
8
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
9
|
+
<ol class="breadcrumb float-xl-end">
|
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
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
14
14
|
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Header -->
|
16
16
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
18
18
|
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Panel -->
|
20
20
|
<div class="row">
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
<!-- Button Panel -->
|
25
|
-
<div class="panel panel-inverse">
|
26
|
-
<!-- Panel Heading -->
|
27
|
-
<div class="panel-heading">
|
28
|
-
<h4 class="panel-title">Options Panel</h4>
|
29
|
-
</div>
|
30
|
-
<!-- Panel Heading -->
|
31
|
-
<!-- Panel Body -->
|
32
|
-
<div class="panel-body">
|
33
|
-
<div class="btn-group d-flex" role="group">
|
34
|
-
<%= link_to 'Update', phccodesnipperpro.edit_script_snippet_url_path, class: "btn btn-primary" %>
|
35
|
-
<%= link_to 'Remove', phccodesnipperpro.script_snippet_urls_path, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
<!-- Panel Body -->
|
39
|
-
</div>
|
40
|
-
<!-- Button Panel -->
|
41
|
-
</div>
|
42
|
-
<!-- Button Area -->
|
22
|
+
<!-- -PHCDEV- Button Area -->
|
23
|
+
<div class="col-lg-4">
|
43
24
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
25
|
+
<!-- -PHCDEV- Button Panel -->
|
26
|
+
<div class="panel panel-inverse">
|
27
|
+
|
28
|
+
<!-- -PHCDEV- Panel - Heading -->
|
29
|
+
<div class="panel-heading">
|
30
|
+
<h4 class="panel-title">Options Panel</h4>
|
31
|
+
</div>
|
32
|
+
<!-- -PHCDEV- Panel - Heading -->
|
33
|
+
|
34
|
+
<!-- -PHCDEV- Panel - Body -->
|
35
|
+
<div class="panel-body">
|
36
|
+
<div class="btn-group d-flex" role="group">
|
37
|
+
<%= link_to "Update", phccodesnipperpro.edit_script_snippet_url_path, class: "btn btn-primary" %>
|
38
|
+
<%= link_to "Remove", phccodesnipperpro.script_snippet_urls_path, method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<!-- -PHCDEV- Panel - Body -->
|
42
|
+
|
43
|
+
</div>
|
44
|
+
<!-- -PHCDEV- Button Panel -->
|
45
|
+
</div>
|
46
|
+
<!-- -PHCDEV- Button Area -->
|
47
|
+
|
48
|
+
<!-- -PHCDEV- Main Area -->
|
49
|
+
<div class="col-lg-8">
|
50
|
+
|
51
|
+
<!-- -PHCDEV- Main Panel -->
|
52
|
+
<div class="panel panel-inverse">
|
53
|
+
|
54
|
+
<!-- -PHCDEV- Panel - Heading -->
|
55
|
+
<div class="panel-heading">
|
56
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
57
|
+
</div>
|
58
|
+
<!-- -PHCDEV- Panel - Heading -->
|
59
|
+
|
60
|
+
<!-- -PHCDEV- Panel - Body -->
|
61
|
+
<div class="panel-body">
|
62
|
+
<p class="h3">Script Snippet URL</p>
|
63
|
+
<hr>
|
64
|
+
<p><%= @script_url.script_url %></p>
|
65
|
+
</div>
|
66
|
+
<!-- -PHCDEV- Panel - Body -->
|
67
|
+
|
68
|
+
</div>
|
69
|
+
<!-- -PHCDEV- Main Panel -->
|
70
|
+
|
71
|
+
</div>
|
72
|
+
<!-- -PHCDEV- Main Area -->
|
69
73
|
|
70
74
|
</div>
|
71
|
-
<!--
|
75
|
+
<!-- -PHCDEV- Panel -->
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
Phccodesnipperpro::Engine.routes.draw do
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# PHCAccounts Routes
|
11
|
-
mount Phcaccountspro::Engine, :at => '/'
|
3
|
+
# Script Snippet Routes
|
4
|
+
namespace :script do
|
5
|
+
resources :snippets, class_name: "Phccodesnipperpro::Script::Snippet" do
|
6
|
+
resources :urls, class_name: "Phccodesnipperpro::Script::Url"
|
7
|
+
end
|
8
|
+
end
|
12
9
|
|
13
10
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePhccodesnipperproScriptUrls < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phccodesnipperpro_script_urls do |t|
|
5
|
+
|
6
|
+
t.string :script_url
|
7
|
+
|
8
|
+
t.string :slug
|
9
|
+
|
10
|
+
t.string :user_id
|
11
|
+
t.string :org_id
|
12
|
+
|
13
|
+
t.references :snippet
|
14
|
+
t.timestamps
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePhccodesnipperproScriptSnippets < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phccodesnipperpro_script_snippets do |t|
|
5
|
+
|
6
|
+
t.string :snippet_title
|
7
|
+
t.text :snippet_code
|
8
|
+
|
9
|
+
t.string :slug
|
10
|
+
|
11
|
+
t.string :user_id
|
12
|
+
t.string :org_id
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -1,69 +1,43 @@
|
|
1
1
|
module Phccodesnipperpro
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
|
4
|
-
#
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
|
9
|
-
|
10
|
-
require
|
11
|
-
require
|
12
|
-
|
13
|
-
#
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
18
|
-
|
19
|
-
|
20
|
-
require
|
21
|
-
|
22
|
-
|
23
|
-
require 'phccorehelpers'
|
24
|
-
require 'phcmenus'
|
25
|
-
require 'phcnotifi'
|
26
|
-
require 'phctitleseo'
|
4
|
+
# Load Main Dependencies
|
5
|
+
require "jbuilder"
|
6
|
+
require "paper_trail"
|
7
|
+
require "friendly_id"
|
8
|
+
|
9
|
+
# Load Theme Dependencies
|
10
|
+
require "phcthemes_admin_panel_pack"
|
11
|
+
require "phcthemes_web_theme_pack"
|
12
|
+
|
13
|
+
# Load Helper Dependencies
|
14
|
+
require "phcdevworks_core"
|
15
|
+
require "phcdevworks_active_menus"
|
16
|
+
require "phcdevworks_notifications"
|
17
|
+
require "phcdevworks_titleseo"
|
18
|
+
|
19
|
+
# Load Upload Dependencies
|
20
|
+
require "aws-sdk-s3"
|
21
|
+
require "google-cloud-storage"
|
22
|
+
require "mini_magick"
|
27
23
|
|
28
24
|
# Frontend Dependencies
|
29
|
-
require
|
30
|
-
require
|
31
|
-
|
32
|
-
# Upload Dependencies
|
33
|
-
require 'aws-sdk-s3'
|
34
|
-
require 'google-cloud-storage'
|
35
|
-
require 'mini_magick'
|
25
|
+
require "wicked"
|
26
|
+
require "gravtastic"
|
27
|
+
require "friendly_id"
|
36
28
|
|
37
|
-
#
|
38
|
-
require
|
39
|
-
require 'pg'
|
29
|
+
# Mailer Dependencies
|
30
|
+
require "mail_form"
|
40
31
|
|
41
|
-
#
|
42
|
-
require 'phcaccountspro'
|
43
|
-
|
44
|
-
# Isolate Namespace
|
32
|
+
# Engine Namespace
|
45
33
|
isolate_namespace Phccodesnipperpro
|
46
34
|
|
47
|
-
#
|
35
|
+
# Rspec Generators
|
48
36
|
config.generators do |g|
|
49
|
-
g.test_framework :rspec
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
routing_specs: false,
|
54
|
-
controller_specs: true,
|
55
|
-
request_specs: false
|
56
|
-
g.fixture_replacement :factory_bot,
|
57
|
-
dir: "spec/factories"
|
58
|
-
end
|
59
|
-
|
60
|
-
# Load Requried Helper Files
|
61
|
-
config.to_prepare do
|
62
|
-
Phcaccountspro::ApplicationController.helper(ApplicationHelper)
|
63
|
-
Phccorehelpers::ApplicationController.helper(ApplicationHelper)
|
64
|
-
Phcmenus::ApplicationController.helper(ApplicationHelper)
|
65
|
-
Phcnotifi::ApplicationController.helper(ApplicationHelper)
|
66
|
-
Phctitleseo::ApplicationController.helper(ApplicationHelper)
|
37
|
+
g.test_framework :rspec
|
38
|
+
g.fixture_replacement :factory_bot
|
39
|
+
g.factory_bot dir: 'spec/factories'
|
40
|
+
g.factory_bot suffix: "factory"
|
67
41
|
end
|
68
42
|
|
69
43
|
end
|