phcscriptcdn 51.0.0 → 52.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/app/assets/javascripts/phcscriptcdn/application.js +1 -1
- data/app/controllers/phcscriptcdn/application_controller.rb +15 -20
- data/app/controllers/phcscriptcdn/script/authors_controller.rb +13 -13
- data/app/controllers/phcscriptcdn/script/extensions_controller.rb +15 -15
- data/app/controllers/phcscriptcdn/script/licences_controller.rb +13 -13
- data/app/controllers/phcscriptcdn/script/listings_controller.rb +11 -11
- data/app/controllers/phcscriptcdn/script/urls_controller.rb +14 -14
- data/app/controllers/phcscriptcdn/script/versions_controller.rb +15 -15
- data/app/models/phcscriptcdn/application_record.rb +0 -2
- data/app/models/phcscriptcdn/script.rb +0 -2
- data/app/models/phcscriptcdn/script/author.rb +16 -7
- data/app/models/phcscriptcdn/script/extension.rb +5 -8
- data/app/models/phcscriptcdn/script/licence.rb +5 -8
- data/app/models/phcscriptcdn/script/listing.rb +12 -17
- data/app/models/phcscriptcdn/script/url.rb +4 -16
- data/app/models/phcscriptcdn/script/version.rb +6 -9
- data/app/views/layouts/phcscriptcdn/application.html.erb +6 -5
- data/app/views/layouts/phcscriptcdn/components/backend/footer/_footer.html.erb +5 -5
- data/app/views/layouts/phcscriptcdn/components/backend/sidebars/_side_menu.html.erb +60 -25
- data/app/views/phcscriptcdn/script/authors/_form.html.erb +6 -5
- data/app/views/phcscriptcdn/script/authors/edit.html.erb +4 -4
- data/app/views/phcscriptcdn/script/authors/index.html.erb +19 -15
- data/app/views/phcscriptcdn/script/authors/new.html.erb +4 -4
- data/app/views/phcscriptcdn/script/authors/show.html.erb +1 -4
- data/app/views/phcscriptcdn/script/extensions/_form.html.erb +5 -4
- data/app/views/phcscriptcdn/script/extensions/edit.html.erb +4 -7
- data/app/views/phcscriptcdn/script/extensions/index.html.erb +19 -15
- data/app/views/phcscriptcdn/script/extensions/new.html.erb +4 -6
- data/app/views/phcscriptcdn/script/extensions/show.html.erb +1 -4
- data/app/views/phcscriptcdn/script/licences/_form.html.erb +10 -9
- data/app/views/phcscriptcdn/script/licences/edit.html.erb +4 -6
- data/app/views/phcscriptcdn/script/licences/index.html.erb +19 -15
- data/app/views/phcscriptcdn/script/licences/new.html.erb +4 -6
- data/app/views/phcscriptcdn/script/licences/show.html.erb +1 -4
- data/app/views/phcscriptcdn/script/listings/_form.html.erb +21 -17
- data/app/views/phcscriptcdn/script/listings/edit.html.erb +4 -4
- data/app/views/phcscriptcdn/script/listings/index.html.erb +24 -19
- data/app/views/phcscriptcdn/script/listings/new.html.erb +6 -5
- data/app/views/phcscriptcdn/script/listings/show.html.erb +3 -5
- data/app/views/phcscriptcdn/script/urls/_form.html.erb +7 -6
- data/app/views/phcscriptcdn/script/urls/edit.html.erb +15 -5
- data/app/views/phcscriptcdn/script/urls/index.html.erb +19 -15
- data/app/views/phcscriptcdn/script/urls/new.html.erb +4 -6
- data/app/views/phcscriptcdn/script/urls/show.html.erb +1 -4
- data/app/views/phcscriptcdn/script/versions/_form.html.erb +3 -2
- data/app/views/phcscriptcdn/script/versions/edit.html.erb +4 -6
- data/app/views/phcscriptcdn/script/versions/index.html.erb +19 -15
- data/app/views/phcscriptcdn/script/versions/new.html.erb +4 -6
- data/app/views/phcscriptcdn/script/versions/show.html.erb +1 -4
- data/config/routes.rb +19 -20
- data/db/migrate/20160821183652_create_phcscriptcdn_script_listings.rb +1 -1
- data/lib/phcscriptcdn/engine.rb +16 -15
- data/lib/phcscriptcdn/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 516dcc20e892c6e239d4932a54b77cb7404d2803a0d9cc5be87cd7b49b0ec593
|
4
|
+
data.tar.gz: 55c2a789bf7dac6b392f4db09cfed925ac89712dd88a8617b773b9d001e636b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42111c83741814b3cbdd6ce3d62e37a92a975b11e8987123172eb7a644946e62d746006375eb2b61f0240cc652e35b60c37c9c88b13db4bca88fbe48654ce7ca
|
7
|
+
data.tar.gz: 7c750ec9f253d44f971a133e1d76d7fea32e4002746fc0f55ee352db32683813be6140f99045e60a708cf956c244302b6d9c05de09effb416ce0d56abcccb707
|
data/MIT-LICENSE
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Load Admin Theme
|
2
|
-
//= require phc_admin_theme_scripts_four
|
2
|
+
//= require phc_admin_theme_scripts_four
|
@@ -1,27 +1,22 @@
|
|
1
1
|
module Phcscriptcdn
|
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 Phccorehelpers::Engine.helpers
|
9
|
+
helper Phcmenus::Engine.helpers
|
10
|
+
helper Phctitleseo::Engine.helpers
|
11
|
+
helper Phcnotifi::Engine.helpers
|
12
|
+
helper Phcaccounts::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,50 +9,50 @@ module Phcscriptcdn
|
|
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
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 = Phcscriptcdn::AuthorVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
|
if @script_author.save
|
37
|
-
redirect_to script_authors_url,
|
38
|
-
|
37
|
+
redirect_to script_authors_url, :flash => { :success => 'Author was successfully created.' }
|
38
|
+
else
|
39
39
|
render :new
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
#
|
43
|
+
# UPDATE
|
44
44
|
def update
|
45
45
|
if @script_author.update(script_author_params)
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
redirect_to script_authors_url, :flash => { :success => 'Author was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# DELETE
|
52
|
+
# DELETE
|
53
53
|
def destroy
|
54
54
|
@script_author.destroy
|
55
|
-
redirect_to script_authors_url,
|
55
|
+
redirect_to script_authors_url, :flash => { :error => 'Author was successfully destroyed.' }
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -9,57 +9,57 @@ module Phcscriptcdn
|
|
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
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 = Phcscriptcdn::ExtensionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
|
if @script_extension.save
|
37
|
-
redirect_to script_extensions_url,
|
38
|
-
|
37
|
+
redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully created.' }
|
38
|
+
else
|
39
39
|
render :new
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
#
|
43
|
+
# UPDATE
|
44
44
|
def update
|
45
45
|
if @script_extension.update(script_extension_params)
|
46
|
-
redirect_to script_extensions_url,
|
47
|
-
|
48
|
-
|
46
|
+
redirect_to script_extensions_url, :flash => { :success => 'Extension was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# DELETE
|
52
|
+
# DELETE
|
53
53
|
def destroy
|
54
54
|
@script_extension.destroy
|
55
|
-
redirect_to script_extensions_url,
|
55
|
+
redirect_to script_extensions_url, :flash => { :error => 'Extension was successfully destroyed.' }
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
59
59
|
|
60
60
|
# Common Callbacks
|
61
|
-
|
62
|
-
|
61
|
+
def set_script_extension
|
62
|
+
@script_extension = Script::Extension.friendly.find(params[:id])
|
63
63
|
end
|
64
64
|
|
65
65
|
# Whitelists
|
@@ -9,50 +9,50 @@ module Phcscriptcdn
|
|
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
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 = Phcscriptcdn::LicenceVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
|
if @script_licence.save
|
37
|
-
redirect_to script_licences_url,
|
38
|
-
|
37
|
+
redirect_to script_licences_url, :flash => { :success => 'Licence was successfully created.' }
|
38
|
+
else
|
39
39
|
render :new
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
#
|
43
|
+
# UPDATE
|
44
44
|
def update
|
45
45
|
if @script_licence.update(script_licence_params)
|
46
|
-
redirect_to script_licences_url,
|
47
|
-
|
48
|
-
|
46
|
+
redirect_to script_licences_url, :flash => { :success => 'Licence was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# DELETE
|
52
|
+
# DELETE
|
53
53
|
def destroy
|
54
54
|
@script_licence.destroy
|
55
|
-
redirect_to script_licences_url,
|
55
|
+
redirect_to script_licences_url, :flash => { :error => 'Licence was successfully destroyed.' }
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -9,50 +9,50 @@ module Phcscriptcdn
|
|
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
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 = Phcscriptcdn::ListingVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::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
36
|
if @script_listing.save
|
37
|
-
redirect_to script_listings_path,
|
37
|
+
redirect_to script_listings_path, :flash => { :success => 'Listing was successfully created.' }
|
38
38
|
else
|
39
39
|
render :new
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
#
|
43
|
+
# UPDATE
|
44
44
|
def update
|
45
45
|
if @script_listing.update(script_listing_params)
|
46
|
-
redirect_to script_listings_path,
|
46
|
+
redirect_to script_listings_path, :flash => { :success => 'Listing was successfully updated.' }
|
47
47
|
else
|
48
48
|
render :edit
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# DELETE
|
52
|
+
# DELETE
|
53
53
|
def destroy
|
54
54
|
@script_listing.destroy
|
55
|
-
redirect_to script_listings_path,
|
55
|
+
redirect_to script_listings_path, :flash => { :error => 'Listing was successfully destroyed.' }
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -64,7 +64,7 @@ module Phcscriptcdn
|
|
64
64
|
|
65
65
|
# Whitelist
|
66
66
|
def script_listing_params
|
67
|
-
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)
|
68
68
|
end
|
69
69
|
|
70
70
|
end
|
@@ -9,57 +9,57 @@ module Phcscriptcdn
|
|
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
41
|
if @script_url.save
|
42
|
-
redirect_to script_listing_urls_path,
|
43
|
-
|
44
|
-
|
42
|
+
redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully created.' }
|
43
|
+
else
|
44
|
+
render :new
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
#
|
48
|
+
# UPDATE
|
49
49
|
def update
|
50
50
|
if @script_url.update(script_url_params)
|
51
|
-
redirect_to script_listing_urls_path,
|
52
|
-
|
53
|
-
|
51
|
+
redirect_to script_listing_urls_path, :flash => { :success => 'Author was successfully updated.' }
|
52
|
+
else
|
53
|
+
render :edit
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
# DELETE
|
57
|
+
# DELETE
|
58
58
|
def destroy
|
59
59
|
@script_listing = Script::Listing.find(params[:listing_id])
|
60
60
|
@script_url = @script_listing.urls.find(params[:id])
|
61
61
|
@script_url.destroy
|
62
|
-
redirect_to script_listing_urls_path,
|
62
|
+
redirect_to script_listing_urls_path, :flash => { :error => 'Author was successfully destroyed.' }
|
63
63
|
end
|
64
64
|
|
65
65
|
private
|
@@ -9,50 +9,50 @@ module Phcscriptcdn
|
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_script_version, only: [:show, :edit, :update, :destroy]
|
11
11
|
|
12
|
-
# INDEX
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
14
|
@script_versions = Script::Version.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# SHOW
|
18
18
|
def show
|
19
19
|
@script_versions = Script::Version.friendly.find(params[:id])
|
20
20
|
@versions = Phcscriptcdn::ScriptversionVersions.where(item_id: params[:id], item_type: 'Phcscriptcdn::Script::Version')
|
21
21
|
end
|
22
22
|
|
23
|
-
# NEW
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@script_version = Script::Version.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_version = Script::Version.new(script_version_params)
|
35
35
|
@script_version.user_id = current_user.id
|
36
36
|
if @script_version.save
|
37
|
-
redirect_to script_versions_url,
|
38
|
-
|
39
|
-
|
37
|
+
redirect_to script_versions_url, :flash => { :success => 'Version was successfully created.' }
|
38
|
+
else
|
39
|
+
render :new
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
#
|
43
|
+
# UPDATE
|
44
44
|
def update
|
45
45
|
if @script_version.update(script_version_params)
|
46
|
-
redirect_to script_versions_url,
|
47
|
-
|
48
|
-
|
46
|
+
redirect_to script_versions_url, :flash => { :success => 'Version was successfully updated.' }
|
47
|
+
else
|
48
|
+
render :edit
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# DELETE
|
52
|
+
# DELETE
|
53
53
|
def destroy
|
54
54
|
@script_version.destroy
|
55
|
-
redirect_to script_versions_url,
|
55
|
+
redirect_to script_versions_url, :flash => { :error => 'Version was successfully destroyed.' }
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -62,7 +62,7 @@ module Phcscriptcdn
|
|
62
62
|
@script_version = Script::Version.friendly.find(params[:id])
|
63
63
|
end
|
64
64
|
|
65
|
-
#
|
65
|
+
# Whitelist
|
66
66
|
def script_version_params
|
67
67
|
params.require(:script_version).permit(:script_version_number, :slug, :user_id, :org_id)
|
68
68
|
end
|