phcscriptcdnpro 5.8.4 → 5.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +5 -6
  4. data/Rakefile +11 -14
  5. data/app/controllers/phcscriptcdnpro/application_controller.rb +48 -46
  6. data/app/controllers/phcscriptcdnpro/frontend/listings_controller.rb +4 -2
  7. data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +70 -70
  8. data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +70 -70
  9. data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +70 -70
  10. data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +70 -70
  11. data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +79 -79
  12. data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +71 -69
  13. data/app/helpers/phcscriptcdnpro/application_helper.rb +9 -10
  14. data/app/jobs/phcscriptcdnpro/application_job.rb +2 -3
  15. data/app/mailers/phcscriptcdnpro/application_mailer.rb +4 -4
  16. data/app/models/phcscriptcdnpro/application_record.rb +3 -3
  17. data/app/models/phcscriptcdnpro/frontend.rb +2 -0
  18. data/app/models/phcscriptcdnpro/frontend/listing.rb +1 -2
  19. data/app/models/phcscriptcdnpro/script.rb +5 -5
  20. data/app/models/phcscriptcdnpro/script/author.rb +5 -5
  21. data/app/models/phcscriptcdnpro/script/extension.rb +6 -6
  22. data/app/models/phcscriptcdnpro/script/licence.rb +5 -5
  23. data/app/models/phcscriptcdnpro/script/listing.rb +13 -11
  24. data/app/models/phcscriptcdnpro/script/url.rb +9 -9
  25. data/app/models/phcscriptcdnpro/script/version.rb +7 -7
  26. data/app/views/layouts/phcscriptcdnpro/application.html.erb +6 -7
  27. data/app/views/layouts/phcscriptcdnpro/components/backend/footer/_footer.html.erb +1 -1
  28. data/app/views/layouts/phcscriptcdnpro/components/backend/navigation/_top_bar.html.erb +0 -1
  29. data/app/views/layouts/phcscriptcdnpro/components/backend/sidebars/_left_sidebar.html.erb +1 -2
  30. data/app/views/layouts/phcscriptcdnpro/frontend.html.erb +14 -16
  31. data/app/views/phcscriptcdnpro/frontend/listings/index.html.erb +30 -30
  32. data/app/views/phcscriptcdnpro/frontend/listings/show.html.erb +12 -12
  33. data/app/views/phcscriptcdnpro/script/authors/_form.html.erb +6 -0
  34. data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +6 -7
  35. data/app/views/phcscriptcdnpro/script/authors/index.html.erb +19 -23
  36. data/app/views/phcscriptcdnpro/script/authors/new.html.erb +6 -7
  37. data/app/views/phcscriptcdnpro/script/authors/show.html.erb +6 -6
  38. data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +6 -0
  39. data/app/views/phcscriptcdnpro/script/extensions/edit.html.erb +8 -9
  40. data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +6 -8
  41. data/app/views/phcscriptcdnpro/script/extensions/new.html.erb +8 -9
  42. data/app/views/phcscriptcdnpro/script/extensions/show.html.erb +7 -9
  43. data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +7 -0
  44. data/app/views/phcscriptcdnpro/script/licences/edit.html.erb +6 -7
  45. data/app/views/phcscriptcdnpro/script/licences/index.html.erb +10 -12
  46. data/app/views/phcscriptcdnpro/script/licences/new.html.erb +6 -7
  47. data/app/views/phcscriptcdnpro/script/licences/show.html.erb +5 -7
  48. data/app/views/phcscriptcdnpro/script/listings/_form.html.erb +7 -1
  49. data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +15 -0
  50. data/app/views/phcscriptcdnpro/script/listings/index.html.erb +14 -4
  51. data/app/views/phcscriptcdnpro/script/listings/new.html.erb +15 -0
  52. data/app/views/phcscriptcdnpro/script/listings/show.html.erb +14 -0
  53. data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +6 -0
  54. data/app/views/phcscriptcdnpro/script/urls/edit.html.erb +17 -6
  55. data/app/views/phcscriptcdnpro/script/urls/index.html.erb +14 -7
  56. data/app/views/phcscriptcdnpro/script/urls/new.html.erb +17 -7
  57. data/app/views/phcscriptcdnpro/script/urls/show.html.erb +14 -10
  58. data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +7 -0
  59. data/app/views/phcscriptcdnpro/script/versions/edit.html.erb +12 -8
  60. data/app/views/phcscriptcdnpro/script/versions/index.html.erb +11 -5
  61. data/app/views/phcscriptcdnpro/script/versions/new.html.erb +12 -8
  62. data/app/views/phcscriptcdnpro/script/versions/show.html.erb +11 -6
  63. data/config/routes.rb +21 -26
  64. data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +23 -23
  65. data/db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb +17 -17
  66. data/db/migrate/20160821183735_create_phcscriptcdnpro_script_extensions.rb +12 -12
  67. data/db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb +18 -18
  68. data/db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb +16 -16
  69. data/db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb +10 -10
  70. data/lib/phcscriptcdnpro/engine.rb +62 -61
  71. data/lib/phcscriptcdnpro/version.rb +1 -1
  72. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21150358a69e13bde9f3f82f1b80655763274276
