phccodesnipperpro 4.4.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +28 -0
  4. data/Rakefile +4 -18
  5. data/app/assets/config/phccodesnipperpro_manifest.js +2 -2
  6. data/app/controllers/phccodesnipperpro/application_controller.rb +14 -15
  7. data/app/controllers/phccodesnipperpro/script/snippets_controller.rb +1 -1
  8. data/app/controllers/phccodesnipperpro/script/urls_controller.rb +1 -1
  9. data/app/models/phccodesnipperpro/script/snippet.rb +0 -3
  10. data/app/views/layouts/phccodesnipperpro/application.html.erb +73 -79
  11. data/app/views/layouts/phccodesnipperpro/components/backend/footer/_footer.html.erb +14 -8
  12. data/app/views/layouts/phccodesnipperpro/components/backend/navigation/_top_menu.html.erb +41 -37
  13. data/app/views/layouts/phccodesnipperpro/components/backend/sidebars/_side_menu.html.erb +921 -189
  14. data/app/views/phccodesnipperpro/script/snippets/_form.html.erb +15 -15
  15. data/app/views/phccodesnipperpro/script/snippets/edit.html.erb +21 -21
  16. data/app/views/phccodesnipperpro/script/snippets/index.html.erb +57 -57
  17. data/app/views/phccodesnipperpro/script/snippets/new.html.erb +19 -21
  18. data/app/views/phccodesnipperpro/script/snippets/show.html.erb +63 -58
  19. data/app/views/phccodesnipperpro/script/urls/_form.html.erb +12 -12
  20. data/app/views/phccodesnipperpro/script/urls/edit.html.erb +16 -16
  21. data/app/views/phccodesnipperpro/script/urls/index.html.erb +55 -55
  22. data/app/views/phccodesnipperpro/script/urls/new.html.erb +21 -21
  23. data/app/views/phccodesnipperpro/script/urls/show.html.erb +61 -57
  24. data/config/routes.rb +6 -9
  25. data/db/migrate/20190504104048_create_phccodesnipperpro_script_urls.rb +19 -0
  26. data/db/migrate/20190504104101_create_phccodesnipperpro_script_snippets.rb +19 -0
  27. data/lib/phccodesnipperpro/engine.rb +30 -56
  28. data/lib/phccodesnipperpro/version.rb +1 -1
  29. data/lib/phccodesnipperpro.rb +2 -0
  30. metadata +62 -390
  31. data/app/assets/javascripts/phccodesnipperpro/application.js +0 -2
  32. data/app/assets/stylesheets/phccodesnipperpro/application.scss +0 -2
  33. data/config/initializers/friendly_id.rb +0 -107
@@ -1,66 +1,66 @@
1
- <!-- Title System -->
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 System -->
6
+ <!-- -PHCDEV- Title Variables -->
7
7
 
8
- <!-- Page Bradcrumbs -->
9
- <ol class="breadcrumb pull-right">
10
- <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
- <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
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
- <!-- Page Bradcrumbs -->
13
+ <!-- -PHCDEV- Bradcrumbs -->
14
14
 
15
- <!-- Page Header -->
15
+ <!-- -PHCDEV- Header -->
16
16
  <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
- <!-- Page Header -->
17
+ <!-- -PHCDEV- Header -->
18
18
 
19
- <!-- Page & Panel Content -->
19
+ <!-- -PHCDEV- Panel -->
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>
27
- </div>
28
- <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
29
- </div>
30
- <!-- Panel Heading -->
31
- <!-- Panel Body -->
32
- <div class="panel-body">
33
- <!-- Table - Snippet Index -->
34
- <div class="table-responsive">
35
- <table class="table table-striped table-bordered">
36
- <thead>
37
- <tr>
38
- <th>Script Url</th>
39
- <th colspan="3"></th>
40
- </tr>
41
- </thead>
42
- <tbody>
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 %>
55
- </tbody>
56
- </table>
57
- <%= link_to phccodesnipperpro.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 %>
61
- </div>
62
- <!-- Table - Snippet Index -->
63
- </div>
64
- <!-- Panel Body -->
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
- <!-- Page & Panel Content -->
66
+ <!-- -PHCDEV- Panel -->
@@ -1,39 +1,39 @@
1
- <!-- Title System -->
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 System -->
6
+ <!-- -PHCDEV- Title Variables -->
7
7
 
8
- <!-- Page Bradcrumbs -->
9
- <ol class="breadcrumb pull-right">
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
- <!-- Page Bradcrumbs -->
13
+ <!-- -PHCDEV- Bradcrumbs -->
14
14
 
