phcscriptcdnpro 73.1.0 → 74.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +1 -1
- data/app/assets/javascripts/phcscriptcdnpro/application.js +1 -1
- data/app/assets/stylesheets/phcscriptcdnpro/application.scss +1 -1
- data/app/controllers/phcscriptcdnpro/application_controller.rb +15 -20
- data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +15 -16
- data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +17 -18
- data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +14 -15
- data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +12 -13
- data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +15 -16
- data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +16 -21
- data/app/models/phcscriptcdnpro/application_record.rb +0 -2
- data/app/models/phcscriptcdnpro/script.rb +0 -2
- data/app/models/phcscriptcdnpro/script/author.rb +16 -7
- data/app/models/phcscriptcdnpro/script/extension.rb +5 -8
- data/app/models/phcscriptcdnpro/script/licence.rb +5 -8
- data/app/models/phcscriptcdnpro/script/listing.rb +13 -18
- data/app/models/phcscriptcdnpro/script/url.rb +4 -16
- data/app/models/phcscriptcdnpro/script/version.rb +6 -9
- data/app/views/layouts/phcscriptcdnpro/application.html.erb +6 -5
- data/app/views/layouts/phcscriptcdnpro/components/backend/footer/_footer.html.erb +5 -5
- data/app/views/layouts/phcscriptcdnpro/components/backend/navigation/_top_menu.html.erb +0 -41
- data/app/views/layouts/phcscriptcdnpro/components/backend/sidebars/_side_menu.html.erb +68 -61
- data/app/views/phcscriptcdnpro/script/authors/_form.html.erb +19 -18
- data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +4 -4
- data/app/views/phcscriptcdnpro/script/authors/index.html.erb +19 -15
- data/app/views/phcscriptcdnpro/script/authors/new.html.erb +4 -4
- data/app/views/phcscriptcdnpro/script/authors/show.html.erb +1 -4
- data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +16 -15
- data/app/views/phcscriptcdnpro/script/extensions/edit.html.erb +4 -7
- data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +19 -15
- data/app/views/phcscriptcdnpro/script/extensions/new.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/extensions/show.html.erb +1 -4
- data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +31 -30
- data/app/views/phcscriptcdnpro/script/licences/edit.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/licences/index.html.erb +19 -15
- data/app/views/phcscriptcdnpro/script/licences/new.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/licences/show.html.erb +1 -4
- data/app/views/phcscriptcdnpro/script/listings/_form.html.erb +41 -37
- data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +4 -4
- data/app/views/phcscriptcdnpro/script/listings/index.html.erb +24 -19
- data/app/views/phcscriptcdnpro/script/listings/new.html.erb +6 -5
- data/app/views/phcscriptcdnpro/script/listings/show.html.erb +3 -5
- data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +17 -16
- data/app/views/phcscriptcdnpro/script/urls/edit.html.erb +15 -5
- data/app/views/phcscriptcdnpro/script/urls/index.html.erb +19 -15
- data/app/views/phcscriptcdnpro/script/urls/new.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/urls/show.html.erb +1 -4
- data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +7 -6
- data/app/views/phcscriptcdnpro/script/versions/edit.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/versions/index.html.erb +19 -15
- data/app/views/phcscriptcdnpro/script/versions/new.html.erb +4 -6
- data/app/views/phcscriptcdnpro/script/versions/show.html.erb +1 -4
- data/config/routes.rb +19 -20
- data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +1 -1
- data/lib/phcscriptcdnpro.rb +0 -1
- data/lib/phcscriptcdnpro/engine.rb +16 -15
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +62 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17a659183e2d7535cf7703de59038a4e82e2190d7ff71e316f7cc598776de05b
|
4
|
+
data.tar.gz: a2ca13dca91834c4b4c237bf2668897e534132848f2e1f9e9d7d513fd2b3f4e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70ed42f6fee08f90174c106445bc0ecc8b59399e60cbdd55fbef421ea57a54bc53be55f8a5dea2e13e0ad5e2875a6c5f7d0d9fdf8c1542321f299e9a95c76537
|
7
|
+
data.tar.gz: 607daca226fabdf4207e7682b2e24e184d64d9cefab21605cee603314868499f1fef51b460078cd760f746bc20fc8d4d08d97c0f7575094436e27ad7eea87093
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -31,4 +31,4 @@ To properly function re-compile your application's assets to copy over required
|
|
31
31
|
#### Step 5 - Generate Contact Form View (Customization)
|
32
32
|
All PHCScriptCDN views and layouts can be overwritten by copying files to your application.
|
33
33
|
|
34
|
-
rails generate phcscriptcdnpro:views
|
34
|
+
rails generate phcscriptcdnpro:views
|
@@ -1,2 +1,2 @@
|
|
1
1
|
// Load Admin Theme
|
2
|
-
//= require phc_admin_theme_scripts_four
|
2
|
+
//= require phc_admin_theme_scripts_four
|
@@ -1,2 +1,2 @@
|
|
1
1
|
// Load Admin Theme
|
2
|
-
@import "phc_admin_theme_styles_four";
|
2
|
+
@import "phc_admin_theme_styles_four";
|
@@ -1,27 +1,22 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class ApplicationController < ActionController::Base
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
before_action :set_default_locale
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
# Load Requried Helper Files
|
8
|
+
helper Phcaccountspro::Engine.helpers
|
9
|
+
helper Phccorehelpers::Engine.helpers
|
10
|
+
helper Phcmenus::Engine.helpers
|
11
|
+
helper Phctitleseo::Engine.helpers
|
12
|
+
helper Phcnotifi::Engine.helpers
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
private
|
14
|
+
# Papertrail Whodunnit Username
|
15
|
+
def user_for_paper_trail
|
16
|
+
current_user ? current_user.username : 'Public user'
|
17
|
+
end
|
21
18
|
|
22
|
-
|
23
|
-
I18n.default_locale = :en
|
24
|
-
end
|
19
|
+
private
|
25
20
|
|
26
|
-
|
21
|
+
end
|
27
22
|
end
|
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_author, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@script_authors = Script::Author.
|
14
|
+
@script_authors = Script::Author.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# SHOW
|
18
18
|
def show
|
19
19
|
@script_authors = Script::Author.friendly.find(params[:id])
|
20
20
|
@versions = Phcscriptcdnpro::AuthorVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Author')
|
21
21
|
end
|
22
22
|
|
23
|
-
# NEW
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@script_author = Script::Author.new
|
26
26
|
end
|
27
27
|
|
28
|
-
# EDIT
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
# CREATE
|
32
|
+
# CREATE
|
33
33
|
def create
|
34
34
|
@script_author = Script::Author.new(script_author_params)
|
35
35
|
@script_author.user_id = current_user.id
|
36
|
-
@script_author.org_id = current_user.org_id
|
37
36
|
if @script_author.save
|
38
|
-
redirect_to script_authors_url,
|
39
|
-
|
37
|
+
redirect_to script_authors_url, :flash => { :success => 'Author was successfully created.' }
|
38
|
+
else
|
40
39
|
render :new
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @script_author.update(script_author_params)
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
redirect_to script_authors_url, :flash => { :success => 'Author was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
# DELETE
|
52
|
+
# DELETE
|
54
53
|
def destroy
|
55
54
|
@script_author.destroy
|
56
|
-
redirect_to script_authors_url,
|
55
|
+
redirect_to script_authors_url, :flash => { :error => 'Author was successfully destroyed.' }
|
57
56
|
end
|
58
57
|
|
59
58
|
private
|
@@ -65,7 +64,7 @@ module Phcscriptcdnpro
|
|
65
64
|
|
66
65
|
# Whitelist
|
67
66
|
def script_author_params
|
68
|
-
params.require(:script_author).permit(:author_first_name, :author_last_name, :author_website, :author_github, :slug, :user_id, :
|
67
|
+
params.require(:script_author).permit(:author_first_name, :author_last_name, :author_website, :author_github, :slug, :user_id, :listing_id)
|
69
68
|
end
|
70
69
|
|
71
70
|
end
|
@@ -9,63 +9,62 @@ module Phcscriptcdnpro
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@script_extensions = Script::Extension.
|
14
|
+
@script_extensions = Script::Extension.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# SHOW
|
18
18
|
def show
|
19
19
|
@script_extensions = Script::Extension.friendly.find(params[:id])
|
20
20
|
@versions = Phcscriptcdnpro::ExtensionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Extension')
|
21
21
|
end
|
22
22
|
|
23
|
-
# NEW
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@script_extension = Script::Extension.new
|
26
26
|
end
|
27
27
|
|
28
|
-
# EDIT
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
# CREATE
|
32
|
+
# CREATE
|
33
33
|
def create
|
34
34
|
@script_extension = Script::Extension.new(script_extension_params)
|
35
35
|
@script_extension.user_id = current_user.id
|
36
|
-
@script_extension.org_id = current_user.org_id
|
37
36
|
if @script_extension.save
|
38
|
-
redirect_to script_extensions_url,
|
39
|
-
|
37
|
+
redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully created.' }
|
38
|
+
else
|
40
39
|
render :new
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @script_extension.update(script_extension_params)
|
47
|
-
redirect_to script_extensions_url,
|
48
|
-
|
49
|
-
|
46
|
+
redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
# DELETE
|
52
|
+
# DELETE
|
54
53
|
def destroy
|
55
54
|
@script_extension.destroy
|
56
|
-
redirect_to script_extensions_url,
|
55
|
+
redirect_to script_extensions_url, :flash => { :error => 'Extension was successfully destroyed.' }
|
57
56
|
end
|
58
57
|
|
59
58
|
private
|
60
59
|
|
61
60
|
# Common Callbacks
|
62
|
-
|
63
|
-
|
61
|
+
def set_script_extension
|
62
|
+
@script_extension = Script::Extension.friendly.find(params[:id])
|
64
63
|
end
|
65
64
|
|
66
65
|
# Whitelists
|
67
66
|
def script_extension_params
|
68
|
-
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id
|
67
|
+
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id)
|
69
68
|
end
|
70
69
|
|
71
70
|
end
|
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@script_licences = Script::Licence.
|
14
|
+
@script_licences = Script::Licence.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# SHOW
|
18
18
|
def show
|
19
19
|
@script_licences = Script::Licence.friendly.find(params[:id])
|
20
20
|
@versions = Phcscriptcdnpro::LicenceVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Licence')
|
21
21
|
end
|
22
22
|
|
23
|
-
# NEW
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@script_licence = Script::Licence.new
|
26
26
|
end
|
27
27
|
|
28
|
-
# EDIT
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
32
|
+
# CREATE
|
33
33
|
def create
|
34
34
|
@script_licence = Script::Licence.new(script_licence_params)
|
35
35
|
@script_licence.user_id = current_user.id
|
36
|
-
@script_licence.org_id = current_user.org_id
|
37
36
|
if @script_licence.save
|
38
|
-
redirect_to script_licences_url,
|
39
|
-
|
37
|
+
redirect_to script_licences_url, :flash => { :success => 'Licence was successfully created.' }
|
38
|
+
else
|
40
39
|
render :new
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @script_licence.update(script_licence_params)
|
47
|
-
redirect_to script_licences_url,
|
48
|
-
|
49
|
-
|
46
|
+
redirect_to script_licences_url, :flash => { :success => 'Licence was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
# DELETE
|
52
|
+
# DELETE
|
54
53
|
def destroy
|
55
54
|
@script_licence.destroy
|
56
|
-
redirect_to script_licences_url,
|
55
|
+
redirect_to script_licences_url, :flash => { :error => 'Licence was successfully destroyed.' }
|
57
56
|
end
|
58
57
|
|
59
58
|
private
|
@@ -9,51 +9,50 @@ module Phcscriptcdnpro
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@script_listings = Script::Listing.
|
14
|
+
@script_listings = Script::Listing.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# SHOW
|
18
18
|
def show
|
19
19
|
@script_listings = Script::Listing.friendly.find(params[:id])
|
20
20
|
@versions = Phcscriptcdnpro::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script_::Listing')
|
21
21
|
end
|
22
22
|
|
23
|
-
# NEW
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@script_listing = Script::Listing.new
|
26
26
|
end
|
27
27
|
|
28
|
-
# EDIT
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
32
|
+
# CREATE
|
33
33
|
def create
|
34
34
|
@script_listing = Script::Listing.new(script_listing_params)
|
35
35
|
@script_listing.user_id = current_user.id
|
36
|
-
@script_listing.org_id = current_user.org_id
|
37
36
|
if @script_listing.save
|
38
|
-
redirect_to script_listings_path,
|
37
|
+
redirect_to script_listings_path, :flash => { :success => 'Listing was successfully created.' }
|
39
38
|
else
|
40
39
|
render :new
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @script_listing.update(script_listing_params)
|
47
|
-
redirect_to script_listings_path,
|
46
|
+
redirect_to script_listings_path, :flash => { :success => 'Listing was successfully updated.' }
|
48
47
|
else
|
49
48
|
render :edit
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
# DELETE
|
52
|
+
# DELETE
|
54
53
|
def destroy
|
55
54
|
@script_listing.destroy
|
56
|
-
redirect_to script_listings_path,
|
55
|
+
redirect_to script_listings_path, :flash => { :error => 'Listing was successfully destroyed.' }
|
57
56
|
end
|
58
57
|
|
59
58
|
private
|
@@ -65,7 +64,7 @@ module Phcscriptcdnpro
|
|
65
64
|
|
66
65
|
# Whitelist
|
67
66
|
def script_listing_params
|
68
|
-
params.require(:script_listing).permit(:
|
67
|
+
params.require(:script_listing).permit(:script_title, :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, :version_id, :author_id, :licence_id)
|
69
68
|
end
|
70
69
|
|
71
70
|
end
|
@@ -9,58 +9,57 @@ module Phcscriptcdnpro
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_url, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
14
|
script_listing = Script::Listing.find(params[:listing_id])
|
15
15
|
@script_urls = script_listing.urls
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
18
|
+
# SHOW
|
19
19
|
def show
|
20
20
|
script_listing = Script::Listing.find(params[:listing_id])
|
21
21
|
@script_url = script_listing.urls.friendly.find(params[:id])
|
22
22
|
end
|
23
23
|
|
24
|
-
# NEW
|
24
|
+
# NEW
|
25
25
|
def new
|
26
26
|
script_listing = Script::Listing.find(params[:listing_id])
|
27
27
|
@script_url = script_listing.urls.build
|
28
28
|
end
|
29
29
|
|
30
|
-
# EDIT
|
30
|
+
# EDIT
|
31
31
|
def edit
|
32
32
|
script_listing = Script::Listing.find(params[:listing_id])
|
33
33
|
@script_url = script_listing.urls.find(params[:id])
|
34
34
|
end
|
35
35
|
|
36
|
-
#
|
36
|
+
# CREATE
|
37
37
|
def create
|
38
38
|
@script_listing = Script::Listing.find(params[:listing_id])
|
39
39
|
@script_url = @script_listing.urls.create(script_url_params)
|
40
40
|
@script_url.user_id = current_user.id
|
41
|
-
@script_url.org_id = current_user.org_id
|
42
41
|
if @script_url.save
|
43
|
-
redirect_to script_listing_urls_path,
|
44
|
-
|
45
|
-
|
42
|
+
redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully created.' }
|
43
|
+
else
|
44
|
+
render :new
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
49
|
-
#
|
48
|
+
# UPDATE
|
50
49
|
def update
|
51
50
|
if @script_url.update(script_url_params)
|
52
|
-
redirect_to script_listing_urls_path,
|
53
|
-
|
54
|
-
|
51
|
+
redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully updated.' }
|
52
|
+
else
|
53
|
+
render :edit
|
55
54
|
end
|
56
55
|
end
|
57
56
|
|
58
|
-
# DELETE
|
57
|
+
# DELETE
|
59
58
|
def destroy
|
60
59
|
@script_listing = Script::Listing.find(params[:listing_id])
|
61
60
|
@script_url = @script_listing.urls.find(params[:id])
|
62
61
|
@script_url.destroy
|
63
|
-
redirect_to script_listing_urls_path,
|
62
|
+
redirect_to script_listing_urls_path, :flash => { :error => 'Author was successfully destroyed.' }
|
64
63
|
end
|
65
64
|
|
66
65
|
private
|
@@ -72,7 +71,7 @@ module Phcscriptcdnpro
|
|
72
71
|
|
73
72
|
# Whitelists
|
74
73
|
def script_url_params
|
75
|
-
params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :
|
74
|
+
params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :listing_id, :version_id, :extension_id)
|
76
75
|
end
|
77
76
|
|
78
77
|
end
|