phcscriptcdn 2.0.4 → 3.0.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -3
  3. data/app/assets/javascripts/phcscriptcdn/script/licences.js +2 -0
  4. data/app/assets/stylesheets/phcscriptcdn/_custom.scss +9 -0
  5. data/app/assets/stylesheets/phcscriptcdn/application.scss +14 -15
  6. data/app/controllers/phcscriptcdn/script/authors_controller.rb +74 -0
  7. data/app/controllers/phcscriptcdn/script/extensions_controller.rb +65 -0
  8. data/app/controllers/phcscriptcdn/script/licences_controller.rb +65 -0
  9. data/app/controllers/phcscriptcdn/script/listings_controller.rb +65 -0
  10. data/app/controllers/phcscriptcdn/script/urls_controller.rb +75 -0
  11. data/app/controllers/phcscriptcdn/script/versions_controller.rb +65 -0
  12. data/app/helpers/phcscriptcdn/application_helper.rb +2 -2
  13. data/app/helpers/phcscriptcdn/script/licences_helper.rb +4 -0
  14. data/app/models/phcscriptcdn/script/author.rb +10 -0
  15. data/app/models/phcscriptcdn/script/extension.rb +4 -0
  16. data/app/models/phcscriptcdn/script/licence.rb +4 -0
  17. data/app/models/phcscriptcdn/script/listing.rb +13 -0
  18. data/app/models/phcscriptcdn/script/url.rb +10 -0
  19. data/app/models/phcscriptcdn/script/version.rb +5 -0
  20. data/app/models/phcscriptcdn/{scriptcdn.rb → script.rb} +2 -2
  21. data/app/views/layouts/phcscriptcdn/application.html.erb +3 -5
  22. data/app/views/phcscriptcdn/{scriptcdn → script}/authors/_form.html.erb +14 -12
  23. data/app/views/phcscriptcdn/script/authors/edit.html.erb +32 -0
  24. data/app/views/phcscriptcdn/script/authors/index.html.erb +55 -0
  25. data/app/views/phcscriptcdn/script/authors/new.html.erb +32 -0
  26. data/app/views/phcscriptcdn/script/authors/show.html.erb +4 -0
  27. data/app/views/phcscriptcdn/script/extensions/_form.html.erb +22 -0
  28. data/app/views/phcscriptcdn/script/extensions/edit.html.erb +32 -0
  29. data/app/views/phcscriptcdn/script/extensions/index.html.erb +49 -0
  30. data/app/views/phcscriptcdn/script/extensions/new.html.erb +32 -0
  31. data/app/views/phcscriptcdn/script/extensions/show.html.erb +4 -0
  32. data/app/views/phcscriptcdn/script/licences/_form.html.erb +42 -0
  33. data/app/views/phcscriptcdn/script/licences/edit.html.erb +32 -0
  34. data/app/views/phcscriptcdn/script/licences/index.html.erb +59 -0
  35. data/app/views/phcscriptcdn/script/licences/new.html.erb +32 -0
  36. data/app/views/phcscriptcdn/script/licences/show.html.erb +4 -0
  37. data/app/views/phcscriptcdn/{scriptcdn/informations → script/listings}/_form.html.erb +15 -10
  38. data/app/views/phcscriptcdn/script/listings/edit.html.erb +31 -0
  39. data/app/views/phcscriptcdn/script/listings/index.html.erb +54 -0
  40. data/app/views/phcscriptcdn/script/listings/new.html.erb +31 -0
  41. data/app/views/phcscriptcdn/script/listings/show.html.erb +27 -0
  42. data/app/views/phcscriptcdn/script/urls/_form.html.erb +12 -0
  43. data/app/views/phcscriptcdn/script/urls/edit.html.erb +32 -0
  44. data/app/views/phcscriptcdn/script/urls/index.html.erb +47 -0
  45. data/app/views/phcscriptcdn/script/urls/new.html.erb +32 -0
  46. data/app/views/phcscriptcdn/script/urls/show.html.erb +4 -0
  47. data/app/views/phcscriptcdn/script/versions/_form.html.erb +12 -0
  48. data/app/views/phcscriptcdn/script/versions/edit.html.erb +32 -0
  49. data/app/views/phcscriptcdn/script/versions/index.html.erb +47 -0
  50. data/app/views/phcscriptcdn/script/versions/new.html.erb +32 -0
  51. data/app/views/phcscriptcdn/script/versions/show.html.erb +4 -0
  52. data/config/routes.rb +13 -14
  53. data/db/migrate/20160731205205_create_phcscriptcdn_script_extensions.rb +15 -0
  54. data/db/migrate/20160731205917_create_phcscriptcdn_script_listings.rb +26 -0
  55. data/db/migrate/20160731205954_create_phcscriptcdn_script_versions.rb +13 -0
  56. data/db/migrate/20160731210626_create_phcscriptcdn_script_urls.rb +16 -0
  57. data/db/migrate/20160731210723_create_phcscriptcdn_script_authors.rb +20 -0
  58. data/db/migrate/20160801032225_create_phcscriptcdn_script_licences.rb +21 -0
  59. data/lib/phcscriptcdn/version.rb +1 -1
  60. metadata +172 -74
  61. data/app/controllers/phcscriptcdn/scriptcdn/authors_controller.rb +0 -69
  62. data/app/controllers/phcscriptcdn/scriptcdn/informations_controller.rb +0 -69
  63. data/app/controllers/phcscriptcdn/scriptcdn/mains_controller.rb +0 -62
  64. data/app/controllers/phcscriptcdn/scriptcdn/urls_controller.rb +0 -84
  65. data/app/controllers/phcscriptcdn/scriptcdn/versions_controller.rb +0 -69
  66. data/app/models/phcscriptcdn/scriptcdn/author.rb +0 -8
  67. data/app/models/phcscriptcdn/scriptcdn/information.rb +0 -8
  68. data/app/models/phcscriptcdn/scriptcdn/main.rb +0 -11
  69. data/app/models/phcscriptcdn/scriptcdn/url.rb +0 -8
  70. data/app/models/phcscriptcdn/scriptcdn/version.rb +0 -8
  71. data/app/views/phcscriptcdn/scriptcdn/authors/_formpatch.html.erb +0 -29
  72. data/app/views/phcscriptcdn/scriptcdn/authors/edit.html.erb +0 -3
  73. data/app/views/phcscriptcdn/scriptcdn/authors/index.html.erb +0 -23
  74. data/app/views/phcscriptcdn/scriptcdn/authors/new.html.erb +0 -3
  75. data/app/views/phcscriptcdn/scriptcdn/informations/_formpatch.html.erb +0 -49
  76. data/app/views/phcscriptcdn/scriptcdn/informations/edit.html.erb +0 -3
  77. data/app/views/phcscriptcdn/scriptcdn/informations/index.html.erb +0 -26
  78. data/app/views/phcscriptcdn/scriptcdn/informations/new.html.erb +0 -3
  79. data/app/views/phcscriptcdn/scriptcdn/informations/show.html.erb +0 -58
  80. data/app/views/phcscriptcdn/scriptcdn/mains/_form.html.erb +0 -13
  81. data/app/views/phcscriptcdn/scriptcdn/mains/edit.html.erb +0 -3
  82. data/app/views/phcscriptcdn/scriptcdn/mains/index.html.erb +0 -19
  83. data/app/views/phcscriptcdn/scriptcdn/mains/new.html.erb +0 -3
  84. data/app/views/phcscriptcdn/scriptcdn/urls/_form.html.erb +0 -17
  85. data/app/views/phcscriptcdn/scriptcdn/urls/_formpatch.html.erb +0 -17
  86. data/app/views/phcscriptcdn/scriptcdn/urls/edit.html.erb +0 -3
  87. data/app/views/phcscriptcdn/scriptcdn/urls/index.html.erb +0 -21
  88. data/app/views/phcscriptcdn/scriptcdn/urls/new.html.erb +0 -3
  89. data/app/views/phcscriptcdn/scriptcdn/versions/_form.html.erb +0 -13
  90. data/app/views/phcscriptcdn/scriptcdn/versions/_formpatch.html.erb +0 -13
  91. data/app/views/phcscriptcdn/scriptcdn/versions/edit.html.erb +0 -3
  92. data/app/views/phcscriptcdn/scriptcdn/versions/index.html.erb +0 -20
  93. data/app/views/phcscriptcdn/scriptcdn/versions/new.html.erb +0 -3
  94. data/db/migrate/20160704004828_create_phcscriptcdn_scriptcdn_authors.rb +0 -20
  95. data/db/migrate/20160704005455_create_phcscriptcdn_scriptcdn_information.rb +0 -27
  96. data/db/migrate/20160704011123_create_phcscriptcdn_scriptcdn_urls.rb +0 -19
  97. data/db/migrate/20160704011452_create_phcscriptcdn_scriptcdn_versions.rb +0 -15
  98. data/db/migrate/20160704011727_create_phcscriptcdn_scriptcdn_mains.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa251e6c09ab7445bbf64ab2c90cc3f4b01a6dbd
