phcscriptcdn 51.0.0 → 52.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/app/assets/javascripts/phcscriptcdn/application.js +1 -1
  4. data/app/controllers/phcscriptcdn/application_controller.rb +15 -20
  5. data/app/controllers/phcscriptcdn/script/authors_controller.rb +13 -13
  6. data/app/controllers/phcscriptcdn/script/extensions_controller.rb +15 -15
  7. data/app/controllers/phcscriptcdn/script/licences_controller.rb +13 -13
  8. data/app/controllers/phcscriptcdn/script/listings_controller.rb +11 -11
  9. data/app/controllers/phcscriptcdn/script/urls_controller.rb +14 -14
  10. data/app/controllers/phcscriptcdn/script/versions_controller.rb +15 -15
  11. data/app/models/phcscriptcdn/application_record.rb +0 -2
  12. data/app/models/phcscriptcdn/script.rb +0 -2
  13. data/app/models/phcscriptcdn/script/author.rb +16 -7
  14. data/app/models/phcscriptcdn/script/extension.rb +5 -8
  15. data/app/models/phcscriptcdn/script/licence.rb +5 -8
  16. data/app/models/phcscriptcdn/script/listing.rb +12 -17
  17. data/app/models/phcscriptcdn/script/url.rb +4 -16
  18. data/app/models/phcscriptcdn/script/version.rb +6 -9
  19. data/app/views/layouts/phcscriptcdn/application.html.erb +6 -5
  20. data/app/views/layouts/phcscriptcdn/components/backend/footer/_footer.html.erb +5 -5
  21. data/app/views/layouts/phcscriptcdn/components/backend/sidebars/_side_menu.html.erb +60 -25
  22. data/app/views/phcscriptcdn/script/authors/_form.html.erb +6 -5
  23. data/app/views/phcscriptcdn/script/authors/edit.html.erb +4 -4
  24. data/app/views/phcscriptcdn/script/authors/index.html.erb +19 -15
  25. data/app/views/phcscriptcdn/script/authors/new.html.erb +4 -4
  26. data/app/views/phcscriptcdn/script/authors/show.html.erb +1 -4
  27. data/app/views/phcscriptcdn/script/extensions/_form.html.erb +5 -4
  28. data/app/views/phcscriptcdn/script/extensions/edit.html.erb +4 -7
  29. data/app/views/phcscriptcdn/script/extensions/index.html.erb +19 -15
  30. data/app/views/phcscriptcdn/script/extensions/new.html.erb +4 -6
  31. data/app/views/phcscriptcdn/script/extensions/show.html.erb +1 -4
  32. data/app/views/phcscriptcdn/script/licences/_form.html.erb +10 -9
  33. data/app/views/phcscriptcdn/script/licences/edit.html.erb +4 -6
  34. data/app/views/phcscriptcdn/script/licences/index.html.erb +19 -15
  35. data/app/views/phcscriptcdn/script/licences/new.html.erb +4 -6
  36. data/app/views/phcscriptcdn/script/licences/show.html.erb +1 -4
  37. data/app/views/phcscriptcdn/script/listings/_form.html.erb +21 -17
  38. data/app/views/phcscriptcdn/script/listings/edit.html.erb +4 -4
  39. data/app/views/phcscriptcdn/script/listings/index.html.erb +24 -19
  40. data/app/views/phcscriptcdn/script/listings/new.html.erb +6 -5
  41. data/app/views/phcscriptcdn/script/listings/show.html.erb +3 -5
  42. data/app/views/phcscriptcdn/script/urls/_form.html.erb +7 -6
  43. data/app/views/phcscriptcdn/script/urls/edit.html.erb +15 -5
  44. data/app/views/phcscriptcdn/script/urls/index.html.erb +19 -15
  45. data/app/views/phcscriptcdn/script/urls/new.html.erb +4 -6
  46. data/app/views/phcscriptcdn/script/urls/show.html.erb +1 -4
  47. data/app/views/phcscriptcdn/script/versions/_form.html.erb +3 -2
  48. data/app/views/phcscriptcdn/script/versions/edit.html.erb +4 -6
  49. data/app/views/phcscriptcdn/script/versions/index.html.erb +19 -15
  50. data/app/views/phcscriptcdn/script/versions/new.html.erb +4 -6
  51. data/app/views/phcscriptcdn/script/versions/show.html.erb +1 -4
  52. data/config/routes.rb +19 -20
  53. data/db/migrate/20160821183652_create_phcscriptcdn_script_listings.rb +1 -1
  54. data/lib/phcscriptcdn/engine.rb +16 -15
  55. data/lib/phcscriptcdn/version.rb +1 -1
  56. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16da2eed282f65c8b0b2840139472b473b88aadfe58ef7da055b1e0af48311df
