phccodesnipper 5.3.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +36 -0
  4. data/Rakefile +4 -18
  5. data/app/assets/config/phccodesnipper_manifest.js +2 -2
  6. data/app/controllers/phccodesnipper/application_controller.rb +14 -15
  7. data/app/controllers/phccodesnipper/script/snippets_controller.rb +1 -1
  8. data/app/controllers/phccodesnipper/script/urls_controller.rb +1 -1
  9. data/app/models/phccodesnipper/script/snippet.rb +0 -3
  10. data/app/views/layouts/phccodesnipper/application.html.erb +73 -79
  11. data/app/views/layouts/phccodesnipper/components/backend/footer/_footer.html.erb +14 -8
  12. data/app/views/layouts/phccodesnipper/components/backend/navigation/_top_menu.html.erb +41 -37
  13. data/app/views/layouts/phccodesnipper/components/backend/sidebars/_side_menu.html.erb +921 -189
  14. data/app/views/phccodesnipper/script/snippets/_form.html.erb +15 -15
  15. data/app/views/phccodesnipper/script/snippets/edit.html.erb +21 -21
  16. data/app/views/phccodesnipper/script/snippets/index.html.erb +57 -57
  17. data/app/views/phccodesnipper/script/snippets/new.html.erb +21 -21
  18. data/app/views/phccodesnipper/script/snippets/show.html.erb +63 -58
  19. data/app/views/phccodesnipper/script/urls/_form.html.erb +12 -12
  20. data/app/views/phccodesnipper/script/urls/edit.html.erb +16 -21
  21. data/app/views/phccodesnipper/script/urls/index.html.erb +55 -55
  22. data/app/views/phccodesnipper/script/urls/new.html.erb +21 -21
  23. data/app/views/phccodesnipper/script/urls/show.html.erb +63 -58
  24. data/config/routes.rb +5 -8
  25. data/db/migrate/20190502060733_create_phccodesnipper_script_urls.rb +17 -0
  26. data/db/migrate/20190508091330_create_phccodesnipper_script_snippets.rb +17 -0
  27. data/db/migrate/20190513040626_create_friendly_id_slugs.rb +21 -0
  28. data/lib/phccodesnipper/engine.rb +30 -56
  29. data/lib/phccodesnipper/version.rb +1 -1
  30. data/lib/phccodesnipper.rb +2 -0
  31. metadata +70 -393
  32. data/app/assets/javascripts/phccodesnipper/application.js +0 -2
  33. data/app/assets/stylesheets/phccodesnipper/application.scss +0 -2
  34. data/config/initializers/friendly_id.rb +0 -107
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaabef8452646c047fad791a64e24aebb78a2a018a4580764c5dff7c136e9e15
4
- data.tar.gz: '03873437a75d57a8f19d9c5ed250571af081a2f33e35f2e2a26342816a0503b8'
3
+ metadata.gz: 805c8b76ea965b6e91f38f5aaa6559b027aa41cfcb62e48f07bea657df76125a
4
+ data.tar.gz: ea2746063a7cd42fa209eb047ab667075042d398638f038cf7664c02aa3d135a
5
5
  SHA512:
