phcdevworks_scripts 8.1.1 → 8.2.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 +20 -20
- data/README.md +1 -28
- data/Rakefile +8 -8
- data/app/assets/config/phcdevworks_scripts_manifest.js +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/application.scss +15 -15
- data/app/assets/stylesheets/phcdevworks_scripts/script/authors.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/extensions.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/listings.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/urls.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/versions.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/posts.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/urls.scss +3 -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/script_author_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_extension_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_listing_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_url_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_version_versions.rb +0 -0
- 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 +131 -131
- data/app/views/layouts/phcdevworks_scripts/components/backend/footer/_footer.html.erb +0 -0
- data/app/views/layouts/phcdevworks_scripts/components/backend/navigation/_top_menu.html.erb +0 -0
- data/app/views/layouts/phcdevworks_scripts/components/backend/sidebars/_side_menu.html.erb +0 -0
- data/app/views/phcdevworks_scripts/script/authors/_form.html.erb +37 -37
- data/app/views/phcdevworks_scripts/script/authors/edit.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/authors/index.html.erb +78 -78
- data/app/views/phcdevworks_scripts/script/authors/new.html.erb +49 -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 +49 -49
- data/app/views/phcdevworks_scripts/script/extensions/index.html.erb +73 -73
- data/app/views/phcdevworks_scripts/script/extensions/new.html.erb +49 -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 +47 -47
- data/app/views/phcdevworks_scripts/script/listings/index.html.erb +76 -76
- data/app/views/phcdevworks_scripts/script/listings/new.html.erb +47 -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 +60 -60
- data/app/views/phcdevworks_scripts/script/urls/index.html.erb +76 -76
- data/app/views/phcdevworks_scripts/script/urls/new.html.erb +49 -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 +49 -49
- data/app/views/phcdevworks_scripts/script/versions/index.html.erb +72 -72
- data/app/views/phcdevworks_scripts/script/versions/new.html.erb +49 -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 +47 -47
- data/app/views/phcdevworks_scripts/snippet/posts/index.html.erb +82 -82
- data/app/views/phcdevworks_scripts/snippet/posts/new.html.erb +47 -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 +47 -47
- data/app/views/phcdevworks_scripts/snippet/urls/index.html.erb +80 -80
- data/app/views/phcdevworks_scripts/snippet/urls/new.html.erb +47 -47
- data/app/views/phcdevworks_scripts/snippet/urls/show.html.erb +71 -71
- data/config/routes.rb +33 -33
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_scripts_script_extension_versions.rb +0 -0
- 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 +0 -0
- 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 +47 -47
- data/lib/phcdevworks_scripts/version.rb +3 -3
- data/lib/phcdevworks_scripts.rb +6 -6
- data/lib/tasks/phcdevworks_scripts_tasks.rake +4 -4
- metadata +33 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0fce49c21a7be6d21170424b91cb7593abff3787f2e852bca23cbdf94856df
|
4
|
+
data.tar.gz: ba32e66d3f2cbc8eec0bd9d1db9d846a4155981f3d22e76d9fe0be4e55e151e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 561d695bc93cbdaeb69bfa6dca4f4c859afb0ad291194e3a4830fa7a6d41b91e4d15d23ef21453180ebb134e087eb858d02b1bf24b6ec9e0d01406ea5511edfa
|
7
|
+
data.tar.gz: 88a076961f18efb99f24cbcb66b96cf44be5c6f3111646c945bc9073c089052595cdb9152c2a92c2bb1a22bcc2f3e38da94907920713c04737a858f524406b2c
|
data/MIT-LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright 2020 BradPotts
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright 2020 BradPotts
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,28 +1 @@
|
|
1
|
-
|
2
|
-
Short description and motivation.
|
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
|
+
[![Gem Version](https://badge.fury.io/rb/phcdevworks_scripts.svg)](https://badge.fury.io/rb/phcdevworks_scripts)
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
|
3
|
-
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
4
|
-
load "rails/tasks/engine.rake"
|
5
|
-
|
6
|
-
load "rails/tasks/statistics.rake"
|
7
|
-
|
8
|
-
require "bundler/gem_tasks"
|
1
|
+
require "bundler/setup"
|
2
|
+
|
3
|
+
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
4
|
+
load "rails/tasks/engine.rake"
|
5
|
+
|
6
|
+
load "rails/tasks/statistics.rake"
|
7
|
+
|
8
|
+
require "bundler/gem_tasks"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
//= link_directory ../stylesheets/phcdevworks_scripts .scss
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.css
|
3
|
-
//= link phcthemes_admin_panel_pack_coloradmin.js
|
1
|
+
//= link_directory ../stylesheets/phcdevworks_scripts .scss
|
2
|
+
//= link phcthemes_admin_panel_pack_coloradmin.css
|
3
|
+
//= link phcthemes_admin_panel_pack_coloradmin.js
|
@@ -1,15 +1,15 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the script::authors controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the script::authors controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the script::extensions controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the script::extensions controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the script::listings controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the script::listings controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the script::urls controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the script::urls controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the script::versions controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the script::versions controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the snippet::posts controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the snippet::posts controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the snippet::urls controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the snippet::urls controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -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
|