4
- data.tar.gz: 1e3f30f876694ed344a94ba071d0698f79588fed
3
+ metadata.gz: ab879db204db927b723a2eb822a60585bfcbe243
4
+ data.tar.gz: 4e4f6f14e8e55d41a51e9249bb350428abb1dc67
5
5
  SHA512:
6
- metadata.gz: cbb7b9bc37aeca0e12043c441ece2a5d2cdb040b573ca3f6d481e1a15b5e333594e8e011bff41b0082689785113ec5715b5a7aa49b8ded0a86da99ef2e331858
7
- data.tar.gz: 5d9083d0cdb6683fcab7eae4f86eb471cf3cacbd96db07da2640637a061192423fb24968c98d1ec93977d54b996db1ab32257d3643f04da4a5876eda6e415552
6
+ metadata.gz: d9bef7f14ff03e4cfed7d3b90d9f2c33346093add653f2fc5c9a495dff3b1edfc8143693e2a8c6013c6178de227bb757b542f11c4091963515943f9088bbd96b
7
+ data.tar.gz: ae325823ce50db315069ce029c75fc7170458249d2bed5ab17733d38fed435a75114a4cafc88538b50e996f79bcf0c0465e11b99292a9196a9bd21c209fb7695
data/README.md CHANGED
@@ -7,11 +7,11 @@
7
7
  PHCScriptCDN(2) script listing software to manage your online script CDN.