4
- data.tar.gz: a8a9d96ccfe08cc3c2920270ffa4bfd0bbaaabf1d4f67b3a58ef16330677a5ff
3
+ metadata.gz: 516dcc20e892c6e239d4932a54b77cb7404d2803a0d9cc5be87cd7b49b0ec593
4
+ data.tar.gz: 55c2a789bf7dac6b392f4db09cfed925ac89712dd88a8617b773b9d001e636b8
5
5
  SHA512:
6
- metadata.gz: ac85e6f5278475a774a8c6aa78af1916723a03a41862c9a4f09cc931d01a23dde5fbecf09c3fe49f63a0910d181aaa0101efaa05ff682353ec974a57c3152196
7
- data.tar.gz: 8749b5c38e43e99a0fe55d571bddb31907ce7650df7b84b292d372d7d3dc1b3171c83ded386b14d71d6ff32bed0535f946500ae1cb7daca06588200d8f71c14c
6
+ metadata.gz: 42111c83741814b3cbdd6ce3d62e37a92a975b11e8987123172eb7a644946e62d746006375eb2b61f0240cc652e35b60c37c9c88b13db4bca88fbe48654ce7ca
7
+ data.tar.gz: 7c750ec9f253d44f971a133e1d76d7fea32e4002746fc0f55ee352db32683813be6140f99045e60a708cf956c244302b6d9c05de09effb416ce0d56abcccb707
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - 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
@@ -1,2 +1,2 @@
1
1
  // Load Admin Theme
2
- //= require phc_admin_theme_scripts_four
2
+ //= require phc_admin_theme_scripts_four
@@ -1,27 +1,22 @@
1
1
  module Phcscriptcdn
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 Phcaccounts::Engine.helpers
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
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,50 +9,50 @@ module Phcscriptcdn
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
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 = Phcscriptcdn::AuthorVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
  if @script_author.save
37
- redirect_to script_authors_url, notice: 'Author was successfully created.'
38
- else
37
+ redirect_to script_authors_url, :flash => { :success => 'Author was successfully created.' }
38
+ else
39
39
  render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT - Script Author
43
+ # UPDATE
44
44
  def update
45
45
  if @script_author.update(script_author_params)
46
- redirect_to script_authors_url, notice: 'Author was successfully updated.'
47
- else
48
- render :edit
46
+ redirect_to script_authors_url, :flash => { :success => 'Author was successfully updated.' }
47
+ else
48
+ render :edit
49
49
  end
50
50
  end
51
51
 
52
- # DELETE - Script Author
52
+ # DELETE
53
53
  def destroy
54
54
  @script_author.destroy
