phcmembers 11.0.0 → 12.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 +20 -20
- data/README.md +45 -45
- data/Rakefile +33 -33
- data/app/assets/config/phcmembers_manifest.js +2 -2
- data/app/assets/javascripts/phcmembers/application.js +2 -2
- data/app/assets/stylesheets/phcmembers/application.scss +2 -2
- data/app/controllers/phcmembers/api/directories_controller.rb +18 -18
- data/app/controllers/phcmembers/application_controller.rb +17 -17
- data/app/controllers/phcmembers/directory/categories_controller.rb +68 -68
- data/app/controllers/phcmembers/directory/categorylistings_controller.rb +21 -21
- data/app/controllers/phcmembers/member/addresses_controller.rb +75 -75
- data/app/controllers/phcmembers/member/listings_controller.rb +77 -77
- data/app/controllers/phcmembers/member/profiles_controller.rb +68 -68
- data/app/controllers/phcmembers/modules/dashboards_controller.rb +14 -14
- data/app/helpers/phcmembers/application_helper.rb +14 -14
- data/app/jobs/phcmembers/application_job.rb +4 -4
- data/app/mailers/phcmembers/application_mailer.rb +8 -8
- data/app/models/phcmembers/application_record.rb +5 -5
- data/app/models/phcmembers/connections.rb +7 -7
- data/app/models/phcmembers/directory.rb +7 -7
- data/app/models/phcmembers/directory/category.rb +29 -19
- data/app/models/phcmembers/directory/categorylisting.rb +12 -18
- data/app/models/phcmembers/member.rb +7 -7
- data/app/models/phcmembers/member/address.rb +45 -17
- data/app/models/phcmembers/member/listing.rb +66 -26
- data/app/models/phcmembers/member/profile.rb +49 -49
- data/app/models/phcmembers/versions_address.rb +5 -0
- data/app/models/phcmembers/versions_category.rb +5 -0
- data/app/models/phcmembers/versions_category_listing.rb +5 -0
- data/app/models/phcmembers/versions_listing.rb +5 -0
- data/app/models/phcmembers/versions_profile.rb +5 -0
- data/app/views/layouts/phcmembers/application.html.erb +56 -56
- data/app/views/layouts/phcmembers/components/backend/footer/_footer.html.erb +4 -4
- data/app/views/layouts/phcmembers/components/backend/navigation/_navigation.html.erb +60 -60
- data/app/views/layouts/phcmembers/components/backend/topbar/_topbar.html.erb +5 -5
- data/app/views/layouts/phcmembers/components/backend/topbar/_topbar_links.html.erb +0 -0
- data/app/views/layouts/phcmembers/directory/directory_all.html.erb +56 -56
- data/app/views/layouts/phcmembers/members/members_all.html.erb +56 -56
- data/app/views/phcmembers/directory/categories/_form.html.erb +15 -15
- data/app/views/phcmembers/directory/categories/components/_category_audits.html.erb +14 -14
- data/app/views/phcmembers/directory/categories/components/_category_list.html.erb +7 -7
- data/app/views/phcmembers/directory/categories/components/_category_main.html.erb +31 -31
- data/app/views/phcmembers/directory/categories/edit.html.erb +38 -38
- data/app/views/phcmembers/directory/categories/index.html.erb +47 -47
- data/app/views/phcmembers/directory/categories/new.html.erb +36 -36
- data/app/views/phcmembers/directory/categories/show.html.erb +27 -27
- data/app/views/phcmembers/directory/categorylistings/index.html.erb +63 -63
- data/app/views/phcmembers/directory/categorylistings/show.html.erb +4 -4
- data/app/views/phcmembers/member/addresses/_form.html.erb +44 -44
- data/app/views/phcmembers/member/addresses/components/_address_address.html.erb +29 -29
- data/app/views/phcmembers/member/addresses/components/_address_audits.html.erb +12 -12
- data/app/views/phcmembers/member/addresses/components/_address_main.html.erb +31 -31
- data/app/views/phcmembers/member/addresses/edit.html.erb +40 -40
- data/app/views/phcmembers/member/addresses/index.html.erb +74 -74
- data/app/views/phcmembers/member/addresses/new.html.erb +40 -40
- data/app/views/phcmembers/member/addresses/show.html.erb +27 -27
- data/app/views/phcmembers/member/listings/_form.html.erb +68 -68
- data/app/views/phcmembers/member/listings/components/_listing_address.html.erb +48 -48
- data/app/views/phcmembers/member/listings/components/_listing_audits.html.erb +14 -14
- data/app/views/phcmembers/member/listings/components/_listing_main.html.erb +31 -31
- data/app/views/phcmembers/member/listings/edit.html.erb +40 -40
- data/app/views/phcmembers/member/listings/index.html.erb +76 -76
- data/app/views/phcmembers/member/listings/new.html.erb +40 -40
- data/app/views/phcmembers/member/listings/show.html.erb +27 -27
- data/app/views/phcmembers/member/profiles/_form.html.erb +36 -36
- data/app/views/phcmembers/member/profiles/components/_profile_main.html.erb +44 -44
- data/app/views/phcmembers/member/profiles/components/_profile_sidebar.html.erb +28 -28
- data/app/views/phcmembers/member/profiles/edit.html.erb +39 -39
- data/app/views/phcmembers/member/profiles/index.html.erb +68 -68
- data/app/views/phcmembers/member/profiles/new.html.erb +39 -39
- data/app/views/phcmembers/member/profiles/show.html.erb +31 -31
- data/app/views/phcmembers/modules/dashboards/index.html.erb +66 -66
- data/config/initializers/friendly_id.rb +92 -92
- data/config/initializers/paper_trail.rb +1 -0
- data/config/locales/en.yml +9 -9
- data/config/routes.rb +36 -36
- data/db/migrate/20160724220339_create_phcmembers_member_profiles.rb +23 -23
- data/db/migrate/20160725153306_create_phcmembers_member_addresses.rb +26 -26
- data/db/migrate/20160725182257_create_phcmembers_directory_categories.rb +18 -18
- data/db/migrate/20160727024006_create_phcmembers_member_listings.rb +30 -30
- data/db/migrate/20160727042756_create_phcmembers_directory_categorylistings.rb +19 -19
- data/db/migrate/20170509002355_create_phcmembers_friendly_id_slugs.rb +15 -0
- data/db/migrate/20170517064030_create_phcmembers_versions_profiles.rb +12 -0
- data/db/migrate/20170517064049_create_phcmembers_versions_listings.rb +12 -0
- data/db/migrate/20170517064114_create_phcmembers_versions_addresses.rb +12 -0
- data/db/migrate/20170517064208_create_phcmembers_versions_categorylistings.rb +12 -0
- data/db/migrate/20170517064427_create_phcmembers_versions_categories.rb +12 -0
- data/lib/phcmembers.rb +4 -4
- data/lib/phcmembers/engine.rb +73 -73
- data/lib/phcmembers/version.rb +3 -3
- data/lib/tasks/phcmembers_tasks.rake +4 -4
- metadata +59 -7
- data/db/migrate/20160707154842_create_versions.rb +0 -80
- data/db/migrate/20170509002355_create_friendly_id_slugs.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e459ae1d0dd556b71b131570a4d7fefcd7e0abf5
|
4
|
+
data.tar.gz: b95b27b04db7f97781f0a652fa6d12bc34b153b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d7c1f5b2ed0a3211b8fc8f5bef71992ec9e6b38b2263beea4936646a77e3bcd8d3001e9b80c078e10e5d4b38f599e9138a926f8903d616a77bcb933b4c5d22c
|
7
|
+
data.tar.gz: 5169a5b3e9f85b93bdddb9941f9ae1a4b9225489b94987a5143f853adc2d4e6ab4f27473d173d2ab7450d7889369333afe7f642fd71815cfd7e10ee30f375efa
|
data/MIT-LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright 2016-2017 BradPotts - PHCNetworks
|
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 2016-2017 BradPotts - PHCNetworks
|
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,45 +1,45 @@
|
|
1
|
-
[![security](https://hakiri.io/github/PHCNetworks/phc-members/master.svg)](https://hakiri.io/github/PHCNetworks/phc-members/master)
|
2
|
-
[![Code Climate](https://codeclimate.com/github/PHCNetworks/phc-members/badges/gpa.svg)](https://codeclimate.com/github/PHCNetworks/phc-members)
|
3
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/PHCNetworks/phc-members.svg)](https://gemnasium.com/github.com/PHCNetworks/phc-members)
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/phcmembers.svg)](https://badge.fury.io/rb/phcmembers)
|
5
|
-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/PHCNetworks/phc-members/blob/master/MIT-LICENSE)
|
6
|
-
|
7
|
-
### PHCMembers(9) (Membership & Directory Engine) Documentation
|
8
|
-
PHCMembers(9) rails engine to manage membership information and directory listings.
|
9
|
-
|
10
|
-
* Fast setup of membership and web directory modules.
|
11
|
-
* Directory and listings manager with a web directory API.
|
12
|
-
* Member's list, contact information, and listings manager.
|
13
|
-
* Easy app integration with views that can be customized.
|
14
|
-
* User authentication will activate when Devise is installed.
|
15
|
-
|
16
|
-
#### Step 1 - Add PHCMembers to your gemfile and run command
|
17
|
-
|
18
|
-
gem 'phcmembers', '~> 9.0'
|
19
|
-
bundle install
|
20
|
-
|
21
|
-
#### Step 2 - Add PHCMembers Database Tables
|
22
|
-
To copy PHCMembers' required database migrations, copy each command individually to your terminal's command line.
|
23
|
-
|
24
|
-
rails phcmembers:install:migrations
|
25
|
-
rails db:migrate
|
26
|
-
|
27
|
-
#### Step 3 - Mount PHCMembers & Add Routes
|
28
|
-
Mount PHCMembers by adding code below to your routes file.
|
29
|
-
|
30
|
-
mount Phcmembers::Engine, :at => '/'
|
31
|
-
|
32
|
-
#### Step 4 - Recompile Assets
|
33
|
-
To properly function re-compile your application's assets to copy over required files.
|
34
|
-
|
35
|
-
rails assets:clobber
|
36
|
-
rails assets:precompile
|
37
|
-
|
38
|
-
#### Step 5 - Generate Views (Customization)
|
39
|
-
Generate views for customization and app integration.
|
40
|
-
|
41
|
-
rails generate phcmembers:views
|
42
|
-
|
43
|
-
#### Additional Information
|
44
|
-
|
45
|
-
- [Past Security Patch Notes](https://github.com/PHCNetworks/phc-members/wiki/Critical-Security-Updates)
|
1
|
+
[![security](https://hakiri.io/github/PHCNetworks/phc-members/master.svg)](https://hakiri.io/github/PHCNetworks/phc-members/master)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/PHCNetworks/phc-members/badges/gpa.svg)](https://codeclimate.com/github/PHCNetworks/phc-members)
|
3
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/PHCNetworks/phc-members.svg)](https://gemnasium.com/github.com/PHCNetworks/phc-members)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/phcmembers.svg)](https://badge.fury.io/rb/phcmembers)
|
5
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/PHCNetworks/phc-members/blob/master/MIT-LICENSE)
|
6
|
+
|
7
|
+
### PHCMembers(9) (Membership & Directory Engine) Documentation
|
8
|
+
PHCMembers(9) rails engine to manage membership information and directory listings.
|
9
|
+
|
10
|
+
* Fast setup of membership and web directory modules.
|
11
|
+
* Directory and listings manager with a web directory API.
|
12
|
+
* Member's list, contact information, and listings manager.
|
13
|
+
* Easy app integration with views that can be customized.
|
14
|
+
* User authentication will activate when Devise is installed.
|
15
|
+
|
16
|
+
#### Step 1 - Add PHCMembers to your gemfile and run command
|
17
|
+
|
18
|
+
gem 'phcmembers', '~> 9.0'
|
19
|
+
bundle install
|
20
|
+
|
21
|
+
#### Step 2 - Add PHCMembers Database Tables
|
22
|
+
To copy PHCMembers' required database migrations, copy each command individually to your terminal's command line.
|
23
|
+
|
24
|
+
rails phcmembers:install:migrations
|
25
|
+
rails db:migrate
|
26
|
+
|
27
|
+
#### Step 3 - Mount PHCMembers & Add Routes
|
28
|
+
Mount PHCMembers by adding code below to your routes file.
|
29
|
+
|
30
|
+
mount Phcmembers::Engine, :at => '/'
|
31
|
+
|
32
|
+
#### Step 4 - Recompile Assets
|
33
|
+
To properly function re-compile your application's assets to copy over required files.
|
34
|
+
|
35
|
+
rails assets:clobber
|
36
|
+
rails assets:precompile
|
37
|
+
|
38
|
+
#### Step 5 - Generate Views (Customization)
|
39
|
+
Generate views for customization and app integration.
|
40
|
+
|
41
|
+
rails generate phcmembers:views
|
42
|
+
|
43
|
+
#### Additional Information
|
44
|
+
|
45
|
+
- [Past Security Patch Notes](https://github.com/PHCNetworks/phc-members/wiki/Critical-Security-Updates)
|
data/Rakefile
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
begin
|
2
|
-
require 'bundler/setup'
|
3
|
-
|
4
|
-
rescue LoadError
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
-
end
|
7
|
-
|
8
|
-
require 'rdoc/task'
|
9
|
-
|
10
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
11
|
-
rdoc.rdoc_dir = 'rdoc'
|
12
|
-
rdoc.title = 'Phcmembers'
|
13
|
-
rdoc.options << '--line-numbers'
|
14
|
-
rdoc.rdoc_files.include('README.md')
|
15
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
-
end
|
17
|
-
|
18
|
-
APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
|
19
|
-
|
20
|
-
load 'rails/tasks/engine.rake'
|
21
|
-
load 'rails/tasks/statistics.rake'
|
22
|
-
|
23
|
-
require 'bundler/gem_tasks'
|
24
|
-
require 'rake/testtask'
|
25
|
-
|
26
|
-
Rake::TestTask.new(:test) do |t|
|
27
|
-
t.libs << 'lib'
|
28
|
-
t.libs << 'test'
|
29
|
-
t.pattern = 'test/**/*_test.rb'
|
30
|
-
t.verbose = false
|
31
|
-
end
|
32
|
-
|
33
|
-
task default: :test
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'rdoc/task'
|
9
|
+
|
10
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
11
|
+
rdoc.rdoc_dir = 'rdoc'
|
12
|
+
rdoc.title = 'Phcmembers'
|
13
|
+
rdoc.options << '--line-numbers'
|
14
|
+
rdoc.rdoc_files.include('README.md')
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
+
end
|
17
|
+
|
18
|
+
APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
|
19
|
+
|
20
|
+
load 'rails/tasks/engine.rake'
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
require 'bundler/gem_tasks'
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
|
33
|
+
task default: :test
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//= link_directory ../javascripts/phcmembers .js
|
2
|
-
//= link_directory ../stylesheets/phcmembers .scss
|
1
|
+
//= link_directory ../javascripts/phcmembers .js
|
2
|
+
//= link_directory ../stylesheets/phcmembers .scss
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// Load PHCAdmin3 Javascript
|
2
|
-
//= require phc_admins_main_three
|
1
|
+
// Load PHCAdmin3 Javascript
|
2
|
+
//= require phc_admins_main_three
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// Load PHCAdmin3 Styles
|
2
|
-
@import "phc_admins_style_three";
|
1
|
+
// Load PHCAdmin3 Styles
|
2
|
+
@import "phc_admins_style_three";
|
@@ -1,18 +1,18 @@
|
|
1
|
-
require_dependency "phcmembers/application_controller"
|
2
|
-
|
3
|
-
module Phcmembers
|
4
|
-
class Api::DirectoriesController < ApplicationController
|
5
|
-
|
6
|
-
# Directory Category API
|
7
|
-
def index
|
8
|
-
@directory_categories = Directory::Category.where(membership_id: membership_info.id).order('catname ASC')
|
9
|
-
end
|
10
|
-
|
11
|
-
# Directory Listing API
|
12
|
-
def show
|
13
|
-
category = Directory::Category.find(params[:category_id])
|
14
|
-
@directory_listings = category.catlists.where(membership_id: membership_info.id)
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
1
|
+
require_dependency "phcmembers/application_controller"
|
2
|
+
|
3
|
+
module Phcmembers
|
4
|
+
class Api::DirectoriesController < ApplicationController
|
5
|
+
|
6
|
+
# Directory Category API
|
7
|
+
def index
|
8
|
+
@directory_categories = Directory::Category.where(membership_id: membership_info.id).order('catname ASC')
|
9
|
+
end
|
10
|
+
|
11
|
+
# Directory Listing API
|
12
|
+
def show
|
13
|
+
category = Directory::Category.find(params[:category_id])
|
14
|
+
@directory_listings = category.catlists.where(membership_id: membership_info.id)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Phcmembers
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Phcmembers
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
6
|
+
|
7
|
+
# Grab Member Information
|
8
|
+
def get_member_profile_info
|
9
|
+
@members_profile_info = Member::Profile.find(params[:profile_id])
|
10
|
+
end
|
11
|
+
|
12
|
+
# Load Helpers
|
13
|
+
helper Phctitleseo::Engine.helpers
|
14
|
+
helper Phcnotifi::Engine.helpers
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -1,68 +1,68 @@
|
|
1
|
-
require_dependency "phcmembers/application_controller"
|
2
|
-
|
3
|
-
module Phcmembers
|
4
|
-
class Directory::CategoriesController < ApplicationController
|
5
|
-
|
6
|
-
# Security & Action Filters
|
7
|
-
before_action :set_paper_trail_whodunnit
|
8
|
-
before_action :set_directory_category, only: [:show, :edit, :update, :destroy]
|
9
|
-
|
10
|
-
# INDEX - Directory Category
|
11
|
-
def index
|
12
|
-
@directory_categories = Directory::Category.all
|
13
|
-
end
|
14
|
-
|
15
|
-
# DETAILED - Directory Category
|
16
|
-
def show
|
17
|
-
@directory_category = Directory::Category.
|
18
|
-
@versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmembers::Directory::Category')
|
19
|
-
end
|
20
|
-
|
21
|
-
# NEW - Directory Category
|
22
|
-
def new
|
23
|
-
@directory_category = Directory::Category.new
|
24
|
-
end
|
25
|
-
|
26
|
-
# EDIT - Directory Category
|
27
|
-
def edit
|
28
|
-
end
|
29
|
-
|
30
|
-
# POST - Directory Category
|
31
|
-
def create
|
32
|
-
@directory_category = Directory::Category.new(directory_category_params)
|
33
|
-
if @directory_category.save
|
34
|
-
redirect_to directory_categories_url, notice: 'Category was successfully created.'
|
35
|
-
else
|
36
|
-
render :new
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# PATCH/PUT - Directory Category
|
41
|
-
def update
|
42
|
-
if @directory_category.update(directory_category_params)
|
43
|
-
redirect_to directory_categories_url, notice: 'Category was successfully updated.'
|
44
|
-
else
|
45
|
-
render :edit
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# DELETE - Directory Category
|
50
|
-
def destroy
|
51
|
-
@directory_category.destroy
|
52
|
-
redirect_to directory_categories_url, notice: 'Category was successfully destroyed.'
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
# Common Callbacks
|
58
|
-
def set_directory_category
|
59
|
-
@directory_category = Directory::Category.
|
60
|
-
end
|
61
|
-
|
62
|
-
# Whitelist
|
63
|
-
def directory_category_params
|
64
|
-
params.require(:directory_category).permit(:catname, :slug, :user_id, :user_name)
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
1
|
+
require_dependency "phcmembers/application_controller"
|
2
|
+
|
3
|
+
module Phcmembers
|
4
|
+
class Directory::CategoriesController < ApplicationController
|
5
|
+
|
6
|
+
# Security & Action Filters
|
7
|
+
before_action :set_paper_trail_whodunnit
|
8
|
+
before_action :set_directory_category, only: [:show, :edit, :update, :destroy]
|
9
|
+
|
10
|
+
# INDEX - Directory Category
|
11
|
+
def index
|
12
|
+
@directory_categories = Directory::Category.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# DETAILED - Directory Category
|
16
|
+
def show
|
17
|
+
@directory_category = Directory::Category.find(params[:id])
|
18
|
+
@versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmembers::Directory::Category')
|
19
|
+
end
|
20
|
+
|
21
|
+
# NEW - Directory Category
|
22
|
+
def new
|
23
|
+
@directory_category = Directory::Category.new
|
24
|
+
end
|
25
|
+
|
26
|
+
# EDIT - Directory Category
|
27
|
+
def edit
|
28
|
+
end
|
29
|
+
|
30
|
+
# POST - Directory Category
|
31
|
+
def create
|
32
|
+
@directory_category = Directory::Category.new(directory_category_params)
|
33
|
+
if @directory_category.save
|
34
|
+
redirect_to directory_categories_url, notice: 'Category was successfully created.'
|
35
|
+
else
|
36
|
+
render :new
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# PATCH/PUT - Directory Category
|
41
|
+
def update
|
42
|
+
if @directory_category.update(directory_category_params)
|
43
|
+
redirect_to directory_categories_url, notice: 'Category was successfully updated.'
|
44
|
+
else
|
45
|
+
render :edit
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# DELETE - Directory Category
|
50
|
+
def destroy
|
51
|
+
@directory_category.destroy
|
52
|
+
redirect_to directory_categories_url, notice: 'Category was successfully destroyed.'
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# Common Callbacks
|
58
|
+
def set_directory_category
|
59
|
+
@directory_category = Directory::Category.find(params[:id])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Whitelist
|
63
|
+
def directory_category_params
|
64
|
+
params.require(:directory_category).permit(:catname, :slug, :user_id, :user_name)
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
@@ -1,21 +1,21 @@
|
|
1
|
-
require_dependency "phcmembers/application_controller"
|
2
|
-
|
3
|
-
module Phcmembers
|
4
|
-
class Directory::CategorylistingsController < ApplicationController
|
5
|
-
|
6
|
-
# Security & Action Filters
|
7
|
-
before_action :set_paper_trail_whodunnit
|
8
|
-
before_action :set_directory_category, only: [:show]
|
9
|
-
|
10
|
-
# INDEX - Directory Category/Listings
|
11
|
-
def index
|
12
|
-
@directory_categorylistings = Directory::Categorylisting.all
|
13
|
-
end
|
14
|
-
|
15
|
-
# DETAILED - Directory Category/Listings
|
16
|
-
def show
|
17
|
-
@directory_categorylistings = Directory::Categorylisting.
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
1
|
+
require_dependency "phcmembers/application_controller"
|
2
|
+
|
3
|
+
module Phcmembers
|
4
|
+
class Directory::CategorylistingsController < ApplicationController
|
5
|
+
|
6
|
+
# Security & Action Filters
|
7
|
+
before_action :set_paper_trail_whodunnit
|
8
|
+
before_action :set_directory_category, only: [:show]
|
9
|
+
|
10
|
+
# INDEX - Directory Category/Listings
|
11
|
+
def index
|
12
|
+
@directory_categorylistings = Directory::Categorylisting.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# DETAILED - Directory Category/Listings
|
16
|
+
def show
|
17
|
+
@directory_categorylistings = Directory::Categorylisting.find(params[:id])
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|