8
8
 
9
9
  - Main script title and description.
10
- - Script versions and script urls.
10
+ - Script versions and script URLs.
11
11
 
12
12
  #### Step 1 - Add PHCScriptCDN Engine to your gemfile
13
13
 
14
- gem 'phcscriptcdn', '~> 2.0', '>= 2.0.3'
14
+ gem 'phcscriptcdn', '~> 2.0', '>= 2.0.4'
15
15
  bundle install
16
16
 
17
17
  #### Step 2 - Add Database Migration Files
@@ -33,4 +33,8 @@ Generate views for customization and app integration.
33
33
  PHCScriptCDN UI requires Bootstrap and FontAwesome to operate.
34
34
 
35
35
  rake assets:clobber
36
- rake assets:precompile
36
+ rake assets:precompile
37
+
38
+ #### Additional Information
39
+
40
+ - [Critical Security Updates](https://github.com/PHCNetworks/phc-scriptcdn/wiki/Critical-Security-Updates)
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,9 @@
1
+ // Top Padding Override
2
+ .container {
3
+ padding-top: 50px;
4
+ }
5
+
6
+ // Vertical Align TD Cell
7
+ .table tbody>tr>td.vert-align{
8
+ vertical-align: middle;
9
+ }
@@ -1,23 +1,22 @@
1
1
  /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
16
16
 
17
17
  // Bootstrap & Font Awesome
18
18
  @import "bootstrap-sprockets";
19
19
  @import "bootstrap";
20
20
  @import "font-awesome";
21
21
 
22
- // Custom Alterations
23
22
  @import "custom";
@@ -0,0 +1,74 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::AuthorsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_author, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Authors
10
+ def index
11
+ script_listing = Script::Listing.find(params[:listing_id])
12
+ @script_authors = script_listing.authors
13
+ end
14
+
15
+ # DETAILED PROFILE - Script Authors
16
+ def show
17
+ script_listing = Script::Listing.find(params[:listing_id])
18
+ @script_author = script_listing.authors.find(params[:id])
19
+ end
20
+
21
+ # NEW - Script Athors
22
+ def new
23
+ script_listing = Script::Listing.find(params[:listing_id])
24
+ @script_author = script_listing.authors.build
25
+ end
26
+
27
+ # EDIT - Script Athors
28
+ def edit
29
+ script_listing = Script::Listing.find(params[:listing_id])
30
+ @script_author = script_listing.authors.find(params[:id])
31
+ end
32
+
33
+ # POST - Script Athors
34
+ def create
35
+ @script_listing = Script::Listing.find(params[:listing_id])
36
+ @script_author = @script_listing.authors.create(script_author_params)
37
+ if @script_author.save
38
+ redirect_to script_listing_authors_path, notice: 'Author was successfully created.'
39
+ else
40
+ render :new
41
+ end
42
+ end
43
+
44
+ # PATCH/PUT - Script Athors
45
+ def update
46
+ if @script_author.update(script_author_params)
47
+ redirect_to script_listing_authors_path, notice: 'Author was successfully updated.'
48
+ else
49
+ render :edit
50
+ end
51
+ end
52
+
53
+ # DELETE - Script Athors
54
+ def destroy
55
+ @script_listing = Script::Listing.find(params[:listing_id])
56
+ @script_author = @script_listing.authors.find(params[:id])
57
+ @script_author.destroy
58
+ redirect_to script_listing_authors_path, 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, :listing_id)
71
+ end
72
+
73
+ end
74
+ end
@@ -0,0 +1,65 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::ExtensionsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Extension
10
+ def index
11
+ @script_extensions = Script::Extension.all
12
+ end
13
+
14
+ # DETAILS - Script Extension
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Extension
19
+ def new
20
+ @script_extension = Script::Extension.new
21
+ end
22
+
23
+ # EDIT - Script Extension
24
+ def edit
25
+ end
26
+
27
+ # CREATE - Script Extension
28
+ def create
29
+ @script_extension = Script::Extension.new(script_extension_params)
30
+ if @script_extension.save
31
+ redirect_to script_extensions_url, notice: 'Extension was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Extension
38
+ def update
39
+ if @script_extension.update(script_extension_params)
40
+ redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Extension
47
+ def destroy
48
+ @script_extension.destroy
49
+ redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_extension
56
+ @script_extension = Script::Extension.find(params[:id])
57
+ end
58
+
59
+ # Whitelists
60
+ def script_extension_params
61
+ params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension)
62
+ end
63
+
64
+ end
65
+ end
@@ -0,0 +1,65 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::LicencesController < ApplicationController
5
+
6
+ #Secrity & Filters
7
+ before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Licences
10
+ def index
11
+ @script_licences = Script::Licence.all
12
+ end
13
+
14
+ # DETAILS - Script Licences
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Licences
19
+ def new
20
+ @script_licence = Script::Licence.new
21
+ end
22
+
23
+ # EDIT - Script Licences
24
+ def edit
25
+ end
26
+
27
+ # POST - Script Licences
28
+ def create
29
+ @script_licence = Script::Licence.new(script_licence_params)
30
+ if @script_licence.save
31
+ redirect_to script_licences_url, notice: 'Licence was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Licences
38
+ def update
39
+ if @script_licence.update(script_licence_params)
40
+ redirect_to script_licences_url, notice: 'Licence was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Licences
47
+ def destroy
48
+ @script_licence.destroy
49
+ redirect_to script_licences_url, notice: 'Licence was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_licence
56
+ @script_licence = Script::Licence.find(params[:id])
57
+ end
58
+
59
+ # Whitelists
60
+ def script_licence_params
61
+ params.require(:script_licence).permit(:lcncname, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora)
62
+ end
63
+
64
+ end
65
+ end
@@ -0,0 +1,65 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::ListingsController < ApplicationController
5
+
6
+ # Security & Filters
7
+ before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Listings
10
+ def index
11
+ @script_listings = Script::Listing.all
12
+ end
13
+
14
+ # DETAILS - Script Listings
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Listings
19
+ def new
20
+ @script_listing = Script::Listing.new
21
+ end
22
+
23
+ # EDIT - Script Listings
24
+ def edit
25
+ end
26
+
27
+ # POST - Script Listings
28
+ def create
29
+ @script_listing = Script::Listing.new(script_listing_params)
30
+ if @script_listing.save
31
+ redirect_to script_listings_url, notice: 'Listing was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Listings
38
+ def update
39
+ if @script_listing.update(script_listing_params)
40
+ redirect_to script_listings_url, notice: 'Listing was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Listings
47
+ def destroy
48
+ @script_listing.destroy
49
+ redirect_to script_listings_url, notice: 'Listing was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_listing
56
+ @script_listing = Script::Listing.find(params[:id])
57
+ end
58
+
59
+ # Whitelist
60
+ def script_listing_params
61
+ params.require(:script_listing).permit(:scripttitle, :scriptdescription, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlastestrelease, :scriptbetarelease, :scriptstatus)
62
+ end
63
+
64
+ end
65
+ end
@@ -0,0 +1,75 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::UrlsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_url, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Authors
10
+ def index
11
+ script_listing = Script::Listing.find(params[:listing_id])
12
+ @script_urls = script_listing.urls
13
+ end
14
+
15
+ # DETAILED PROFILE - Script Authors
16
+ def show
17
+ script_listing = Script::Listing.find(params[:listing_id])
18
+ @script_url = script_listing.urls.find(params[:id])
19
+ end
20
+
21
+ # NEW - Script Athors
22
+ def new
23
+ script_listing = Script::Listing.find(params[:listing_id])
24
+ @script_url = script_listing.urls.build
25
+ end
26
+
27
+ # EDIT - Script Athors
28
+ def edit
29
+ script_listing = Script::Listing.find(params[:listing_id])
30
+ @script_url = script_listing.urls.find(params[:id])
31
+ end
32
+
33
+ # POST - Script Athors
34
+ def create
35
+ @script_listing = Script::Listing.find(params[:listing_id])
36
+ @script_url = @script_listing.urls.create(script_url_params)
37
+ if @script_url.save
38
+ redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
39
+ else
40
+ render :new
41
+ end
42
+ end
43
+
44
+ # PATCH/PUT - Script Athors
45
+ def update
46
+ if @script_url.update(script_url_params)
47
+ redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
48
+ else
49
+ render :edit
50
+ end
51
+ end
52
+
53
+ # DELETE - Script Athors
54
+ def destroy
55
+ @script_listing = Script::Listing.find(params[:listing_id])
56
+ @script_url = @script_listing.urls.find(params[:id])
57
+ @script_url.destroy
58
+ redirect_to script_listing_urls_path, notice: 'Author was successfully destroyed.'
59
+ end
60
+
61
+ private
62
+
63
+
64
+ # Common Callbacks
65
+ def set_script_url
66
+ @script_url = Script::Url.find(params[:id])
67
+ end
68
+
69
+ # Whitelists
70
+ def script_url_params
71
+ params.require(:script_url).permit(:scripturl, :listing_id)
72
+ end
73
+
74
+ end
75
+ end
@@ -0,0 +1,65 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::VersionsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_version, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Versions
10
+ def index
11
+ @script_versions = Script::Version.all
12
+ end
13
+
14
+ # DETAILS - Script Versions
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Versions
19
+ def new
20
+ @script_version = Script::Version.new
21
+ end
22
+
23
+ # EDIT - Script Versions
24
+ def edit
25
+ end
26
+
27
+ # POST - Script Versions
28
+ def create
29
+ @script_version = Script::Version.new(script_version_params)
30
+ if @script_version.save
31
+ redirect_to script_versions_url, notice: 'Version was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Versions
38
+ def update
39
+ if @script_version.update(script_version_params)
40
+ redirect_to script_versions_url, notice: 'Version was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Versions
47
+ def destroy
48
+ @script_version.destroy
49
+ redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_version
56
+ @script_version = Script::Version.find(params[:id])
57
+ end
58
+
59
+ # Only allow a trusted parameter "white list" through.
60
+ def script_version_params
61
+ params.require(:script_version).permit(:scriptversion)
62
+ end
63
+
64
+ end
65
+ end
@@ -1,4 +1,4 @@
1
1
  module Phcscriptcdn
