phcscriptcdn 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +3 -3
  4. data/Rakefile +18 -12
  5. data/app/assets/config/phcscriptcdn_manifest.js +2 -0
  6. data/app/assets/javascripts/phcscriptcdn/application.js +1 -4
  7. data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scripts.js → authors.js} +0 -0
  8. data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scripturls.js → information.js} +0 -0
  9. data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scriptversions.js → mains.js} +0 -0
  10. data/app/assets/javascripts/phcscriptcdn/scriptcdn/urls.js +2 -0
  11. data/app/assets/javascripts/phcscriptcdn/scriptcdn/versions.js +2 -0
  12. data/app/assets/stylesheets/phcscriptcdn/application.css +15 -0
  13. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/authors.scss +3 -0
  14. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/information.scss +3 -0
  15. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/mains.scss +3 -0
  16. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/urls.scss +3 -0
  17. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/versions.scss +3 -0
  18. data/app/assets/stylesheets/scaffolds.scss +89 -0
  19. data/app/controllers/phcscriptcdn/application_controller.rb +4 -1
  20. data/app/controllers/phcscriptcdn/scriptcdn/authors_controller.rb +69 -0
  21. data/app/controllers/phcscriptcdn/scriptcdn/informations_controller.rb +69 -0
  22. data/app/controllers/phcscriptcdn/scriptcdn/mains_controller.rb +62 -0
  23. data/app/controllers/phcscriptcdn/scriptcdn/urls_controller.rb +84 -0
  24. data/app/controllers/phcscriptcdn/scriptcdn/versions_controller.rb +69 -0
  25. data/app/jobs/phcscriptcdn/application_job.rb +4 -0
  26. data/app/models/phcscriptcdn/application_record.rb +5 -0
  27. data/app/models/phcscriptcdn/scriptcdn/author.rb +8 -0
  28. data/app/models/phcscriptcdn/scriptcdn/information.rb +8 -0
  29. data/app/models/phcscriptcdn/scriptcdn/main.rb +11 -0
  30. data/app/models/phcscriptcdn/scriptcdn/url.rb +8 -0
  31. data/app/models/phcscriptcdn/scriptcdn/version.rb +8 -0
  32. data/app/models/phcscriptcdn/scriptcdn.rb +5 -5
  33. data/app/views/layouts/phcscriptcdn/application.html.erb +2 -2
  34. data/app/views/layouts/phcscriptcdn/frontend.html.erb +21 -0
  35. data/app/views/phcscriptcdn/scriptcdn/authors/_form.html.erb +29 -0
  36. data/app/views/phcscriptcdn/scriptcdn/authors/_formpatch.html.erb +29 -0
  37. data/app/views/phcscriptcdn/scriptcdn/authors/edit.html.erb +3 -0
  38. data/app/views/phcscriptcdn/scriptcdn/authors/index.html.erb +23 -0
  39. data/app/views/phcscriptcdn/scriptcdn/authors/new.html.erb +3 -0
  40. data/app/views/phcscriptcdn/scriptcdn/information/_form.html.erb +49 -0
  41. data/app/views/phcscriptcdn/scriptcdn/information/_formpatch.html.erb +49 -0
  42. data/app/views/phcscriptcdn/scriptcdn/information/edit.html.erb +3 -0
  43. data/app/views/phcscriptcdn/scriptcdn/information/index.html.erb +26 -0
  44. data/app/views/phcscriptcdn/scriptcdn/information/new.html.erb +3 -0
  45. data/app/views/phcscriptcdn/scriptcdn/information/show.html.erb +58 -0
  46. data/app/views/phcscriptcdn/scriptcdn/mains/_form.html.erb +13 -0
  47. data/app/views/phcscriptcdn/scriptcdn/mains/edit.html.erb +3 -0
  48. data/app/views/phcscriptcdn/scriptcdn/mains/index.html.erb +19 -0
  49. data/app/views/phcscriptcdn/scriptcdn/mains/new.html.erb +3 -0
  50. data/app/views/phcscriptcdn/scriptcdn/urls/_form.html.erb +17 -0
  51. data/app/views/phcscriptcdn/scriptcdn/urls/_formpatch.html.erb +17 -0
  52. data/app/views/phcscriptcdn/scriptcdn/urls/edit.html.erb +3 -0
  53. data/app/views/phcscriptcdn/scriptcdn/urls/index.html.erb +21 -0
  54. data/app/views/phcscriptcdn/scriptcdn/urls/new.html.erb +3 -0
  55. data/app/views/phcscriptcdn/scriptcdn/versions/_form.html.erb +13 -0
  56. data/app/views/phcscriptcdn/scriptcdn/versions/_formpatch.html.erb +13 -0
  57. data/app/views/phcscriptcdn/scriptcdn/versions/edit.html.erb +3 -0
  58. data/app/views/phcscriptcdn/scriptcdn/versions/index.html.erb +20 -0
  59. data/app/views/phcscriptcdn/scriptcdn/versions/new.html.erb +3 -0
  60. data/config/routes.rb +1 -2
  61. data/db/migrate/20160704004828_create_phcscriptcdn_scriptcdn_authors.rb +20 -0
  62. data/db/migrate/20160704005455_create_phcscriptcdn_scriptcdn_information.rb +27 -0
  63. data/db/migrate/20160704011123_create_phcscriptcdn_scriptcdn_urls.rb +19 -0
  64. data/db/migrate/20160704011452_create_phcscriptcdn_scriptcdn_versions.rb +15 -0
  65. data/db/migrate/20160704011727_create_phcscriptcdn_scriptcdn_mains.rb +11 -0
  66. data/lib/phcscriptcdn/engine.rb +3 -3
  67. data/lib/phcscriptcdn/version.rb +2 -2
  68. metadata +116 -166
  69. data/LICENSE +0 -238
  70. data/app/assets/stylesheets/phcscriptcdn/application.css.scss +0 -10
  71. data/app/assets/stylesheets/phcscriptcdn/custom.scss +0 -4
  72. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scripts.css +0 -4
  73. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scripturls.css +0 -4
  74. data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scriptversions.css +0 -4
  75. data/app/controllers/phcscriptcdn/scriptcdn/scripts_controller.rb +0 -66
  76. data/app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb +0 -88
  77. data/app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb +0 -62
  78. data/app/helpers/phcscriptcdn/scriptcdn/scripts_helper.rb +0 -4
  79. data/app/helpers/phcscriptcdn/scriptcdn/scripturls_helper.rb +0 -4
  80. data/app/helpers/phcscriptcdn/scriptcdn/scriptversions_helper.rb +0 -4
  81. data/app/models/phcscriptcdn/scriptcdn/script.rb +0 -15
  82. data/app/models/phcscriptcdn/scriptcdn/scripturl.rb +0 -14
  83. data/app/models/phcscriptcdn/scriptcdn/scriptversion.rb +0 -15
  84. data/app/views/phcscriptcdn/scriptcdn/scripts/_form.html.erb +0 -22
  85. data/app/views/phcscriptcdn/scriptcdn/scripts/edit.html.erb +0 -12
  86. data/app/views/phcscriptcdn/scriptcdn/scripts/index.html.erb +0 -36
  87. data/app/views/phcscriptcdn/scriptcdn/scripts/index_scriptlist.html.erb +0 -8
  88. data/app/views/phcscriptcdn/scriptcdn/scripts/new.html.erb +0 -11
  89. data/app/views/phcscriptcdn/scriptcdn/scripts/show.html.erb +0 -19
  90. data/app/views/phcscriptcdn/scriptcdn/scripts/show_scriptlisting.html.erb +0 -16
  91. data/app/views/phcscriptcdn/scriptcdn/scripturls/_form.html.erb +0 -22
  92. data/app/views/phcscriptcdn/scriptcdn/scripturls/_formpatch.html.erb +0 -22
  93. data/app/views/phcscriptcdn/scriptcdn/scripturls/edit.html.erb +0 -12
  94. data/app/views/phcscriptcdn/scriptcdn/scripturls/index.html.erb +0 -37
  95. data/app/views/phcscriptcdn/scriptcdn/scripturls/new.html.erb +0 -12
  96. data/app/views/phcscriptcdn/scriptcdn/scripturls/show.html.erb +0 -11
  97. data/app/views/phcscriptcdn/scriptcdn/scriptversions/_form.html.erb +0 -19
  98. data/app/views/phcscriptcdn/scriptcdn/scriptversions/edit.html.erb +0 -12
  99. data/app/views/phcscriptcdn/scriptcdn/scriptversions/index.html.erb +0 -37
  100. data/app/views/phcscriptcdn/scriptcdn/scriptversions/new.html.erb +0 -12
  101. data/db/migrate/20160222025658_create_phcscriptcdn_scriptcdn_scripts.rb +0 -12
  102. data/db/migrate/20160222030223_create_phcscriptcdn_scriptcdn_scriptversions.rb +0 -12
  103. data/db/migrate/20160222030446_create_phcscriptcdn_scriptcdn_scripturls.rb +0 -13
  104. data/lib/generators/phcscriptcdn/views_generator.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73595d35610bbe3a4c6eb0cb0585a0e24139627b
