phcscriptcdnpro 73.0.0 → 73.1.0
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/application_controller.rb +10 -5
- data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +1 -5
- data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +2 -6
- data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +1 -5
- data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +4 -6
- data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +1 -5
- data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +1 -1
- data/app/models/phcscriptcdnpro/script/author.rb +1 -1
- data/app/models/phcscriptcdnpro/script/extension.rb +4 -4
- data/app/models/phcscriptcdnpro/script/licence.rb +3 -3
- data/app/models/phcscriptcdnpro/script/listing.rb +21 -4
- data/app/models/phcscriptcdnpro/script/url.rb +5 -5
- data/app/models/phcscriptcdnpro/script/version.rb +3 -3
- data/app/views/layouts/phcscriptcdnpro/application.html.erb +21 -22
- data/app/views/layouts/phcscriptcdnpro/components/backend/sidebars/_side_menu.html.erb +38 -10
- data/app/views/phcscriptcdnpro/script/authors/_form.html.erb +8 -8
- data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +2 -4
- data/app/views/phcscriptcdnpro/script/authors/index.html.erb +10 -8
- data/app/views/phcscriptcdnpro/script/authors/new.html.erb +2 -5
- data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +6 -6
- data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +8 -7
- data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +16 -16
- data/app/views/phcscriptcdnpro/script/licences/index.html.erb +13 -12
- data/app/views/phcscriptcdnpro/script/listings/_form.html.erb +26 -33
- data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +1 -4
- data/app/views/phcscriptcdnpro/script/listings/index.html.erb +14 -13
- data/app/views/phcscriptcdnpro/script/listings/new.html.erb +2 -4
- data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +8 -8
- data/app/views/phcscriptcdnpro/script/urls/index.html.erb +9 -8
- data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +2 -2
- data/app/views/phcscriptcdnpro/script/versions/index.html.erb +7 -6
- data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +10 -11
- data/db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb +4 -4
- data/db/migrate/20160821183735_create_phcscriptcdnpro_script_extensions.rb +3 -3
- data/db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb +9 -10
- data/db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb +4 -4
- data/db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb +1 -1
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aeafb460622321c00bee73a05baeb0c6d3913ccf23905116bb7786e5958020f
|
4
|
+
data.tar.gz: dd9482caba24597d6004cc32293b1a7708ec0771e7ac6d00929825195f7386df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b56ff83cb90e06418572ad03414f52fb9f45ea1941685d6ff8985b5f2ffcade2aca7ff87b0918e374fe7d21e3730fdb525cd5c78f08d4107eec8269a80fc8f8d
|
7
|
+
data.tar.gz: ceab28cfb68ef4a92f02c94798e23e14a2b92ac1b3db094e97eed52db308cd9d303d79ba02ccdc91c756ce7228cedb98c2c7776d31b800504147a6c998e5afcd
|
@@ -1,22 +1,27 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
-
|
3
|
+
|
4
4
|
# Security Filters
|
5
5
|
protect_from_forgery with: :exception
|
6
|
-
|
6
|
+
before_action :set_default_locale
|
7
|
+
|
7
8
|
# Load Requried Helper Files
|
8
9
|
helper Phccorehelpers::Engine.helpers
|
9
10
|
helper Phcmenus::Engine.helpers
|
10
11
|
helper Phctitleseo::Engine.helpers
|
11
12
|
helper Phcnotifi::Engine.helpers
|
12
13
|
helper Phcaccountspro::Engine.helpers
|
13
|
-
|
14
|
+
|
14
15
|
# Papertrail Whodunnit Username
|
15
16
|
def user_for_paper_trail
|
16
17
|
current_user ? current_user.username : 'Public user'
|
17
18
|
end
|
18
|
-
|
19
|
+
|
19
20
|
private
|
20
|
-
|
21
|
+
|
22
|
+
def set_default_locale
|
23
|
+
I18n.default_locale = :en
|
24
|
+
end
|
25
|
+
|
21
26
|
end
|
22
27
|
end
|
@@ -23,8 +23,6 @@ module Phcscriptcdnpro
|
|
23
23
|
# NEW - Script Author
|
24
24
|
def new
|
25
25
|
@script_author = Script::Author.new
|
26
|
-
@script_author.user_id = current_user.id
|
27
|
-
@script_author.org_id = current_user.org_id
|
28
26
|
end
|
29
27
|
|
30
28
|
# EDIT - Script Author
|
@@ -45,8 +43,6 @@ module Phcscriptcdnpro
|
|
45
43
|
|
46
44
|
# PATCH/PUT - Script Author
|
47
45
|
def update
|
48
|
-
@script_author.user_id = current_user.id
|
49
|
-
@script_author.org_id = current_user.org_id
|
50
46
|
if @script_author.update(script_author_params)
|
51
47
|
redirect_to script_authors_url, notice: 'Author was successfully updated.'
|
52
48
|
else
|
@@ -69,7 +65,7 @@ module Phcscriptcdnpro
|
|
69
65
|
|
70
66
|
# Whitelist
|
71
67
|
def script_author_params
|
72
|
-
params.require(:script_author).permit(:
|
68
|
+
params.require(:script_author).permit(:author_first_name, :author_last_name, :author_website, :author_github, :slug, :user_id, :org_id, :listing_id)
|
73
69
|
end
|
74
70
|
|
75
71
|
end
|
@@ -23,8 +23,6 @@ module Phcscriptcdnpro
|
|
23
23
|
# NEW - Script Extension
|
24
24
|
def new
|
25
25
|
@script_extension = Script::Extension.new
|
26
|
-
@script_extension.user_id = current_user.id
|
27
|
-
@script_extension.org_id = current_user.org_id
|
28
26
|
end
|
29
27
|
|
30
28
|
# EDIT - Script Extension
|
@@ -45,8 +43,6 @@ module Phcscriptcdnpro
|
|
45
43
|
|
46
44
|
# PATCH/PUT - Script Extension
|
47
45
|
def update
|
48
|
-
@script_extension.user_id = current_user.id
|
49
|
-
@script_extension.org_id = current_user.org_id
|
50
46
|
if @script_extension.update(script_extension_params)
|
51
47
|
redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
|
52
48
|
else
|
@@ -56,7 +52,7 @@ module Phcscriptcdnpro
|
|
56
52
|
|
57
53
|
# DELETE - Script Extension
|
58
54
|
def destroy
|
59
|
-
|
55
|
+
@script_extension.destroy
|
60
56
|
redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
|
61
57
|
end
|
62
58
|
|
@@ -69,7 +65,7 @@ module Phcscriptcdnpro
|
|
69
65
|
|
70
66
|
# Whitelists
|
71
67
|
def script_extension_params
|
72
|
-
params.require(:script_extension).permit(:
|
68
|
+
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id, :org_id)
|
73
69
|
end
|
74
70
|
|
75
71
|
end
|
@@ -23,8 +23,6 @@ module Phcscriptcdnpro
|
|
23
23
|
# NEW - Script Licences
|
24
24
|
def new
|
25
25
|
@script_licence = Script::Licence.new
|
26
|
-
@script_licence.user_id = current_user.id
|
27
|
-
@script_licence.org_id = current_user.org_id
|
28
26
|
end
|
29
27
|
|
30
28
|
# EDIT - Script Licences
|
@@ -45,8 +43,6 @@ module Phcscriptcdnpro
|
|
45
43
|
|
46
44
|
# PATCH/PUT - Script Licences
|
47
45
|
def update
|
48
|
-
@script_licence.user_id = current_user.id
|
49
|
-
@script_licence.org_id = current_user.org_id
|
50
46
|
if @script_licence.update(script_licence_params)
|
51
47
|
redirect_to script_licences_url, notice: 'Licence was successfully updated.'
|
52
48
|
else
|
@@ -69,7 +65,7 @@ module Phcscriptcdnpro
|
|
69
65
|
|
70
66
|
# Whitelists
|
71
67
|
def script_licence_params
|
72
|
-
params.require(:script_licence).permit(:
|
68
|
+
params.require(:script_licence).permit(:licence_name, :licence_description, :licence_compatible_gpl, :licence_approval_fsf, :licence_approval_osi, :licence_approval_copyfree, :licence_approval_debian, :licence_approval_fedora, :slug, :user_id, :org_id, :listing_id)
|
73
69
|
end
|
74
70
|
|
75
71
|
end
|
@@ -17,7 +17,7 @@ module Phcscriptcdnpro
|
|
17
17
|
# DETAILS - Script Listings
|
18
18
|
def show
|
19
19
|
@script_listings = Script::Listing.friendly.find(params[:id])
|
20
|
-
@versions = Phcscriptcdnpro::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::
|
20
|
+
@versions = Phcscriptcdnpro::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script_::Listing')
|
21
21
|
end
|
22
22
|
|
23
23
|
# NEW - Script Listings
|
@@ -36,15 +36,13 @@ module Phcscriptcdnpro
|
|
36
36
|
@script_listing.org_id = current_user.org_id
|
37
37
|
if @script_listing.save
|
38
38
|
redirect_to script_listings_path, notice: 'Listing was successfully created.'
|
39
|
-
|
40
|
-
|
39
|
+
else
|
40
|
+
render :new
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
# PATCH/PUT - Script Listings
|
45
45
|
def update
|
46
|
-
@script_listing.user_id = current_user.id
|
47
|
-
@script_listing.org_id = current_user.org_id
|
48
46
|
if @script_listing.update(script_listing_params)
|
49
47
|
redirect_to script_listings_path, notice: 'Listing was successfully updated.'
|
50
48
|
else
|
@@ -67,7 +65,7 @@ module Phcscriptcdnpro
|
|
67
65
|
|
68
66
|
# Whitelist
|
69
67
|
def script_listing_params
|
70
|
-
params.require(:script_listing).permit(:
|
68
|
+
params.require(:script_listing).permit(:script_tittle, :script_description, :script_source, :script_website, :script_github, :script_initial_release, :script_lastest_release, :script_beta_release, :script_lastest_release_cdn, :script_status, :slug, :user_id, :org_id, :version_id, :author_id, :licence_id)
|
71
69
|
end
|
72
70
|
|
73
71
|
end
|
@@ -25,8 +25,6 @@ module Phcscriptcdnpro
|
|
25
25
|
def new
|
26
26
|
script_listing = Script::Listing.find(params[:listing_id])
|
27
27
|
@script_url = script_listing.urls.build
|
28
|
-
@script_url.user_id = current_user.id
|
29
|
-
@script_url.org_id = current_user.org_id
|
30
28
|
end
|
31
29
|
|
32
30
|
# EDIT - Script Athors
|
@@ -50,8 +48,6 @@ module Phcscriptcdnpro
|
|
50
48
|
|
51
49
|
# PATCH/PUT - Script Athors
|
52
50
|
def update
|
53
|
-
@script_url.user_id = current_user.id
|
54
|
-
@script_url.org_id = current_user.org_id
|
55
51
|
if @script_url.update(script_url_params)
|
56
52
|
redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
|
57
53
|
else
|
@@ -76,7 +72,7 @@ module Phcscriptcdnpro
|
|
76
72
|
|
77
73
|
# Whitelists
|
78
74
|
def script_url_params
|
79
|
-
params.require(:script_url).permit(:
|
75
|
+
params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :org_id, :listing_id, :version_id, :extension_id)
|
80
76
|
end
|
81
77
|
|
82
78
|
end
|
@@ -69,7 +69,7 @@ module Phcscriptcdnpro
|
|
69
69
|
|
70
70
|
# Only allow a trusted parameter "white list" through.
|
71
71
|
def script_version_params
|
72
|
-
params.require(:script_version).permit(:
|
72
|
+
params.require(:script_version).permit(:script_version_number, :slug, :user_id, :org_id)
|
73
73
|
end
|
74
74
|
|
75
75
|
end
|
@@ -12,13 +12,13 @@ module Phcscriptcdnpro
|
|
12
12
|
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
13
13
|
|
14
14
|
# Validation for Form Fields
|
15
|
-
validates :
|
15
|
+
validates :script_extension_name,
|
16
16
|
presence: true
|
17
17
|
|
18
|
-
validates :
|
18
|
+
validates :script_extension_description,
|
19
19
|
presence: true
|
20
20
|
|
21
|
-
validates :
|
21
|
+
validates :script_extension,
|
22
22
|
presence: true
|
23
23
|
|
24
24
|
# Clean URL Define
|
@@ -27,7 +27,7 @@ module Phcscriptcdnpro
|
|
27
27
|
# Define for Multiple Records
|
28
28
|
def phcscriptcdnpro_extentension_slug
|
29
29
|
[
|
30
|
-
[:
|
30
|
+
[:script_extension]
|
31
31
|
]
|
32
32
|
end
|
33
33
|
|
@@ -11,10 +11,10 @@ module Phcscriptcdnpro
|
|
11
11
|
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
|
12
12
|
|
13
13
|
# Validation for Form Fields
|
14
|
-
validates :
|
14
|
+
validates :licence_name,
|
15
15
|
presence: true
|
16
16
|
|
17
|
-
validates :
|
17
|
+
validates :licence_description,
|
18
18
|
presence: true
|
19
19
|
|
20
20
|
# Clean URL Define
|
@@ -23,7 +23,7 @@ module Phcscriptcdnpro
|
|
23
23
|
# Define for Multiple Records
|
24
24
|
def phcscriptcdnpro_licence_slug
|
25
25
|
[
|
26
|
-
[:
|
26
|
+
[:licence_name]
|
27
27
|
]
|
28
28
|
end
|
29
29
|
|
@@ -9,9 +9,26 @@ module Phcscriptcdnpro
|
|
9
9
|
|
10
10
|
# Relationships
|
11
11
|
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
12
|
-
belongs_to :author, class_name: 'Phcscriptcdnpro::Script::Author'
|
13
|
-
belongs_to :
|
14
|
-
|
12
|
+
belongs_to :author, class_name: 'Phcscriptcdnpro::Script::Author'
|
13
|
+
belongs_to :licence, class_name: 'Phcscriptcdnpro::Script::Licence'
|
14
|
+
|
15
|
+
# Validation for Form Fields
|
16
|
+
validates :script_tittle,
|
17
|
+
presence: true,
|
18
|
+
length: { minimum: 3 }
|
19
|
+
|
20
|
+
validates :script_description,
|
21
|
+
presence: true,
|
22
|
+
length: { minimum: 4 }
|
23
|
+
|
24
|
+
validates :script_source,
|
25
|
+
length: { minimum: 5 }
|
26
|
+
|
27
|
+
validates :script_website,
|
28
|
+
length: { minimum: 5 }
|
29
|
+
|
30
|
+
validates :script_github,
|
31
|
+
length: { minimum: 5 }
|
15
32
|
|
16
33
|
# Clean URL Define
|
17
34
|
friendly_id :phcscriptcdnpro_listing_slug, use: [:slugged, :finders]
|
@@ -19,7 +36,7 @@ module Phcscriptcdnpro
|
|
19
36
|
# Define for Multiple Records
|
20
37
|
def phcscriptcdnpro_listing_slug
|
21
38
|
[
|
22
|
-
[:
|
39
|
+
[:script_tittle, :version]
|
23
40
|
]
|
24
41
|
end
|
25
42
|
|
@@ -9,17 +9,17 @@ module Phcscriptcdnpro
|
|
9
9
|
|
10
10
|
# Relationships
|
11
11
|
belongs_to :listing, class_name: 'Phcscriptcdnpro::Script::Listing'
|
12
|
+
belongs_to :extension, class_name: 'Phcscriptcdnpro::Script::Extension'
|
12
13
|
belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version', optional: true
|
13
|
-
belongs_to :extension, class_name: 'Phcscriptcdnpro::Script::Extension', optional: true
|
14
14
|
|
15
15
|
# Validation for Form Fields
|
16
|
-
validates :
|
16
|
+
validates :script_url,
|
17
17
|
presence: true
|
18
18
|
|
19
|
-
validates :
|
19
|
+
validates :script_url_release,
|
20
20
|
presence: true
|
21
21
|
|
22
|
-
validates :
|
22
|
+
validates :script_url_cdn_update,
|
23
23
|
presence: true
|
24
24
|
|
25
25
|
# Clean URL Define
|
@@ -28,7 +28,7 @@ module Phcscriptcdnpro
|
|
28
28
|
# Define for Multiple Records
|
29
29
|
def phcscriptcdnpro_url_slug
|
30
30
|
[
|
31
|
-
[:
|
31
|
+
[:id]
|
32
32
|
]
|
33
33
|
end
|
34
34
|
|
@@ -8,11 +8,11 @@ module Phcscriptcdnpro
|
|
8
8
|
has_paper_trail :class_name => 'Phcscriptcdnpro::ScriptversionVersions'
|
9
9
|
|
10
10
|
# Relationships
|
11
|
-
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
|
11
|
+
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing', :through => :urls
|
12
12
|
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
13
13
|
|
14
14
|
# Validation for Form Fields
|
15
|
-
validates :
|
15
|
+
validates :script_version_number,
|
16
16
|
presence: true
|
17
17
|
|
18
18
|
# Clean URL Define
|
@@ -21,7 +21,7 @@ module Phcscriptcdnpro
|
|
21
21
|
# Define for Multiple Records
|
22
22
|
def phcscriptcdnpro_version_slug
|
23
23
|
[
|
24
|
-
[:
|
24
|
+
[:script_version_number]
|
25
25
|
]
|
26
26
|
end
|
27
27
|
|
@@ -2,25 +2,27 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
|
5
|
-
|
6
|
-
<%
|
5
|
+
<!-- SEO System -->
|
6
|
+
<% phc_seo_title "PHCScriptCDN by PHCDevworks" %>
|
7
|
+
<% phc_seo_description "Application to manage CDN Script Listings." %>
|
8
|
+
<!-- SEO System -->
|
7
9
|
|
8
|
-
<!--
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1
|
10
|
+
<!-- SEO and Site Description -->
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
10
12
|
<title><%= yield(:phc_seo_title) %></title>
|
11
13
|
<meta name="description" content="<%= yield(:phc_seo_description) %>">
|
12
14
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
|
13
|
-
<link rel="canonical" href="http://
|
14
|
-
<!--
|
15
|
-
|
16
|
-
<!--
|
15
|
+
<link rel="canonical" href="http://phcdevworks.com">
|
16
|
+
<!-- SEO and Site Description -->
|
17
|
+
|
18
|
+
<!-- Rails Security Tags -->
|
17
19
|
<%= csrf_meta_tags %>
|
18
20
|
<%= csp_meta_tag %>
|
19
|
-
<!--
|
20
|
-
|
21
|
-
<!--
|
21
|
+
<!-- Rails Security Tags -->
|
22
|
+
|
23
|
+
<!-- CSS Styles -->
|
22
24
|
<%= stylesheet_link_tag 'phcscriptcdnpro/application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
23
|
-
<!--
|
25
|
+
<!-- CSS Styles -->
|
24
26
|
|
25
27
|
<!-- Font -->
|
26
28
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700"/>
|
@@ -31,6 +33,7 @@
|
|
31
33
|
|
32
34
|
<!-- Page Container -->
|
33
35
|
<div id="page-container" class="page-container fade page-sidebar-fixed page-header-fixed">
|
36
|
+
|
34
37
|
<!-- Page Header -->
|
35
38
|
<div id="header" class="header navbar-default">
|
36
39
|
<%= render 'layouts/phcscriptcdnpro/components/backend/navigation/top_menu' %>
|
@@ -51,29 +54,25 @@
|
|
51
54
|
<!-- Page Content -->
|
52
55
|
|
53
56
|
<!-- Footer Content -->
|
54
|
-
<div id="footer" class="footer">
|
57
|
+
<div id="footer" class="footer mb-4">
|
55
58
|
<%= render 'layouts/phcscriptcdnpro/components/backend/footer/footer' %>
|
56
59
|
</div>
|
57
60
|
<!-- Footer Content -->
|
58
61
|
|
59
|
-
<!-- Scroll to Top -->
|
60
|
-
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top">
|
61
|
-
<i class="fa fa-angle-up"></i>
|
62
|
-
</a>
|
63
|
-
<!-- Scroll to Top -->
|
64
|
-
|
65
62
|
</div>
|
66
63
|
<!-- Page Container -->
|
67
64
|
|
68
|
-
<!--
|
65
|
+
<!-- JavaScript -->
|
69
66
|
<%= javascript_include_tag "phcscriptcdnpro/application", 'data-turbolinks-track': 'reload' %>
|
70
|
-
|
67
|
+
<!-- JavaScript -->
|
68
|
+
|
69
|
+
<!-- JavaScript Loader -->
|
71
70
|
<script>
|
72
71
|
$(document).ready(function() {
|
73
72
|
App.init();
|
74
73
|
});
|
75
74
|
</script>
|
76
|
-
<!--
|
75
|
+
<!-- JavaScript Loader -->
|
77
76
|
|
78
77
|
</body>
|
79
78
|
</html>
|