2
- module ApplicationHelper
3
- end
2
+ module ApplicationHelper
3
+ end
4
4
  end
@@ -0,0 +1,4 @@
1
+ module Phcscriptcdn
2
+ module Script::LicencesHelper
3
+ end
4
+ end
@@ -0,0 +1,10 @@
1
+ module Phcscriptcdn
2
+ class Script::Author < ApplicationRecord
3
+
4
+ # Relationships
5
+
6
+ # Attach to Listings
7
+ belongs_to :listing, class_name: 'Phcscriptcdn::Script::Listing'
8
+
9
+ end
10
+ end
@@ -0,0 +1,4 @@
1
+ module Phcscriptcdn
2
+ class Script::Extension < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Phcscriptcdn
2
+ class Script::Licence < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,13 @@
1
+ module Phcscriptcdn
2
+ class Script::Listing < ApplicationRecord
3
+
4
+ # Relationships
5
+ #has_many :versions, class_name: 'Phcscriptcdn::Script::Version'
6
+ #has_many :informations, class_name: 'Phcscriptcdn::Script::Version'
7
+ # URL Nested
8
+ has_many :urls, class_name: 'Phcscriptcdn::Script::Url'
9
+ # Author Nested
10
+ has_many :authors, class_name: 'Phcscriptcdn::Script::Author'
11
+
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ module Phcscriptcdn
2
+ class Script::Url < ApplicationRecord
3
+
4
+ # Relationships
5
+
6
+ # Attach to Listings
7
+ belongs_to :listing, class_name: 'Phcscriptcdn::Script::Listing'
8
+
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdn
2
+ class Script::Version < ApplicationRecord
3
+
4
+ end
5
+ end
@@ -1,7 +1,7 @@
1
1
  module Phcscriptcdn