4
- data.tar.gz: 614b7c167f04e57e8a95e9a6955d3cc62061c0c1
3
+ metadata.gz: 0a0089614f3f34b493bcabec113701ce972a81ba
4
+ data.tar.gz: 7831a0d1155cf655b8b0f57e2794c45a9a3134ea
5
5
  SHA512:
6
- metadata.gz: e70d11441232ac63e098e49fde2b7d6e525257f6305533635bc4237a178730c13c4808244f7cd36ec3e14e0848f5237f0bd367a15fdf601dc5d4be3834fc9aa9
7
- data.tar.gz: 959105d26cf004237bf2550cf0feeffe09f72a9510e62065da155e857c53a6d542399389bc91693371472ffedc4b7e53413eaa73ae01d2a7f1fac401817ba78d
6
+ metadata.gz: 282a6761b8b59905db84b959aa9873b3255ebdd0cb004f6ccaece2ca0227fdf09d7532c61ceca69d842a076987a81f190ddeaee97b9275e07617e239ef00966e
7
+ data.tar.gz: 9d80aced693506835f200cdef572ed6ea93ef8857975b9b3f318856bde775a909e37ff0461e2f20f5debe530d44d2cf6dbb539773b916ed41cfe101cdf3a1a34
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2016 BradPotts - PHCNetworks
1
+ Copyright 2016-2017 BradPotts - 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
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
- ### PHCScriptCDN(PRO) (Script Listing Engine) Documentation
2
- PHCScriptCDN(PRO) rails script management engine for website script CDN listings.
3
-
1
+ ### PHCScriptCDN(PRO) (Script Listing Engine) Documentation
2
+
3
+ PHCScriptCDN(PRO) rails script management engine for website script CDN listings.
4
+
4
5
  - Manage script CDN listings for websites.
5
6
  - Main script title and description.
6
7
  - Script versions and script URLs.
7
-
8
+
8
9
  #### Step 1 - Add PHCScriptCDN(PRO) to your gemfile and run command
9
10
 
10
11
  gem 'phcscriptcdnpro', '~> 5.8'
@@ -31,5 +32,3 @@ To properly function re-compile your application's assets to copy over required
31
32
  All PHCScriptCDN views and layouts can be overwritten by copying files to your application.
32
33
 
33
34
  rails generate phcscriptcdnpro:views
34
-
35
- #### Additional Information
data/Rakefile CHANGED
@@ -1,34 +1,31 @@
1
1
  begin
2
- require 'bundler/setup'
2
+ require 'bundler/setup'
3
3
 
4
4
  rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
6
  end
7
7
 
8
8
  require 'rdoc/task'
9
9
 
10
10
  RDoc::Task.new(:rdoc) do |rdoc|
11
- rdoc.rdoc_dir = 'rdoc'
12
- rdoc.title = 'Phcscriptcdnpro'
13
- rdoc.options << '--line-numbers'
14
- rdoc.rdoc_files.include('README.md')
15
- rdoc.rdoc_files.include('lib/**/*.rb')
11
+ rdoc.rdoc_dir = 'rdoc'
12
+ rdoc.title = 'Phcscriptcdnpro'
13
+ rdoc.options << '--line-numbers'
14
+ rdoc.rdoc_files.include('README.md')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
16
16
  end
