phcscriptcdn 0.2.5 → 0.5.5
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/phcscriptcdn/application.js +3 -0
- data/app/assets/stylesheets/phcscriptcdn/application.css.scss +10 -0
- data/app/assets/stylesheets/phcscriptcdn/custom.scss +4 -0
- data/app/controllers/phcscriptcdn/scriptcdn/scripts_controller.rb +3 -3
- data/app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb +16 -16
- data/app/views/layouts/phcscriptcdn/application.html.erb +13 -9
- data/app/views/phcscriptcdn/scriptcdn/scripts/_form.html.erb +1 -1
- data/app/views/phcscriptcdn/scriptcdn/scripturls/_form.html.erb +1 -1
- data/app/views/phcscriptcdn/scriptcdn/scripturls/_formpatch.html.erb +35 -0
- data/app/views/phcscriptcdn/scriptcdn/scripturls/edit.html.erb +1 -1
- data/app/views/phcscriptcdn/scriptcdn/scripturls/index.html.erb +1 -2
- data/app/views/phcscriptcdn/scriptcdn/scripturls/show.html.erb +0 -5
- data/config/routes.rb +1 -0
- data/db/migrate/20160222030446_create_phcscriptcdn_scriptcdn_scripturls.rb +1 -1
- data/lib/generators/phcscriptcdn/views_generator.rb +1 -1
- data/lib/phcscriptcdn/version.rb +1 -1
- metadata +4 -3
- data/app/assets/stylesheets/phcscriptcdn/application.css +0 -15
- data/app/assets/stylesheets/scaffold.css +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f899263f0aa8c9d80c06d52d34b977a79dbf84e
|
4
|
+
data.tar.gz: 6dfc4bdb29dea982a2bd2018f10e9989d50228fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41495a70b7b93cd41d8f09d78d11067b96d453356c0656941dbdfe37253f811d64fe0e90a8e3804a5f9c35bda0db699e496dce81d33d560b72dbc6a74bd3f950
|
7
|
+
data.tar.gz: faaf82feae71f48c66b73c93409103e05b6620061a0463a6ce26ee5aa87c44e6af7080c410fd2172a9e06d98d08d9e6fd563481b6b52a22017d296e65755d263
|
@@ -29,7 +29,7 @@ module Phcscriptcdn
|
|
29
29
|
@scriptcdn_script = Scriptcdn::Script.new(scriptcdn_script_params)
|
30
30
|
|
31
31
|
if @scriptcdn_script.save
|
32
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script was successfully created.'
|
32
|
+
redirect_to scriptcdn_scripts_path, notice: 'Script listing was successfully created.'
|
33
33
|
else
|
34
34
|
render :new
|
35
35
|
end
|
@@ -38,7 +38,7 @@ module Phcscriptcdn
|
|
38
38
|
# PATCH/PUT Script
|
39
39
|
def update
|
40
40
|
if @scriptcdn_script.update(scriptcdn_script_params)
|
41
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script was successfully updated.'
|
41
|
+
redirect_to scriptcdn_scripts_path, notice: 'Script listing was successfully updated.'
|
42
42
|
else
|
43
43
|
render :edit
|
44
44
|
end
|
@@ -47,7 +47,7 @@ module Phcscriptcdn
|
|
47
47
|
# DELETE Script from CDN
|
48
48
|
def destroy
|
49
49
|
@scriptcdn_script.destroy
|
50
|
-
redirect_to scriptcdn_scripts_path, notice: 'Script was successfully destroyed.'
|
50
|
+
redirect_to scriptcdn_scripts_path, notice: 'Script listing & Script URLs was successfully destroyed.'
|
51
51
|
end
|
52
52
|
|
53
53
|
private
|
@@ -38,12 +38,12 @@ module Phcscriptcdn
|
|
38
38
|
@scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
39
39
|
@scriptcdn_scripturl = @scriptcdn_script.scripturls.create(scriptcdn_scripturl_params)
|
40
40
|
respond_to do |format|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
if @scriptcdn_scripturl.save
|
42
|
+
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Created.' }
|
43
|
+
format.json { render action: 'show', status: :created, location: @scriptcdn_scripturl }
|
44
|
+
else
|
45
|
+
format.html { render action: 'new' }
|
46
|
+
format.json { render json: @scriptcdn_scripturl.errors, status: :unprocessable_entity }
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -51,23 +51,23 @@ module Phcscriptcdn
|
|
51
51
|
# PATCH/PUT Scriptcdn_script URL
|
52
52
|
def update
|
53
53
|
respond_to do |format|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
if @scriptcdn_scripturl.update(scriptcdn_scripturl_params)
|
55
|
+
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Updated.' }
|
56
|
+
format.json { head :no_content }
|
57
|
+
else
|
58
|
+
format.html { render action: 'edit' }
|
59
|
+
format.json { render json: @scriptcdn_scripturl.errors, status: :unprocessable_entity }
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
# Delete Scriptcdn_script URL
|
65
65
|
def destroy
|
66
|
-
@scriptcdn_script =
|
66
|
+
@scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
|
67
67
|
@scriptcdn_scripturl = @scriptcdn_script.scripturls.find(params[:id])
|
68
68
|
@scriptcdn_scripturl.destroy
|
69
69
|
respond_to do |format|
|
70
|
-
format.html { redirect_to scriptcdn_script_scripturls_path, notice: '
|
70
|
+
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Deleted.' }
|
71
71
|
format.json { head :no_content }
|
72
72
|
end
|
73
73
|
end
|
@@ -76,12 +76,12 @@ module Phcscriptcdn
|
|
76
76
|
|
77
77
|
# Callback
|
78
78
|
def set_scriptcdn_scripturl
|
79
|
-
@scriptcdn_scripturl = Scriptcdn::
|
79
|
+
@scriptcdn_scripturl = Scriptcdn::Scripturl.find(params[:id])
|
80
80
|
end
|
81
81
|
|
82
82
|
# Whitelist
|
83
83
|
def scriptcdn_scripturl_params
|
84
|
-
params.require(:scriptcdn_scripturl).permit(:scrpturlname, :scrpturlphc, :scrpturltype, :scriptversion_id)
|
84
|
+
params.require(:scriptcdn_scripturl).permit(:scrpturlname, :scrpturlphc, :scrpturltype, :scriptversion_id, :script_id)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -1,17 +1,21 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
|
5
|
+
<title>PHCScriptCDN - Script Listing Engine</title>
|
6
|
+
|
7
|
+
<%= stylesheet_link_tag "phcscriptcdn/application", media: "all" %>
|
8
|
+
<%= javascript_include_tag "phcscriptcdn/application" %>
|
7
9
|
<%= csrf_meta_tags %>
|
10
|
+
|
8
11
|
</head>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
<body>
|
14
|
+
<div class="container">
|
15
|
+
<div class="row">
|
16
|
+
<%= yield %>
|
17
|
+
</div>
|
15
18
|
</div>
|
16
19
|
</body>
|
20
|
+
|
17
21
|
</html>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
</div>
|
22
22
|
<div class="form-group">
|
23
23
|
<label><%= f.label :scriptversion_id, "Script Version" %></label>
|
24
|
-
<%= collection_select(:scriptcdn_script, :scriptversion_id, Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
24
|
+
<%= collection_select(:scriptcdn_script, :scriptversion_id, Phcscriptcdn::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
25
25
|
</div>
|
26
26
|
|
27
27
|
<div class="actions">
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</div>
|
26
26
|
<div class="form-group">
|
27
27
|
<label><%= f.label :scriptversion_id, "Script Version" %></label>
|
28
|
-
<%= collection_select(:scriptcdn_scripturl, :scriptversion_id, Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
28
|
+
<%= collection_select(:scriptcdn_scripturl, :scriptversion_id, Phcscriptcdn::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
<div class="actions">
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%= form_for([@scriptcdn_scripturl.script, @scriptcdn_scripturl], url: scriptcdn_script_scripturl_path, method: :patch) do |f| %>
|
2
|
+
|
3
|
+
<% if @scriptcdn_scripturl.errors.any? %>
|
4
|
+
<div id="error_explanation">
|
5
|
+
<h2><%= pluralize(@scriptcdn_scripturl.errors.count, "error") %> prohibited this scriptcdn_scripturl from being saved:</h2>
|
6
|
+
<ul>
|
7
|
+
<% @scriptcdn_scripturl.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<label><%= f.label :scrpturlname, "Script Name" %></label>
|
16
|
+
<%= f.text_field :scrpturlname, class: "form-control" %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<label><%= f.label :scrpturlphc, "Script URL (AWS)" %></label>
|
20
|
+
<%= f.text_field :scrpturlphc, class: "form-control" %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<label><%= f.label :scrpturltype, "Script Type" %></label>
|
24
|
+
<%= f.select :scrpturltype, [['CSS','css'],['JS','js'],['font','Font']], class: "form-control" %>
|
25
|
+
</div>
|
26
|
+
<div class="form-group">
|
27
|
+
<label><%= f.label :scriptversion_id, "Script Version" %></label>
|
28
|
+
<%= collection_select(:scriptcdn_scripturl, :scriptversion_id, Phcscriptcdn::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control form-control-sm"}) %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="actions">
|
32
|
+
<%= f.submit "Submit", class: "btn btn-primary btn-sm"%>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<% end %>
|
@@ -27,9 +27,8 @@
|
|
27
27
|
<td><%= scriptcdn_scripturl.scrpturltype %></td>
|
28
28
|
<td><%= scriptcdn_scripturl.scriptversion %></td>
|
29
29
|
<td><div class="btn-group" role="group" aria-label="Script CDN">
|
30
|
-
<%= link_to 'Show', scriptcdn_script_scripturl_path(scriptcdn_scripturl.script, scriptcdn_scripturl), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
31
30
|
<%= link_to 'Edit', edit_scriptcdn_script_scripturl_path(scriptcdn_scripturl.script, scriptcdn_scripturl), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
32
|
-
<%= link_to 'Destroy', scriptcdn_script_scripturl_path(scriptcdn_scripturl.script, class: "btn btn-w-m btn-danger btn-xs btn-phc-custom",
|
31
|
+
<%= link_to 'Destroy', scriptcdn_script_scripturl_path(scriptcdn_scripturl.script, scriptcdn_scripturl), class: "btn btn-w-m btn-danger btn-xs btn-phc-custom", method: :delete, data: { confirm: 'Are you sure?' } %>
|
33
32
|
</div></td>
|
34
33
|
</tr>
|
35
34
|
<% end %>
|
data/config/routes.rb
CHANGED
data/lib/phcscriptcdn/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcscriptcdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
@@ -236,11 +236,11 @@ files:
|
|
236
236
|
- app/assets/javascripts/phcscriptcdn/scriptcdn/scripts.js
|
237
237
|
- app/assets/javascripts/phcscriptcdn/scriptcdn/scripturls.js
|
238
238
|
- app/assets/javascripts/phcscriptcdn/scriptcdn/scriptversions.js
|
239
|
-
- app/assets/stylesheets/phcscriptcdn/application.css
|
239
|
+
- app/assets/stylesheets/phcscriptcdn/application.css.scss
|
240
|
+
- app/assets/stylesheets/phcscriptcdn/custom.scss
|
240
241
|
- app/assets/stylesheets/phcscriptcdn/scriptcdn/scripts.css
|
241
242
|
- app/assets/stylesheets/phcscriptcdn/scriptcdn/scripturls.css
|
242
243
|
- app/assets/stylesheets/phcscriptcdn/scriptcdn/scriptversions.css
|
243
|
-
- app/assets/stylesheets/scaffold.css
|
244
244
|
- app/controllers/phcscriptcdn/application_controller.rb
|
245
245
|
- app/controllers/phcscriptcdn/scriptcdn/scripts_controller.rb
|
246
246
|
- app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb
|
@@ -260,6 +260,7 @@ files:
|
|
260
260
|
- app/views/phcscriptcdn/scriptcdn/scripts/new.html.erb
|
261
261
|
- app/views/phcscriptcdn/scriptcdn/scripts/show.html.erb
|
262
262
|
- app/views/phcscriptcdn/scriptcdn/scripturls/_form.html.erb
|
263
|
+
- app/views/phcscriptcdn/scriptcdn/scripturls/_formpatch.html.erb
|
263
264
|
- app/views/phcscriptcdn/scriptcdn/scripturls/edit.html.erb
|
264
265
|
- app/views/phcscriptcdn/scriptcdn/scripturls/index.html.erb
|
265
266
|
- app/views/phcscriptcdn/scriptcdn/scripturls/new.html.erb
|
@@ -1,15 +0,0 @@
|
|
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 styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,56 +0,0 @@
|
|
1
|
-
body { background-color: #fff; color: #333; }
|
2
|
-
|
3
|
-
body, p, ol, ul, td {
|
4
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
-
font-size: 13px;
|
6
|
-
line-height: 18px;
|
7
|
-
}
|
8
|
-
|
9
|
-
pre {
|
10
|
-
background-color: #eee;
|
11
|
-
padding: 10px;
|
12
|
-
font-size: 11px;
|
13
|
-
}
|
14
|
-
|
15
|
-
a { color: #000; }
|
16
|
-
a:visited { color: #666; }
|
17
|
-
a:hover { color: #fff; background-color:#000; }
|
18
|
-
|
19
|
-
div.field, div.actions {
|
20
|
-
margin-bottom: 10px;
|
21
|
-
}
|
22
|
-
|
23
|
-
#notice {
|
24
|
-
color: green;
|
25
|
-
}
|
26
|
-
|
27
|
-
.field_with_errors {
|
28
|
-
padding: 2px;
|
29
|
-
background-color: red;
|
30
|
-
display: table;
|
31
|
-
}
|
32
|
-
|
33
|
-
#error_explanation {
|
34
|
-
width: 450px;
|
35
|
-
border: 2px solid red;
|
36
|
-
padding: 7px;
|
37
|
-
padding-bottom: 0;
|
38
|
-
margin-bottom: 20px;
|
39
|
-
background-color: #f0f0f0;
|
40
|
-
}
|
41
|
-
|
42
|
-
#error_explanation h2 {
|
43
|
-
text-align: left;
|
44
|
-
font-weight: bold;
|
45
|
-
padding: 5px 5px 5px 15px;
|
46
|
-
font-size: 12px;
|
47
|
-
margin: -7px;
|
48
|
-
margin-bottom: 0px;
|
49
|
-
background-color: #c00;
|
50
|
-
color: #fff;
|
51
|
-
}
|
52
|
-
|
53
|
-
#error_explanation ul li {
|
54
|
-
font-size: 12px;
|
55
|
-
list-style: square;
|
56
|
-
}
|