55
- redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
55
+ redirect_to script_authors_url, :flash => { :error => 'Author was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
@@ -9,57 +9,57 @@ module Phcscriptcdn
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
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 = Phcscriptcdn::ExtensionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
  if @script_extension.save
37
- redirect_to script_extensions_url, notice: 'Extension was successfully created.'
38
- else
37
+ redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully created.' }
38
+ else
39
39
  render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT - Script Extension
43
+ # UPDATE
44
44
  def update
45
45
  if @script_extension.update(script_extension_params)
46
- redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
47
- else
48
- render :edit
46
+ redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully updated.' }
47
+ else
48
+ render :edit
49
49
  end
50
50
  end
51
51
 
52
- # DELETE - Script Extension
52
+ # DELETE
53
53
  def destroy
54
54
  @script_extension.destroy
55
- redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
55
+ redirect_to script_extensions_url, :flash => { :error => 'Extension was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
59
59
 
60
60
  # Common Callbacks
61
- def set_script_extension
62
- @script_extension = Script::Extension.friendly.find(params[:id])
61
+ def set_script_extension
62
+ @script_extension = Script::Extension.friendly.find(params[:id])
63
63
  end
64
64
 
65
65
  # Whitelists
@@ -9,50 +9,50 @@ module Phcscriptcdn
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
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 = Phcscriptcdn::LicenceVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
  if @script_licence.save
37
- redirect_to script_licences_url, notice: 'Licence was successfully created.'
38
- else
37
+ redirect_to script_licences_url, :flash => { :success => 'Licence was successfully created.' }
38
+ else
39
39
  render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT - Script Licences
43
+ # UPDATE
44
44
  def update
45
45
  if @script_licence.update(script_licence_params)
46
- redirect_to script_licences_url, notice: 'Licence was successfully updated.'
47
- else
48
- render :edit
46
+ redirect_to script_licences_url, :flash => { :success => 'Licence was successfully updated.' }
47
+ else
48
+ render :edit
49
49
  end
50
50
  end
51
51
 
52
- # DELETE - Script Licences
52
+ # DELETE
53
53
  def destroy
54
54
  @script_licence.destroy
55
- redirect_to script_licences_url, notice: 'Licence was successfully destroyed.'
55
+ redirect_to script_licences_url, :flash => { :error => 'Licence was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
@@ -9,50 +9,50 @@ module Phcscriptcdn
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
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 = Phcscriptcdn::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
  if @script_listing.save
37
- redirect_to script_listings_path, notice: 'Listing was successfully created.'
37
+ redirect_to script_listings_path, :flash => { :success => 'Listing was successfully created.' }
38
38
  else
39
39
  render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT - Script Listings
43
+ # UPDATE
44
44
  def update
45
45
  if @script_listing.update(script_listing_params)
46
- redirect_to script_listings_path, notice: 'Listing was successfully updated.'
46
+ redirect_to script_listings_path, :flash => { :success => 'Listing was successfully updated.' }
47
47
  else
48
48
  render :edit
49
49
  end
50
50
  end
51
51
 
52
- # DELETE - Script Listings
52
+ # DELETE
53
53
  def destroy
54
54
  @script_listing.destroy
55
- redirect_to script_listings_path, notice: 'Listing was successfully destroyed.'
55
+ redirect_to script_listings_path, :flash => { :error => 'Listing was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
@@ -64,7 +64,7 @@ module Phcscriptcdn
64
64
 
65
65
  # Whitelist
66
66
  def script_listing_params
67
- 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, :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)
68
68
  end
69
69
 
70
70
  end
@@ -9,57 +9,57 @@ module Phcscriptcdn
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
41
  if @script_url.save
42
- redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
43
- else
44
- render :new
42
+ redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully created.' }
43
+ else
44
+ render :new
45
45
  end
46
46
  end
47
47
 
48
- # PATCH/PUT - Script Athors
48
+ # UPDATE
49
49
  def update
50
50
  if @script_url.update(script_url_params)
51
- redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
52
- else
53
- render :edit
51
+ redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully updated.' }
52
+ else
53
+ render :edit
54
54
  end
55
55
  end
56
56
 
57
- # DELETE - Script Athors
57
+ # DELETE
58
58
  def destroy
59
59
  @script_listing = Script::Listing.find(params[:listing_id])
60
60
  @script_url = @script_listing.urls.find(params[:id])
61
61
  @script_url.destroy
62
- redirect_to script_listing_urls_path, notice: 'Author was successfully destroyed.'
62
+ redirect_to script_listing_urls_path, :flash => { :error => 'Author was successfully destroyed.' }
63
63
  end
64
64
 
65
65
  private
@@ -9,50 +9,50 @@ module Phcscriptcdn
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_script_version, only: [:show, :edit, :update, :destroy]
11
11
 
12
- # INDEX - Script Versions
12
+ # INDEX
13
13
  def index
14
14
  @script_versions = Script::Version.all
15
15
  end
16
16
 
17
- # DETAILS - Script Versions
17
+ # SHOW
18
18
  def show
19
19
  @script_versions = Script::Version.friendly.find(params[:id])
20
20
  @versions = Phcscriptcdn::ScriptversionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::Script::Version')
21
21
  end
22
22
 
23
- # NEW - Script Versions
23
+ # NEW
24
24
  def new
25
25
  @script_version = Script::Version.new
26
26
  end
27
27
 
28
- # EDIT - Script Versions
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # POST - Script Versions
32
+ # CREATE
33
33
  def create
34
34
  @script_version = Script::Version.new(script_version_params)
35
35
  @script_version.user_id = current_user.id
36
36
  if @script_version.save
37
- redirect_to script_versions_url, notice: 'Version was successfully created.'
38
- else
39
- render :new
37
+ redirect_to script_versions_url, :flash => { :success => 'Version was successfully created.' }
38
+ else
39
+ render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT - Script Versions
43
+ # UPDATE
44
44
  def update
45
45
  if @script_version.update(script_version_params)
46
- redirect_to script_versions_url, notice: 'Version was successfully updated.'
47
- else
48
- render :edit
46
+ redirect_to script_versions_url, :flash => { :success => 'Version was successfully updated.' }
47
+ else
48
+ render :edit
49
49
  end
50
50
  end
51
51
 
52
- # DELETE - Script Versions
52
+ # DELETE
53
53
  def destroy
54
54
  @script_version.destroy
55
- redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
55
+ redirect_to script_versions_url, :flash => { :error => 'Version was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
@@ -62,7 +62,7 @@ module Phcscriptcdn
62
62
  @script_version = Script::Version.friendly.find(params[:id])
63
63
  end
64
64
 
65
- # Only allow a trusted parameter "white list" through.
65
+ # Whitelist
66
66
  def script_version_params
67
67
  params.require(:script_version).permit(:script_version_number, :slug, :user_id, :org_id)
68
68
  end