phcscriptcdnpro 73.1.0 → 74.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/app/assets/javascripts/phcscriptcdnpro/application.js +1 -1
  5. data/app/assets/stylesheets/phcscriptcdnpro/application.scss +1 -1
  6. data/app/controllers/phcscriptcdnpro/application_controller.rb +15 -20
  7. data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +15 -16
  8. data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +17 -18
  9. data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +14 -15
  10. data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +12 -13
  11. data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +15 -16
  12. data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +16 -21
  13. data/app/models/phcscriptcdnpro/application_record.rb +0 -2
  14. data/app/models/phcscriptcdnpro/script.rb +0 -2
  15. data/app/models/phcscriptcdnpro/script/author.rb +16 -7
  16. data/app/models/phcscriptcdnpro/script/extension.rb +5 -8
  17. data/app/models/phcscriptcdnpro/script/licence.rb +5 -8
  18. data/app/models/phcscriptcdnpro/script/listing.rb +13 -18
  19. data/app/models/phcscriptcdnpro/script/url.rb +4 -16
  20. data/app/models/phcscriptcdnpro/script/version.rb +6 -9
  21. data/app/views/layouts/phcscriptcdnpro/application.html.erb +6 -5
  22. data/app/views/layouts/phcscriptcdnpro/components/backend/footer/_footer.html.erb +5 -5
  23. data/app/views/layouts/phcscriptcdnpro/components/backend/navigation/_top_menu.html.erb +0 -41
  24. data/app/views/layouts/phcscriptcdnpro/components/backend/sidebars/_side_menu.html.erb +68 -61
  25. data/app/views/phcscriptcdnpro/script/authors/_form.html.erb +19 -18
  26. data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +4 -4
  27. data/app/views/phcscriptcdnpro/script/authors/index.html.erb +19 -15
  28. data/app/views/phcscriptcdnpro/script/authors/new.html.erb +4 -4
  29. data/app/views/phcscriptcdnpro/script/authors/show.html.erb +1 -4
  30. data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +16 -15
  31. data/app/views/phcscriptcdnpro/script/extensions/edit.html.erb +4 -7
  32. data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +19 -15
  33. data/app/views/phcscriptcdnpro/script/extensions/new.html.erb +4 -6
  34. data/app/views/phcscriptcdnpro/script/extensions/show.html.erb +1 -4
  35. data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +31 -30
  36. data/app/views/phcscriptcdnpro/script/licences/edit.html.erb +4 -6
  37. data/app/views/phcscriptcdnpro/script/licences/index.html.erb +19 -15
  38. data/app/views/phcscriptcdnpro/script/licences/new.html.erb +4 -6
  39. data/app/views/phcscriptcdnpro/script/licences/show.html.erb +1 -4
  40. data/app/views/phcscriptcdnpro/script/listings/_form.html.erb +41 -37
  41. data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +4 -4
  42. data/app/views/phcscriptcdnpro/script/listings/index.html.erb +24 -19
  43. data/app/views/phcscriptcdnpro/script/listings/new.html.erb +6 -5
  44. data/app/views/phcscriptcdnpro/script/listings/show.html.erb +3 -5
  45. data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +17 -16
  46. data/app/views/phcscriptcdnpro/script/urls/edit.html.erb +15 -5
  47. data/app/views/phcscriptcdnpro/script/urls/index.html.erb +19 -15
  48. data/app/views/phcscriptcdnpro/script/urls/new.html.erb +4 -6
  49. data/app/views/phcscriptcdnpro/script/urls/show.html.erb +1 -4
  50. data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +7 -6
  51. data/app/views/phcscriptcdnpro/script/versions/edit.html.erb +4 -6
  52. data/app/views/phcscriptcdnpro/script/versions/index.html.erb +19 -15
  53. data/app/views/phcscriptcdnpro/script/versions/new.html.erb +4 -6
  54. data/app/views/phcscriptcdnpro/script/versions/show.html.erb +1 -4
  55. data/config/routes.rb +19 -20
  56. data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +1 -1
  57. data/lib/phcscriptcdnpro.rb +0 -1
  58. data/lib/phcscriptcdnpro/engine.rb +16 -15
  59. data/lib/phcscriptcdnpro/version.rb +1 -1
  60. metadata +62 -62
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2aeafb460622321c00bee73a05baeb0c6d3913ccf23905116bb7786e5958020f
4
- data.tar.gz: dd9482caba24597d6004cc32293b1a7708ec0771e7ac6d00929825195f7386df
3
+ metadata.gz: 17a659183e2d7535cf7703de59038a4e82e2190d7ff71e316f7cc598776de05b
4
+ data.tar.gz: a2ca13dca91834c4b4c237bf2668897e534132848f2e1f9e9d7d513fd2b3f4e3
5
5
  SHA512:
