phcdevworks_core_modules 0.3.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee +3 -0
  3. data/app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee +3 -0
  4. data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +3 -0
  5. data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +3 -0
  6. data/app/assets/stylesheets/scaffolds.scss +65 -0
  7. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -0
  8. data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -0
  9. data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -0
  10. data/app/helpers/phcdevworks_core_modules/{modules → post}/categories_helper.rb +1 -1
  11. data/app/models/phcdevworks_core_modules/marketing.rb +7 -0
  12. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -0
  13. data/app/models/phcdevworks_core_modules/marketing_optimization_versions.rb +5 -0
  14. data/app/models/phcdevworks_core_modules/post.rb +7 -0
  15. data/app/models/phcdevworks_core_modules/post/category.rb +43 -0
  16. data/app/models/phcdevworks_core_modules/post_category_versions.rb +5 -0
  17. data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +1 -1
  18. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +75 -80
  19. data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +87 -0
  20. data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +47 -0
  21. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +88 -0
  22. data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +47 -0
  23. data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +49 -0
  24. data/app/views/phcdevworks_core_modules/{modules → post}/categories/_form.html.erb +10 -5
  25. data/app/views/phcdevworks_core_modules/{modules → post}/categories/edit.html.erb +2 -2
  26. data/app/views/phcdevworks_core_modules/{modules → post}/categories/index.html.erb +7 -7
  27. data/app/views/phcdevworks_core_modules/{modules → post}/categories/new.html.erb +2 -2
  28. data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -0
  29. data/config/routes.rb +11 -6
  30. data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +17 -0
  31. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -0
  32. data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +17 -0
  33. data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -0
  34. data/lib/phcdevworks_core_modules/engine.rb +1 -1
  35. data/lib/phcdevworks_core_modules/version.rb +1 -1
  36. metadata +34 -16
  37. data/app/controllers/phcdevworks_core_modules/modules/categories_controller.rb +0 -81
  38. data/app/models/phcdevworks_core_modules/core_category_versions.rb +0 -5
  39. data/app/models/phcdevworks_core_modules/modules/category.rb +0 -27
  40. data/app/views/phcdevworks_core_modules/modules/categories/show.html.erb +0 -9
  41. data/db/migrate/20170517064427_create_phcdevworks_core_category_versions.rb +0 -17
  42. data/db/migrate/20200629113153_create_phcdevworks_core_modules_modules_categories.rb +0 -15
@@ -0,0 +1,17 @@
1
+ class CreatePhcdevworksCoreModulesPostCategoryVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_core_modules_post_category_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcdevworks_core_modules_post_category_versions, %i(item_type item_id), :name => 'post_category_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,26 @@
1
+ class CreatePhcdevworksCoreModulesMarketingOptimizations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_core_modules_marketing_optimizations do |t|
4
+
5
+ t.string :seo_title
6
+ t.text :seo_description
7
+
8
+ t.string :seo_open_graph_post_type
9
+ t.string :seo_open_graph_url
10
+ t.string :seo_open_graph_title
11
+ t.text :seo_open_graph_description
12
+
13
+ t.string :seo_twitter_post_type
14
+ t.string :seo_twitter_url
15
+ t.string :seo_twitter_title
16
+ t.text :seo_twitter_description
17
+
18
+ t.string :slug
19
+ t.string :user_id
20
+ t.string :org_id
21
+
22
+ t.timestamps
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePhcdevworksCoreModulesMarketingOptimizationVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_core_modules_marketing_optimization_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcdevworks_core_modules_marketing_optimization_versions, %i(item_type item_id), :name => 'marketing_optimize_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePhcdevworksCoreModulesPostCategories < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_core_modules_post_categories do |t|
4
+
5
+ t.string :category_name
6
+
7
+ t.string :slug
8
+ t.string :user_id
9
+ t.string :org_id
10
+
11
+ t.string :optimization_id
12
+
13
+ t.timestamps
14
+
15
+ end
16
+ end
17
+ end
@@ -28,7 +28,7 @@ module PhcdevworksCoreModules
28
28
 
29
29
  # Load User Accounts
30
30
  require "phcdevworks_accounts"
31
-
31
+
32
32
  # Engine Namespace
33
33
  isolate_namespace PhcdevworksCoreModules
