phcdevworks_core_modules 6.4.0 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -28
  3. data/Rakefile +4 -18
  4. data/app/assets/config/phcdevworks_core_modules_manifest.js +2 -1
  5. data/app/assets/javascripts/phcdevworks_core_modules/{marketing/optimizations.coffee → affiliate/links.coffee} +0 -0
  6. data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +3 -0
  7. data/app/assets/stylesheets/phcdevworks_core_modules/application.scss +0 -2
  8. data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -0
  9. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +1 -1
  10. data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -0
  11. data/app/models/phcdevworks_core_modules/affiliate.rb +7 -0
  12. data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -0
  13. data/app/models/phcdevworks_core_modules/affiliate_link_versions.rb +5 -0
  14. data/app/views/layouts/phcdevworks_core_modules/application.html.erb +2 -2
  15. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +87 -8
  16. data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +27 -0
  17. data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +47 -0
  18. data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +86 -0
  19. data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +47 -0
  20. data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -0
  21. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +3 -3
  22. data/config/routes.rb +10 -2
  23. data/config/spring.rb +2 -1
  24. data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -0
  25. data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -0
  26. data/lib/phcdevworks_core_modules.rb +2 -1
  27. data/lib/phcdevworks_core_modules/engine.rb +44 -43
  28. data/lib/phcdevworks_core_modules/version.rb +1 -1
  29. metadata +39 -30
  30. data/app/assets/javascripts/phcdevworks_core_modules/application.js +0 -2
  31. data/app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d01293faf8eb309e717dcbf79c01396465d960bb2421735c1c957bf4c8620fa
4
- data.tar.gz: 841c10df6e1d52ea42de3fe3a206381490b5d188fa650b4993c63dae40205b02
3
+ metadata.gz: fc7783d475d54e14b3a1be7b2e5b53351c4731a50b5cd146f00c3b14ac87f79c
4
+ data.tar.gz: afaad43b1b56bc8b169cfb6bfc110d21ae4993b6935c4615a9a9e102035e9d8b
5
5
  SHA512:
6
- metadata.gz: d514450f8497db4a98e157bcafc0f73aa4a8d90af653d971d36be1f759b93bff3e727d8c2e1ec9777f932dde51dec2286f7348f640bb56d832ad3144aa603952
7
- data.tar.gz: 6d9c4b1a587c6de59d06e0e0c1364f5d2785119d4b5da6b2500d9d087017c505614439012b245d6fcccf5ed166b9b7d46ad52b838c1f5f0fd633579fe24a416a
6
+ metadata.gz: 8fbdcc7e39f9b295cabdad951d97404f5ba92027d1e194eb9519ccf61a701476817d7169f832eb4c555fc42f5cc95213fa5ade945845d17f6824b01a81d9bc61
7
+ data.tar.gz: 59f24bd7eca72e2f6ae69bf8626cc43a84aef68920db50a6aa96973f502fa9e800691fd3770887728799e27a107587cf09355e3d8cf952ba6d9ad65245f3c2d4
data/README.md CHANGED
@@ -1,28 +0,0 @@
1
- # PhcdevworksCoreModules
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_core_modules'
12
- ```
13
-
14
- And then execute:
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install phcdevworks_core_modules
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).
data/Rakefile CHANGED
@@ -1,22 +1,8 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'PhcdevworksCoreModules'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.md')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
1
+ require "bundler/setup"
16
2
 
17
3
  APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
18
- load 'rails/tasks/engine.rake'
4
+ load "rails/tasks/engine.rake"
19
5
 
20
- load 'rails/tasks/statistics.rake'
6
+ load "rails/tasks/statistics.rake"
21
7
 
22
- require 'bundler/gem_tasks'
8
+ require "bundler/gem_tasks"
@@ -1,2 +1,3 @@
1
- //= link_directory ../javascripts/phcdevworks_core_modules .js
2
1
  //= link_directory ../stylesheets/phcdevworks_core_modules .scss
2
+ //= link phcthemes_admin_panel_pack_coloradmin.css
3
+ //= link phcthemes_admin_panel_pack_coloradmin.js
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Affiliate::Links controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,2 +0,0 @@
1
- // Load Admin Theme
2
- @import "phcthemes_admin_panel_pack_coloradmin";
@@ -0,0 +1,81 @@
1
+ require_dependency "phcdevworks_core_modules/application_controller"
2
+
3
+ module PhcdevworksCoreModules
4
+ class Affiliate::LinksController < 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_affiliate_link, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /affiliate/links
13
+ def index
14
+ @affiliate_links = Affiliate::Link.order('affiliate_link_name ASC')
15
+ end
16
+
17
+ # GET /affiliate/links/1
18
+ def show
19
+ end
20
+
21
+ # GET /affiliate/links/new
22
+ def new
23
+ @affiliate_link = Affiliate::Link.new
24
+ end
25
+
26
+ # GET /affiliate/links/1/edit
27
+ def edit
28
+ end
29
+
30
+ # POST /affiliate/links
31
+ def create
32
+ @affiliate_link = Affiliate::Link.new(affiliate_link_params)
33
+ @affiliate_link.user_id = current_user.id
34
+ @affiliate_link.org_id = current_user.org_id
35
+ respond_to do |format|
36
+ if @affiliate_link.save
37
+ format.html { redirect_to affiliate_links_path, :flash => { :success => 'Affilate Link has been Added.' }}
38
+ format.json { render :show, status: :created, location: @affiliate_link }
39
+ else
40
+ format.html { render :new }
41
+ format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PATCH/PUT /affiliate/links/1
47
+ def update
48
+ respond_to do |format|
49
+ if @affiliate_link.update(affiliate_link_params)
50
+ format.html { redirect_to affiliate_links_path, :flash => { :notice => 'Affiliate Link has been Updated.' }}
51
+ format.json { render :show, status: :ok, location: @affiliate_link }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /affiliate/links/1
60
+ def destroy
61
+ @affiliate_link.destroy
62
+ respond_to do |format|
63
+ format.html { redirect_to affiliate_links_path, :flash => { :error => 'Affiliate Link and Post 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_affiliate_link
72
+ @affiliate_link = Affiliate::Link.find(params[:id])
73
+ end
74
+
75
+ # Whitelist
76
+ def affiliate_link_params
77
+ params.require(:affiliate_link).permit(:affiliate_link_name, :affiliate_link_button_text, :affiliate_link_url, :affiliate_link_original_url, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -47,7 +47,7 @@ module PhcdevworksCoreModules
47
47
  def update
48
48
  respond_to do |format|
49
49
  if @marketing_optimization.update(marketing_optimization_params)
50
- format.html { redirect_to marketing_optimizations_path, :flash => { :notice => 'Tutorial has been Updated.' }}
50
+ format.html { redirect_to marketing_optimizations_path, :flash => { :notice => 'SEO Attributes has been Updated.' }}
51
51
  format.json { render :show, status: :ok, location: @marketing_optimization }
52
52
  else
53
53
  format.html { render :edit }
@@ -0,0 +1,4 @@
1
+ module PhcdevworksCoreModules
2
+ module Affiliate::LinksHelper
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module PhcdevworksCoreModules
2
+ module Affiliate
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_affiliate_'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,35 @@
1
+ module PhcdevworksCoreModules
2
+ class Affiliate::Link < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Validations
8
+ validates :affiliate_link_name, presence: true
9
+ validates :affiliate_link_button_text, presence: false
10
+ validates :affiliate_link_url, presence: true
11
+ validates :affiliate_link_original_url, presence: false
12
+
13
+
14
+
15
+ # Paper Trail Initialize
16
+ has_paper_trail versions: {class_name: "PhcdevworksCoreModules::AffiliateLinkVersions"}
17
+
18
+ # Relationships for Local
19
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
20
+
21
+ if defined?phcdevworks_press
22
+ has_many :posts, class_name: "PhcdevworksPress::Article::Post"
23
+ has_many :posts, class_name: "PhcdevworksPress::Review::Post"
24
+ has_many :posts, class_name: "PhcdevworksPress::List::Post"
25
+ end
26
+
27
+ # Clean URL Define
28
+ friendly_id :affiliate_link_nice_urls, use: [:slugged, :finders]
29
+
30
+ def affiliate_link_nice_urls
31
+ [:affiliate_link_name]
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksCoreModules
2
+ class AffiliateLinkVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_core_modules_affiliate_link_versions
4
+ end
5
+ end
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
 
5
5
  <!-- SEO System -->
6
- <% phc_seo_title "PHCDevworks Accounts" %>
7
- <% phc_seo_description "Ruby on Rails 6 Authentication and User Management Engine." %>
6
+ <% phc_seo_title "PHCDevworks Core Modules" %>
7
+ <% phc_seo_description "Ruby on Rails 6 core plugin for PHCDevworks plugins with common modules to handle functions universally handle common functions." %>
8
8
  <!-- SEO System -->
9
9
 
10
10
  <!-- SEO and Site Description -->
@@ -234,7 +234,7 @@
234
234
 
235
235
  <% if defined?phcdevworks_core_modules %>
236
236
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
237
- <li class="nav-header">Core Modules</li>
237
+ <li class="nav-header">Categories</li>
238
238
  <li class="has-sub">
239
239
  <a href="javascript:;">
240
240
  <b class="caret"></b>
@@ -246,11 +246,28 @@
246
246
  <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/post/categories#new") %>"><%= link_to("New Category", phcdevworks_core_modules.new_post_category_path) %></li>
247
247
  </ul>
248
248
  </li>
249
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
250
+ <% end %>
251
+
252
+ <% if defined?phcdevworks_core_modules %>
253
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
254
+ <li class="nav-header">Marketing</li>
255
+ <li class="has-sub">
256
+ <a href="javascript:;">
257
+ <b class="caret"></b>
258
+ <i class="fad fa-link"></i>
259
+ <span>Affiliate Links</span>
260
+ </a>
261
+ <ul class="sub-menu">
262
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/affiliate/links") %>"><%= link_to("Affiliate Link Index", phcdevworks_core_modules.affiliate_links_path) %></li>
263
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/affiliate/links#new") %>"><%= link_to("New Affiliate Link", phcdevworks_core_modules.new_affiliate_link_path) %></li>
264
+ </ul>
265
+ </li>
249
266
  <li class="has-sub">
250
267
  <a href="javascript:;">
251
268
  <b class="caret"></b>
252
269
  <i class="fad fa-analytics"></i>
253
- <span>Marketing</span>
270
+ <span>Search Optimization</span>
254
271
  </a>
255
272
  <ul class="sub-menu">
256
273
  <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/marketing/optimizations") %>"><%= link_to("SEO Data Index", phcdevworks_core_modules.marketing_optimizations_path) %></li>
@@ -260,25 +277,87 @@
260
277
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
261
278
  <% end %>
262
279
 
280
+ <li class="nav-header">Administration</li>
281
+ <% if defined?phcdevworks_accounts_stripe && current_user && current_user.admin %>
282
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
283
+ <li class="has-sub">
284
+ <a href="javascript:;">
285
+ <b class="caret"></b>
286
+ <i class="fab fa-cc-stripe"></i>
287
+ <span>Subscriptions</span>
288
+ </a>
289
+ <ul class="sub-menu">
290
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Subscription Index", phcdevworks_accounts_stripe.admin_subscriptions_path) %></li>
291
+ </ul>
292
+ </li>
293
+ <li class="has-sub">
294
+ <a href="javascript:;">
295
+ <b class="caret"></b>
296
+ <i class="fad fa-money-check-alt"></i>
297
+ <span>Plans</span>
298
+ </a>
299
+ <ul class="sub-menu">
300
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/products#admin_products_list") %>"><%= link_to("Product List", phcdevworks_accounts_stripe.admin_products_path) %></li>
301
+ </ul>
302
+ </li>
303
+ <li class="has-sub">
304
+ <a href="javascript:;">
305
+ <b class="caret"></b>
306
+ <i class="fad fa-users"></i>
307
+ <span>Customers</span>
308
+ </a>
309
+ <ul class="sub-menu">
310
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/customers#admin_customer_list") %>"><%= link_to("Customer List", phcdevworks_accounts_stripe.admin_customers_path) %></li>
311
+ </ul>
312
+ </li>
313
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
314
+ <% end %>
315
+
263
316
  <% if current_user && current_user.admin? %>
264
317
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
265
- <li class="nav-header">User Administration</li>
266
318
  <li class="has-sub">
267
319
  <a href="javascript:;">
268
320
  <b class="caret"></b>
269
321
  <i class="fad fa-user"></i>
270
- <span>Admin</span>
322
+ <span>User Auth</span>
271
323
  </a>
272
324
  <ul class="sub-menu">
273
325
  <li class="<%= phc_menu_active_controller("phcdevworks_accounts/admin/users") %>"><%= link_to "User List", phcdevworks_accounts.admin_users_all_path %></li>
274
326
  </ul>
275
327
  </li>
276
328
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
277
- <% end %>
278
-
279
- <% if current_user %>
329
+ <% end %>
330
+
331
+ <li class="nav-header">Your Account</li>
332
+ <% if defined?phcdevworks_accounts_stripe && current_user %>
333
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
334
+ <li class="has-sub">
335
+ <a href="javascript:;">
336
+ <b class="caret"></b>
337
+ <i class="fad fa-money-check-alt"></i>
338
+ <span>Plan Settings</span>
339
+ </a>
340
+ <ul class="sub-menu">
341
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Your Subscription", phcdevworks_accounts_stripe.user_subscription_path) %></li>
342
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/products#admin_product_list") %>"><%= link_to("Switch Subscriptions", phcdevworks_accounts_stripe.user_subscription_path) %></li>
343
+ </ul>
344
+ </li>
345
+ <li class="has-sub">
346
+ <a href="javascript:;">
347
+ <b class="caret"></b>
348
+ <i class="fad fa-file-invoice"></i>
349
+ <span>Invoices</span>
350
+ </a>
351
+ <ul class="sub-menu">
352
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/user/invoices#admin_customer_list") %>"><%= link_to("Current Invoice", phcdevworks_accounts_stripe.user_invoices_path) %></li>
353
+ <li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/user/invoices#admin_customer_list") %>"><%= link_to("Past Invoices", phcdevworks_accounts_stripe.admin_customers_path) %></li>
354
+ </ul>
355
+ </li>
356
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
357
+ <% end %>
358
+
359
+ <% if current_user %>
280
360
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts User Options -->
281
- <li class="nav-header">Your Account</li>
282
361
  <li class="has-sub">
283
362
  <a href="javascript:;">
284
363
  <b class="caret"></b>
@@ -0,0 +1,27 @@
1
+ <%= form_with(model: affiliate_link) do |form| %>
2
+
3
+ <div class="form-group">
4
+ <%= form.label :affiliate_link_name, "Link Name" %>
5
+ <%= form.text_field :affiliate_link_name, class: "form-control" %>
6
+ </div>
7
+
8
+ <div class="form-group">
9
+ <%= form.label :affiliate_link_button_text, "Button Text" %>
10
+ <%= form.text_field :affiliate_link_button_text, class: "form-control" %>
11
+ </div>
12
+
13
+ <div class="form-group">
14
+ <%= form.label :affiliate_link_url, "Affiliate Link" %>
15
+ <%= form.text_field :affiliate_link_url, class: "form-control" %>
16
+ </div>
17
+
18
+ <div class="form-group">
19
+ <%= form.label :affiliate_link_original_url, "Original URL" %>
20
+ <%= form.text_field :affiliate_link_original_url, class: "form-control" %>
21
+ </div>
22
+
23
+ <div class="actions">
24
+ <%= form.submit class: "btn btn-primary" %>
25
+ </div>
26
+
27
+ <% end %>
@@ -0,0 +1,47 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Affiliate Manager" %>
3
+ <% phc_title_tagline "Update Affiliate Link" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Affiliate Link Index", phcdevworks_core_modules.affiliate_links_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- Edit Form -->
36
+ <%= render 'form', affiliate_link: @affiliate_link %>
37
+ <!-- Edit Form -->
38
+
39
+ </div>
40
+ <!-- Panel - Body -->
41
+
42
+ </div>
43
+ <!-- Panel -->
44
+
45
+ </div>
46
+ </div>
47
+ <!-- Page Content -->
@@ -0,0 +1,86 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Marketing Manager" %>
3
+ <% phc_title_tagline "Affiliate Links" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Affiliate Link Index", phcdevworks_core_modules.affiliate_links_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %> - <%= yield(:phc_title_tagline) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- Index - Table -->
36
+ <div class="table-responsive">
37
+ <table class="table table-striped table-bordered">
38
+
39
+ <thead>
40
+ <tr>
41
+ <th>Link Name</th>
42
+ <th>Button Text</th>
43
+ <th>Affiliate URL</th>
44
+ <th>Original URL</th>
45
+ <th></th>
46
+ </tr>
47
+ </thead>
48
+
49
+ <tbody>
50
+ <% @affiliate_links.each do |affiliate_link| %>
51
+ <tr>
52
+ <td><%= affiliate_link.affiliate_link_name %></td>
53
+ <td><%= affiliate_link.affiliate_link_button_text %></td>
54
+ <td><%= affiliate_link.affiliate_link_url %></td>
55
+ <td><%= affiliate_link.affiliate_link_original_url %></td>
56
+ <td>
57
+ <div class="btn-group d-flex" role="group">
58
+ <%= link_to "Link Details", affiliate_link, class: "btn btn-purple btn-xs" %>
59
+ <%= link_to "Update Link", edit_affiliate_link_path(affiliate_link), class: "btn btn-primary btn-xs" %>
60
+ <%= link_to "Remove", affiliate_link, method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
61
+ </div>
62
+ </td>
63
+ </tr>
64
+ <% end %>
65
+ </tbody>
66
+
67
+ </table>
68
+ </div>
69
+ <!-- Index - Table -->
70
+
71
+ <!-- New Button -->
72
+ <%= link_to phcdevworks_core_modules.new_affiliate_link_path, class: "btn btn-primary btn-sm" do %>
73
+ <i class="fad fa-plus-circle"></i>
74
+ Add a New Affiliate Link
75
+ <% end %>
76
+ <!-- New Button -->
77
+
78
+ </div>
79
+ <!-- Panel - Body -->
80
+
81
+ </div>
82
+ <!-- Panel -->
83
+
84
+ </div>
85
+ </div>
86
+ <!-- Page Content -->
@@ -0,0 +1,47 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Affiliate Manager" %>
3
+ <% phc_title_tagline "New Affiliate Link" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "Affiliate Link Index", phcdevworks_core_modules.affiliate_links_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- Edit Form -->
36
+ <%= render 'form', affiliate_link: @affiliate_link %>
37
+ <!-- Edit Form -->
38
+
39
+ </div>
40
+ <!-- Panel - Body -->
41
+
42
+ </div>
43
+ <!-- Panel -->
44
+
45
+ </div>
46
+ </div>
47
+ <!-- Page Content -->
@@ -0,0 +1,24 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Affiliate link name:</strong>
5
+ <%= @affiliate_link.affiliate_link_name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Affiliate link button text:</strong>
10
+ <%= @affiliate_link.affiliate_link_button_text %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Affiliate link url:</strong>
15
+ <%= @affiliate_link.affiliate_link_url %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Affiliate link original url:</strong>
20
+ <%= @affiliate_link.affiliate_link_original_url %>
21
+ </p>
22
+
23
+ <%= link_to 'Edit', edit_affiliate_link_path(@affiliate_link) %> |
24
+ <%= link_to 'Back', affiliate_links_path %>
@@ -24,9 +24,9 @@
24
24
  <div class="panel panel-inverse">
25
25
 
26
26
  <!-- Panel - Heading -->
27
- <div class="panel-heading">
28
- <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
- </div>
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %> - <%= yield(:phc_title_tagline) %></h4>
29
+ </div>
30
30
  <!-- Panel - Heading -->
31
31
 
32
32
  <!-- Panel - Body -->
data/config/routes.rb CHANGED
@@ -1,15 +1,23 @@
1
1
  PhcdevworksCoreModules::Engine.routes.draw do
2
2
 
3
+ namespace :affiliate do
4
+ resources :links
5
+ end
3
6
  # Routes for Posts
4
7
  namespace :post do
5
8
  resources :categories, class_name: 'Post::Category'
6
9
  end
7
-
10
+
8
11
  # Routes for Marketing
9
12
  namespace :marketing do
10
13
  resources :optimizations, class_name: 'Marketing::Optimization'
11
14
  end
12
-
15
+
16
+ # Routes for Affiliate
17
+ namespace :affiliate do
18
+ resources :links, class_name: 'Affiliate::Link'
19
+ end
20
+
13
21
  # Mount Routes
14
22
  mount PhcdevworksAccounts::Engine, :at => '/'
15
23
 
data/config/spring.rb CHANGED
@@ -1 +1,2 @@
1
- Spring.application_root = './spec/test_app'
1
+ Spring.application_root = './spec/test_app'
2
+
@@ -0,0 +1,18 @@
1
+ class CreatePhcdevworksCoreModulesAffiliateLinkVersions < ActiveRecord::Migration[6.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+ create_table :phcdevworks_core_modules_affiliate_link_versions do |t|
5
+
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
+
13
+ end
14
+
15
+ add_index :phcdevworks_core_modules_affiliate_link_versions, %i(item_type item_id), :name => 'affiliate_link_versions'
16
+
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ class CreatePhcdevworksCoreModulesAffiliateLinks < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :phcdevworks_core_modules_affiliate_links do |t|
4
+
5
+ t.string :affiliate_link_name
6
+ t.string :affiliate_link_button_text
7
+ t.string :affiliate_link_url
8
+ t.string :affiliate_link_original_url
9
+
10
+ t.string :slug
11
+ t.string :user_id
12
+ t.string :org_id
13
+
14
+ t.timestamps
15
+
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,6 @@
1
+ require "phcdevworks_core_modules/version"
1
2
  require "phcdevworks_core_modules/engine"
2
3
 
3
4
  module PhcdevworksCoreModules
4
- # Your code goes here...
5
+ # Your code goes here...
5
6
  end
@@ -1,46 +1,47 @@
1
1
  module PhcdevworksCoreModules
2
- class Engine < ::Rails::Engine
3
-
4
- # Load Main Dependencies
5
- require "jbuilder"
6
- require "paper_trail"
7
- require "friendly_id"
8
-
9
- # Load Theme Dependencies
10
- require "phcthemes_admin_panel_pack"
11
- require "phcthemes_web_theme_pack"
12
-
13
- # Load Helper Dependencies
14
- require "phcdevworks_core"
15
- require "phcdevworks_active_menus"
16
- require "phcdevworks_notifications"
17
- require "phcdevworks_titleseo"
18
-
19
- # Load Upload Dependencies
20
- require "aws-sdk-s3"
21
- require "google-cloud-storage"
22
- require "mini_magick"
23
-
24
- # Frontend Dependencies
25
- require "wicked"
26
- require "gravtastic"
27
- require "friendly_id"
28
-
29
- # Mailer Dependencies
30
- require "mail_form"
31
-
32
- # Load User Accounts
33
- require "phcdevworks_accounts"
34
-
35
- # Engine Namespace
36
- isolate_namespace PhcdevworksCoreModules
37
-
38
- # Rspec Generators
39
- config.generators do |g|
40
- g.test_framework :rspec
41
- g.fixture_replacement :factory_bot
42
- g.factory_bot dir: 'spec/factories'
43
- end
2
+ class Engine < ::Rails::Engine
3
+
4
+ # Load Main Dependencies
5
+ require "jbuilder"
6
+ require "paper_trail"
7
+ require "friendly_id"
8
+
9
+ # Load Theme Dependencies
10
+ require "phcthemes_admin_panel_pack"
11
+ require "phcthemes_web_theme_pack"
12
+
13
+ # Load Helper Dependencies
14
+ require "phcdevworks_core"
15
+ require "phcdevworks_active_menus"
16
+ require "phcdevworks_notifications"
17
+ require "phcdevworks_titleseo"
18
+
19
+ # Load Upload Dependencies
20
+ require "aws-sdk-s3"
21
+ require "google-cloud-storage"
22
+ require "mini_magick"
23
+
24
+ # Frontend Dependencies
25
+ require "wicked"
26
+ require "gravtastic"
27
+ require "friendly_id"
28
+
29
+ # Mailer Dependencies
30
+ require "mail_form"
31
+
32
+ # Load User Accounts
33
+ require "phcdevworks_accounts"
34
+
35
+ # Engine Namespace
36
+ isolate_namespace PhcdevworksCoreModules
37
+
38
+ # Rspec Generators
39
+ config.generators do |g|
40
+ g.test_framework :rspec
41
+ g.fixture_replacement :factory_bot
42
+ g.factory_bot dir: 'spec/factories'
43
+ g.factory_bot suffix: "factory"
44
+ end
44
45
 
45
- end
46
+ end
46
47
  end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '6.4.0'
2
+ VERSION = "7.1.2"
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: 6.4.0
4
+ version: 7.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2021-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,56 +30,56 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.10'
33
+ version: '2.11'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.10'
40
+ version: '2.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: paper_trail
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '11.0'
47
+ version: '11.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '11.0'
54
+ version: '11.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: phcthemes_admin_panel_pack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.2'
61
+ version: '4.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.2'
68
+ version: '4.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: phcthemes_web_theme_pack
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.2'
75
+ version: '4.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.2'
82
+ version: '4.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: phcdevworks_active_menus
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -184,42 +184,42 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '1.8'
187
+ version: '1.9'
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '1.8'
194
+ version: '1.9'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: aws-sdk-s3
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '1.85'
201
+ version: '1.89'
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '1.85'
208
+ version: '1.89'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: google-cloud-storage
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '1.29'
215
+ version: '1.30'
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '1.29'
222
+ version: '1.30'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: mini_magick
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '2.4'
243
+ version: '3.0'
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '2.4'
250
+ version: '3.0'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: factory_bot_rails
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -268,14 +268,14 @@ dependencies:
268
268
  requirements:
269
269
  - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: '4.0'
271
+ version: '4.1'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: '4.0'
278
+ version: '4.1'
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: spring
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -283,9 +283,6 @@ dependencies:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
285
  version: '2.1'
286
- - - ">="
287
- - !ruby/object:Gem::Version
288
- version: 2.1.1
289
286
  type: :development
290
287
  prerelease: false
291
288
  version_requirements: !ruby/object:Gem::Requirement
@@ -293,9 +290,6 @@ dependencies:
293
290
  - - "~>"
294
291
  - !ruby/object:Gem::Version
295
292
  version: '2.1'
296
- - - ">="
297
- - !ruby/object:Gem::Version
298
- version: 2.1.1
299
293
  - !ruby/object:Gem::Dependency
300
294
  name: spring-commands-rspec
301
295
  requirement: !ruby/object:Gem::Requirement
@@ -335,21 +329,25 @@ files:
335
329
  - README.md
336
330
  - Rakefile
337
331
  - app/assets/config/phcdevworks_core_modules_manifest.js
338
- - app/assets/javascripts/phcdevworks_core_modules/application.js
339
- - app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee
340
- - app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee
332
+ - app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee
333
+ - app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss
341
334
  - app/assets/stylesheets/phcdevworks_core_modules/application.scss
342
335
  - app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss
343
336
  - app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss
344
337
  - app/assets/stylesheets/scaffolds.scss
338
+ - app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb
345
339
  - app/controllers/phcdevworks_core_modules/application_controller.rb
346
340
  - app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb
347
341
  - app/controllers/phcdevworks_core_modules/post/categories_controller.rb
342
+ - app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb
348
343
  - app/helpers/phcdevworks_core_modules/application_helper.rb
349
344
  - app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb
350
345
  - app/helpers/phcdevworks_core_modules/post/categories_helper.rb
351
346
  - app/jobs/phcdevworks_core_modules/application_job.rb
352
347
  - app/mailers/phcdevworks_core_modules/application_mailer.rb
348
+ - app/models/phcdevworks_core_modules/affiliate.rb
349
+ - app/models/phcdevworks_core_modules/affiliate/link.rb
350
+ - app/models/phcdevworks_core_modules/affiliate_link_versions.rb
353
351
  - app/models/phcdevworks_core_modules/application_record.rb
354
352
  - app/models/phcdevworks_core_modules/marketing.rb
355
353
  - app/models/phcdevworks_core_modules/marketing/optimization.rb
@@ -362,6 +360,11 @@ files:
362
360
  - app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb
363
361
  - app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb
364
362
  - app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb
363
+ - app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb
364
+ - app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb
365
+ - app/views/phcdevworks_core_modules/affiliate/links/index.html.erb
366
+ - app/views/phcdevworks_core_modules/affiliate/links/new.html.erb
367
+ - app/views/phcdevworks_core_modules/affiliate/links/show.html.erb
365
368
  - app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb
366
369
  - app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb
367
370
  - app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb
@@ -379,6 +382,8 @@ files:
379
382
  - db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb
380
383
  - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
381
384
  - db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb
385
+ - db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb
386
+ - db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb
382
387
  - lib/phcdevworks_core_modules.rb
383
388
  - lib/phcdevworks_core_modules/engine.rb
384
389
  - lib/phcdevworks_core_modules/version.rb
@@ -386,7 +391,11 @@ files:
386
391
  homepage: https://phcdevworks.com/
387
392
  licenses:
388
393
  - MIT
389
- metadata: {}
394
+ metadata:
395
+ allowed_push_host: https://rubygems.org/
396
+ homepage_uri: https://phcdevworks.com/
397
+ source_code_uri: https://github.com/phcdevworks/phcdevworks_core_modules
398
+ changelog_uri: https://github.com/phcdevworks/phcdevworks_core_modules/releases
390
399
  post_install_message:
391
400
  rdoc_options: []
392
401
  require_paths:
@@ -1,2 +0,0 @@
1
- // Load Admin Theme
2
- //= require phcthemes_admin_panel_pack_coloradmin
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/