6
- metadata.gz: b56ff83cb90e06418572ad03414f52fb9f45ea1941685d6ff8985b5f2ffcade2aca7ff87b0918e374fe7d21e3730fdb525cd5c78f08d4107eec8269a80fc8f8d
7
- data.tar.gz: ceab28cfb68ef4a92f02c94798e23e14a2b92ac1b3db094e97eed52db308cd9d303d79ba02ccdc91c756ce7228cedb98c2c7776d31b800504147a6c998e5afcd
6
+ metadata.gz: 70ed42f6fee08f90174c106445bc0ecc8b59399e60cbdd55fbef421ea57a54bc53be55f8a5dea2e13e0ad5e2875a6c5f7d0d9fdf8c1542321f299e9a95c76537
7
+ data.tar.gz: 607daca226fabdf4207e7682b2e24e184d64d9cefab21605cee603314868499f1fef51b460078cd760f746bc20fc8d4d08d97c0f7575094436e27ad7eea87093
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - PHCNetco/PHCDevworks/PHCNetworks
1
+ Copyright 2012-2019 BradPotts - PHCNetCo/PHCDevworks/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
@@ -31,4 +31,4 @@ To properly function re-compile your application's assets to copy over required
31
31
  #### Step 5 - Generate Contact Form View (Customization)
32
32
  All PHCScriptCDN views and layouts can be overwritten by copying files to your application.
33
33
 
34
- rails generate phcscriptcdnpro:views
34
+ rails generate phcscriptcdnpro:views
@@ -1,2 +1,2 @@
1
1
  // Load Admin Theme
2
- //= require phc_admin_theme_scripts_four
2
+ //= require phc_admin_theme_scripts_four
@@ -1,2 +1,2 @@
1
1
  // Load Admin Theme
2
- @import "phc_admin_theme_styles_four";
2
+ @import "phc_admin_theme_styles_four";
@@ -1,27 +1,22 @@
1
1
  module Phcscriptcdnpro
2
- class ApplicationController < ActionController::Base
2
+ class ApplicationController < ActionController::Base
3
3
 
4
- # Security Filters
5
- protect_from_forgery with: :exception
6
- before_action :set_default_locale
4
+ # Security Filters
5
+ protect_from_forgery with: :exception
7
6
 
8
- # Load Requried Helper Files
9
- helper Phccorehelpers::Engine.helpers
10
- helper Phcmenus::Engine.helpers
11
- helper Phctitleseo::Engine.helpers
12
- helper Phcnotifi::Engine.helpers
13
- helper Phcaccountspro::Engine.helpers
7
+ # Load Requried Helper Files
8
+ helper Phcaccountspro::Engine.helpers
9
+ helper Phccorehelpers::Engine.helpers
10
+ helper Phcmenus::Engine.helpers
11
+ helper Phctitleseo::Engine.helpers
12
+ helper Phcnotifi::Engine.helpers
14
13
 
15
- # Papertrail Whodunnit Username
16
- def user_for_paper_trail
17
- current_user ? current_user.username : 'Public user'
18
- end
19
-
20
- private
14
+ # Papertrail Whodunnit Username
15
+ def user_for_paper_trail
16
+ current_user ? current_user.username : 'Public user'
17
+ end
21
18
 