4
- data.tar.gz: 98875b1eaa1ce45dfb32f0a51291fd3588c9a97b
3
+ metadata.gz: b39c53c2352b0b2af3f30bee0d195cf71df2be2f
4
+ data.tar.gz: c8cf881a8ef731c297743134ce6b2e3f2026f924
5
5
  SHA512:
6
- metadata.gz: 67cedb9c769d9d6d716508cca2c70bee1784722a1be377020d2dadbee8550a26d8c7119d7a6cd4f1b8675089f1ae2045053ef8cb3af9e9c80ce8fc51819b24d6
7
- data.tar.gz: 6034da735b26a1bf9c734ea697ca42fe5dff868a8f4efdfe59e4260fd99acad95fce4b8b9637147ea8260d6cf9ecff9accb57e18c5fd0822e704c5eb9ed53dda
6
+ metadata.gz: 16902db0bc51c70404517654d8b68274edc3861da2d66f68caa78b840a286e00880fd9ebd37e329a1ee320f4d1e418d3d19a9cb65c7b5aa7315a43fb787a69a5
7
+ data.tar.gz: 84e4abe8ae41c9b40d4ac36e2cad183988998b69258120d1c89d1aa410452373e1f92a4c80b721369113617df1644e51beccbe7794602f412227d13bc45e1776
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 BradPotts - PHCNetworks
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,14 +4,14 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/phcscriptcdn.svg)](https://badge.fury.io/rb/phcscriptcdn)
5
5
 
6
6
  ### PHCScript CDN (Script Listing Engine) Documentation
7
- PHCScriptCDN(1) script listing software to manage your online script CDN.
7
+ PHCScriptCDN(2) script listing software to manage your online script CDN.
8
8
 
9
9
  - Main script title and description.
10
10
  - Script versions and script urls.
11
11
 
12
12
  #### Step 1 - Add PHCScriptCDN Engine to your gemfile
13
13
 
14
- gem 'phcscriptcdn', '~> 1.1'
14
+ gem 'phcscriptcdn', '~> 1.2'
15
15
  bundle install
16
16
 
17
17
  #### Step 2 - Add Database Migration Files
@@ -33,4 +33,4 @@ 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
data/Rakefile CHANGED
@@ -1,26 +1,32 @@
1
1
  begin
2
- require 'bundler/setup'
2
+ require 'bundler/setup'
3
+
3
4
  rescue LoadError
4
- 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'
5
6
  end
6
7
 
7
8
  require 'rdoc/task'
8
9
 
9
10
  RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'Phcscriptcdn'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
11
+ rdoc.rdoc_dir = 'rdoc'
12
+ rdoc.title = 'Phcscriptcdn'
13
+ rdoc.options << '--line-numbers'
14
+ rdoc.rdoc_files.include('README.md')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
16
  end
16
17
 
17
- APP_RAKEFILE = File.expand_path("../spec/test_app/Rakefile", __FILE__)
18
+ APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
18
19
  load 'rails/tasks/engine.rake'
19
-
20
-
21
20
  load 'rails/tasks/statistics.rake'
22
21
 
22
+ require 'bundler/gem_tasks'
23
+ require 'rake/testtask'
23
24
 
25
+ Rake::TestTask.new(:test) do |t|
26
+ t.libs << 'lib'
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
24
31
 
25
- Bundler::GemHelper.install_tasks
26
-
32
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/phcscriptcdn .js
2
+ //= link_directory ../stylesheets/phcscriptcdn .css
@@ -5,12 +5,9 @@
5
5
  // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
9
  //
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require bootstrap-sprockets
16
13
  //= require_tree .
@@ -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,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,15 @@
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
+ */
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the scriptcdn::authors controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the scriptcdn::information controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the scriptcdn::mains controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the scriptcdn::urls controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the scriptcdn::versions controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,89 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ margin: 33px;
8
+ }
9
+
10
+ p, ol, ul, td {
11
+ font-family: verdana, arial, helvetica, sans-serif;
12
+ font-size: 13px;
13
+ line-height: 18px;
14
+ margin: 33px;
15
+ }
16
+
17
+ pre {
18
+ background-color: #eee;
19
+ padding: 10px;
20
+ font-size: 11px;
21
+ }
22
+
23
+ a {
24
+ color: #000;
25
+
26
+ &:visited {
27
+ color: #666;
28
+ }
29
+
30
+ &:hover {
31
+ color: #fff;
32
+ background-color: #000;
33
+ }
34
+ }
35
+
36
+ th {
37
+ padding-bottom: 5px;
38
+ }
39
+
40
+ td {
41
+ padding-bottom: 7px;
42
+ padding-left: 5px;
43
+ padding-right: 5px;
44
+ }
45
+
46
+ div {
47
+ &.field, &.actions {
48
+ margin-bottom: 10px;
49
+ }
50
+ }
51
+
52
+ #notice {
53
+ color: green;
54
+ }
55
+
56
+ .field_with_errors {
57
+ padding: 2px;
58
+ background-color: red;
59
+ display: table;
60
+ }
61
+
62
+ #error_explanation {
63
+ width: 450px;
64
+ border: 2px solid red;
65
+ padding: 7px;
66
+ padding-bottom: 0;
67
+ margin-bottom: 20px;
68
+ background-color: #f0f0f0;
69
+
70
+ h2 {
71
+ text-align: left;
72
+ font-weight: bold;
73
+ padding: 5px 5px 5px 15px;
74
+ font-size: 12px;
75
+ margin: -7px;
76
+ margin-bottom: 0;
77
+ background-color: #c00;
78
+ color: #fff;
79
+ }
80
+
81
+ ul li {
82
+ font-size: 12px;
83
+ list-style: square;
84
+ }
85
+ }
86
+
87
+ label {
88
+ display: block;
89
+ }
@@ -1,9 +1,12 @@
1
1
  module Phcscriptcdn