34
34
 
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '0.3.0'
2
+ VERSION = '4.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_core_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-29 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -232,14 +232,14 @@ dependencies:
232
232
  requirements:
233
233
  - - "~>"
234
234
  - !ruby/object:Gem::Version
235
- version: '1.11'
235
+ version: '1.13'
236
236
  type: :runtime
237
237
  prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - "~>"
241
241
  - !ruby/object:Gem::Version
242
- version: '1.11'
242
+ version: '1.13'
243
243
  - !ruby/object:Gem::Dependency
244
244
  name: sqlite3
245
245
  requirement: !ruby/object:Gem::Requirement
@@ -254,7 +254,7 @@ dependencies:
254
254
  - - "~>"
255
255
  - !ruby/object:Gem::Version
256
256
  version: '1.4'
257
- description: ''
257
+ description: Core modules for PHCDevworks plugins.
258
258
  email:
259
259
  - info@phcdevworks.com
260
260
  executables: []
@@ -266,29 +266,47 @@ files:
266
266
  - Rakefile
267
267
  - app/assets/config/phcdevworks_core_modules_manifest.js
268
268
  - app/assets/javascripts/phcdevworks_core_modules/application.js
269
+ - app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee
270
+ - app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee
269
271
  - app/assets/stylesheets/phcdevworks_core_modules/application.scss
272
+ - app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss
273
+ - app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss
274
+ - app/assets/stylesheets/scaffolds.scss
270
275
  - app/controllers/phcdevworks_core_modules/application_controller.rb
271
- - app/controllers/phcdevworks_core_modules/modules/categories_controller.rb
276
+ - app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb
277
+ - app/controllers/phcdevworks_core_modules/post/categories_controller.rb
272
278
  - app/helpers/phcdevworks_core_modules/application_helper.rb
273
- - app/helpers/phcdevworks_core_modules/modules/categories_helper.rb
279
+ - app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb
280
+ - app/helpers/phcdevworks_core_modules/post/categories_helper.rb
274
281
  - app/jobs/phcdevworks_core_modules/application_job.rb
275
282
  - app/mailers/phcdevworks_core_modules/application_mailer.rb
276
283
  - app/models/phcdevworks_core_modules/application_record.rb
277
- - app/models/phcdevworks_core_modules/core_category_versions.rb
284
+ - app/models/phcdevworks_core_modules/marketing.rb
285
+ - app/models/phcdevworks_core_modules/marketing/optimization.rb
286
+ - app/models/phcdevworks_core_modules/marketing_optimization_versions.rb
278
287
  - app/models/phcdevworks_core_modules/modules.rb
279
- - app/models/phcdevworks_core_modules/modules/category.rb
288
+ - app/models/phcdevworks_core_modules/post.rb
289
+ - app/models/phcdevworks_core_modules/post/category.rb
290
+ - app/models/phcdevworks_core_modules/post_category_versions.rb
280
291
  - app/views/layouts/phcdevworks_core_modules/application.html.erb
281
292
  - app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb
282
293
  - app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb
283
294
  - app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb
284
- - app/views/phcdevworks_core_modules/modules/categories/_form.html.erb
285
- - app/views/phcdevworks_core_modules/modules/categories/edit.html.erb
286
- - app/views/phcdevworks_core_modules/modules/categories/index.html.erb
287
- - app/views/phcdevworks_core_modules/modules/categories/new.html.erb
288
- - app/views/phcdevworks_core_modules/modules/categories/show.html.erb
295
+ - app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb
296
+ - app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb
297
+ - app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb
298
+ - app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb
299
+ - app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb
300
+ - app/views/phcdevworks_core_modules/post/categories/_form.html.erb
301
+ - app/views/phcdevworks_core_modules/post/categories/edit.html.erb
302
+ - app/views/phcdevworks_core_modules/post/categories/index.html.erb
303
+ - app/views/phcdevworks_core_modules/post/categories/new.html.erb
304
+ - app/views/phcdevworks_core_modules/post/categories/show.html.erb
289
305
  - config/routes.rb
290
- - db/migrate/20170517064427_create_phcdevworks_core_category_versions.rb
291
- - db/migrate/20200629113153_create_phcdevworks_core_modules_modules_categories.rb
306
+ - db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb
307
+ - db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb
308
+ - db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb
309
+ - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
292
310
  - lib/phcdevworks_core_modules.rb