22
- def set_default_locale
23
- I18n.default_locale = :en
24
- end
19
+ private
25
20
 
26
- end
21
+ end
27
22
  end
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_author, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Author
12
+ # INDEX
13
13
  def index
14
- @script_authors = Script::Author.where(org_id: current_user.org_id)
14
+ @script_authors = Script::Author.all
15
15
  end
16
16
 
17
- # DETAILS - Script Author
17
+ # SHOW
18
18
  def show
19
19
  @script_authors = Script::Author.friendly.find(params[:id])
20
20
  @versions = Phcscriptcdnpro::AuthorVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Author')
21
21
  end
22
22
 
23
- # NEW - Script Author
23
+ # NEW
24
24
  def new
25
25
  @script_author = Script::Author.new
26
26
  end
27
27
 
28
- # EDIT - Script Author
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # CREATE - Script Author
32
+ # CREATE
33
33
  def create
34
34
  @script_author = Script::Author.new(script_author_params)
35
35
  @script_author.user_id = current_user.id
36
- @script_author.org_id = current_user.org_id
37
36
  if @script_author.save
38
- redirect_to script_authors_url, notice: 'Author was successfully created.'
39
- else
37
+ redirect_to script_authors_url, :flash => { :success => 'Author was successfully created.' }
38
+ else
40
39
  render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT - Script Author
43
+ # UPDATE
45
44
  def update
46
45
  if @script_author.update(script_author_params)
47
- redirect_to script_authors_url, notice: 'Author was successfully updated.'
48
- else
49
- render :edit
46
+ redirect_to script_authors_url, :flash => { :success => 'Author was successfully updated.' }
47
+ else
48
+ render :edit
50
49
  end
51
50
  end
52
51
 
53
- # DELETE - Script Author
52
+ # DELETE
54
53
  def destroy
55
54
  @script_author.destroy
56
- redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
55
+ redirect_to script_authors_url, :flash => { :error => 'Author was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
@@ -65,7 +64,7 @@ module Phcscriptcdnpro
65
64
 
66
65
  # Whitelist
67
66
  def script_author_params
68
- params.require(:script_author).permit(:author_first_name, :author_last_name, :author_website, :author_github, :slug, :user_id, :org_id, :listing_id)
67
+ params.require(:script_author).permit(:author_first_name, :author_last_name, :author_website, :author_github, :slug, :user_id, :listing_id)
69
68
  end
70
69
 
71
70
  end
@@ -9,63 +9,62 @@ module Phcscriptcdnpro
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Extension
12
+ # INDEX
13
13
  def index
14
- @script_extensions = Script::Extension.where(org_id: current_user.org_id)
14
+ @script_extensions = Script::Extension.all
15
15
  end
16
16
 
17
- # DETAILS - Script Extension
17
+ # SHOW
18
18
  def show
19
19
  @script_extensions = Script::Extension.friendly.find(params[:id])
20
20
  @versions = Phcscriptcdnpro::ExtensionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Extension')
21
21
  end
22
22
 
23
- # NEW - Script Extension
23
+ # NEW
24
24
  def new
25
25
  @script_extension = Script::Extension.new
26
26
  end
27
27
 
28
- # EDIT - Script Extension
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # CREATE - Script Extension
32
+ # CREATE
33
33
  def create
34
34
  @script_extension = Script::Extension.new(script_extension_params)
35
35
  @script_extension.user_id = current_user.id
36
- @script_extension.org_id = current_user.org_id
37
36
  if @script_extension.save
38
- redirect_to script_extensions_url, notice: 'Extension was successfully created.'
39
- else
37
+ redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully created.' }
38
+ else
40
39
  render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT - Script Extension
43
+ # UPDATE
45
44
  def update
46
45
  if @script_extension.update(script_extension_params)
47
- redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
48
- else
49
- render :edit
46
+ redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully updated.' }
47
+ else
48
+ render :edit
50
49
  end
51
50
  end
52
51
 
53
- # DELETE - Script Extension
52
+ # DELETE
54
53
  def destroy
55
54
  @script_extension.destroy
56
- redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
55
+ redirect_to script_extensions_url, :flash => { :error => 'Extension was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
60
59
 
61
60
  # Common Callbacks
62
- def set_script_extension
63
- @script_extension = Script::Extension.friendly.find(params[:id])
61
+ def set_script_extension
62
+ @script_extension = Script::Extension.friendly.find(params[:id])
64
63
  end
65
64
 
66
65
  # Whitelists
67
66
  def script_extension_params
68
- params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id, :org_id)
67
+ params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id)
69
68
  end
