phcscriptcdnpro 1.4.2 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/phcscriptcdnpro/scriptcdn/authors_controller.rb +12 -12
- data/app/controllers/phcscriptcdnpro/scriptcdn/mains_controller.rb +67 -0
- data/app/controllers/phcscriptcdnpro/scriptcdn/urls_controller.rb +85 -0
- data/app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb +63 -0
- data/app/helpers/phcscriptcdnpro/scriptcdn/mains_helper.rb +4 -0
- data/app/helpers/phcscriptcdnpro/scriptcdn/urls_helper.rb +4 -0
- data/app/helpers/phcscriptcdnpro/scriptcdn/versions_helper.rb +4 -0
- data/app/models/phcscriptcdnpro/scriptcdn/author.rb +1 -1
- data/app/models/phcscriptcdnpro/scriptcdn/{script.rb → main.rb} +3 -3
- data/app/models/phcscriptcdnpro/scriptcdn/url.rb +9 -0
- data/app/models/phcscriptcdnpro/scriptcdn/version.rb +10 -0
- data/app/views/phcscriptcdnpro/scriptcdn/mains/_form.html.erb +18 -0
- data/app/views/phcscriptcdnpro/scriptcdn/{scripts → mains}/edit.html.erb +3 -3
- data/app/views/phcscriptcdnpro/scriptcdn/mains/index.html.erb +66 -0
- data/app/views/phcscriptcdnpro/scriptcdn/{scripts → mains}/new.html.erb +3 -3
- data/app/views/phcscriptcdnpro/scriptcdn/mains/show.html.erb +19 -0
- data/app/views/phcscriptcdnpro/scriptcdn/urls/_form.html.erb +14 -0
- data/app/views/phcscriptcdnpro/scriptcdn/urls/_formpatch.html.erb +14 -0
- data/app/views/phcscriptcdnpro/scriptcdn/{scripturls → urls}/edit.html.erb +1 -1
- data/app/views/phcscriptcdnpro/scriptcdn/{scripturls → urls}/index.html.erb +10 -17
- data/app/views/phcscriptcdnpro/scriptcdn/{scripturls → urls}/new.html.erb +1 -1
- data/app/views/phcscriptcdnpro/scriptcdn/urls/show.html.erb +9 -0
- data/app/views/phcscriptcdnpro/scriptcdn/versions/_form.html.erb +21 -0
- data/app/views/phcscriptcdnpro/scriptcdn/{scriptversions → versions}/edit.html.erb +1 -1
- data/app/views/phcscriptcdnpro/scriptcdn/{scriptversions → versions}/index.html.erb +5 -5
- data/app/views/phcscriptcdnpro/scriptcdn/{scriptversions → versions}/new.html.erb +1 -1
- data/config/routes.rb +9 -0
- data/db/migrate/20160617181959_create_phcscriptcdnpro_scriptcdn_authors.rb +5 -1
- data/db/migrate/20160618200955_create_phcscriptcdnpro_scriptcdn_urls.rb +19 -0
- data/db/migrate/20160618201418_create_phcscriptcdnpro_scriptcdn_mains.rb +20 -0
- data/db/migrate/20160618201703_create_phcscriptcdnpro_scriptcdn_versions.rb +15 -0
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +29 -25
- data/app/controllers/phcscriptcdnpro/scriptcdn/scripts_controller.rb +0 -73
- data/app/controllers/phcscriptcdnpro/scriptcdn/scripturls_controller.rb +0 -85
- data/app/controllers/phcscriptcdnpro/scriptcdn/scriptversions_controller.rb +0 -64
- data/app/models/phcscriptcdnpro/scriptcdn/scripturl.rb +0 -15
- data/app/models/phcscriptcdnpro/scriptcdn/scriptversion.rb +0 -15
- data/app/views/phcscriptcdnpro/scriptcdn/scripts/_form.html.erb +0 -22
- data/app/views/phcscriptcdnpro/scriptcdn/scripts/index.html.erb +0 -66
- data/app/views/phcscriptcdnpro/scriptcdn/scripts/show.html.erb +0 -20
- data/app/views/phcscriptcdnpro/scriptcdn/scripturls/_form.html.erb +0 -22
- data/app/views/phcscriptcdnpro/scriptcdn/scripturls/_formpatch.html.erb +0 -22
- data/app/views/phcscriptcdnpro/scriptcdn/scriptversions/_form.html.erb +0 -14
- data/db/migrate/20160222025658_create_phcscriptcdnpro_scriptcdn_scripts.rb +0 -14
- data/db/migrate/20160222030223_create_phcscriptcdnpro_scriptcdn_scriptversions.rb +0 -11
- data/db/migrate/20160222030446_create_phcscriptcdnpro_scriptcdn_scripturls.rb +0 -15
@@ -23,7 +23,7 @@
|
|
23
23
|
<span class="caption-subject bold uppercase"><%= yield(:phc_title_tagline) %></span>
|
24
24
|
</div>
|
25
25
|
<div class="actions">
|
26
|
-
<%= link_to
|
26
|
+
<%= link_to new_scriptcdn_version_path, class: "btn blue-chambray" do %>
|
27
27
|
<i class="fa fa-plus"></i> Add a New Script Version
|
28
28
|
<% end %>
|
29
29
|
</div>
|
@@ -39,12 +39,12 @@
|
|
39
39
|
</tr>
|
40
40
|
</thead>
|
41
41
|
<tbody>
|
42
|
-
<% @scriptcdn_scriptversions.each do |
|
42
|
+
<% @scriptcdn_scriptversions.each do |scriptcdn_version| %>
|
43
43
|
<tr>
|
44
|
-
<td><%=
|
44
|
+
<td><%= scriptcdn_version.scrptversion %></td>
|
45
45
|
<td>
|
46
|
-
<%= link_to 'Edit',
|
47
|
-
<%= link_to 'Destroy',
|
46
|
+
<%= link_to 'Edit', edit_scriptcdn_version_path(scriptcdn_scriptversion), class: "btn blue-chambray" %>
|
47
|
+
<%= link_to 'Destroy', scriptcdn_version, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn red-mint" %>
|
48
48
|
</td>
|
49
49
|
</tr>
|
50
50
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="page-bar">
|
7
7
|
|
8
8
|
<ul class="page-breadcrumb">
|
9
|
-
<li><%= link_to "Script Versions", phcscriptcdnpro.
|
9
|
+
<li><%= link_to "Script Versions", phcscriptcdnpro.scriptcdn_versions_path %><i class="fa fa-circle"></i></li>
|
10
10
|
<li class="active"><%= yield(:phc_title_tagline) %></li>
|
11
11
|
</ul>
|
12
12
|
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
Phcscriptcdnpro::Engine.routes.draw do
|
2
2
|
|
3
|
+
namespace :scriptcdn do
|
4
|
+
resources :versions
|
5
|
+
end
|
6
|
+
namespace :scriptcdn do
|
7
|
+
resources :mains
|
8
|
+
end
|
9
|
+
namespace :scriptcdn do
|
10
|
+
resources :urls
|
11
|
+
end
|
3
12
|
# CDN Frontend
|
4
13
|
get 'frontend/cdnpages/list', :path => "script-cdn"
|
5
14
|
|
@@ -10,7 +10,11 @@ class CreatePhcscriptcdnproScriptcdnAuthors < ActiveRecord::Migration
|
|
10
10
|
t.string :authorgithub
|
11
11
|
t.string :authortwitter
|
12
12
|
|
13
|
-
t.references :
|
13
|
+
t.references :main, index: true
|
14
|
+
|
15
|
+
t.string :user_id
|
16
|
+
t.string :membership_id
|
17
|
+
t.string :oganization_id
|
14
18
|
|
15
19
|
t.timestamps null: false
|
16
20
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePhcscriptcdnproScriptcdnUrls < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phcscriptcdnpro_scriptcdn_urls do |t|
|
5
|
+
|
6
|
+
t.string :scripturl
|
7
|
+
|
8
|
+
t.references :main, index: true
|
9
|
+
t.references :version, index: true
|
10
|
+
|
11
|
+
t.string :user_id
|
12
|
+
t.string :membership_id
|
13
|
+
t.string :oganization_id
|
14
|
+
|
15
|
+
t.timestamps null: false
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreatePhcscriptcdnproScriptcdnMains < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phcscriptcdnpro_scriptcdn_mains do |t|
|
5
|
+
|
6
|
+
t.string :scriptname
|
7
|
+
t.text :scriptdescription
|
8
|
+
|
9
|
+
t.references :version, index: true
|
10
|
+
|
11
|
+
t.string :user_id
|
12
|
+
t.string :membership_id
|
13
|
+
t.string :oganization_id
|
14
|
+
|
15
|
+
t.timestamps null: false
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreatePhcscriptcdnproScriptcdnVersions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :phcscriptcdnpro_scriptcdn_versions do |t|
|
4
|
+
|
5
|
+
t.string :version
|
6
|
+
|
7
|
+
t.string :user_id
|
8
|
+
t.string :membership_id
|
9
|
+
t.string :oganization_id
|
10
|
+
|
11
|
+
t.timestamps null: false
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcscriptcdnpro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -393,15 +393,18 @@ files:
|
|
393
393
|
- app/controllers/phcscriptcdnpro/application_controller.rb
|
394
394
|
- app/controllers/phcscriptcdnpro/frontend/cdnpages_controller.rb
|
395
395
|
- app/controllers/phcscriptcdnpro/scriptcdn/authors_controller.rb
|
396
|
-
- app/controllers/phcscriptcdnpro/scriptcdn/
|
397
|
-
- app/controllers/phcscriptcdnpro/scriptcdn/
|
398
|
-
- app/controllers/phcscriptcdnpro/scriptcdn/
|
396
|
+
- app/controllers/phcscriptcdnpro/scriptcdn/mains_controller.rb
|
397
|
+
- app/controllers/phcscriptcdnpro/scriptcdn/urls_controller.rb
|
398
|
+
- app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
|
399
399
|
- app/helpers/phcscriptcdnpro/application_helper.rb
|
400
|
+
- app/helpers/phcscriptcdnpro/scriptcdn/mains_helper.rb
|
401
|
+
- app/helpers/phcscriptcdnpro/scriptcdn/urls_helper.rb
|
402
|
+
- app/helpers/phcscriptcdnpro/scriptcdn/versions_helper.rb
|
400
403
|
- app/models/phcscriptcdnpro/scriptcdn.rb
|
401
404
|
- app/models/phcscriptcdnpro/scriptcdn/author.rb
|
402
|
-
- app/models/phcscriptcdnpro/scriptcdn/
|
403
|
-
- app/models/phcscriptcdnpro/scriptcdn/
|
404
|
-
- app/models/phcscriptcdnpro/scriptcdn/
|
405
|
+
- app/models/phcscriptcdnpro/scriptcdn/main.rb
|
406
|
+
- app/models/phcscriptcdnpro/scriptcdn/url.rb
|
407
|
+
- app/models/phcscriptcdnpro/scriptcdn/version.rb
|
405
408
|
- app/views/layouts/phcscriptcdnpro/application.html.erb
|
406
409
|
- app/views/layouts/phcscriptcdnpro/frontend.html.erb
|
407
410
|
- app/views/phcscriptcdnpro/frontend/cdnpages/list.html.erb
|
@@ -411,25 +414,26 @@ files:
|
|
411
414
|
- app/views/phcscriptcdnpro/scriptcdn/authors/edit.html.erb
|
412
415
|
- app/views/phcscriptcdnpro/scriptcdn/authors/index.html.erb
|
413
416
|
- app/views/phcscriptcdnpro/scriptcdn/authors/new.html.erb
|
414
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
415
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
416
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
417
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
418
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
419
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
420
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
421
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
422
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
423
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
424
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
425
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
426
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
427
|
-
- app/views/phcscriptcdnpro/scriptcdn/
|
417
|
+
- app/views/phcscriptcdnpro/scriptcdn/mains/_form.html.erb
|
418
|
+
- app/views/phcscriptcdnpro/scriptcdn/mains/edit.html.erb
|
419
|
+
- app/views/phcscriptcdnpro/scriptcdn/mains/index.html.erb
|
420
|
+
- app/views/phcscriptcdnpro/scriptcdn/mains/new.html.erb
|
421
|
+
- app/views/phcscriptcdnpro/scriptcdn/mains/show.html.erb
|
422
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/_form.html.erb
|
423
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/_formpatch.html.erb
|
424
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/edit.html.erb
|
425
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/index.html.erb
|
426
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/new.html.erb
|
427
|
+
- app/views/phcscriptcdnpro/scriptcdn/urls/show.html.erb
|
428
|
+
- app/views/phcscriptcdnpro/scriptcdn/versions/_form.html.erb
|
429
|
+
- app/views/phcscriptcdnpro/scriptcdn/versions/edit.html.erb
|
430
|
+
- app/views/phcscriptcdnpro/scriptcdn/versions/index.html.erb
|
431
|
+
- app/views/phcscriptcdnpro/scriptcdn/versions/new.html.erb
|
428
432
|
- config/routes.rb
|
429
|
-
- db/migrate/20160222025658_create_phcscriptcdnpro_scriptcdn_scripts.rb
|
430
|
-
- db/migrate/20160222030223_create_phcscriptcdnpro_scriptcdn_scriptversions.rb
|
431
|
-
- db/migrate/20160222030446_create_phcscriptcdnpro_scriptcdn_scripturls.rb
|
432
433
|
- db/migrate/20160617181959_create_phcscriptcdnpro_scriptcdn_authors.rb
|
434
|
+
- db/migrate/20160618200955_create_phcscriptcdnpro_scriptcdn_urls.rb
|
435
|
+
- db/migrate/20160618201418_create_phcscriptcdnpro_scriptcdn_mains.rb
|
436
|
+
- db/migrate/20160618201703_create_phcscriptcdnpro_scriptcdn_versions.rb
|
433
437
|
- lib/phcscriptcdnpro.rb
|
434
438
|
- lib/phcscriptcdnpro/engine.rb
|
435
439
|
- lib/phcscriptcdnpro/version.rb
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require_dependency "phcscriptcdnpro/application_controller"
|
2
|
-
|
3
|
-
module Phcscriptcdnpro
|
4
|
-
class Scriptcdn::ScriptsController < ApplicationController
|
5
|
-
|
6
|
-
# Security & Action Filters
|
7
|
-
before_action :require_user
|
8
|
-
layout '/layouts/phcscriptcdnpro/application.html.erb'
|
9
|
-
before_action :set_scriptcdn_script, only: [:show, :edit, :update, :destroy]
|
10
|
-
|
11
|
-
# Script CDN Index
|
12
|
-
def index
|
13
|
-
@scriptcdn_scripts = Scriptcdn::Script.all
|
14
|
-
end
|
15
|
-
|
16
|
-
# Detailed Script CDN Profile
|
17
|
-
def show
|
18
|
-
end
|
19
|
-
|
20
|
-
# New Script for CDN
|
21
|
-
def new
|
22
|
-
@scriptcdn_script = Scriptcdn::Script.new
|
23
|
-
end
|
24
|
-
|
25
|
-
# Edit Script
|
26
|
-
def edit
|
27
|
-
end
|
28
|
-
|
29
|
-
# Create Script
|
30
|
-
def create
|
31
|
-
@scriptcdn_script = Scriptcdn::Script.new(scriptcdn_script_params)
|
32
|
-
|
33
|
-
if @scriptcdn_script.save
|
34
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script listing was successfully created.'
|
35
|
-
else
|
36
|
-
render :new
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# PATCH/PUT Script
|
41
|
-
def update
|
42
|
-
if @scriptcdn_script.update(scriptcdn_script_params)
|
43
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script listing was successfully updated.'
|
44
|
-
else
|
45
|
-
render :edit
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# DELETE Script from CDN
|
50
|
-
def destroy
|
51
|
-
@scriptcdn_script.destroy
|
52
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script listing & Script URLs was successfully destroyed.'
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
# Grab User Session Key (For ID)
|
58
|
-
def current_user
|
59
|
-
@_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
|
60
|
-
end
|
61
|
-
|
62
|
-
# Callbacks
|
63
|
-
def set_scriptcdn_script
|
64
|
-
@scriptcdn_script = Scriptcdn::Script.find(params[:id])
|
65
|
-
end
|
66
|
-
|
67
|
-
# Whitelist
|
68
|
-
def scriptcdn_script_params
|
69
|
-
params.require(:scriptcdn_script).permit(:scrptname, :scrptdescription, :scriptversion_id)
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
require_dependency "phcscriptcdnpro/application_controller"
|
2
|
-
|
3
|
-
module Phcscriptcdnpro
|
4
|
-
class Scriptcdn::ScripturlsController < ApplicationController
|
5
|
-
|
6
|
-
# Security & Action Filters
|
7
|
-
before_action :require_user
|
8
|
-
layout '/layouts/phcscriptcdnpro/application.html.erb'
|
9
|
-
before_action :set_scriptcdn_scripturl, only: [:edit, :update, :destroy]
|
10
|
-
|
11
|
-
# Index for Scriptcdn_script URLs
|
12
|
-
def index
|
13
|
-
scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
14
|
-
@scriptcdn_scripturls = scriptcdn_script.scripturls
|
15
|
-
end
|
16
|
-
|
17
|
-
# New Scriptcdn_script URL
|
18
|
-
def new
|
19
|
-
scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
20
|
-
@scriptcdn_scripturl = scriptcdn_script.scripturls.build
|
21
|
-
respond_to do |format|
|
22
|
-
format.html # new.html.erb
|
23
|
-
format.xml { render :xml => @scriptcdn_script }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# Edit Scriptcdn_script URL
|
28
|
-
def edit
|
29
|
-
scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
30
|
-
@scriptcdn_scripturl = scriptcdn_script.scripturls.find(params[:id])
|
31
|
-
end
|
32
|
-
|
33
|
-
# POST Scriptcdn_script URL
|
34
|
-
def create
|
35
|
-
@scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
36
|
-
@scriptcdn_scripturl = @scriptcdn_script.scripturls.create(scriptcdn_scripturl_params)
|
37
|
-
respond_to do |format|
|
38
|
-
if @scriptcdn_scripturl.save
|
39
|
-
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Created.' }
|
40
|
-
format.json { render action: 'show', status: :created, location: @scriptcdn_scripturl }
|
41
|
-
else
|
42
|
-
format.html { render action: 'new' }
|
43
|
-
format.json { render json: @scriptcdn_scripturl.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT Scriptcdn_script URL
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @scriptcdn_scripturl.update(scriptcdn_scripturl_params)
|
52
|
-
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Updated.' }
|
53
|
-
format.json { head :no_content }
|
54
|
-
else
|
55
|
-
format.html { render action: 'edit' }
|
56
|
-
format.json { render json: @scriptcdn_scripturl.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# Delete Scriptcdn_script URL
|
62
|
-
def destroy
|
63
|
-
@scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
64
|
-
@scriptcdn_scripturl = @scriptcdn_script.scripturls.find(params[:id])
|
65
|
-
@scriptcdn_scripturl.destroy
|
66
|
-
respond_to do |format|
|
67
|
-
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Deleted.' }
|
68
|
-
format.json { head :no_content }
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
# Common Callbacks
|
75
|
-
def set_scriptcdn_scripturl
|
76
|
-
@scriptcdn_scripturl = Scriptcdn::Scripturl.find(params[:id])
|
77
|
-
end
|
78
|
-
|
79
|
-
# Whitelist
|
80
|
-
def scriptcdn_scripturl_params
|
81
|
-
params.require(:scriptcdn_scripturl).permit(:scrpturlphc, :scrpturltype, :script_id)
|
82
|
-
end
|
83
|
-
|
84
|
-
end
|
85
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
require_dependency "phcscriptcdnpro/application_controller"
|
2
|
-
|
3
|
-
module Phcscriptcdnpro
|
4
|
-
class Scriptcdn::ScriptversionsController < ApplicationController
|
5
|
-
|
6
|
-
# Security & Action Filters
|
7
|
-
before_action :require_user
|
8
|
-
layout '/layouts/phcscriptcdnpro/application.html.erb'
|
9
|
-
before_action :set_scriptcdn_scriptversion, only: [:edit, :update, :destroy]
|
10
|
-
|
11
|
-
# Script Version Index
|
12
|
-
def index
|
13
|
-
@scriptcdn_scriptversions = Scriptcdn::Scriptversion.all
|
14
|
-
end
|
15
|
-
|
16
|
-
# New Script Version for CDN
|
17
|
-
def new
|
18
|
-
@scriptcdn_scriptversion = Scriptcdn::Scriptversion.new
|
19
|
-
end
|
20
|
-
|
21
|
-
# Edit Script Version
|
22
|
-
def edit
|
23
|
-
end
|
24
|
-
|
25
|
-
# POST Script Version
|
26
|
-
def create
|
27
|
-
@scriptcdn_scriptversion = Scriptcdn::Scriptversion.new(scriptcdn_scriptversion_params)
|
28
|
-
|
29
|
-
if @scriptcdn_scriptversion.save
|
30
|
-
redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully created.'
|
31
|
-
else
|
32
|
-
render :new
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# PATCH/PUT Script Version
|
37
|
-
def update
|
38
|
-
if @scriptcdn_scriptversion.update(scriptcdn_scriptversion_params)
|
39
|
-
redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully updated.'
|
40
|
-
else
|
41
|
-
render :edit
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# DELETE Script Version
|
46
|
-
def destroy
|
47
|
-
@scriptcdn_scriptversion.destroy
|
48
|
-
redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully destroyed.'
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
# Callbacks
|
54
|
-
def set_scriptcdn_scriptversion
|
55
|
-
@scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:id])
|
56
|
-
end
|
57
|
-
|
58
|
-
# Whitelist
|
59
|
-
def scriptcdn_scriptversion_params
|
60
|
-
params.require(:scriptcdn_scriptversion).permit(:scrptversion)
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Phcscriptcdnpro
|
2
|
-
class Scriptcdn::Scripturl < ActiveRecord::Base
|
3
|
-
|
4
|
-
# Relationships
|
5
|
-
belongs_to :script, class_name: 'Script::Main'
|
6
|
-
has_many :scriptversions, class_name: 'Script::Scriptversion'
|
7
|
-
|
8
|
-
# Validation for Form Fields
|
9
|
-
validates :scrpturlphc,
|
10
|
-
uniqueness: true,
|
11
|
-
presence: true,
|
12
|
-
length: { minimum: 3 }
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Phcscriptcdnpro
|
2
|
-
class Scriptcdn::Scriptversion < ActiveRecord::Base
|
3
|
-
|
4
|
-
# Relationships
|
5
|
-
belongs_to :script, class_name: 'Script::Main'
|
6
|
-
belongs_to :scripturl, class_name: 'Script::Scripturl'
|
7
|
-
|
8
|
-
# Validation for Form Fields
|
9
|
-
validates :scrptversionpakname,
|
10
|
-
uniqueness: true,
|
11
|
-
presence: true,
|
12
|
-
length: { minimum: 3 }
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_for(@scriptcdn_script) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_script %>
|
4
|
-
|
5
|
-
<div class="form-group field_with_error">
|
6
|
-
<%= f.label :scrptname, "Script Name" %>
|
7
|
-
<%= f.text_field :scrptname, class: "form-control", placeholder: "Script Name" %>
|
8
|
-
</div>
|
9
|
-
<div class="form-group field_with_error">
|
10
|
-
<%= f.label :scrptdescription, "Script Description" %>
|
11
|
-
<%= f.text_area :scrptdescription, class: "form-control", placeholder: "Description for Script" %>
|
12
|
-
</div>
|
13
|
-
<div class="form-group field_with_error">
|
14
|
-
<%= f.label :scriptversion_id, "Script Version" %>
|
15
|
-
<%= collection_select(:scriptcdn_script, :scriptversion_id, Phcscriptcdnpro::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="actions">
|
19
|
-
<%= f.submit "Submit", class: "btn blue-hoki" %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<% end %>
|
@@ -1,66 +0,0 @@
|
|
1
|
-
<!-- Title System -->
|
2
|
-
<% phc_title "Script" %>
|
3
|
-
<% phc_title_tagline "Script CDN Index" %>
|
4
|
-
|
5
|
-
<!-- Bread Crumb -->
|
6
|
-
<div class="page-bar">
|
7
|
-
|
8
|
-
<ul class="page-breadcrumb">
|
9
|
-
<li><%= link_to "Script Versions", phcscriptcdnpro.scriptcdn_script_path %><i class="fa fa-circle"></i></li>
|
10
|
-
<li class="active"><%= yield(:phc_title_tagline) %></li>
|
11
|
-
</ul>
|
12
|
-
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<!-- Main Content -->
|
16
|
-
<div class="row">
|
17
|
-
<div class="col-lg-12">
|
18
|
-
|
19
|
-
<div class="portlet light">
|
20
|
-
|
21
|
-
<div class="portlet-title">
|
22
|
-
<div class="caption">
|
23
|
-
<span class="caption-subject bold uppercase"><%= yield(:phc_title_tagline) %></span>
|
24
|
-
</div>
|
25
|
-
<div class="actions">
|
26
|
-
<%= link_to new_scriptcdn_script_path, class: "btn blue-chambray" do %>
|
27
|
-
<i class="fa fa-plus"></i> Add a New Script for CDN
|
28
|
-
<% end %>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
|
32
|
-
<div class="portlet-body">
|
33
|
-
<div class="table-responsive">
|
34
|
-
<table class="table table-striped table-bordered table-hover table-header-fixed">
|
35
|
-
|
36
|
-
<thead>
|
37
|
-
<tr>
|
38
|
-
<th>Script Name</th>
|
39
|
-
<th></th>
|
40
|
-
</tr>
|
41
|
-
</thead>
|
42
|
-
|
43
|
-
<tbody>
|
44
|
-
<% @scriptcdn_scripts.each do |scriptcdn_script| %>
|
45
|
-
<tr>
|
46
|
-
<td><%= scriptcdn_script.scrptname %></td>
|
47
|
-
|
48
|
-
<td><div class="btn-group" role="group" aria-label="Script CDN">
|
49
|
-
<% if current_user %>
|
50
|
-
<%= link_to 'Show', scriptcdn_script, class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
51
|
-
<%= link_to 'Edit', edit_scriptcdn_script_path(scriptcdn_script), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
52
|
-
<%= link_to 'Destroy', scriptcdn_script, class: "btn btn-w-m btn-danger btn-xs btn-phc-custom", method: :delete, data: { confirm: 'Are you sure?' } %>
|
53
|
-
<% end %>
|
54
|
-
</div></td>
|
55
|
-
</tr>
|
56
|
-
<% end %>
|
57
|
-
</tbody>
|
58
|
-
|
59
|
-
</table>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
|
63
|
-
</div>
|
64
|
-
|
65
|
-
</div>
|
66
|
-
</div>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<strong>Script Name:</strong>
|
5
|
-
<%= @scriptcdn_script.scrptname %>
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
<strong>Script Description:</strong>
|
10
|
-
<%= @scriptcdn_script.scrptdescription %>
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
<strong>Script Version:</strong>
|
15
|
-
<%= @scriptcdn_script.scriptversion_id %>
|
16
|
-
</p>
|
17
|
-
<% if current_user %>
|
18
|
-
<%= link_to 'Edit', edit_scriptcdn_script_path(@scriptcdn_script) %> |
|
19
|
-
<%= link_to 'Back', scriptcdn_scripts_path %>
|
20
|
-
<% end %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_for([@scriptcdn_scripturl.script, @scriptcdn_scripturl], url: scriptcdn_script_scripturls_path) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scripturl %>
|
4
|
-
|
5
|
-
<div class="form-group field_with_error">
|
6
|
-
<%= f.label :scrpturlphc, "Script URL" %>
|
7
|
-
<%= f.text_field :scrpturlphc, class: "form-control", placeholder: "Script URL (AWS)" %>
|
8
|
-
</div>
|
9
|
-
<div class="form-group field_with_error">
|
10
|
-
<%= f.label :scrpturltype, "Script Type" %>
|
11
|
-
<%= f.select :scrpturltype, [['CSS','css'],['JS','js'],['font','Font']], {}, {class: "form-control"} %>
|
12
|
-
</div>
|
13
|
-
<div class="form-group field_with_error">
|
14
|
-
<%= f.label :script_id, "Script Version" %>
|
15
|
-
<%= collection_select(:scriptcdn_scripturl, :script_id, Phcscriptcdnpro::Scriptcdn::Script.order('scrptname'), :id, :scrptname, {}, {class: "form-control"}) %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="actions">
|
19
|
-
<%= f.submit "Submit", class: "btn blue-hoki" %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<% end %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_for([@scriptcdn_scripturl.script, @scriptcdn_scripturl], url: scriptcdn_script_scripturl_path, method: :patch) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scripturl %>
|
4
|
-
|
5
|
-
<div class="form-group field_with_error">
|
6
|
-
<%= f.label :scrpturlphc, "Script URL" %>
|
7
|
-
<%= f.text_field :scrpturlphc, class: "form-control", placeholder: "Script URL (AWS)" %>
|
8
|
-
</div>
|
9
|
-
<div class="form-group field_with_error">
|
10
|
-
<%= f.label :scrpturltype, "Script Type" %>
|
11
|
-
<%= f.select :scrpturltype, [['CSS','css'],['JS','js'],['font','Font']], {}, {class: "form-control"} %>
|
12
|
-
</div>
|
13
|
-
<div class="form-group field_with_error">
|
14
|
-
<%= f.label :script_id, "Script Version" %>
|
15
|
-
<%= collection_select(:scriptcdn_scripturl, :script_id, Phcscriptcdnpro::Scriptcdn::Script.order('scrptname'), :id, :scrptname, {}, {class: "form-control"}) %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="actions">
|
19
|
-
<%= f.submit "Submit", class: "btn blue-hoki" %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= form_for(@scriptcdn_scriptversion) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scriptversion %>
|
4
|
-
|
5
|
-
<div class="form-group">
|
6
|
-
<label><%= f.label :scrptversion, "Script Versions" %></label>
|
7
|
-
<%= f.text_field :scrptversion %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<div class="actions">
|
11
|
-
<%= f.submit "Submit", class: "btn btn-primary btn-sm" %>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class CreatePhcscriptcdnproScriptcdnScripts < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :phcscriptcdnpro_scriptcdn_scripts do |t|
|
4
|
-
|
5
|
-
t.string :scrptname
|
6
|
-
t.text :scrptdescription
|
7
|
-
|
8
|
-
t.references :scriptversion, index: true
|
9
|
-
|
10
|
-
t.timestamps null: false
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|