293
311
  - lib/phcdevworks_core_modules/engine.rb
294
312
  - lib/phcdevworks_core_modules/version.rb
@@ -1,81 +0,0 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Modules::CategoriesController < 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_modules_category, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /modules/categories
13
- def index
14
- @modules_categories = Modules::Category.all
15
- end
16
-
17
- # GET /modules/categories/1
18
- def show
19
- end
20
-
21
- # GET /modules/categories/new
22
- def new
23
- @modules_category = Modules::Category.new
24
- end
25
-
26
- # GET /modules/categories/1/edit
27
- def edit
28
- end
29
-
30
- # POST /modules/categories
31
- def create
32
- @modules_category = Modules::Category.new(modules_category_params)
33
- @modules_category.user_id = current_user.id
34
- @modules_category.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @modules_category.save
37
- format.html { redirect_to modules_categories_path, :flash => { :success => 'Category has been Added.' }}
38
- format.json { render :show, status: :created, location: @modules_category }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @modules_category.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /modules/categories/1
47
- def update
48
- respond_to do |format|
49
- if @modules_category.update(modules_category_params)
50
- format.html { redirect_to modules_categories_path, :flash => { :notice => 'Tutorial has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @modules_category }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @modules_category.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /modules/categories/1
60
- def destroy
61
- @modules_category.destroy
62
- respond_to do |format|
63
- format.html { redirect_to modules_categories_path, :flash => { :error => 'Categories and Category Connections have all been Removed.' }}
64
- format.json { head :no_content }
65
- end
66
- end
67
-
68
- private
69
-
70
- # Common Callbacks
71
- def set_modules_category
72
- @modules_category = Modules::Category.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def modules_category_params
77
- params.require(:modules_category).permit(:category_name)
78
- end
79
-
80
- end
81
- end
@@ -1,5 +0,0 @@
1
- module PhcdevworksCoreModules
2
- class CoreCategoryVersions < PaperTrail::Version
3
- self.table_name = :phcdevworks_core_category_versions
4
- end
5
- end
@@ -1,27 +0,0 @@
1
- module PhcdevworksCoreModules
2
- class Modules::Category < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Paper Trail Initialize
8
- has_paper_trail :class_name => "PhcdevworksCoreModules::CoreCategoryVersions"
9
-
10
- # Relationships
11
- has_and_belongs_to_many :posts, class_name: "Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
12
- belongs_to :user, class_name: "PhcdevworksAccounts::User"
13
-
14
- # Form Fields Validation
15
- validates :category_name,
16
- presence: true,
17
- uniqueness: true
18
-
19
- # Clean URL Define
20
- friendly_id :phcdev_core_category_nice_urls, use: [:slugged, :finders]
21
-
22
- def phcdev_core_category_nice_urls
23
- [:category_name]
24
- end
25
-
26
- end
27
- end
@@ -1,9 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <strong>Category name:</strong>
5
- <%= @modules_category.category_name %>
6
- </p>
7
-
8
- <%= link_to 'Edit', edit_modules_category_path(@modules_category) %> |
9
- <%= link_to 'Back', modules_categories_path %>
@@ -1,17 +0,0 @@
1
- class CreatePhcdevworksCoreCategoryVersions < ActiveRecord::Migration[6.0]
2
- TEXT_BYTES = 1_073_741_823
3
- def change
4
-
5
- create_table :phcdevworks_core_category_versions do |t|
6
- t.string :item_type, {:null=>false}
7
- t.integer :item_id, null: false
8
- t.string :event, null: false
9
- t.string :whodunnit
10
- t.text :object, limit: TEXT_BYTES
11
- t.datetime :created_at
12
- end
13
-
14
- add_index :phcdevworks_core_category_versions, %i(item_type item_id), :name => 'core_category_versions'
15
-
16
- end
17
- end
@@ -1,15 +0,0 @@
1
- class CreatePhcdevworksCoreModulesModulesCategories < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :phcdevworks_core_modules_modules_categories do |t|
4
-
5
- t.string :category_name
6
-
7
- t.string :slug
8
- t.string :user_id
9
- t.string :org_id
10
-
11
- t.timestamps
12
-
13
- end
14
- end
15
- end