17
17
 
18
18
  APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
19
19
  load 'rails/tasks/engine.rake'
20
-
21
20
  load 'rails/tasks/statistics.rake'
22
-
23
21
  require 'bundler/gem_tasks'
24
-
25
22
  require 'rake/testtask'
26
23
 
27
24
  Rake::TestTask.new(:test) do |t|
28
- t.libs << 'lib'
29
- t.libs << 'test'
30
- t.pattern = 'test/**/*_test.rb'
31
- t.verbose = false
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
32
29
  end
33
30
 
34
31
  task default: :test
@@ -1,49 +1,51 @@
1
1
  module Phcscriptcdnpro
2
- class ApplicationController < ActionController::Base
3
-
4
- # Load Helpers for PHCPress Widgets
5
- before_action :phcpress_recent_posts
6
-
7
- # Security Filters
8
- protect_from_forgery with: :exception
9
-
10
- # Grab Member Information
11
- def get_member_profile_info
12
- @members_profile_info = Member::Profile.find(params[:profile_id])
13
- end
14
-
15
- # AuthRocket User Helpers
16
- def require_user
17
- unless current_user
18
- params.permit!
19
- session[:last_url] = request.get? ? url_for(params) : url_for
20
- redirect_to new_login_url
21
- end
22
- end
23
-
24
- def current_user
25
- @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
26
- end
27
- helper_method :current_user
28
-
29
- def new_login_url
30
- ENV['AUTHROCKET_LOGIN_URL']
31
- end
32
- helper_method :new_login_url
33
-
34
- def membership_info
35
- AuthRocket::Membership.all(user_id: current_user.id).first
36
- end
37
-
38
- # Load Helpers
39
- helper Phctitleseo::Engine.helpers
40
- helper Phcnotifi::Engine.helpers
41
- helper Phcaccountspro::Engine.helpers
2
+ class ApplicationController < ActionController::Base
3
+
4
+ # Load Helpers for PHCPress Widgets
5
+ before_action :phcpress_recent_posts
6
+
7
+ # Security Filters
8
+ protect_from_forgery with: :exception
9
+
10
+ # Grab Member Information
11
+ def get_member_profile_info
12
+ @members_profile_info = Member::Profile.find(params[:profile_id])
13
+ end
14
+
15
+ # AuthRocket User Helpers
16
+ def require_user
17
+ unless current_user
18
+ params.permit!
19
+ session[:last_url] = request.get? ? url_for(params) : url_for
20
+ redirect_to new_login_url
21
+ end
22
+ end
23
+
24
+ def current_user
25
+ @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
26
+ end
27
+ helper_method :current_user
28
+
29
+ def new_login_url
30
+ ENV['AUTHROCKET_LOGIN_URL']
31
+ end
32
+ helper_method :new_login_url
33
+
34
+ def membership_info
35
+ AuthRocket::Membership.all(user_id: current_user.id).first
36
+ end
37
+
38
+ # Load Helpers
39
+ helper Phctitleseo::Engine.helpers
40
+ helper Phcnotifi::Engine.helpers
41
+ helper Phcaccountspro::Engine.helpers
42
+
43
+ # PHCPress Widget Helpers
44
+ def phcpress_recent_posts
45
+ @recent_posts = Phcpresspro::Articles::Post.all
46
+ end
47
+
48
+ end
49
+ end
42
50
 
43
- # PHCPress Widget Helpers
44
- def phcpress_recent_posts
45
- @recent_posts = Phcpresspro::Articles::Post.all
46
- end
47
51
 
48
- end
49
- end
@@ -5,12 +5,12 @@ module Phcscriptcdnpro
5
5
 
6
6
  # Change Layout
7
7
  layout '/layouts/phcscriptcdnpro/frontend.html.erb'
8
-
8
+
9
9
  # Script Listing Index
10
10
  def index
11
11
  @script_listings_index = Script::Listing.all
12
12
  end
13
-
13
+
14
14
  # Script Listing Post
15
15
  def show
16
16
  @script_listings_single = Script::Listing.find(params[:id])