70
69
 
71
70
  end
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Licences
12
+ # INDEX
13
13
  def index
14
- @script_licences = Script::Licence.where(org_id: current_user.org_id)
14
+ @script_licences = Script::Licence.all
15
15
  end
16
16
 
17
- # DETAILS - Script Licences
17
+ # SHOW
18
18
  def show
19
19
  @script_licences = Script::Licence.friendly.find(params[:id])
20
20
  @versions = Phcscriptcdnpro::LicenceVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Licence')
21
21
  end
22
22
 
23
- # NEW - Script Licences
23
+ # NEW
24
24
  def new
25
25
  @script_licence = Script::Licence.new
26
26
  end
27
27
 
28
- # EDIT - Script Licences
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # POST - Script Licences
32
+ # CREATE
33
33
  def create
34
34
  @script_licence = Script::Licence.new(script_licence_params)
35
35
  @script_licence.user_id = current_user.id
36
- @script_licence.org_id = current_user.org_id
37
36
  if @script_licence.save
38
- redirect_to script_licences_url, notice: 'Licence was successfully created.'
39
- else
37
+ redirect_to script_licences_url, :flash => { :success => 'Licence was successfully created.' }
38
+ else
40
39
  render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT - Script Licences
43
+ # UPDATE
45
44
  def update
46
45
  if @script_licence.update(script_licence_params)
47
- redirect_to script_licences_url, notice: 'Licence was successfully updated.'
48
- else
49
- render :edit
46
+ redirect_to script_licences_url, :flash => { :success => 'Licence was successfully updated.' }
47
+ else
48
+ render :edit
50
49
  end
51
50
  end
52
51
 
53
- # DELETE - Script Licences
52
+ # DELETE
54
53
  def destroy
55
54
  @script_licence.destroy