2
- module Scriptcdn
2
+ module Script
3
3
  def self.table_name_prefix
4
- 'phcscriptcdn_scriptcdn_'
4
+ 'phcscriptcdn_script_'
5
5
  end
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
 
5
- <title>PHCScriptCDN - Script Listing Engine Backend</title>
5
+ <title>PHCScriptCDN - Script Listing Engine</title>
6
6
 
7
7
  <%= stylesheet_link_tag "phcscriptcdn/application", media: "all" %>
8
8
  <%= javascript_include_tag "phcscriptcdn/application" %>
@@ -12,10 +12,8 @@
12
12
 
13
13
  <body>
14
14
  <div class="container">
15
- <div class="row">
16
- <%= yield %>
17
- </div>
15
+ <%= yield %>
18
16
  </div>
19
17
  </body>
20
18
 
21
- </html>
19
+ </html>
@@ -1,29 +1,31 @@
1
- <%= form_for([@scriptcdn_author.main, @scriptcdn_author], url: scriptcdn_main_authors_path) do |f| %>
2
-
3
- <%= render 'phcnotifi/validations', :object => @scriptcdn_author %>
1
+ <%= form_for([@script_author.listing, @script_author], url: form_url) do |f| %>
4
2
 
5
3
  <div class="form-group field_with_error">
