phcscriptcdnpro 5.8.4 → 5.8.5
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 +5 -6
- data/Rakefile +11 -14
- data/app/controllers/phcscriptcdnpro/application_controller.rb +48 -46
- data/app/controllers/phcscriptcdnpro/frontend/listings_controller.rb +4 -2
- data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +70 -70
- data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +70 -70
- data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +70 -70
- data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +70 -70
- data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +79 -79
- data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +71 -69
- data/app/helpers/phcscriptcdnpro/application_helper.rb +9 -10
- data/app/jobs/phcscriptcdnpro/application_job.rb +2 -3
- data/app/mailers/phcscriptcdnpro/application_mailer.rb +4 -4
- data/app/models/phcscriptcdnpro/application_record.rb +3 -3
- data/app/models/phcscriptcdnpro/frontend.rb +2 -0
- data/app/models/phcscriptcdnpro/frontend/listing.rb +1 -2
- data/app/models/phcscriptcdnpro/script.rb +5 -5
- data/app/models/phcscriptcdnpro/script/author.rb +5 -5
- data/app/models/phcscriptcdnpro/script/extension.rb +6 -6
- data/app/models/phcscriptcdnpro/script/licence.rb +5 -5
- data/app/models/phcscriptcdnpro/script/listing.rb +13 -11
- data/app/models/phcscriptcdnpro/script/url.rb +9 -9
- data/app/models/phcscriptcdnpro/script/version.rb +7 -7
- data/app/views/layouts/phcscriptcdnpro/application.html.erb +6 -7
- data/app/views/layouts/phcscriptcdnpro/components/backend/footer/_footer.html.erb +1 -1
- data/app/views/layouts/phcscriptcdnpro/components/backend/navigation/_top_bar.html.erb +0 -1
- data/app/views/layouts/phcscriptcdnpro/components/backend/sidebars/_left_sidebar.html.erb +1 -2
- data/app/views/layouts/phcscriptcdnpro/frontend.html.erb +14 -16
- data/app/views/phcscriptcdnpro/frontend/listings/index.html.erb +30 -30
- data/app/views/phcscriptcdnpro/frontend/listings/show.html.erb +12 -12
- data/app/views/phcscriptcdnpro/script/authors/_form.html.erb +6 -0
- data/app/views/phcscriptcdnpro/script/authors/edit.html.erb +6 -7
- data/app/views/phcscriptcdnpro/script/authors/index.html.erb +19 -23
- data/app/views/phcscriptcdnpro/script/authors/new.html.erb +6 -7
- data/app/views/phcscriptcdnpro/script/authors/show.html.erb +6 -6
- data/app/views/phcscriptcdnpro/script/extensions/_form.html.erb +6 -0
- data/app/views/phcscriptcdnpro/script/extensions/edit.html.erb +8 -9
- data/app/views/phcscriptcdnpro/script/extensions/index.html.erb +6 -8
- data/app/views/phcscriptcdnpro/script/extensions/new.html.erb +8 -9
- data/app/views/phcscriptcdnpro/script/extensions/show.html.erb +7 -9
- data/app/views/phcscriptcdnpro/script/licences/_form.html.erb +7 -0
- data/app/views/phcscriptcdnpro/script/licences/edit.html.erb +6 -7
- data/app/views/phcscriptcdnpro/script/licences/index.html.erb +10 -12
- data/app/views/phcscriptcdnpro/script/licences/new.html.erb +6 -7
- data/app/views/phcscriptcdnpro/script/licences/show.html.erb +5 -7
- data/app/views/phcscriptcdnpro/script/listings/_form.html.erb +7 -1
- data/app/views/phcscriptcdnpro/script/listings/edit.html.erb +15 -0
- data/app/views/phcscriptcdnpro/script/listings/index.html.erb +14 -4
- data/app/views/phcscriptcdnpro/script/listings/new.html.erb +15 -0
- data/app/views/phcscriptcdnpro/script/listings/show.html.erb +14 -0
- data/app/views/phcscriptcdnpro/script/urls/_form.html.erb +6 -0
- data/app/views/phcscriptcdnpro/script/urls/edit.html.erb +17 -6
- data/app/views/phcscriptcdnpro/script/urls/index.html.erb +14 -7
- data/app/views/phcscriptcdnpro/script/urls/new.html.erb +17 -7
- data/app/views/phcscriptcdnpro/script/urls/show.html.erb +14 -10
- data/app/views/phcscriptcdnpro/script/versions/_form.html.erb +7 -0
- data/app/views/phcscriptcdnpro/script/versions/edit.html.erb +12 -8
- data/app/views/phcscriptcdnpro/script/versions/index.html.erb +11 -5
- data/app/views/phcscriptcdnpro/script/versions/new.html.erb +12 -8
- data/app/views/phcscriptcdnpro/script/versions/show.html.erb +11 -6
- data/config/routes.rb +21 -26
- data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +23 -23
- data/db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb +17 -17
- data/db/migrate/20160821183735_create_phcscriptcdnpro_script_extensions.rb +12 -12
- data/db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb +18 -18
- data/db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb +16 -16
- data/db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb +10 -10
- data/lib/phcscriptcdnpro/engine.rb +62 -61
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +2 -2
@@ -1,74 +1,76 @@
|
|
1
1
|
require_dependency "phcscriptcdnpro/application_controller"
|
2
2
|
|
3
3
|
module Phcscriptcdnpro
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
4
|
+
class Script::VersionsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
before_action :require_user
|
8
|
+
before_action :set_script_version, only: [:show, :edit, :update, :destroy]
|
9
|
+
|
10
|
+
# INDEX - Script Versions
|
11
|
+
def index
|
12
|
+
@script_versions = Script::Version.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# DETAILS - Script Versions
|
16
|
+
def show
|
17
|
+
end
|
18
|
+
|
19
|
+
# NEW - Script Versions
|
20
|
+
def new
|
21
|
+
@script_version = Script::Version.new
|
22
|
+
end
|
23
|
+
|
24
|
+
# EDIT - Script Versions
|
25
|
+
def edit
|
26
|
+
end
|
27
|
+
|
28
|
+
# POST - Script Versions
|
29
|
+
def create
|
30
|
+
@script_version = Script::Version.new(script_version_params)
|
31
|
+
@script_version.user_id = current_user.id
|
32
|
+
@script_version.user_name = current_user.username
|
33
|
+
@script_version.membership_id = membership_info.id
|
34
|
+
@script_version.oganization_id = membership_info.org_id
|
35
|
+
if @script_version.save
|
36
|
+
redirect_to script_versions_url, notice: 'Version was successfully created.'
|
37
|
+
else
|
38
|
+
render :new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# PATCH/PUT - Script Versions
|
43
|
+
def update
|
44
|
+
@script_version.user_id = current_user.id
|
45
|
+
@script_version.user_name = current_user.username
|
46
|
+
@script_version.membership_id = membership_info.id
|
47
|
+
@script_version.oganization_id = membership_info.org_id
|
48
|
+
if @script_version.update(script_version_params)
|
49
|
+
redirect_to script_versions_url, notice: 'Version was successfully updated.'
|
50
|
+
else
|
51
|
+
render :edit
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# DELETE - Script Versions
|
56
|
+
def destroy
|
57
|
+
@script_version.destroy
|
58
|
+
redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# Common Callbacks
|
64
|
+
def set_script_version
|
65
|
+
@script_version = Script::Version.find(params[:id])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Only allow a trusted parameter "white list" through.
|
69
|
+
def script_version_params
|
70
|
+
params.require(:script_version).permit(:scriptversion, :user_id, :user_name, :membership_id, :oganization_id)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
67
75
|
|
68
|
-
# Only allow a trusted parameter "white list" through.
|
69
|
-
def script_version_params
|
70
|
-
params.require(:script_version).permit(:scriptversion, :user_id, :user_name, :membership_id, :oganization_id)
|
71
|
-
end
|
72
76
|
|
73
|
-
end
|
74
|
-
end
|
@@ -1,15 +1,14 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
module ApplicationHelper
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
# Add Active to Menu
|
5
|
+
def is_active_controller(controller_name)
|
6
|
+
params[:controller] == controller_name ? "active open selected" : nil
|
7
|
+
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
def is_active_action(action_name)
|
10
|
+
params[:action] == action_name ? "active" : nil
|
11
|
+
end
|
12
12
|
|
13
|
-
|
14
|
-
end
|
13
|
+
end
|
15
14
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class ApplicationMailer < ActionMailer::Base
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
default from: 'no-reply@phcnetworks.net'
|
5
|
+
layout 'mailer'
|
6
6
|
|
7
|
-
|
7
|
+
end
|
8
8
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Author < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# Listing (None Nested)
|
7
|
+
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
|
8
8
|
|
9
|
-
|
9
|
+
end
|
10
10
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Extension < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
# URLs & Extensions (None Nested)
|
7
|
+
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing', :through => :urls
|
8
|
+
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
9
9
|
|
10
|
-
|
10
|
+
end
|
11
11
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Licence < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# Listing (None Nested)
|
7
|
+
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
|
8
8
|
|
9
|
-
|
9
|
+
end
|
10
10
|
end
|
@@ -1,19 +1,21 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Listing < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# Attach to URL (Nested)
|
7
|
+
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
# Attach to Author (None Nested)
|
10
|
+
belongs_to :author, class_name: 'Phcscriptcdnpro::Script::Author'
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
# Attach to Version (None Nested)
|
13
|
+
belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version'
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
# Attach to Licence (None Nested)
|
16
|
+
belongs_to :licence, class_name: 'Phcscriptcdnpro::Script::Licence'
|
17
17
|
|
18
|
-
|
18
|
+
end
|
19
19
|
end
|
20
|
+
|
21
|
+
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Url < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# Attach to Listings (Nested)
|
7
|
+
belongs_to :listing, class_name: 'Phcscriptcdnpro::Script::Listing'
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
# Attach to Version (None Nested)
|
10
|
+
belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version'
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
# Attach to Extension (None Nested)
|
13
|
+
belongs_to :extension, class_name: 'Phcscriptcdnpro::Script::Extension'
|
14
14
|
|
15
|
-
|
15
|
+
end
|
16
16
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Phcscriptcdnpro
|
2
|
-
|
2
|
+
class Script::Version < ApplicationRecord
|
3
3
|
|
4
|
-
|
4
|
+
# Relationships
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# Attach to Listing (None Nested)
|
7
|
+
has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
# Attach to URL (None Nested)
|
10
|
+
has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
|
11
11
|
|
12
|
-
|
12
|
+
end
|
13
13
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
|
3
|
+
<head>
|
4
4
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title><%= content_for?(:title) ? yield(:title) : "PHCScriptCDN - Rails Script Listing Engine" %></title>
|
@@ -9,16 +9,15 @@
|
|
9
9
|
|
10
10
|
<!-- Font -->
|
11
11
|
<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"/>
|
12
|
-
|
12
|
+
|
13
13
|
<!-- Requried Style Sheets -->
|
14
14
|
<%= stylesheet_link_tag "phcscriptcdnpro/application", media: "all", 'data-turbolinks-track': 'reload' %>
|
15
|
-
|
15
|
+
|
16
16
|
<!-- Security -->
|
17
17
|
<%= csrf_meta_tags %>
|
18
18
|
|
19
|
-
|
19
|
+
</head>
|
20
20
|
<body>
|
21
|
-
|
22
21
|
<div id="wrapper" class="<%= params[:controller] %>.<%= params[:action] %>">
|
23
22
|
<nav class="navbar-default navbar-static-side" role="navigation">
|
24
23
|
<%= render 'layouts/phcscriptcdnpro/components/backend/sidebars/left_sidebar' %>
|
@@ -34,9 +33,9 @@
|
|
34
33
|
</div>
|
35
34
|
<%= render 'layouts/phcscriptcdnpro/components/backend/sidebars/right_sidebar' %>
|
36
35
|
</div>
|
37
|
-
|
36
|
+
|
38
37
|
<!-- Requried JavaScripts -->
|
39
38
|
<%= javascript_include_tag "phcscriptcdnpro/application", 'data-turbolinks-track': 'reload' %>
|
40
|
-
|
39
|
+
|
41
40
|
</body>
|
42
41
|
</html>
|
@@ -13,7 +13,6 @@
|
|
13
13
|
</a>
|
14
14
|
<ul class="dropdown-menu animated fadeInRight m-t-xs">
|
15
15
|
<li>
|
16
|
-
|
17
16
|
</li>
|
18
17
|
</ul>
|
19
18
|
</div>
|
@@ -42,7 +41,7 @@
|
|
42
41
|
</ul>
|
43
42
|
</li>
|
44
43
|
<li class="<%= is_active_controller('phcmemberspro/directory/categories') %>">
|
45
|
-
|
44
|
+
<a href=""><i class="fa fa-sitemap"></i> <span class="nav-label">Directories & Listings</span> <span class="fa arrow"></span></a>
|
46
45
|
<ul class="nav nav-second-level collapse">
|
47
46
|
<li class="<%= is_active_controller('phcmemberspro/directory/categories') %>"><%= link_to "Category List", phcmemberspro.directory_categories_path %></li>
|
48
47
|
<li class="<%= is_active_controller('phcmemberspro/directory/categories#new') %>"><%= link_to "Add a Category", phcmemberspro.new_directory_category_path %></li>
|