phcscriptcdnpro 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcscriptcdnpro/application.js +2 -5
- data/app/assets/stylesheets/phcscriptcdnpro/application.scss +15 -20
- data/app/controllers/phcscriptcdnpro/application_controller.rb +1 -19
- data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +74 -0
- data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +65 -0
- data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +65 -0
- data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +65 -0
- data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +74 -0
- data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +65 -0
- data/app/models/phcscriptcdnpro/application_record.rb +2 -0
- data/app/models/phcscriptcdnpro/{scriptcdn.rb → script.rb} +4 -2
- data/app/models/phcscriptcdnpro/script/author.rb +10 -0
- data/app/models/phcscriptcdnpro/script/extension.rb +8 -0
- data/app/models/phcscriptcdnpro/script/licence.rb +4 -0
- data/app/models/phcscriptcdnpro/script/listing.rb +17 -0
- data/app/models/phcscriptcdnpro/script/url.rb +16 -0
- data/app/models/phcscriptcdnpro/script/version.rb +13 -0
- data/app/views/phcscriptcdnpro/{scriptcdn → script}/authors/_form.html.erb +14 -11
- data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/authors/index.html.erb +55 -0
- data/app/views/phcscriptcdnpro/script/authors/new.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/authors/show.html.erb +4 -0
- data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +22 -0
- data/app/views/phcscriptcdnpro/script/extensions/edit.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +49 -0
- data/app/views/phcscriptcdnpro/script/extensions/new.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/extensions/show.html.erb +4 -0
- data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +42 -0
- data/app/views/phcscriptcdnpro/script/licences/edit.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/licences/index.html.erb +59 -0
- data/app/views/phcscriptcdnpro/script/licences/new.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/licences/show.html.erb +4 -0
- data/app/views/phcscriptcdnpro/{scriptcdn/informations → script/listings}/_form.html.erb +20 -10
- data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +31 -0
- data/app/views/phcscriptcdnpro/script/listings/index.html.erb +54 -0
- data/app/views/phcscriptcdnpro/script/listings/new.html.erb +31 -0
- data/app/views/phcscriptcdnpro/script/listings/show.html.erb +27 -0
- data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/urls/edit.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/urls/index.html.erb +51 -0
- data/app/views/phcscriptcdnpro/script/urls/new.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/urls/show.html.erb +4 -0
- data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +12 -0
- data/app/views/phcscriptcdnpro/script/versions/edit.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/versions/index.html.erb +47 -0
- data/app/views/phcscriptcdnpro/script/versions/new.html.erb +32 -0
- data/app/views/phcscriptcdnpro/script/versions/show.html.erb +4 -0
- data/config/routes.rb +14 -16
- data/db/migrate/{20160704185337_create_phcscriptcdnpro_scriptcdn_information.rb → 20160821183652_create_phcscriptcdnpro_script_listings.rb} +14 -8
- data/db/migrate/{20160704185254_create_phcscriptcdnpro_scriptcdn_authors.rb → 20160821183714_create_phcscriptcdnpro_script_authors.rb} +6 -6
- data/db/migrate/20160821183735_create_phcscriptcdnpro_script_extensions.rb +19 -0
- data/db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb +25 -0
- data/db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb +23 -0
- data/db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb +17 -0
- data/lib/phcscriptcdnpro/engine.rb +2 -0
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +73 -84
- data/app/assets/javascripts/phcscriptcdnpro/api/mains.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/cdnsite/cdnpages.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/scriptcdn/authors.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/scriptcdn/information.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/scriptcdn/mains.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/scriptcdn/urls.js +0 -2
- data/app/assets/javascripts/phcscriptcdnpro/scriptcdn/versions.js +0 -2
- data/app/assets/stylesheets/phcscriptcdnpro/api/mains.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/cdnsite/cdnpages.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/custom.scss +0 -0
- data/app/assets/stylesheets/phcscriptcdnpro/scriptcdn/authors.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/scriptcdn/information.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/scriptcdn/mains.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/scriptcdn/urls.scss +0 -3
- data/app/assets/stylesheets/phcscriptcdnpro/scriptcdn/versions.scss +0 -3
- data/app/assets/stylesheets/scaffolds.scss +0 -89
- data/app/controllers/phcscriptcdnpro/api/mains_controller.rb +0 -17
- data/app/controllers/phcscriptcdnpro/scriptcdn/authors_controller.rb +0 -70
- data/app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb +0 -70
- data/app/controllers/phcscriptcdnpro/scriptcdn/mains_controller.rb +0 -63
- data/app/controllers/phcscriptcdnpro/scriptcdn/urls_controller.rb +0 -70
- data/app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb +0 -70
- data/app/helpers/phcscriptcdnpro/api/mains_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/cdnsite/cdnpages_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/scriptcdn/authors_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/scriptcdn/information_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/scriptcdn/mains_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/scriptcdn/urls_helper.rb +0 -4
- data/app/helpers/phcscriptcdnpro/scriptcdn/versions_helper.rb +0 -4
- data/app/models/phcscriptcdnpro/scriptcdn/author.rb +0 -8
- data/app/models/phcscriptcdnpro/scriptcdn/information.rb +0 -8
- data/app/models/phcscriptcdnpro/scriptcdn/main.rb +0 -11
- data/app/models/phcscriptcdnpro/scriptcdn/url.rb +0 -8
- data/app/models/phcscriptcdnpro/scriptcdn/version.rb +0 -8
- data/app/views/phcscriptcdnpro/api/mains/index.json.rabl +0 -18
- data/app/views/phcscriptcdnpro/api/mains/show.json.rabl +0 -18
- data/app/views/phcscriptcdnpro/scriptcdn/authors/_formpatch.html.erb +0 -29
- data/app/views/phcscriptcdnpro/scriptcdn/authors/edit.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/authors/index.html.erb +0 -65
- data/app/views/phcscriptcdnpro/scriptcdn/authors/new.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/informations/_formpatch.html.erb +0 -49
- data/app/views/phcscriptcdnpro/scriptcdn/informations/edit.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/informations/index.html.erb +0 -69
- data/app/views/phcscriptcdnpro/scriptcdn/informations/new.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/mains/_form.html.erb +0 -13
- data/app/views/phcscriptcdnpro/scriptcdn/mains/edit.html.erb +0 -42
- data/app/views/phcscriptcdnpro/scriptcdn/mains/index.html.erb +0 -61
- data/app/views/phcscriptcdnpro/scriptcdn/mains/new.html.erb +0 -42
- data/app/views/phcscriptcdnpro/scriptcdn/urls/_form.html.erb +0 -17
- data/app/views/phcscriptcdnpro/scriptcdn/urls/_formpatch.html.erb +0 -17
- data/app/views/phcscriptcdnpro/scriptcdn/urls/edit.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/urls/index.html.erb +0 -62
- data/app/views/phcscriptcdnpro/scriptcdn/urls/new.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/versions/_form.html.erb +0 -13
- data/app/views/phcscriptcdnpro/scriptcdn/versions/_formpatch.html.erb +0 -13
- data/app/views/phcscriptcdnpro/scriptcdn/versions/edit.html.erb +0 -43
- data/app/views/phcscriptcdnpro/scriptcdn/versions/index.html.erb +0 -63
- data/app/views/phcscriptcdnpro/scriptcdn/versions/new.html.erb +0 -43
- data/db/migrate/20160704185441_create_phcscriptcdnpro_scriptcdn_urls.rb +0 -19
- data/db/migrate/20160704185454_create_phcscriptcdnpro_scriptcdn_versions.rb +0 -17
- data/db/migrate/20160704190509_create_phcscriptcdnpro_scriptcdn_mains.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba28112a28f45f1dfe4a740ff74ca52d90f24575
|
4
|
+
data.tar.gz: 21df3edd7c1e407009975b07f0b9e0a67130bf27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a6c778c8f915fa7b15398418f2ec8fe383a7de4b3a83a5e80cc48ebcbbc9f90cdf6cf05fa33e343b421403df447ceeb52f758bf932bcba4bcf90425fa27677a
|
7
|
+
data.tar.gz: d269a257aa603d85e5ce41e4c50f25a66e7dd3e2a235527fb38d2bdaa6963fc14ee2e049db63a7c27e4b5eb5e6eb60e6831c45d2a53d7bfbf8ba4344201293e8
|
@@ -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.
|
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
|
14
|
-
//= require jquery_ujs
|
15
|
-
//= require bootstrap-sprockets
|
16
|
-
//= require_tree .
|
13
|
+
//= require phc_admins_main
|
@@ -1,22 +1,17 @@
|
|
1
1
|
/*
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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_self
|
14
|
+
*/
|
16
15
|
|
17
|
-
//
|
18
|
-
@import "
|
19
|
-
@import "font-awesome";
|
20
|
-
|
21
|
-
// Load Custom
|
22
|
-
@import "custom";
|
16
|
+
// Add PHCAdmins Styles
|
17
|
+
@import "phc_admins_style";
|
@@ -3,29 +3,11 @@ module Phcscriptcdnpro
|
|
3
3
|
|
4
4
|
# Security Filters
|
5
5
|
protect_from_forgery with: :exception
|
6
|
-
|
7
|
-
# AuthRocket User Helpers
|
8
|
-
def require_user
|
9
|
-
unless current_user
|
10
|
-
session[:last_url] = request.get? ? url_for(params) : url_for
|
11
|
-
redirect_to new_login_url
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def current_user
|
16
|
-
@_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
|
17
|
-
end
|
18
|
-
helper_method :current_user
|
19
|
-
|
20
|
-
def new_login_url
|
21
|
-
ENV['AUTHROCKET_LOGIN_URL']
|
22
|
-
# $ar_login_url
|
23
|
-
end
|
24
|
-
helper_method :new_login_url
|
25
6
|
|
26
7
|
# Load Helpers
|
27
8
|
helper Phctitleseo::Engine.helpers
|
28
9
|
helper Phcnotifi::Engine.helpers
|
10
|
+
helper Phcaccountspro::Engine.helpers
|
29
11
|
|
30
12
|
end
|
31
13
|
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require_dependency "phcscriptcdnpro/application_controller"
|
2
|
+
|
3
|
+
module Phcscriptcdnpro
|
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 "phcscriptcdnpro/application_controller"
|
2
|
+
|
3
|
+
module Phcscriptcdnpro
|
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 "phcscriptcdnpro/application_controller"
|
2
|
+
|
3
|
+
module Phcscriptcdnpro
|
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 "phcscriptcdnpro/application_controller"
|
2
|
+
|
3
|
+
module Phcscriptcdnpro
|
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, :version_id)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require_dependency "phcscriptcdnpro/application_controller"
|
2
|
+
|
3
|
+
module Phcscriptcdnpro
|
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
|
+
# Common Callbacks
|
64
|
+
def set_script_url
|
65
|
+
@script_url = Script::Url.find(params[:id])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Whitelists
|
69
|
+
def script_url_params
|
70
|
+
params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate, :listing_id, :version_id, :extension_id)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|