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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e49df6b70133f6d69ac7e0761f4634108232265
4
- data.tar.gz: 751319a198920480261d0f980e08b242030ef854
3
+ metadata.gz: 2f899263f0aa8c9d80c06d52d34b977a79dbf84e
4
+ data.tar.gz: 6dfc4bdb29dea982a2bd2018f10e9989d50228fc
5
5
  SHA512:
6
- metadata.gz: 5aa93109f2de1e8549750672f1ebffb256fb12ada2626e7be17507a19e1882ae6c8d47dc64a441070346b5f5c689619f52d190245f647470682856d2cd06d449
7
- data.tar.gz: 21c128d9bf894caacdf8f9f827d0f4c1701b21ab41701fc766ee49c714381495f390f070534c98dd5eb4e2dfd41db742cf74cf476fb4cbd08724f2b79c974f48
6
+ metadata.gz: 41495a70b7b93cd41d8f09d78d11067b96d453356c0656941dbdfe37253f811d64fe0e90a8e3804a5f9c35bda0db699e496dce81d33d560b72dbc6a74bd3f950
7
+ data.tar.gz: faaf82feae71f48c66b73c93409103e05b6620061a0463a6ce26ee5aa87c44e6af7080c410fd2172a9e06d98d08d9e6fd563481b6b52a22017d296e65755d263
@@ -10,4 +10,7 @@
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
13
16
  //= require_tree .
@@ -0,0 +1,10 @@
1
+ /*
2
+ *= require_self
3
+ */
4
+
5
+ // Load Standard
6
+ @import "bootstrap";
7
+ @import "font-awesome";
8
+
9
+ // Load Custom
10
+ @import "custom";
@@ -0,0 +1,4 @@
1
+ // Main Container Margin
2
+ .container {
3
+ padding-top: 40px;
4
+ }
@@ -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
- if @scriptcdn_scripturl.save
42
- format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Comment for Scriptcdn_script 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 }
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
- if @scriptcdn_scripturl.update(scriptcdn_scripturl_params)
55
- format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Comment for Scriptcdn_script 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 }
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 = Scriptcdn_script.find(params[:script_id])
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: 'Comment for Scriptcdn_script was Successfully Deleted.' }
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::Script.find(params[:id])
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
- <title>PHCNetworks - Online Applications &amp; Digital Services</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
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
- <body class="backend">
10
- <div class="wrapper wrapper-content">
11
- <%= yield %>
12
- </div>
13
- <div class="footer">
14
- <%= render 'layouts/template-backend/footer' %>
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 %>
@@ -4,7 +4,7 @@
4
4
  <i class="fa fa-code"></i> Edit Script URL
5
5
  </div>
6
6
  <div class="panel-body">
7
- <%= render 'form' %>
7
+ <%= render 'formpatch' %>
8
8
  </div>
9
9
  </div>
10
10
  </div>
@@ -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", scriptcdn_scripturl), method: :delete, data: { confirm: 'Are you sure?' } %>
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 %>
@@ -14,8 +14,3 @@
14
14
  <strong>Script Type:</strong>
15
15
  <%= @scriptcdn_scripturl.scrpturltype %>
16
16
  </p>
17
-
18
- <p>
19
- <strong>Script Version:</strong>
20
- <%= @scriptcdn_scripturl.scriptversion %>
21
- </p>
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  Phcscriptcdn::Engine.routes.draw do
2
2
 
3
+ # Script CDN Listing System
3
4
  namespace :scriptcdn do
4
5
  resources :scripts do
5
6
  resources :scripturls
@@ -6,7 +6,7 @@ class CreatePhcscriptcdnScriptcdnScripturls < ActiveRecord::Migration
6
6
  t.string :scrpturlphc
7
7
  t.string :scrpturltype
8
8
  t.references :scriptversion, index: true
9
- t.references :script
9
+ t.references :script, index: true
10
10
 
11
11
  t.timestamps null: false
12
12
 
@@ -1,6 +1,6 @@
1
1
  require 'rails/generators/base'
2
2
 
3
- module phcscriptcdn
3
+ module Phcscriptcdn
4
4
 
5
5
  module Generators
6
6
 
@@ -1,3 +1,3 @@
1
1
  module Phcscriptcdn
2
- VERSION = "0.2.5"
2
+ VERSION = "0.5.5"
3
3
  end
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.2.5
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
- }