2
2
  class ApplicationController < ActionController::Base
3
3
 
4
+ # Security
5
+ protect_from_forgery with: :exception
6
+
4
7
  # Load Helpers
5
8
  helper Phctitleseo::Engine.helpers
6
- helper Phcnotifi::Engine.helpers
9
+ #helper Phcnotifi::Engine.helpers
7
10
 
8
11
  end
9
12
  end
@@ -0,0 +1,69 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Scriptcdn::AuthorsController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ layout '/layouts/phcscriptcdn/application.html.erb'
8
+ before_action :set_scriptcdn_author, only: [:edit, :update, :destroy]
9
+
10
+ # Author Index
11
+ def index
12
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
13
+ @scriptcdn_authors = scriptcdn_main.authors
14
+ end
15
+
16
+ # New Author
17
+ def new
18
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
19
+ @scriptcdn_author = scriptcdn_main.authors.build
20
+ end
21
+
22
+ # Edit Author
23
+ def edit
24
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
25
+ @scriptcdn_author = scriptcdn_main.authors.find(params[:id])
26
+ end
27
+
28
+ # POST Author
29
+ def create
30
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
31
+ @scriptcdn_author = @scriptcdn_main.authors.create(scriptcdn_author_params)
32
+ if @scriptcdn_author.save
33
+ redirect_to scriptcdn_main_authors_path, notice: 'Author was successfully created.'
34
+ else
35
+ render :new
36
+ end
37
+ end
38
+
39
+ # PATCH/PUT Author
40
+ def update
41
+ if @scriptcdn_author.update(scriptcdn_author_params)
42
+ redirect_to scriptcdn_main_authors_path, notice: 'Author was successfully updated.'
43
+ else
44
+ render :edit
45
+ end
46
+ end
47
+
48
+ # DELETE Author
49
+ def destroy
50
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
51
+ @scriptcdn_author = @scriptcdn_main.authors.find(params[:id])
52
+ @scriptcdn_author.destroy
53
+ redirect_to scriptcdn_main_authors_path, notice: 'Author was successfully destroyed.'
54
+ end
55
+
56
+ private
57
+
58
+ # Common Callbacks
59
+ def set_scriptcdn_author
60
+ @scriptcdn_author = Scriptcdn::Author.find(params[:id])
61
+ end
62
+
63
+ # Whitelist
64
+ def scriptcdn_author_params
65
+ params.require(:scriptcdn_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :main_id)
66
+ end
67
+
68
+ end
69
+ end
@@ -0,0 +1,69 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Scriptcdn::InformationsController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ layout '/layouts/phcscriptcdn/application.html.erb'
8
+ before_action :set_scriptcdn_information, only: [:edit, :update, :destroy]
9
+
10
+ # Script Information Index
11
+ def index
12
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
13
+ @scriptcdn_informations = scriptcdn_main.informations
14
+ end
15
+
16
+ # New Script Information
17
+ def new
18
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
19
+ @scriptcdn_information = scriptcdn_main.informations.build
20
+ end
21
+
22
+ # Edit Script Information
23
+ def edit
24
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
25
+ @scriptcdn_information = scriptcdn_main.informations.find(params[:id])
26
+ end
27
+
28
+ # POST Script Information
29
+ def create
30
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
31
+ @scriptcdn_information = @scriptcdn_main.informations.create(scriptcdn_information_params)
32
+ if @scriptcdn_information.save
33
+ redirect_to scriptcdn_main_informations_path, notice: 'Script information was successfully created.'
34
+ else
35
+ render :new
36
+ end
37
+ end
38
+
39
+ # PATCH/PUT Script Information
40
+ def update
41
+ if @scriptcdn_information.update(scriptcdn_information_params)
42
+ redirect_to scriptcdn_main_informations_path, notice: 'Script information was successfully updated.'
43
+ else
44
+ render :edit
45
+ end
46
+ end
47
+
48
+ # DELETE Script Information
49
+ def destroy
50
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
51
+ @scriptcdn_information = @scriptcdn_main.informations.find(params[:id])
52
+ @scriptcdn_information.destroy
53
+ redirect_to scriptcdn_main_informations_path, notice: 'Script information was successfully destroyed.'
54
+ end
55
+
56
+ private
57
+
58
+ # Common Callbacks
59
+ def set_scriptcdn_information
60
+ @scriptcdn_information = Scriptcdn::Information.find(params[:id])
61
+ end
62
+
63
+ # Whitelist
64
+ def scriptcdn_information_params
65
+ params.require(:scriptcdn_information).permit(:scripttitle, :scriptdescription, :scriptcategory, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlicence, :scriptplatform, :scriptstatus, :main_id)
66
+ end
67
+
68
+ end
69
+ end
@@ -0,0 +1,62 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Scriptcdn::MainsController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ layout '/layouts/phcscriptcdn/application.html.erb'
8
+ before_action :set_scriptcdn_main, only: [:edit, :update, :destroy]
9
+
10
+ # Script CDN Backend Index
11
+ def index
12
+ @scriptcdn_mains = Scriptcdn::Main.all
13
+ end
14
+
15
+ # New Script Listing
16
+ def new
17
+ @scriptcdn_main = Scriptcdn::Main.new
18
+ end
19
+
20
+ # Edit Script Listing
21
+ def edit
22
+ end
23
+
24
+ # POST Script CDN
25
+ def create
26
+ @scriptcdn_main = Scriptcdn::Main.new(scriptcdn_main_params)
27
+ if @scriptcdn_main.save
28
+ redirect_to scriptcdn_mains_path, notice: 'Script was successfully created.'
29
+ else
30
+ render :new
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT Script
35
+ def update
36
+ if @scriptcdn_main.update(scriptcdn_main_params)
37
+ redirect_to scriptcdn_mains_path, notice: 'Script was successfully updated.'
38
+ else
39
+ render :edit
40
+ end
41
+ end
42
+
43
+ # DELETE Script
44
+ def destroy
45
+ @scriptcdn_main.destroy
46
+ redirect_to scriptcdn_mains_path, notice: 'Main was successfully destroyed.'
47
+ end
48
+
49
+ private
50
+
51
+ # Common Callbacks
52
+ def set_scriptcdn_main
53
+ @scriptcdn_main = Scriptcdn::Main.find(params[:id])
54
+ end
55
+
56
+ # Whitelist
57
+ def scriptcdn_main_params
58
+ params.require(:scriptcdn_main).permit(:scriptname)
59
+ end
60
+
61
+ end
62
+ end
@@ -0,0 +1,84 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Scriptcdn::UrlsController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ layout '/layouts/phcscriptcdn/application.html.erb'
8
+ before_action :set_scriptcdn_url, only: [:edit, :update, :destroy]
9
+
10
+ # Index for Script URL
11
+ def index
12
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
13
+ @scriptcdn_urls = scriptcdn_main.urls
14
+ end
15
+
16
+ # New Script URL
17
+ def new
18
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
19
+ @scriptcdn_url = scriptcdn_main.urls.build
20
+ respond_to do |format|
21
+ format.html # new.html.erb
22
+ format.xml { render :xml => @scriptcdn_main }
23
+ end
24
+ end
25
+
26
+ # Edit Script URL
27
+ def edit
28
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
29
+ @scriptcdn_url = scriptcdn_main.urls.find(params[:id])
30
+ end
31
+
32
+ # POST Script URL
33
+ def create
34
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
35
+ @scriptcdn_url = @scriptcdn_main.urls.create(scriptcdn_url_params)
36
+ respond_to do |format|
37
+ if @scriptcdn_url.save
38
+ format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Created.' }
39
+ format.json { render action: 'show', status: :created, location: @scriptcdn_url }
40
+ else
41
+ format.html { render action: 'new' }
42
+ format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity }
43
+ end
44
+ end
45
+ end
46
+
47
+ # PATCH/PUT Script URL
48
+ def update
49
+ respond_to do |format|
50
+ if @scriptcdn_url.update(scriptcdn_url_params)
51
+ format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Updated.' }
52
+ format.json { head :no_content }
53
+ else
54
+ format.html { render action: 'edit' }
55
+ format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity }
56
+ end
57
+ end
58
+ end
59
+
60
+ # Delete Script URL
61
+ def destroy
62
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
63
+ @scriptcdn_url = @scriptcdn_main.urls.find(params[:id])
64
+ @scriptcdn_url.destroy
65
+ respond_to do |format|
66
+ format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Deleted.' }
67
+ format.json { head :no_content }
68
+ end
69
+ end
70
+
71
+ private
72
+
73
+ # Common Callbacks
74
+ def set_scriptcdn_url
75
+ @scriptcdn_url = Scriptcdn::Url.find(params[:id])
76
+ end
77
+
78
+ # Whitelist
79
+ def scriptcdn_url_params
80
+ params.require(:scriptcdn_url).permit(:scripturl, :scripturlext, :main_id)
81
+ end
82
+
83
+ end
84
+ end
@@ -0,0 +1,69 @@
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Scriptcdn::VersionsController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ layout '/layouts/phcscriptcdn/application.html.erb'
8
+ before_action :set_scriptcdn_version, only: [:edit, :update, :destroy]
9
+
10
+ # Script Version Index
11
+ def index
12
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
13
+ @scriptcdn_versions = scriptcdn_main.versions
14
+ end
15
+
16
+ # New Script Version
17
+ def new
18
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
19
+ @scriptcdn_version = scriptcdn_main.versions.build
20
+ end
21
+
22
+ # Edit Script Version
23
+ def edit
24
+ scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
25
+ @scriptcdn_version = scriptcdn_main.versions.find(params[:id])
26
+ end
27
+
28
+ # POST Script Version
29
+ def create
30
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
31
+ @scriptcdn_version = @scriptcdn_main.versions.create(scriptcdn_version_params)
32
+ if @scriptcdn_version.save
33
+ redirect_to scriptcdn_main_versions_path, notice: 'Script version was successfully created.'
34
+ else
35
+ render :new
36
+ end
37
+ end
38
+
39
+ # PATCH/PUT Script Version
40
+ def update
41
+ if @scriptcdn_version.update(scriptcdn_version_params)
42
+ redirect_to scriptcdn_main_versions_path, notice: 'Script version was successfully updated.'
43
+ else
44
+ render :edit
45
+ end
46
+ end
47
+
48
+ # DELETE Script Version
49
+ def destroy
50
+ @scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
51
+ @scriptcdn_version = @scriptcdn_main.versions.find(params[:id])
52
+ @scriptcdn_version.destroy
53
+ redirect_to scriptcdn_main_versions_path, notice: 'Script version was successfully destroyed.'
54
+ end
55
+
56
+ private
57
+
58
+ # Callbacks
59
+ def set_scriptcdn_version
60
+ @scriptcdn_version = Scriptcdn::Version.find(params[:id])
61
+ end
62
+
63
+ # Whitelist
64
+ def scriptcdn_version_params
65
+ params.require(:scriptcdn_version).permit(:versionnumber, :main_id)
66
+ end
67
+
68
+ end
69
+ end
@@ -0,0 +1,4 @@
1
+ module Phcscriptcdn
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdn
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ module Phcscriptcdn
2
+ class Scriptcdn::Author < ActiveRecord::Base
3
+
4
+ # Relationships
5
+ belongs_to :main, class_name: 'Scriptcdn::Main'
6
+
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Phcscriptcdn
2
+ class Scriptcdn::Information < ActiveRecord::Base
3
+
4
+ # Relationships
5
+ belongs_to :main, class_name: 'Scriptcdn::Main'
6
+
7
+ end
8
+ end