6
4
  <%= f.label :authorfirstname, "Author First Name" %>
7
- <%= f.text_field :authorfirstname, placeholder: "Author First Name", class: "form-control" %>
5
+ <%= f.text_field :authorfirstname, placeholder: "Author First Name", class: "form-control" %>
8
6
  </div>
7
+
9
8
  <div class="form-group field_with_error">
10
9
  <%= f.label :authorlastname, "Author Last Name" %>
11
- <%= f.text_field :authorlastname, placeholder: "Author Last Name", class: "form-control" %>
10
+ <%= f.text_field :authorlastname, placeholder: "Author Last Name", class: "form-control" %>
12
11
  </div>
12
+
13
13
  <div class="form-group field_with_error">
14
14
  <%= f.label :authorwebsite, "Author Website" %>
15
- <%= f.text_field :authorwebsite, placeholder: "Author Website", class: "form-control" %>
15
+ <%= f.text_field :authorwebsite, placeholder: "Author Website", class: "form-control" %>
16
16
  </div>
17
+
17
18
  <div class="form-group field_with_error">
18
- <%= f.label :authorgithub, "Author Github" %>
19
- <%= f.text_field :authorgithub, placeholder: "Author Github", class: "form-control" %>
19
+ <%= f.label :authorgithub, "Author Github Address" %>
20
+ <%= f.text_field :authorgithub, placeholder: "Author Github Address", class: "form-control" %>
20
21
  </div>
