phcmembers 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +4 -4
  4. data/Rakefile +15 -5
  5. data/app/assets/config/phcmembers_manifest.js +2 -0
  6. data/app/assets/stylesheets/phcmembers/_custom.scss +0 -9
  7. data/app/assets/stylesheets/phcmembers/application.scss +23 -0
  8. data/app/controllers/phcmembers/api/directories_controller.rb +18 -0
  9. data/app/controllers/phcmembers/application_controller.rb +4 -1
  10. data/app/controllers/phcmembers/dashboard/mains_controller.rb +19 -0
  11. data/app/controllers/phcmembers/directory/categories_controller.rb +6 -4
  12. data/app/controllers/phcmembers/directory/listings_controller.rb +71 -0
  13. data/app/controllers/phcmembers/members/businesses_controller.rb +83 -0
  14. data/app/controllers/phcmembers/members/contacts_controller.rb +13 -17
  15. data/app/controllers/phcmembers/members/mains_controller.rb +10 -7
  16. data/app/helpers/phcmembers/application_helper.rb +0 -1
  17. data/app/jobs/phcmembers/application_job.rb +4 -0
  18. data/app/mailers/phcmembers/application_mailer.rb +6 -0
  19. data/app/models/phcmembers/api.rb +7 -0
  20. data/app/models/phcmembers/application_record.rb +5 -0
  21. data/app/models/phcmembers/directory.rb +0 -3
  22. data/app/models/phcmembers/directory/category.rb +6 -3
  23. data/app/models/phcmembers/directory/listing.rb +20 -0
  24. data/app/models/phcmembers/members.rb +0 -3
  25. data/app/models/phcmembers/members/business.rb +44 -0
  26. data/app/models/phcmembers/members/contact.rb +10 -9
  27. data/app/models/phcmembers/members/main.rb +4 -3
  28. data/app/views/layouts/phcmembers/application.html.erb +12 -8
  29. data/app/views/layouts/phcmembers/directory/directory_all.html.erb +12 -8
  30. data/app/views/layouts/phcmembers/members/members_all.html.erb +12 -8
  31. data/app/views/phcmembers/directory/categories/_form.html.erb +2 -1
  32. data/app/views/phcmembers/directory/categories/components/_category_audits.html.erb +25 -0
  33. data/app/views/phcmembers/directory/categories/components/_category_list.html.erb +7 -0
  34. data/app/views/phcmembers/directory/categories/components/_category_main.html.erb +24 -0
  35. data/app/views/phcmembers/directory/categories/edit.html.erb +30 -11
  36. data/app/views/phcmembers/directory/categories/index.html.erb +37 -37
  37. data/app/views/phcmembers/directory/categories/new.html.erb +28 -9
  38. data/app/views/phcmembers/directory/categories/show.html.erb +34 -0
  39. data/app/views/phcmembers/directory/listings/_form.html.erb +15 -0
  40. data/app/views/phcmembers/directory/listings/_formpatch.html.erb +15 -0
  41. data/app/views/phcmembers/directory/listings/components/_listing_audits.html.erb +25 -0
  42. data/app/views/phcmembers/directory/listings/components/_listing_list.html.erb +48 -0
  43. data/app/views/phcmembers/directory/listings/components/_listing_main.html.erb +21 -0
  44. data/app/views/phcmembers/directory/listings/edit.html.erb +45 -0
  45. data/app/views/phcmembers/directory/listings/index.html.erb +73 -0
  46. data/app/views/phcmembers/directory/listings/new.html.erb +45 -0
  47. data/app/views/phcmembers/directory/listings/show.html.erb +34 -0
  48. data/app/views/phcmembers/members/businesses/_form.html.erb +65 -0
  49. data/app/views/phcmembers/members/businesses/_formpatch.html.erb +65 -0
  50. data/app/views/phcmembers/members/businesses/components/_business_address.html.erb +48 -0
  51. data/app/views/phcmembers/members/businesses/components/_business_audits.html.erb +25 -0
  52. data/app/views/phcmembers/members/businesses/components/_business_main.html.erb +21 -0
  53. data/app/views/phcmembers/members/businesses/edit.html.erb +46 -0
  54. data/app/views/phcmembers/members/businesses/index.html.erb +76 -0
  55. data/app/views/phcmembers/members/businesses/new.html.erb +47 -0
  56. data/app/views/phcmembers/members/businesses/show.html.erb +35 -0
  57. data/app/views/phcmembers/members/contacts/_form.html.erb +14 -26
  58. data/app/views/phcmembers/members/contacts/_formpatch.html.erb +14 -26
  59. data/app/views/phcmembers/members/contacts/components/_contact_address.html.erb +29 -0
  60. data/app/views/phcmembers/members/contacts/components/_contact_audits.html.erb +25 -0
  61. data/app/views/phcmembers/members/contacts/components/_contact_main.html.erb +21 -0
  62. data/app/views/phcmembers/members/contacts/edit.html.erb +30 -11
  63. data/app/views/phcmembers/members/contacts/index.html.erb +57 -37
  64. data/app/views/phcmembers/members/contacts/new.html.erb +30 -11
  65. data/app/views/phcmembers/members/contacts/show.html.erb +35 -51
  66. data/app/views/phcmembers/members/mains/_form.html.erb +14 -15
  67. data/app/views/phcmembers/members/mains/components/_profile_main.html.erb +48 -0
  68. data/app/views/phcmembers/members/mains/components/_profile_sidebar.html.erb +67 -0
  69. data/app/views/phcmembers/members/mains/edit.html.erb +28 -9
  70. data/app/views/phcmembers/members/mains/index.html.erb +53 -43
  71. data/app/views/phcmembers/members/mains/new.html.erb +27 -8
  72. data/app/views/phcmembers/members/mains/show.html.erb +31 -53
  73. data/config/routes.rb +22 -10
  74. data/db/migrate/20160706184011_create_phcmembers_members_businesses.rb +27 -0
  75. data/db/migrate/{20160227194651_create_phcmembers_members_contacts.rb → 20160706184249_create_phcmembers_members_contacts.rb} +3 -6
  76. data/db/migrate/{20160227150117_create_phcmembers_members_mains.rb → 20160706184353_create_phcmembers_members_mains.rb} +8 -2
  77. data/db/migrate/20160706184527_create_phcmembers_directory_listings.rb +15 -0
  78. data/db/migrate/{20160227205022_create_phcmembers_directory_categories.rb → 20160706184708_create_phcmembers_directory_categories.rb} +4 -2
  79. data/db/migrate/20160707154842_create_versions.rb +80 -0
  80. data/lib/phcmembers/engine.rb +11 -8
  81. data/lib/phcmembers/version.rb +2 -2
  82. metadata +132 -155
  83. data/LICENSE +0 -238
  84. data/app/assets/stylesheets/adminlte_overrides.scss +0 -56
  85. data/app/assets/stylesheets/phcmembers/_variables.scss +0 -0
  86. data/app/assets/stylesheets/phcmembers/application.css.scss +0 -12
  87. data/app/assets/stylesheets/phcmembers/dashboard.scss +0 -3
  88. data/app/assets/stylesheets/scaffolds.scss +0 -73
  89. data/app/controllers/phcmembers/api/catsapi_controller.rb +0 -15
  90. data/app/controllers/phcmembers/api/listapi_controller.rb +0 -16
  91. data/app/controllers/phcmembers/dashboard/indices_controller.rb +0 -20
  92. data/app/controllers/phcmembers/directory/catlists_controller.rb +0 -98
  93. data/app/controllers/phcmembers/members/listings_controller.rb +0 -87
  94. data/app/helpers/nav_helper.rb +0 -29
  95. data/app/helpers/phcmembers/dashboard_helper.rb +0 -4
  96. data/app/helpers/phcmembers/directory/categories_helper.rb +0 -4
  97. data/app/helpers/phcmembers/directory/catlists_helper.rb +0 -4
  98. data/app/helpers/phcmembers/members/contacts_helper.rb +0 -4
  99. data/app/helpers/phcmembers/members/listings_helper.rb +0 -4
  100. data/app/helpers/phcmembers/members/mains_helper.rb +0 -4
  101. data/app/models/phcmembers/api/category.rb +0 -8
  102. data/app/models/phcmembers/api/catlist.rb +0 -9
  103. data/app/models/phcmembers/directory/catlist.rb +0 -17
  104. data/app/models/phcmembers/members/listing.rb +0 -42
  105. data/app/views/layouts/_application_header.html.erb +0 -133
  106. data/app/views/layouts/_application_sidebar.html.erb +0 -39
  107. data/app/views/layouts/application.html.erb +0 -19
  108. data/app/views/phcmembers/api/catsapi/index.json.rabl +0 -2
  109. data/app/views/phcmembers/api/listapi/index.json.rabl +0 -6
  110. data/app/views/phcmembers/dashboard/indices/index.html.erb +0 -51
  111. data/app/views/phcmembers/directory/catlists/_form.html.erb +0 -15
  112. data/app/views/phcmembers/directory/catlists/index.html.erb +0 -37
  113. data/app/views/phcmembers/directory/catlists/new.html.erb +0 -26
  114. data/app/views/phcmembers/members/listings/_form.html.erb +0 -54
  115. data/app/views/phcmembers/members/listings/_formpatch.html.erb +0 -54
  116. data/app/views/phcmembers/members/listings/edit.html.erb +0 -27
  117. data/app/views/phcmembers/members/listings/index.html.erb +0 -58
  118. data/app/views/phcmembers/members/listings/new.html.erb +0 -25
  119. data/app/views/phcmembers/members/listings/show.html.erb +0 -56
  120. data/db/migrate/20160227160416_create_phcmembers_members_listings.rb +0 -23
  121. data/db/migrate/20160227212144_create_phcmembers_directory_catlists.rb +0 -13
  122. data/lib/generators/phcmembers/views_generator.rb +0 -53
  123. data/lib/templates/erb/controller/view.html.erb +0 -9
  124. data/lib/templates/erb/scaffold/_form.html.erb +0 -30
  125. data/lib/templates/erb/scaffold/edit.html.erb +0 -15
  126. data/lib/templates/erb/scaffold/index.html.erb +0 -52
  127. data/lib/templates/erb/scaffold/new.html.erb +0 -13
  128. data/lib/templates/erb/scaffold/show.html.erb +0 -38