6
- metadata.gz: 3aae8fc6a8d034d41f6f8a5a6174025d99861d2638db1c6927a8a28a67fbd06e78d1e6de63ee8c10554787d2e6b8c074f131bd494fcbcdb8a6f4ee9494fec948
7
- data.tar.gz: 3a9aed96aed8ac8748cbc2d3b1bb572ded3a78ec761c257b185ddc1c49452b92d8d224af0210427a820631e13ccebb58d9510f1c8a637694e662a1e5b01bee38
6
+ metadata.gz: 2ebd506d77116b6dfbf04fa4b26261a00fae376f5efe07a9871b64de4e721c0cabef11e761ae877d869ebe0df2b9a91321e6feb782c69ff32d0cedaaeb3303a5
7
+ data.tar.gz: 820116ee8a48e73487fce1ee5e302ed461c4e6423f3bd721bcd17883caea78cd63fb7b32bec5915af2d2e6449b39e712e8f862b994a33ae085fc3cdd4f3b4438
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - PHCNetCo/PHCDevworks/PHCNetworks
1
+ Copyright 2022 - BradPotts
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
data/README.md CHANGED
@@ -0,0 +1,36 @@
1
+ #### PHCCodeSnipper Documentation
2
+ Ruby on Rails 7 engine to manage member information and business directory listings.
3
+
4
+ - Fast setup of membership management and web directory modules.
5
+ - Directory and listings manager with a web directory API.
6
+ - Member's list, contact information, and listings manager.
7
+ - Easy app integration with views that can be customized.
8
+ - [Pro version](https://bradpotts.github.io/phccodesnipperpro/) has multi-tenancy capabilities.
9
+
10
+ #### Step 1 - Add PHCCodeSnipper to your gemfile and run the install command
11
+
12
+ gem 'phccodesnipper'
13
+ bundle install
14
+
15
+ #### Step 2 - Add [PHCDevworks Accounts Devise](https://github.com/phcdevworks/phcdevworks_accounts_devise) to your gemfile
16
+ This plugin is optimized for PHCDevworks Accounts which uses Devise.
17
+
18
+ gem 'phcdevworks_accounts_devise'
19
+ bundle install
20
+
21
+ #### Step 3 - Mount PHCCodeSnipper & Add Routes
22
+ Mount PHCCodeSnipper by adding code below to your routes file.
23
+
24
+ mount PhcdevworksAccountsDevise::Engine, :at => '/'
25
+ mount Phccodesnipper::Engine, :at => '/'
26
+
27
+ #### Step 4 - Copy All Required Database Tables
28
+ To copy PHCCodeSnipper and PHCDevworks Accounts Devise database migrations.
29
+
30
+ rails railties:install:migrations
31
+
32
+ #### Step 5 - Recompile Assets
33
+ To ensure proper function re-compile your application's assets.
34
+
35
+ rails assets:clobber && rails assets:precompile
36
+
data/Rakefile CHANGED
@@ -1,22 +1,8 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'Phccodesnipper'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.md')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
1
+ require "bundler/setup"
16
2
 
17
3
  APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
18
- load 'rails/tasks/engine.rake'
4
+ load "rails/tasks/engine.rake"
19
5
 
20
- load 'rails/tasks/statistics.rake'
6
+ load "rails/tasks/statistics.rake"
21
7
 
22
- require 'bundler/gem_tasks'
8
+ require "bundler/gem_tasks"
@@ -1,2 +1,2 @@
1
- //= link_directory ../javascripts/phccodesnipper .js
2
- //= link_directory ../stylesheets/phccodesnipper .scss
1
+ //= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
2
+ //= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
@@ -1,22 +1,21 @@
1
1
  module Phccodesnipper
2
- class ApplicationController < ActionController::Base
2
+ class ApplicationController < ActionController::Base
3
3
 
4
- # Security Filters
5
- protect_from_forgery with: :exception
4
+ # Security Filters
5
+ protect_from_forgery with: :exception
6
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
7
+ # Load Requried Helper Files
8
+ helper PhcdevworksActiveMenus::Engine.helpers
9
+ helper PhcdevworksNotifications::Engine.helpers
10
+ helper PhcdevworksTitleseo::Engine.helpers
11
+ helper PhcdevworksCore::Engine.helpers
13
12
 
14
- # Papertrail Whodunnit Username
15
- def user_for_paper_trail
16
- current_user ? current_user.username : 'Public user'
17
- end
13
+ # Papertrail Whodunnit Username
14
+ def user_for_paper_trail
15
+ current_user ? current_user.username : 'Public user'
16
+ end
18
17
 
19
- private
18
+ private
20
19
 
21
- end
20
+ end
22
21
  end
@@ -4,7 +4,7 @@ module Phccodesnipper
4
4
  class Script::SnippetsController < ApplicationController
5
5
 
6
6
  # Include Core Helpers, Security & Action Filters
7
- include Phccorehelpers::PhcpluginsHelper
7
+ include PhcdevworksCore::PhcdevPluginsHelper
8
8
  before_action :authenticate_user!
9
9
  before_action :set_script_snippet, only: [:show, :edit, :update, :destroy]
10
10
 
@@ -4,7 +4,7 @@ module Phccodesnipper
4
4
  class Script::UrlsController < ApplicationController
5
5
 
6
6
  # Include Core Helpers, Security & Action Filters
7
- include Phccorehelpers::PhcpluginsHelper
7
+ include PhcdevworksCore::PhcdevPluginsHelper
8
8
  before_action :authenticate_user!
9
9
  before_action :set_script_url, only: [:show, :edit, :update, :destroy]
10
10
 
@@ -1,9 +1,6 @@
1
1
  module Phccodesnipper
2
2
  class Script::Snippet < ApplicationRecord
3
3
 
4
- # Include Core Validations
5
- include Phccorehelpers::Validations
6
-
7
4
  # Clean URL Initialize
8
5
  extend FriendlyId
9
6
 
@@ -1,79 +1,73 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
-
5
- <!-- SEO System -->
6
- <% phc_seo_title "PHCCodeSnipper by PHCDevworks" %>
7
- <% phc_seo_description "Application to manage and post code snippets." %>
8
- <!-- SEO System -->
9
-
10
- <!-- SEO and Site Description -->
11
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
12
- <title><%= yield(:phc_seo_title) %></title>
13
- <meta name="description" content="<%= yield(:phc_seo_description) %>">
14
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
15
- <link rel="canonical" href="http://phcdevworks.com">
16
- <!-- SEO and Site Description -->
17
-
18
- <!-- Rails Security Tags -->
19
- <%= csrf_meta_tags %>
20
- <%= csp_meta_tag %>
21
- <!-- Rails Security Tags -->
22
-
23
- <!-- CSS Styles -->
24
- <%= stylesheet_link_tag 'phccodesnipper/application', media: 'all', 'data-turbolinks-track': 'reload' %>
25
- <!-- CSS Styles -->
26
-
27
- <!-- Font -->
28
- <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700"/>
29
- <!-- Font -->
30
-
31
- </head>
32
- <body>
33
-
34
- <!-- Page Container -->
35
- <div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
36
-
37
- <!-- Page Header -->
38
- <div id="header" class="header navbar-default">
39
- <%= render 'layouts/phccodesnipper/components/backend/navigation/top_menu' %>
40
- </div>
41
- <!-- Page Header -->
42
-
43
- <!-- Page Sidebar -->
44
- <div id="sidebar" class="sidebar">
45
- <%= render 'layouts/phccodesnipper/components/backend/sidebars/side_menu' %>
46
- </div>
47
- <div class="sidebar-bg"></div>
48
- <!-- Page Sidebar -->
49
-
50
- <!-- Page Content -->
51
- <div id="content" class="content">
52
- <%= render 'phcnotifi/default/notifications' %>
53
- <%= yield %>
54
- </div>
55
- <!-- Page Content -->
56
-
57
- <!-- Footer Content -->
58
- <div id="footer" class="footer mb-4">
59
- <%= render 'layouts/phccodesnipper/components/backend/footer/footer' %>
60
- </div>
61
- <!-- Footer Content -->
62
-
63
- </div>
64
- <!-- Page Container -->
65
-
66
- <!-- JavaScript -->
67
- <%= javascript_include_tag "phccodesnipper/application", 'data-turbolinks-track': 'reload' %>
68
- <!-- JavaScript -->
69
-
70
- <!-- JavaScript Loader -->
71
- <script>
72
- $(document).ready(function() {
73
- App.init();
74
- });
75
- </script>
76
- <!-- JavaScript Loader -->
77
-
78
- </body>
79
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+
5
+ <!-- SEO System -->
6
+ <% phc_seo_title "BradPotts - PHCCodeSnipper" %>
7
+ <% phc_seo_description "Ruby on Rails 7 engine to manage script and post code snippets." %>
8
+ <!-- SEO System -->
9
+
10
+ <!-- SEO and Site Description -->
11
+ <meta charset="utf-8">
12
+ <title><%= yield(:phc_seo_title) %></title>
13
+ <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
14
+ <meta name="description" content="<%= yield(:phc_seo_description) %>">
15
+ <!-- SEO and Site Description -->
16
+
17
+ <!-- Rails Security Tags -->
18
+ <%= csrf_meta_tags %>
19
+ <%= csp_meta_tag %>
20
+ <!-- Rails Security Tags -->
21
+
22
+ <!-- CSS Styles -->
23
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
24
+ <%= stylesheet_link_tag "coloradmin/default/phcthemes_admin_panel_pack_coloradmin", media: "all" %>
25
+ <!-- CSS Styles -->
26
+
27
+ </head>
28
+ <body>
29
+
30
+ <!-- -PHCDEV- Page Container -->
31
+ <div id="app" class="app app-header-fixed app-sidebar-fixed app-with-wide-sidebar">
32
+
33
+ <!-- -PHCDEV- Page Container - Header -->
34
+ <div id="header" class="app-header">
35
+ <%= render "layouts/phccodesnipper/components/backend/navigation/top_menu" %>
36
+ </div>
37
+ <!-- -PHCDEV- Page Container - Header -->
38
+
39
+ <!-- -PHCDEV- Page Container - Sidebar -->
40
+ <div id="sidebar" class="app-sidebar" data-disable-slide-animation="true">
41
+ <%= render "layouts/phccodesnipper/components/backend/sidebars/side_menu" %>
42
+ </div>
43
+ <div class="app-sidebar-bg"></div>
44
+ <div class="app-sidebar-mobile-backdrop"><a href="#" data-dismiss="app-sidebar-mobile" class="stretched-link"></a></div>
45
+ <!-- -PHCDEV- Page Container - Sidebar -->
46
+
47
+ <!-- -PHCDEV- Page Container - Content -->
48
+ <div id="app" class="app app-content-full-height">
49
+ <div id="content" class="app-content d-flex flex-column p-0">
50
+ <!-- -PHCDEV- Page Container - Main -->
51
+ <div class="app-content-padding flex-grow-1 overflow-hidden" data-scrollbar="true" data-height="100%">
52
+ <%= render "phcdevworks_notifications/bootstrap/notifications" %>
53
+ <%= yield %>
54
+ </div>
55
+ <!-- -PHCDEV- Page Container - Main -->
56
+ <!-- -PHCDEV- Page Container - Footer -->
57
+ <div id="footer" class="app-footer m-0">
58
+ <%= render "layouts/phccodesnipper/components/backend/footer/footer" %>
59
+ </div>
60
+ <!-- -PHCDEV- Page Container - Footer -->
61
+ </div>
62
+ </div>
63
+ <!-- -PHCDEV- Page Container - Content -->
64
+
65
+ </div>
66
+ <!-- -PHCDEV- Page Container -->
67
+
68
+ <!-- JavaScript -->
69
+ <%= javascript_include_tag "coloradmin/phcthemes_admin_panel_pack_coloradmin" %>
70
+ <!-- JavaScript -->
71
+
72
+ </body>
73
+ </html>
@@ -1,11 +1,17 @@
1
- <!-- Footer -->
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 %>
1
+ <!-- -PHCDEV- Page Container - Footer - Left -->
2
+ <span>
3
+ <!-- -PHCDEV- Page Container - Footer - Left - Copyright -->
4
+ <i class="fab fa-osi font-weight-bolder"></i> <%= Time.now.year %>
5
+ <span class="phc_dev_strong_plugin">PHC</span><span class="phc_dev_light_plugin">Code Snipper</span> - Engine v<%= Gem.loaded_specs["phccodesnipper"].version.to_s %>
6
+ <!-- -PHCDEV- Page Container - Footer - Left - Copyright -->
6
7
  </span>
8
+ <!-- -PHCDEV- Page Container - Footer - Left -->
9
+
10
+ <!-- -PHCDEV- Page Container - Footer - Right -->
7
11
  <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>
12
+ <!-- -PHCDEV- Page Container - Footer - Right - Developed -->
13
+ Developed with <i class="fas fa-heart hanna_hearts"></i> by
14
+ <a class="phcnet_copyright text-dark" href="https://rubygems.org/profiles/bradpotts" target="_blank"><u><span class="phc_dev_strong_plugin">Brad</span><span class="phc_dev_light_plugin">Potts</span></u></a>
15
+ <!-- -PHCDEV- Page Container - Footer - Right - Developed -->
10
16
  </span>
11
- <!-- Footer -->
17
+ <!-- -PHCDEV- Page Container - Footer - Right -->
@@ -1,37 +1,41 @@
1
- <!-- Topbar - Navigation Header -->
2
- <div class="navbar-header">
3
- <%= link_to phccodesnipper.script_snippets_path, class: "navbar-brand" do %>
4
- <strong>PHC</strong>CodeSnipper
5
- <% end %>
6
- <button type="button" class="navbar-toggle" data-click="sidebar-toggled">
7
- <span class="icon-bar"></span>
8
- <span class="icon-bar"></span>
9
- <span class="icon-bar"></span>
10
- </button>
11
- </div>
12
- <!-- Topbar - Navigation Header -->
13
-
14
- <!-- Topbar - Navigation Main -->
15
- <% if current_user %>
16
- <ul class="navbar-nav navbar-right">
17
-
18
- <!-- Topbar - Navigation Main - User Menu -->
19
- <li class="dropdown navbar-user">
20
- <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
21
- <%= image_tag current_user.gravatar_url %>
22
- <span class="d-none d-md-inline"><%= current_user.firstname + ' ' + current_user.lastname %></span> <b class="caret"></b>
23
- </a>
24
- <div class="dropdown-menu dropdown-menu-right">
25
- <%= link_to phcaccounts.edit_user_registration_path, class: "dropdown-item" do %>
26
- <i class="fas fa-cogs"></i> Account Settings
27
- <% end %>
28
- <%= link_to phcaccounts.destroy_user_session_path, method: :delete, class: "dropdown-item" do %>
29
- <i class="fas fa-sign-out-alt"></i> Logout
30
- <% end %>
31
- </div>
32
- </li>
33
- <!-- Topbar - Navigation Main - User Menu -->
34
-
35
- </ul>
36
- <% end %>
37
- <!-- Topbar - Navigation Main -->
1
+ <!-- -PHCDEV- Topbar - Navigation Header -->
2
+ <div class="navbar-header">
3
+
4
+ <button type="button" class="navbar-mobile-toggler" data-toggle="app-sidebar-mobile">
5
+ <span class="icon-bar"></span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ </button>
9
+
10
+ <%= link_to phcdevworks_accounts_devise.user_path, class: "navbar-brand" do %>
11
+ <span class="phc_dev_strong_plugin_logo">PHC</span><span class="phc_dev_light_plugin_logo">CodeSnipper</span>
12
+ <% end %>
13
+
14
+ </div>
15
+ <!-- -PHCDEV- Topbar - Navigation Header -->
16
+
17
+ <!-- -PHCDEV- Topbar - Navigation Main -->
18
+ <% if current_user %>
19
+ <div class="navbar-nav">
20
+ <div class="navbar-item navbar-user dropdown">
21
+ <a href="#" class="navbar-link dropdown-toggle d-flex align-items-center" data-bs-toggle="dropdown">
22
+ <%= image_tag current_user.gravatar_url %>
23
+ <span>
24
+ <span class="d-none d-md-inline"><%= current_user.firstname + " " + current_user.lastname %></span>
25
+ <b class="caret"></b>
26
+ </span>
27
+ </a>
28
+ <div class="dropdown-menu dropdown-menu-end me-1">
29
+ <%= link_to phcdevworks_accounts_devise.edit_user_registration_path, class: "dropdown-item" do %>
30
+ <i class="fad fa-cogs"></i> Account Settings
31
+ <% end %>
32
+ <%= link_to phcdevworks_accounts_devise.destroy_user_session_path, method: :delete, class: "dropdown-item" do %>
33
+ <i class="fad fa-sign-out-alt"></i> Logout
34
+ <% end %>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <% end %>
39
+
40
+ </div>
41
+ <!-- -PHCDEV- Topbar - Navigation Main -->