56
- redirect_to script_licences_url, notice: 'Licence was successfully destroyed.'
55
+ redirect_to script_licences_url, :flash => { :error => 'Licence was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Listings
12
+ # INDEX
13
13
  def index
14
- @script_listings = Script::Listing.where(org_id: current_user.org_id)
14
+ @script_listings = Script::Listing.all
15
15
  end
16
16
 
17
- # DETAILS - Script Listings
17
+ # SHOW
18
18
  def show
19
19
  @script_listings = Script::Listing.friendly.find(params[:id])
20
20
  @versions = Phcscriptcdnpro::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script_::Listing')
21
21
  end
22
22
 
23
- # NEW - Script Listings
23
+ # NEW
24
24
  def new
25
25
  @script_listing = Script::Listing.new
26
26
  end
27
27
 
28
- # EDIT - Script Listings
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # POST - Script Listings
32
+ # CREATE
33
33
  def create
34
34
  @script_listing = Script::Listing.new(script_listing_params)
35
35
  @script_listing.user_id = current_user.id
36
- @script_listing.org_id = current_user.org_id
37
36
  if @script_listing.save
38
- redirect_to script_listings_path, notice: 'Listing was successfully created.'
37
+ redirect_to script_listings_path, :flash => { :success => 'Listing was successfully created.' }
39
38
  else
40
39
  render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT - Script Listings
43
+ # UPDATE
45
44
  def update
46
45
  if @script_listing.update(script_listing_params)
47
- redirect_to script_listings_path, notice: 'Listing was successfully updated.'
46
+ redirect_to script_listings_path, :flash => { :success => 'Listing was successfully updated.' }
48
47
  else
49
48
  render :edit
50
49
  end
51
50
  end
52
51
 
53
- # DELETE - Script Listings
52
+ # DELETE
54
53
  def destroy
55
54
  @script_listing.destroy
56
- redirect_to script_listings_path, notice: 'Listing was successfully destroyed.'
55
+ redirect_to script_listings_path, :flash => { :error => 'Listing was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
@@ -65,7 +64,7 @@ module Phcscriptcdnpro
65
64
 
66
65
  # Whitelist
67
66
  def script_listing_params
68
- params.require(:script_listing).permit(:script_tittle, :script_description, :script_source, :script_website, :script_github, :script_initial_release, :script_lastest_release, :script_beta_release, :script_lastest_release_cdn, :script_status, :slug, :user_id, :org_id, :version_id, :author_id, :licence_id)
67
+ params.require(:script_listing).permit(:script_title, :script_description, :script_source, :script_website, :script_github, :script_initial_release, :script_lastest_release, :script_beta_release, :script_lastest_release_cdn, :script_status, :slug, :user_id, :version_id, :author_id, :licence_id)
69
68
  end
70
69
 
71
70
  end
@@ -9,58 +9,57 @@ module Phcscriptcdnpro
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_url, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Authors
12
+ # INDEX
13
13
  def index
14
14
  script_listing = Script::Listing.find(params[:listing_id])
15
15
  @script_urls = script_listing.urls
16
16
  end
17
17
 
18
- # DETAILED PROFILE - Script Authors
18
+ # SHOW
19
19
  def show
20
20
  script_listing = Script::Listing.find(params[:listing_id])
21
21
  @script_url = script_listing.urls.friendly.find(params[:id])
22
22
  end
23
23
 
24
- # NEW - Script Athors
24
+ # NEW
25
25
  def new
26
26
  script_listing = Script::Listing.find(params[:listing_id])
27
27
  @script_url = script_listing.urls.build
28
28
  end
29
29
 
30
- # EDIT - Script Athors
30
+ # EDIT
31
31
  def edit
32
32
  script_listing = Script::Listing.find(params[:listing_id])
33
33
  @script_url = script_listing.urls.find(params[:id])
34
34
  end
35
35
 
36
- # POST - Script Athors
36
+ # CREATE
37
37
  def create
38
38
  @script_listing = Script::Listing.find(params[:listing_id])
39
39
  @script_url = @script_listing.urls.create(script_url_params)
40
40
  @script_url.user_id = current_user.id
41
- @script_url.org_id = current_user.org_id
42
41
  if @script_url.save
43
- redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
44
- else
45
- render :new
42
+ redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully created.' }
43
+ else
44
+ render :new
46
45
  end
47
46
  end
48
47
 
49
- # PATCH/PUT - Script Athors
48
+ # UPDATE
50
49
  def update
51
50
  if @script_url.update(script_url_params)
52
- redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
53
- else
54
- render :edit
51
+ redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully updated.' }
52
+ else
53
+ render :edit
55
54
  end
56
55
  end
57
56
 
58
- # DELETE - Script Athors
57
+ # DELETE
59
58
  def destroy
60
59
  @script_listing = Script::Listing.find(params[:listing_id])
61
60
  @script_url = @script_listing.urls.find(params[:id])
62
61
  @script_url.destroy
63
- redirect_to script_listing_urls_path, notice: 'Author was successfully destroyed.'
62
+ redirect_to script_listing_urls_path, :flash => { :error => 'Author was successfully destroyed.' }
64
63
  end
65
64
 
66
65
  private
@@ -72,7 +71,7 @@ module Phcscriptcdnpro
72
71
 
73
72
  # Whitelists
74
73
  def script_url_params
75
- params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :org_id, :listing_id, :version_id, :extension_id)
74
+ params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :listing_id, :version_id, :extension_id)
76
75
  end
77
76
 
78
77
  end