phcdevworks_scripts 8.1.1 → 9.0.1
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 +3 -28
- data/app/assets/config/phcdevworks_scripts_manifest.js +2 -3
- data/app/controllers/phcdevworks_scripts/application_controller.rb +13 -13
- data/app/controllers/phcdevworks_scripts/script/authors_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/extensions_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/listings_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/urls_controller.rb +78 -78
- data/app/controllers/phcdevworks_scripts/script/versions_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/snippet/posts_controller.rb +82 -82
- data/app/controllers/phcdevworks_scripts/snippet/urls_controller.rb +77 -77
- data/app/helpers/phcdevworks_scripts/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/authors_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/extensions_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/listings_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/urls_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/versions_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/snippet/posts_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/snippet/urls_helper.rb +4 -4
- data/app/jobs/phcdevworks_scripts/application_job.rb +4 -4
- data/app/mailers/phcdevworks_scripts/application_mailer.rb +6 -6
- data/app/models/phcdevworks_scripts/application_record.rb +5 -5
- data/app/models/phcdevworks_scripts/script/author.rb +33 -33
- data/app/models/phcdevworks_scripts/script/extension.rb +32 -32
- data/app/models/phcdevworks_scripts/script/listing.rb +38 -38
- data/app/models/phcdevworks_scripts/script/url.rb +24 -24
- data/app/models/phcdevworks_scripts/script/version.rb +26 -26
- data/app/models/phcdevworks_scripts/script.rb +7 -7
- data/app/models/phcdevworks_scripts/snippet/post.rb +28 -28
- data/app/models/phcdevworks_scripts/snippet/url.rb +19 -19
- data/app/models/phcdevworks_scripts/snippet.rb +7 -7
- data/app/models/phcdevworks_scripts/snippet_post_versions.rb +5 -5
- data/app/models/phcdevworks_scripts/snippet_url_versions.rb +5 -5
- data/app/views/layouts/phcdevworks_scripts/application.html.erb +58 -116
- data/app/views/layouts/phcdevworks_scripts/components/backend/footer/_footer.html.erb +10 -9
- data/app/views/layouts/phcdevworks_scripts/components/backend/navigation/_top_menu.html.erb +26 -25
- data/app/views/layouts/phcdevworks_scripts/components/backend/sidebars/_side_menu.html.erb +491 -349
- data/app/views/phcdevworks_scripts/script/authors/_form.html.erb +37 -37
- data/app/views/phcdevworks_scripts/script/authors/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/authors/index.html.erb +70 -78
- data/app/views/phcdevworks_scripts/script/authors/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/authors/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/extensions/_form.html.erb +32 -32
- data/app/views/phcdevworks_scripts/script/extensions/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/extensions/index.html.erb +65 -73
- data/app/views/phcdevworks_scripts/script/extensions/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/extensions/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/listings/_form.html.erb +73 -73
- data/app/views/phcdevworks_scripts/script/listings/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/script/listings/index.html.erb +68 -76
- data/app/views/phcdevworks_scripts/script/listings/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/script/listings/show.html.erb +48 -48
- data/app/views/phcdevworks_scripts/script/urls/_form.html.erb +42 -42
- data/app/views/phcdevworks_scripts/script/urls/edit.html.erb +52 -60
- data/app/views/phcdevworks_scripts/script/urls/index.html.erb +68 -76
- data/app/views/phcdevworks_scripts/script/urls/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/urls/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/versions/_form.html.erb +22 -22
- data/app/views/phcdevworks_scripts/script/versions/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/versions/index.html.erb +64 -72
- data/app/views/phcdevworks_scripts/script/versions/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/versions/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/snippet/posts/_form.html.erb +28 -28
- data/app/views/phcdevworks_scripts/snippet/posts/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/posts/index.html.erb +74 -82
- data/app/views/phcdevworks_scripts/snippet/posts/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/posts/show.html.erb +71 -71
- data/app/views/phcdevworks_scripts/snippet/urls/_form.html.erb +22 -22
- data/app/views/phcdevworks_scripts/snippet/urls/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/urls/index.html.erb +72 -80
- data/app/views/phcdevworks_scripts/snippet/urls/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/urls/show.html.erb +71 -71
- data/config/routes.rb +29 -33
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_scripts_script_extension_versions.rb +1 -1
- data/db/migrate/20170517064049_create_phcdevworks_scripts_script_listing_versions.rb +18 -18
- data/db/migrate/20170517064114_create_phcdevworks_scripts_script_version_versions.rb +18 -18
- data/db/migrate/20170517064150_create_phcdevworks_scripts_script_url_versions.rb +1 -1
- data/db/migrate/20170517064208_create_phcdevworks_scripts_script_author_versions.rb +18 -18
- data/db/migrate/20190818022002_create_phcdevworks_scripts_snippet_posts.rb +18 -18
- data/db/migrate/20190818022024_create_phcdevworks_scripts_snippet_urls.rb +17 -17
- data/db/migrate/20190818022939_create_phcdevworks_scripts_script_authors.rb +18 -18
- data/db/migrate/20190818023353_create_phcdevworks_scripts_script_listings.rb +29 -29
- data/db/migrate/20190818023709_create_phcdevworks_scripts_script_extensions.rb +17 -17
- data/db/migrate/20190818023911_create_phcdevworks_scripts_script_urls.rb +21 -21
- data/db/migrate/20190818031653_create_phcdevworks_scripts_script_versions.rb +15 -15
- data/db/migrate/20191102092649_create_phcdevworks_scripts_snippet_url_versions.rb +18 -18
- data/db/migrate/20191102092711_create_phcdevworks_scripts_snippet_post_versions.rb +18 -18
- data/lib/phcdevworks_scripts/engine.rb +45 -45
- data/lib/phcdevworks_scripts/version.rb +3 -3
- metadata +36 -87
- data/app/assets/stylesheets/phcdevworks_scripts/application.scss +0 -15
- data/app/assets/stylesheets/phcdevworks_scripts/script/authors.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/extensions.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/listings.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/urls.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/versions.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/posts.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/urls.scss +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc5e488519271cdbf014e2ae2ca75c4053b01dd8dd8aa41599a3aaa47e52c578
|
4
|
+
data.tar.gz: 7496b2afdfb026237cb2aa922aece06dcf7a8542628177f689b0e83a9e15918d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b07aab25583b3cf9e601555299929e26029d5897b374e441386ff507b447841e3ec92f78862baeea3f271aff04f41b982ce538a7e8978e86eaf85fe2077a656
|
7
|
+
data.tar.gz: 9ea78964ad06a2944c465bdfad2d6a513f0c3f3a4ab2354d4d03d251c274c8998e83538cfaa8e841ab976953c00e4c088f0793ec687371813030857c6fa23e14
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
## Usage
|
5
|
-
How to use my plugin.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
Add this line to your application's Gemfile:
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
gem 'phcdevworks_scripts'
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
```bash
|
16
|
-
$ bundle
|
17
|
-
```
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
```bash
|
21
|
-
$ gem install phcdevworks_scripts
|
22
|
-
```
|
23
|
-
|
24
|
-
## Contributing
|
25
|
-
Contribution directions go here.
|
26
|
-
|
27
|
-
## License
|
28
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
1
|
+
### Status
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/phcdevworks_scripts.svg)](https://badge.fury.io/rb/phcdevworks_scripts) [![Publish to Github.com](https://github.com/phcdevworks/phcdevworks_scripts/actions/workflows/publish_gem_github_com.yml/badge.svg)](https://github.com/phcdevworks/phcdevworks_scripts/actions/workflows/publish_gem_github_com.yml) [![Publish to Rubygems.org](https://github.com/phcdevworks/phcdevworks_scripts/actions/workflows/publish_gem_rubygems_org.yml/badge.svg)](https://github.com/phcdevworks/phcdevworks_scripts/actions/workflows/publish_gem_rubygems_org.yml)
|
@@ -1,3 +1,2 @@
|
|
1
|
-
//=
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.
|
3
|
-
//= link phcthemes_admin_panel_pack_coloradmin.js
|
1
|
+
//= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
|
2
|
+
//= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
# Security Filters
|
5
|
-
protect_from_forgery with: :exception
|
6
|
-
|
7
|
-
# Load Requried Helper Files
|
8
|
-
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
-
helper PhcdevworksNotifications::Engine.helpers
|
10
|
-
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
6
|
+
|
7
|
+
# Load Requried Helper Files
|
8
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
+
helper PhcdevworksNotifications::Engine.helpers
|
10
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -1,83 +1,83 @@
|
|
1
|
-
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksScripts
|
4
|
-
class Script::AuthorsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_script_author, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /script/authors
|
13
|
-
def index
|
14
|
-
@script_authors = Script::Author.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /script/authors/1
|
18
|
-
def show
|
19
|
-
@script_authors = Script::Author.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::ScriptAuthorVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Author')
|
21
|
-
end
|
22
|
-
|
23
|
-
# GET /script/authors/new
|
24
|
-
def new
|
25
|
-
@script_author = Script::Author.new
|
26
|
-
end
|
27
|
-
|
28
|
-
# GET /script/authors/1/edit
|
29
|
-
def edit
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /script/authors
|
33
|
-
def create
|
34
|
-
@script_author = Script::Author.new(script_author_params)
|
35
|
-
@script_author.user_id = current_user.id
|
36
|
-
@script_author.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @script_author.save
|
39
|
-
format.html { redirect_to script_authors_path, :flash => { :success => 'Author has been Added.' }}
|
40
|
-
format.json { render :show, status: :created, location: @script_author }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @script_author.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /script/authors/1
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @script_author.update(script_author_params)
|
52
|
-
format.html { redirect_to script_authors_path, :flash => { :notice => 'Author Name has been Updated.' }}
|
53
|
-
format.json { render :show, status: :ok, location: @script_author }
|
54
|
-
else
|
55
|
-
format.html { render :edit }
|
56
|
-
format.json { render json: @script_author.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# DELETE /script/authors/1
|
62
|
-
def destroy
|
63
|
-
@script_author.destroy
|
64
|
-
respond_to do |format|
|
65
|
-
format.html { redirect_to script_authors_path, :flash => { :error => 'Category and Connections have all been Removed.' }}
|
66
|
-
format.json { head :no_content }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
# Callback
|
73
|
-
def set_script_author
|
74
|
-
@script_author = Script::Author.friendly.find(params[:id])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Whitelist
|
78
|
-
def script_author_params
|
79
|
-
params.require(:script_author).permit(:script_author_first_name, :script_author_last_name, :script_author_website, :script_author_github, :slug, :user_id, :org_id)
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
1
|
+
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksScripts
|
4
|
+
class Script::AuthorsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_script_author, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /script/authors
|
13
|
+
def index
|
14
|
+
@script_authors = Script::Author.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /script/authors/1
|
18
|
+
def show
|
19
|
+
@script_authors = Script::Author.friendly.find(params[:id])
|
20
|
+
@versions = PhcdevworksScripts::ScriptAuthorVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Author')
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /script/authors/new
|
24
|
+
def new
|
25
|
+
@script_author = Script::Author.new
|
26
|
+
end
|
27
|
+
|
28
|
+
# GET /script/authors/1/edit
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
# POST /script/authors
|
33
|
+
def create
|
34
|
+
@script_author = Script::Author.new(script_author_params)
|
35
|
+
@script_author.user_id = current_user.id
|
36
|
+
@script_author.org_id = current_user.org_id
|
37
|
+
respond_to do |format|
|
38
|
+
if @script_author.save
|
39
|
+
format.html { redirect_to script_authors_path, :flash => { :success => 'Author has been Added.' }}
|
40
|
+
format.json { render :show, status: :created, location: @script_author }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @script_author.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# PATCH/PUT /script/authors/1
|
49
|
+
def update
|
50
|
+
respond_to do |format|
|
51
|
+
if @script_author.update(script_author_params)
|
52
|
+
format.html { redirect_to script_authors_path, :flash => { :notice => 'Author Name has been Updated.' }}
|
53
|
+
format.json { render :show, status: :ok, location: @script_author }
|
54
|
+
else
|
55
|
+
format.html { render :edit }
|
56
|
+
format.json { render json: @script_author.errors, status: :unprocessable_entity }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# DELETE /script/authors/1
|
62
|
+
def destroy
|
63
|
+
@script_author.destroy
|
64
|
+
respond_to do |format|
|
65
|
+
format.html { redirect_to script_authors_path, :flash => { :error => 'Category and Connections have all been Removed.' }}
|
66
|
+
format.json { head :no_content }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
# Callback
|
73
|
+
def set_script_author
|
74
|
+
@script_author = Script::Author.friendly.find(params[:id])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Whitelist
|
78
|
+
def script_author_params
|
79
|
+
params.require(:script_author).permit(:script_author_first_name, :script_author_last_name, :script_author_website, :script_author_github, :slug, :user_id, :org_id)
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -1,83 +1,83 @@
|
|
1
|
-
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksScripts
|
4
|
-
class Script::ExtensionsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /script/extensions
|
13
|
-
def index
|
14
|
-
@script_extensions = Script::Extension.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /script/extensions/1
|
18
|
-
def show
|
19
|
-
@script_extensions = Script::Extension.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::ScriptExtensionVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Extension')
|
21
|
-
end
|
22
|
-
|
23
|
-
# GET /script/extensions/new
|
24
|
-
def new
|
25
|
-
@script_extension = Script::Extension.new
|
26
|
-
end
|
27
|
-
|
28
|
-
# GET /script/extensions/1/edit
|
29
|
-
def edit
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /script/extensions
|
33
|
-
def create
|
34
|
-
@script_extension = Script::Extension.new(script_extension_params)
|
35
|
-
@script_extension.user_id = current_user.id
|
36
|
-
@script_extension.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @script_extension.save
|
39
|
-
format.html { redirect_to script_extensions_path, :flash => { :success => 'Script Extension has been Added.' }}
|
40
|
-
format.json { render :show, status: :created, location: @script_extension }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @script_extension.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /script/extensions/1
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @script_extension.update(script_extension_params)
|
52
|
-
format.html { redirect_to script_extensions_path, :flash => { :notice => 'Script Extension Name has been Updated.' }}
|
53
|
-
format.json { render :show, status: :ok, location: @script_extension }
|
54
|
-
else
|
55
|
-
format.html { render :edit }
|
56
|
-
format.json { render json: @script_extension.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# DELETE /script/extensions/1
|
62
|
-
def destroy
|
63
|
-
@script_extension.destroy
|
64
|
-
respond_to do |format|
|
65
|
-
format.html { redirect_to script_extensions_path, :flash => { :error => 'Script Extension and Connections have all been Removed.' }}
|
66
|
-
format.json { head :no_content }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
# Callback
|
73
|
-
def set_script_extension
|
74
|
-
@script_extension = Script::Extension.friendly.find(params[:id])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Whitelist
|
78
|
-
def script_extension_params
|
79
|
-
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id, :org_id)
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
1
|
+
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksScripts
|
4
|
+
class Script::ExtensionsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /script/extensions
|
13
|
+
def index
|
14
|
+
@script_extensions = Script::Extension.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /script/extensions/1
|
18
|
+
def show
|
19
|
+
@script_extensions = Script::Extension.friendly.find(params[:id])
|
20
|
+
@versions = PhcdevworksScripts::ScriptExtensionVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Extension')
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /script/extensions/new
|
24
|
+
def new
|
25
|
+
@script_extension = Script::Extension.new
|
26
|
+
end
|
27
|
+
|
28
|
+
# GET /script/extensions/1/edit
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
# POST /script/extensions
|
33
|
+
def create
|
34
|
+
@script_extension = Script::Extension.new(script_extension_params)
|
35
|
+
@script_extension.user_id = current_user.id
|
36
|
+
@script_extension.org_id = current_user.org_id
|
37
|
+
respond_to do |format|
|
38
|
+
if @script_extension.save
|
39
|
+
format.html { redirect_to script_extensions_path, :flash => { :success => 'Script Extension has been Added.' }}
|
40
|
+
format.json { render :show, status: :created, location: @script_extension }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @script_extension.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# PATCH/PUT /script/extensions/1
|
49
|
+
def update
|
50
|
+
respond_to do |format|
|
51
|
+
if @script_extension.update(script_extension_params)
|
52
|
+
format.html { redirect_to script_extensions_path, :flash => { :notice => 'Script Extension Name has been Updated.' }}
|
53
|
+
format.json { render :show, status: :ok, location: @script_extension }
|
54
|
+
else
|
55
|
+
format.html { render :edit }
|
56
|
+
format.json { render json: @script_extension.errors, status: :unprocessable_entity }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# DELETE /script/extensions/1
|
62
|
+
def destroy
|
63
|
+
@script_extension.destroy
|
64
|
+
respond_to do |format|
|
65
|
+
format.html { redirect_to script_extensions_path, :flash => { :error => 'Script Extension and Connections have all been Removed.' }}
|
66
|
+
format.json { head :no_content }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
# Callback
|
73
|
+
def set_script_extension
|
74
|
+
@script_extension = Script::Extension.friendly.find(params[:id])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Whitelist
|
78
|
+
def script_extension_params
|
79
|
+
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id, :org_id)
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -1,83 +1,83 @@
|
|
1
|
-
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksScripts
|
4
|
-
class Script::ListingsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /script/listings
|
13
|
-
def index
|
14
|
-
@script_listings = Script::Listing.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /script/listings/1
|
18
|
-
def show
|
19
|
-
@script_listings = Script::Listing.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::ScriptListingVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Listing')
|
21
|
-
end
|
22
|
-
|
23
|
-
# GET /script/listings/new
|
24
|
-
def new
|
25
|
-
@script_listing = Script::Listing.new
|
26
|
-
end
|
27
|
-
|
28
|
-
# GET /script/listings/1/edit
|
29
|
-
def edit
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /script/listings
|
33
|
-
def create
|
34
|
-
@script_listing = Script::Listing.new(script_listing_params)
|
35
|
-
@script_listing.user_id = current_user.id
|
36
|
-
@script_listing.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @script_listing.save
|
39
|
-
format.html { redirect_to script_listings_path, :flash => { :success => 'Script Listing has been Added.' }}
|
40
|
-
format.json { render :show, status: :created, location: @script_listing }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @script_listing.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /script/listings/1
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @script_listing.update(script_listing_params)
|
52
|
-
format.html { redirect_to script_listings_path, :flash => { :notice => 'Script Listing has been Updated.' }}
|
53
|
-
format.json { render :show, status: :ok, location: @script_listing }
|
54
|
-
else
|
55
|
-
format.html { render :edit }
|
56
|
-
format.json { render json: @script_listing.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# DELETE /script/listings/1
|
62
|
-
def destroy
|
63
|
-
@script_listing.destroy
|
64
|
-
respond_to do |format|
|
65
|
-
format.html { redirect_to script_listings_path, :flash => { :error => 'Script Listing and Connections have all been Removed.' }}
|
66
|
-
format.json { head :no_content }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
# Callback
|
73
|
-
def set_script_listing
|
74
|
-
@script_listing = Script::Listing.friendly.find(params[:id])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Whitelist
|
78
|
-
def script_listing_params
|
79
|
-
params.require(:script_listing).permit(:script_listing_title, :script_listing_description, :script_listing_script_source, :script_listing_script_website, :script_listing_script_repo, :script_listing_script_initial_release, :listing_script_lastest_release, :script_listing_script_beta_release, :script_listing_script_lastest_release, :script_listing_script_lastest_release_cdn, :author_id, :slug, :user_id, :org_id)
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
1
|
+
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksScripts
|
4
|
+
class Script::ListingsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /script/listings
|
13
|
+
def index
|
14
|
+
@script_listings = Script::Listing.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /script/listings/1
|
18
|
+
def show
|
19
|
+
@script_listings = Script::Listing.friendly.find(params[:id])
|
20
|
+
@versions = PhcdevworksScripts::ScriptListingVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Listing')
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /script/listings/new
|
24
|
+
def new
|
25
|
+
@script_listing = Script::Listing.new
|
26
|
+
end
|
27
|
+
|
28
|
+
# GET /script/listings/1/edit
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
# POST /script/listings
|
33
|
+
def create
|
34
|
+
@script_listing = Script::Listing.new(script_listing_params)
|
35
|
+
@script_listing.user_id = current_user.id
|
36
|
+
@script_listing.org_id = current_user.org_id
|
37
|
+
respond_to do |format|
|
38
|
+
if @script_listing.save
|
39
|
+
format.html { redirect_to script_listings_path, :flash => { :success => 'Script Listing has been Added.' }}
|
40
|
+
format.json { render :show, status: :created, location: @script_listing }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @script_listing.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# PATCH/PUT /script/listings/1
|
49
|
+
def update
|
50
|
+
respond_to do |format|
|
51
|
+
if @script_listing.update(script_listing_params)
|
52
|
+
format.html { redirect_to script_listings_path, :flash => { :notice => 'Script Listing has been Updated.' }}
|
53
|
+
format.json { render :show, status: :ok, location: @script_listing }
|
54
|
+
else
|
55
|
+
format.html { render :edit }
|
56
|
+
format.json { render json: @script_listing.errors, status: :unprocessable_entity }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# DELETE /script/listings/1
|
62
|
+
def destroy
|
63
|
+
@script_listing.destroy
|
64
|
+
respond_to do |format|
|
65
|
+
format.html { redirect_to script_listings_path, :flash => { :error => 'Script Listing and Connections have all been Removed.' }}
|
66
|
+
format.json { head :no_content }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
# Callback
|
73
|
+
def set_script_listing
|
74
|
+
@script_listing = Script::Listing.friendly.find(params[:id])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Whitelist
|
78
|
+
def script_listing_params
|
79
|
+
params.require(:script_listing).permit(:script_listing_title, :script_listing_description, :script_listing_script_source, :script_listing_script_website, :script_listing_script_repo, :script_listing_script_initial_release, :listing_script_lastest_release, :script_listing_script_beta_release, :script_listing_script_lastest_release, :script_listing_script_lastest_release_cdn, :author_id, :slug, :user_id, :org_id)
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|