@@ -18,3 +18,5 @@ module Phcscriptcdnpro
18
18
 
19
19
  end
20
20
  end
21
+
22
+
@@ -1,74 +1,74 @@
1
1
  require_dependency "phcscriptcdnpro/application_controller"
2
2
 
3
3
  module Phcscriptcdnpro
4
- class Script::AuthorsController < ApplicationController
5
-
6
- # Filters & Security
7
- before_action :require_user
8
- before_action :set_script_author, only: [:show, :edit, :update, :destroy]
9
-
10
- # INDEX - Script Author
11
- def index
12
- @script_authors = Script::Author.all
13
- end
14
-
15
- # DETAILS - Script Author
16
- def show
17
- end
18
-
19
- # NEW - Script Author
20
- def new
21
- @script_author = Script::Author.new
22
- end
23
-
24
- # EDIT - Script Author
25
- def edit
26
- end
27
-
28
- # CREATE - Script Author
29
- def create
30
- @script_author = Script::Author.new(script_author_params)
31
- @script_author.user_id = current_user.id
32
- @script_author.user_name = current_user.username
33
- @script_author.membership_id = membership_info.id
34
- @script_author.oganization_id = membership_info.org_id
35
- if @script_author.save
36
- redirect_to script_authors_url, notice: 'Author was successfully created.'
37
- else
38
- render :new
39
- end
40
- end
41
-
42
- # PATCH/PUT - Script Author
43
- def update
44
- @script_author.user_id = current_user.id
45
- @script_author.user_name = current_user.username
46
- @script_author.membership_id = membership_info.id
47
- @script_author.oganization_id = membership_info.org_id
48
- if @script_author.update(script_author_params)
49
- redirect_to script_authors_url, notice: 'Author was successfully updated.'
50
- else
51
- render :edit
52
- end
53
- end
54
-
55
- # DELETE - Script Author
56
- def destroy
57
- @script_author.destroy
58
- redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
59
- end
60
-
61
- private
62
-
63
- # Common Callbacks
64
- def set_script_author
65
- @script_author = Script::Author.find(params[:id])
66
- end
67
-
68
- # Whitelist
69
- def script_author_params
70
- params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :user_id, :user_name, :membership_id, :oganization_id)
71
- end
72
-
73
- end
4
+ class Script::AuthorsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :require_user
8
+ before_action :set_script_author, only: [:show, :edit, :update, :destroy]
9
+
10
+ # INDEX - Script Author
11
+ def index
12
+ @script_authors = Script::Author.all
13
+ end
14
+
15
+ # DETAILS - Script Author
16
+ def show
17
+ end
18
+
19
+ # NEW - Script Author
20
+ def new
21
+ @script_author = Script::Author.new
22
+ end
23
+
24
+ # EDIT - Script Author
25
+ def edit
26
+ end
27
+
28
+ # CREATE - Script Author
29
+ def create
30
+ @script_author = Script::Author.new(script_author_params)
31
+ @script_author.user_id = current_user.id
32
+ @script_author.user_name = current_user.username
33
+ @script_author.membership_id = membership_info.id
34
+ @script_author.oganization_id = membership_info.org_id
35
+ if @script_author.save
36
+ redirect_to script_authors_url, notice: 'Author was successfully created.'
37
+ else
38
+ render :new
39
+ end
40
+ end
41
+
42
+ # PATCH/PUT - Script Author
43
+ def update
44
+ @script_author.user_id = current_user.id
45
+ @script_author.user_name = current_user.username
46
+ @script_author.membership_id = membership_info.id
47
+ @script_author.oganization_id = membership_info.org_id
48
+ if @script_author.update(script_author_params)
49
+ redirect_to script_authors_url, notice: 'Author was successfully updated.'
50
+ else
51
+ render :edit
52
+ end
53
+ end
54
+
55
+ # DELETE - Script Author
56
+ def destroy
57
+ @script_author.destroy
58
+ redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
59
+ end
60
+
61
+ private
62
+
63
+ # Common Callbacks
64
+ def set_script_author
65
+ @script_author = Script::Author.find(params[:id])
66
+ end
67
+
68
+ # Whitelist
69
+ def script_author_params
70
+ params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :user_id, :user_name, :membership_id, :oganization_id)
71
+ end
72
+
73
+ end
74
74
  end