22
+
21
23
  <div class="form-group field_with_error">
22
- <%= f.label :authortwitter, "Author Twitter" %>
23
- <%= f.text_field :authortwitter, placeholder: "Author Twitter", class: "form-control" %>
24
+ <%= f.label :authortwitter, "Author Twitter Addresss" %>
25
+ <%= f.text_field :authortwitter, placeholder: "Author Twitter Addresss", class: "form-control" %>
24
26
  </div>
27
+
25
28
  <div class="actions">
26
- <%= f.submit class: "btn blue-hoki" %>
29
+ <%= f.submit class: "btn btn-primary" %>
27
30
  </div>
28
-
29
31
  <% end %>
@@ -0,0 +1,32 @@
1
+ <!-- Title System -->
2
+ <% phc_title "Script Extension" %>
3
+ <% phc_title_tagline "Update Script Extension" %>
4
+
5
+ <!-- Page Header -->
6
+ <div class="row">
7
+ <div class="col-lg-12">
8
+
9
+ <!-- Bread Crumbs -->
10
+ <ol class="breadcrumb">
11
+ <li><%= link_to "Script Listings Index", script_listings_path %></li>
12
+ <li><%= link_to "Author Index", script_listing_authors_path %></li>
13
+ <li class="active"><%= yield(:phc_title_tagline) %></li>
14
+ </ol>
15
+
16
+ <!-- Page Title -->
17
+ <h3 class="page-title">
18
+ <%= yield(:phc_title) %> </br>
19
+ <small><%= yield(:phc_title_tagline) %></small>
20
+ </h3>
21
+
22
+ </div>
23
+ </div>
24
+
25
+ <!-- Main Content -->
26
+ <div class="row">
27
+ <div class="col-lg-12">
28
+
29
+ <%= render 'form', { form_url: script_listing_author_path } %>
30
+
31
+ </div>
32
+ </div>