@@ -1,23 +0,0 @@
1
- class CreatePhcmembersMembersListings < ActiveRecord::Migration
2
- def change
3
- create_table :phcmembers_members_listings do |t|
4
-
5
- t.string :mlcontactname
6
- t.string :mlcompanyname
7
- t.string :mladdressl1
8
- t.string :mladdressl2
9
- t.string :mlcity
10
- t.string :mlprovince
11
- t.string :mlcountry
12
- t.string :mlpostalcode
13
- t.string :mlphone
14
- t.string :mlwebsite
15
- t.string :mlemail
16
-
17
- t.references :main, index: true
18
-
19
- t.timestamps null: false
20
-
21
- end
22
- end
23
- end
@@ -1,13 +0,0 @@
1
- class CreatePhcmembersDirectoryCatlists < ActiveRecord::Migration
2
- def change
3
- create_table :phcmembers_directory_catlists do |t|
4
-
5
- t.integer :category_id
6
- t.integer :subcategory_id
7
- t.integer :listing_id
8
-
9
- t.timestamps null: false
10
-
11
- end
12
- end
13
- end
@@ -1,53 +0,0 @@
1
- require 'rails/generators/base'
2
-
3
- module Phcmembers
4
-
5
- module Generators
6
-
7
- module ViewPathTemplates
8
- extend ActiveSupport::Concern
9
-
10
- included do
11
- class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (layouts, phcmembers)"
12
-
13
- public_task :copy_views
14
- end
15
-
16
- def copy_views
17
- if options[:views]
18
- options[:views].each do |directory|
19
- view_directory directory.to_sym
20
- end
21
- else
22
- view_directory :layouts
23
- view_directory :phcmembers
24
- end
25
- end
26
-
27
- protected
28
-
29
- def view_directory(name, _target_path = nil)
30
- directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
31
- content
32
- end
33
- end
34
-
35
- def target_path
36
- @target_path ||= "app/views"
37
- end
38
- end
39
-
40
- class SharedViewsGenerator < Rails::Generators::Base
41
- include ViewPathTemplates
42
- source_root File.expand_path("../../../../app/views", __FILE__)
43
- desc "Copies phcmembers views to your application."
44
- hide!
45
- end
46
-
47
- class ViewsGenerator < Rails::Generators::Base
48
- desc "Copies phcmembers views to your application."
49
- invoke SharedViewsGenerator
50
- end
51
- end
52
-
53
- end
@@ -1,9 +0,0 @@
1
- <%% content_for :content_header do %>
2
- <section class="content-header">
3
- <h1><%= class_name %> <small>#<%= @action %></small></h1>
4
- </section>
5
- <%% end %>
6
-
7
- <section class="content invoice">
8
- <p>Find me in <%= @path %></p>
9
- </section>
@@ -1,30 +0,0 @@
1
- <section class="content invoice">
2
- <div class="row">
3
- <div class="col-md-10">
4
- <%%= form_for(@<%= singular_table_name %>, :html => { :role => "form" }) do |f| %>
5
- <%% if @<%= singular_table_name %>.errors.any? %>
6
- <div class="alert alert-danger alert-dismissable" role="alert">
7
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
8
- <h4><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h4>
9
-
10
- <ul>
11
- <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
12
- <li><%%= msg %></li>
13
- <%% end %>
14
- </ul>
15
- </div>
16
- <%% end %>
17
-
18
- <% attributes.each do |attribute| -%>
19
- <div class="form-group">
20
- <%%= f.label :<%= attribute.name %> %>
21
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %>
22
- </div>
23
- <% end -%>
24
- <div class="form-group">
25
- <%%= f.submit :class => "btn btn-primary" %>
26
- </div>
27
- <%% end %>
28
- </div>
29
- </div>
30
- </section>
@@ -1,15 +0,0 @@
1
- <%% content_for :content_header do %>
2
- <section class="content-header">
3
- <h1>
4
- Editing <small><%%= link_to <%=singular_table_name %>, @<%= singular_table_name %> %></small>
5
-
6
- <ol class="breadcrumb">
7
- <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
8
- <li><%%= link_to "<%= plural_table_name.capitalize %>", <%= plural_table_name %>_path %></li>
9
- <li class="active">Edit</li>
10
- </ol>
11
- </h1>
12
- </section>
13
- <%% end %>
14
-
15
- <%%= render 'form' %>
@@ -1,52 +0,0 @@
1
- <%% content_for :content_header do %>
2
- <section class="content-header">
3
- <h1>Listing <small><%= plural_table_name %></small></h1>
4
-
5
- <ol class="breadcrumb">
6
- <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
- <li class="active"><%= plural_table_name %></li>
8
- </ol>
9
- </section>
10
- <%% end %>
11
-
12
- <section class="content">
13
- <div class="row">
14
- <div class="col-xs-12">
15
- <div class="box box-primary">
16
- <div class="box-header">
17
- <div class="box-tools pull-right">
18
- <%%= link_to new_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-success' do %>
19
- <span class="glyphicon glyphicon-plus"></span>
20
- New <%= human_name %>
21
- <%% end %>
22
- </div>
23
- </div>
24
- <div class="box-body table-responsive">
25
- <table class="table table-hover">
26
- <thead>
27
- <tr>
28
- <% attributes.each do |attribute| -%>
29
- <th><%= attribute.human_name %></th>
30
- <% end -%>
31
- <th></th>
32
- <th></th>
33
- <th></th>
34
- </tr>
35
- </thead>
36
- <tbody>
37
- <%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %>
38
- <% attributes.each do |attribute| -%>
39
- <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
40
- <% end -%>
41
- <td><%%= link_to 'Show', <%= singular_table_name %> %></td>
42
- <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
43
- <td><%%= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
44
- <%% end %>
45
- </tbody>
46
- </table>
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- </section>
52
-
@@ -1,13 +0,0 @@
1
- <%% content_for :content_header do %>
2
- <section class="content-header">
3
- <h1>New <small><%= singular_table_name %></small></h1>
4
-
5
- <ol class="breadcrumb">
6
- <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
- <li><%%= link_to "<%= plural_table_name %>", <%= plural_table_name %>_path %></li>
8
- <li class="active">New</li>
9
- </ol>
10
- </section>
11
- <%% end %>
12
-
13
- <%%= render 'form' %>
@@ -1,38 +0,0 @@
1
- <%% content_for :content_header do %>
2
- <section class="content-header">
3
- <h1>Show <small><%= singular_table_name %></small></h1>
4
-
5
- <ol class="breadcrumb">
6
- <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
- <li><%%= link_to "<%= plural_table_name.capitalize %>", <%= plural_table_name %>_path %></li>
8
- <li class="active">Show</li>
9
- </ol>
10
- </section>
11
- <%% end %>
12
-
13
- <section class="content">
14
- <div class="row">
15
- <div class="col-md-12">
16
- <div class="box box-primary">
17
- <div class="box-header">
18
- <div class="box-tools pull-right">
19
- <%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-primary' do %>
20
- <span class="glyphicon glyphicon-pencil"></span>
21
- Edit
22
- <%% end %>
23
- </div>
24
- </div>
25
- <div class="box-body">
26
- <dl class="dl-horizontal">
27
- <%- attributes.each do |attribute| -%>
28
- <dt><%= attribute.human_name %>:</dt>
29
- <dd><%%= @<%= singular_table_name %>.<%= attribute.name %> %></dd>
30
-
31
- <%- end -%>
32
- </dl>
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </section>
38
-