@@ -1,74 +1,74 @@
1
1
  require_dependency "phcscriptcdnpro/application_controller"
2
2
 
3
3
  module Phcscriptcdnpro
4
- class Script::ExtensionsController < ApplicationController
5
-
6
- # Filters & Security
7
- before_action :require_user
8
- before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
9
-
10
- # INDEX - Script Extension
11
- def index
12
- @script_extensions = Script::Extension.all
13
- end
14
-
15
- # DETAILS - Script Extension
16
- def show
17
- end
18
-
19
- # NEW - Script Extension
20
- def new
21
- @script_extension = Script::Extension.new
22
- end
23
-
24
- # EDIT - Script Extension
25
- def edit
26
- end
27
-
28
- # CREATE - Script Extension
29
- def create
30
- @script_extension = Script::Extension.new(script_extension_params)
31
- @script_extension.user_id = current_user.id
32
- @script_extension.user_name = current_user.username
33
- @script_extension.membership_id = membership_info.id
34
- @script_extension.oganization_id = membership_info.org_id
35
- if @script_extension.save
36
- redirect_to script_extensions_url, notice: 'Extension was successfully created.'
37
- else
38
- render :new
39
- end
40
- end
41
-
42
- # PATCH/PUT - Script Extension
43
- def update
44
- @script_extension.user_id = current_user.id
45
- @script_extension.user_name = current_user.username
46
- @script_extension.membership_id = membership_info.id
47
- @script_extension.oganization_id = membership_info.org_id
48
- if @script_extension.update(script_extension_params)
49
- redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
50
- else
51
- render :edit
52
- end
53
- end
54
-
55
- # DELETE - Script Extension
56
- def destroy
57
- @script_extension.destroy
58
- redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
59
- end
60
-
61
- private
62
-
63
- # Common Callbacks
64
- def set_script_extension
65
- @script_extension = Script::Extension.find(params[:id])
66
- end
67
-
68
- # Whitelists
69
- def script_extension_params
70
- params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, user_id, user_name, membership_id, oganization_id)
71
- end
72
-
73
- end
4
+ class Script::ExtensionsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :require_user
8
+ before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
9
+
10
+ # INDEX - Script Extension
11
+ def index
12
+ @script_extensions = Script::Extension.all
13
+ end
14
+
15
+ # DETAILS - Script Extension
16
+ def show
17
+ end
18
+
19
+ # NEW - Script Extension
20
+ def new
21
+ @script_extension = Script::Extension.new
22
+ end
23
+
24
+ # EDIT - Script Extension
25
+ def edit
26
+ end
27
+
28
+ # CREATE - Script Extension
29
+ def create
30
+ @script_extension = Script::Extension.new(script_extension_params)
31
+ @script_extension.user_id = current_user.id
32
+ @script_extension.user_name = current_user.username
33
+ @script_extension.membership_id = membership_info.id
34
+ @script_extension.oganization_id = membership_info.org_id
35
+ if @script_extension.save
36
+ redirect_to script_extensions_url, notice: 'Extension was successfully created.'
37
+ else
38
+ render :new
39
+ end
40
+ end
41
+
42
+ # PATCH/PUT - Script Extension
43
+ def update
44
+ @script_extension.user_id = current_user.id
45
+ @script_extension.user_name = current_user.username
46
+ @script_extension.membership_id = membership_info.id
47
+ @script_extension.oganization_id = membership_info.org_id
48
+ if @script_extension.update(script_extension_params)
49
+ redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
50
+ else
51
+ render :edit
52
+ end
53
+ end
54
+
55
+ # DELETE - Script Extension
56
+ def destroy
57
+ @script_extension.destroy
58
+ redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
59
+ end
60
+
61
+ private
62
+
63
+ # Common Callbacks
64
+ def set_script_extension
65
+ @script_extension = Script::Extension.find(params[:id])
66
+ end
67
+
68
+ # Whitelists
69
+ def script_extension_params
70
+ params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, user_id, user_name, membership_id, oganization_id)
71
+ end
72
+
73
+ end
74
74
  end