phcdevworks_core_modules 0.4.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee +3 -0
- data/app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee +3 -0
- data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +3 -0
- data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +3 -0
- data/app/assets/stylesheets/scaffolds.scss +65 -0
- data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -0
- data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -0
- data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -0
- data/app/helpers/phcdevworks_core_modules/{modules → post}/categories_helper.rb +1 -1
- data/app/models/phcdevworks_core_modules/marketing.rb +7 -0
- data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -0
- data/app/models/phcdevworks_core_modules/marketing_optimization_versions.rb +5 -0
- data/app/models/phcdevworks_core_modules/post.rb +7 -0
- data/app/models/phcdevworks_core_modules/post/category.rb +39 -0
- data/app/models/phcdevworks_core_modules/post_category_versions.rb +5 -0
- data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +1 -1
- data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +75 -80
- data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +89 -0
- data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +47 -0
- data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +88 -0
- data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +47 -0
- data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +54 -0
- data/app/views/phcdevworks_core_modules/post/categories/_form.html.erb +27 -0
- data/app/views/phcdevworks_core_modules/{modules → post}/categories/edit.html.erb +2 -2
- data/app/views/phcdevworks_core_modules/{modules → post}/categories/index.html.erb +7 -7
- data/app/views/phcdevworks_core_modules/{modules → post}/categories/new.html.erb +2 -2
- data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -0
- data/config/routes.rb +11 -6
- data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +17 -0
- data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -0
- data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +17 -0
- data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -0
- data/lib/phcdevworks_core_modules/version.rb +1 -1
- metadata +34 -16
- data/app/controllers/phcdevworks_core_modules/modules/categories_controller.rb +0 -81
- data/app/models/phcdevworks_core_modules/core_category_versions.rb +0 -5
- data/app/models/phcdevworks_core_modules/modules/category.rb +0 -30
- data/app/views/phcdevworks_core_modules/modules/categories/_form.html.erb +0 -22
- data/app/views/phcdevworks_core_modules/modules/categories/show.html.erb +0 -9
- data/db/migrate/20170517064427_create_phcdevworks_core_category_versions.rb +0 -17
- 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 :marketing_optimization_page_title
|
6
|
+
t.text :marketing_optimization_page_description
|
7
|
+
|
8
|
+
t.string :marketing_optimization_og_title
|
9
|
+
t.text :marketing_optimization_og_description
|
10
|
+
t.string :marketing_optimization_og_type
|
11
|
+
t.string :marketing_optimization_og_url
|
12
|
+
|
13
|
+
t.string :marketing_optimization_twitter_title
|
14
|
+
t.text :marketing_optimization_twitter_description
|
15
|
+
t.string :marketing_optimization_twitter_type
|
16
|
+
t.string :marketing_optimization_twitter_url
|
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
|
data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb
ADDED
@@ -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 :post_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
|
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.
|
4
|
+
version: 5.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-
|
11
|
+
date: 2020-07-13 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.
|
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.
|
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/
|
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/
|
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/
|
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/
|
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/
|
285
|
-
- app/views/phcdevworks_core_modules/
|
286
|
-
- app/views/phcdevworks_core_modules/
|
287
|
-
- app/views/phcdevworks_core_modules/
|
288
|
-
- app/views/phcdevworks_core_modules/
|
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/
|
291
|
-
- db/migrate/
|
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,30 +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
|
-
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
12
|
-
has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
|
13
|
-
has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
|
14
|
-
has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
15
|
-
has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
|
16
|
-
|
17
|
-
# Form Fields Validation
|
18
|
-
validates :category_name,
|
19
|
-
presence: true,
|
20
|
-
uniqueness: true
|
21
|
-
|
22
|
-
# Clean URL Define
|
23
|
-
friendly_id :phcdev_core_category_nice_urls, use: [:slugged, :finders]
|
24
|
-
|
25
|
-
def phcdev_core_category_nice_urls
|
26
|
-
[:category_name]
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<!-- Form - Command - Post -->
|
2
|
-
<%= form_with(model: modules_category, local: true) do |form| %>
|
3
|
-
|
4
|
-
<!-- PHCNotifi Render Validation -->
|
5
|
-
<%= render "phcdevworks_notifications/bootstrap/validations", :object => @modules_category %>
|
6
|
-
<!-- PHCNotifi Render Validation -->
|
7
|
-
|
8
|
-
<!-- Form Input Fields -->
|
9
|
-
<div class="form-group">
|
10
|
-
<%= form.label :category_name, "Category Name" %>
|
11
|
-
<%= form.text_field :category_name, class: "form-control" %>
|
12
|
-
</div>
|
13
|
-
<!-- Form Input Fields -->
|
14
|
-
|
15
|
-
<!-- Form Submition Button -->
|
16
|
-
<div class="actions">
|
17
|
-
<%= form.submit class: "btn btn-primary" %>
|
18
|
-
</div>
|
19
|
-
<!-- For Submition Button -->
|
20
|
-
|
21
|
-
<% end %>
|
22
|
-
<!-- Form - Command - Post -->
|
@@ -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
|