15
- <!-- Page Header -->
15
+ <!-- -PHCDEV- Header -->
16
16
  <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
- <!-- Page Header -->
17
+ <!-- -PHCDEV- Header -->
18
18
 
19
- <!-- Page & Panel Content -->
19
+ <!-- -PHCDEV- Panel -->
20
20
  <div class="panel panel-inverse">
21
- <!-- Panel Heading -->
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
- <!-- Panel Body -->
26
+ <!-- -PHCDEV- Panel - Heading -->
27
+
28
+ <!-- -PHCDEV- Panel - Body -->
32
29
  <div class="panel-body">
33
- <!-- Form for New Script Asset URL -->
34
- <%= render 'form', { form_url: script_snippet_urls_path } %>
35
- <!-- Form for New Script Asset URL -->
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
- <!-- Page & Panel Content -->
39
+ <!-- -PHCDEV- Panel -->
@@ -1,71 +1,75 @@
1
- <!-- Title System -->
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 System -->
6
+ <!-- -PHCDEV- Title Variables -->
7
7
 
8
- <!-- Page Bradcrumbs -->
9
- <ol class="breadcrumb pull-right">
10
- <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
- <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
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
- <!-- Page Bradcrumbs -->
13
+ <!-- -PHCDEV- Bradcrumbs -->
14
14
 
15
- <!-- Page Header -->
15
+ <!-- -PHCDEV- Header -->
16
16
  <h1 class="page-header"><%= yield(:phc_title) %></h1>
17
- <!-- Page Header -->
17
+ <!-- -PHCDEV- Bradcrumbs -->
18
18
 
19
- <!-- Page Content -->
19
+ <!-- -PHCDEV- Panel -->
20
20
  <div class="row">
21
21
 
22
- <!-- Button Area -->
23
- <div class="col-lg-4">
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
- <!-- Main Area -->
45
- <div class="col-lg-8">
46
- <!-- Main Panel -->
47
- <div class="panel panel-inverse">
48
- <!-- Panel Heading -->
49
- <div class="panel-heading">
50
- <div class="panel-heading-btn">
51
- <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
52
- <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
53
- <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
54
- </div>
55
- <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
56
- </div>
57
- <!-- Panel Heading -->
58
- <!-- Panel Body -->
59
- <div class="panel-body">
60
- <p class="h3">Script Snippet URL</p>
61
- <hr>
62
- <p><%= @script_url.script_url %></p>
63
- </div>
64
- <!-- Panel Body -->
65
- </div>
66
- <!-- Main Panel -->
67
- </div>
68
- <!-- Main Area -->
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
- <!-- Page Content -->
75
+ <!-- -PHCDEV- Panel -->
data/config/routes.rb CHANGED
@@ -1,13 +1,10 @@
1
1
  Phccodesnipperpro::Engine.routes.draw do
2
2
 
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
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
- # PHCTheme Dependencies
5
- require 'phctheme1'
6
- require 'phctheme2'
7
- require 'phctheme3'
8
- require 'phctheme4'
9
- require 'phctheme5'
10
- require 'phctheme6'
11
- require 'phctheme7'
12
-
13
- # PHCAdmin Dependencies
14
- require 'phcadmin1'
15
- require 'phcadmin2'
16
- require 'phcadmin3'
17
- require 'phcadmin4'
18
- require 'phcadmin5'
19
- require 'phcadmin6'
20
- require 'phcadmin7'
21
-
22
- # PHCHelper Dependencies
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 'gravtastic'
30
- require 'friendly_id'
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
- # Database Dependencies
38
- require 'paper_trail'
39
- require 'pg'
29
+ # Mailer Dependencies
30
+ require "mail_form"
40
31
 
41
- # Payment Dependencies
42
- require 'phcaccountspro'
43
-
44
- # Isolate Namespace
32
+ # Engine Namespace
45
33
  isolate_namespace Phccodesnipperpro
46
34
 
47
- # Testing Generator
35
+ # Rspec Generators
48
36
  config.generators do |g|
49
- g.test_framework :rspec,
50
- fixtures: true,
51
- view_specs: false,
52
- helper_specs: false,
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
@@ -1,3 +1,3 @@
1
1
  module Phccodesnipperpro
2
- VERSION = '4.4.0'
2
+ VERSION = "5.0.0"
3
3
  end
@@ -1,4 +1,6 @@
1
+ require "phccodesnipperpro/version"
1
2
  require "phccodesnipperpro/engine"
2
3
 
3
4
  module Phccodesnipperpro
5
+ # Your code goes here...
4
6
  end