phcdevworks_core_modules 6.5.0 → 7.1.3

Sign up to get free protection for your applications and to get access to all the features.
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 +0 -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 +11 -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 +45 -43
  28. data/lib/phcdevworks_core_modules/version.rb +1 -1
  29. metadata +53 -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: e0c8ca2048bf5f9b5af2f4f0da070936eeeba533508455277011a6accb74f4f0
4
- data.tar.gz: cfefa7f461b715f45b5c9f7e3049f311ee77c3b68cf0fd5c83c3700fafc8cc9e
3
+ metadata.gz: d88f6ab35104d7ce13c4682287d09d7509c047e493fe6597f29b472d18f01393
4
+ data.tar.gz: af076a3e73a866fc3719102348ce91d666624725e8b4b0939f13e9d91b5e86a7
5
5
  SHA512:
6
- metadata.gz: f8fb980c0ce49d9432f299143214a5dcd84ef908d41adb381fe862cb71f81ab50f69f269aa02279eb0115f8f301dce7ab462a6a39e101b422bfa324482f0a81d
7
- data.tar.gz: c1ad3014782bdc2302372074da8a2e3289f7fa24491bf99bf737f7f12624ce469da5fa72ae1212f96588cb89ad9d0b691a7f47ae3d3edf4071e41cb2dfc42891
6
+ metadata.gz: 59cbefcf497264d752cb7d724b7537cb3c62287e2aabf72c8e0acb48ff883a3589d1048d6106e0703c3268944409f374596f74c052ca58c14a15e7efc0cdbe25
7
+ data.tar.gz: 6b58f8875af4f2b839548a940429b7a4dd268cca9fb65a1368952f861003c3d975e5734f29d77b3949ac9a62a18981418d4a250840049a7d8c26038527815bf3
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,4 +1,3 @@
1
- //= link_directory ../javascripts/phcdevworks_core_modules .js
2
1
  //= link_directory ../stylesheets/phcdevworks_core_modules .scss
3
2
  //= link phcthemes_admin_panel_pack_coloradmin.css
4
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,16 +1,25 @@
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 => '/'
23
+ mount PhcdevworksAccountsStripe::Engine, :at => '/'
15
24
 
16
25
  end
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,48 @@
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 Required PHC Plugins
33
+ require "phcdevworks_accounts"
34
+ require "phcdevworks_accounts_stripe"
35
+
36
+ # Engine Namespace
37
+ isolate_namespace PhcdevworksCoreModules
38
+
39
+ # Rspec Generators
40
+ config.generators do |g|
41
+ g.test_framework :rspec
42
+ g.fixture_replacement :factory_bot
43
+ g.factory_bot dir: 'spec/factories'
44
+ g.factory_bot suffix: "factory"
45
+ end
44
46
 
45
- end
47
+ end
46
48
  end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '6.5.0'
2
+ VERSION = "7.1.3"
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.5.0
4
+ version: 7.1.3
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-21 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,28 @@ dependencies:
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '2.5'
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.5'
250
+ version: '3.0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: phcdevworks_accounts_stripe
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: 0.1.1
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: 0.1.1
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: factory_bot_rails
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -268,14 +282,14 @@ dependencies:
268
282
  requirements:
269
283
  - - "~>"
270
284
  - !ruby/object:Gem::Version
271
- version: '4.0'
285
+ version: '4.1'
272
286
  type: :development
273
287
  prerelease: false
274
288
  version_requirements: !ruby/object:Gem::Requirement
275
289
  requirements:
276
290
  - - "~>"
277
291
  - !ruby/object:Gem::Version
278
- version: '4.0'
292
+ version: '4.1'
279
293
  - !ruby/object:Gem::Dependency
280
294
  name: spring
281
295
  requirement: !ruby/object:Gem::Requirement
@@ -283,9 +297,6 @@ dependencies:
283
297
  - - "~>"
284
298
  - !ruby/object:Gem::Version
285
299
  version: '2.1'
286
- - - ">="
287
- - !ruby/object:Gem::Version
288
- version: 2.1.1
289
300
  type: :development
290
301
  prerelease: false
291
302
  version_requirements: !ruby/object:Gem::Requirement
@@ -293,9 +304,6 @@ dependencies:
293
304
  - - "~>"
294
305
  - !ruby/object:Gem::Version
295
306
  version: '2.1'
296
- - - ">="
297
- - !ruby/object:Gem::Version
298
- version: 2.1.1
299
307
  - !ruby/object:Gem::Dependency
300
308
  name: spring-commands-rspec
301
309
  requirement: !ruby/object:Gem::Requirement
@@ -335,21 +343,25 @@ files:
335
343
  - README.md
336
344
  - Rakefile
337
345
  - 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
346
+ - app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee
347
+ - app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss
341
348
  - app/assets/stylesheets/phcdevworks_core_modules/application.scss
342
349
  - app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss
343
350
  - app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss
344
351
  - app/assets/stylesheets/scaffolds.scss
352
+ - app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb
345
353
  - app/controllers/phcdevworks_core_modules/application_controller.rb
346
354
  - app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb
347
355
  - app/controllers/phcdevworks_core_modules/post/categories_controller.rb
356
+ - app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb
348
357
  - app/helpers/phcdevworks_core_modules/application_helper.rb
349
358
  - app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb
350
359
  - app/helpers/phcdevworks_core_modules/post/categories_helper.rb
351
360
  - app/jobs/phcdevworks_core_modules/application_job.rb
352
361
  - app/mailers/phcdevworks_core_modules/application_mailer.rb
362
+ - app/models/phcdevworks_core_modules/affiliate.rb
363
+ - app/models/phcdevworks_core_modules/affiliate/link.rb
364
+ - app/models/phcdevworks_core_modules/affiliate_link_versions.rb
353
365
  - app/models/phcdevworks_core_modules/application_record.rb
354
366
  - app/models/phcdevworks_core_modules/marketing.rb
355
367
  - app/models/phcdevworks_core_modules/marketing/optimization.rb
@@ -362,6 +374,11 @@ files:
362
374
  - app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb
363
375
  - app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb
364
376
  - app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb
377
+ - app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb
378
+ - app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb
379
+ - app/views/phcdevworks_core_modules/affiliate/links/index.html.erb
380
+ - app/views/phcdevworks_core_modules/affiliate/links/new.html.erb
381
+ - app/views/phcdevworks_core_modules/affiliate/links/show.html.erb
365
382
  - app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb
366
383
  - app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb
367
384
  - app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb
@@ -379,6 +396,8 @@ files:
379
396
  - db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb
380
397
  - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
381
398
  - db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb
399
+ - db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb
400
+ - db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb
382
401
  - lib/phcdevworks_core_modules.rb
383
402
  - lib/phcdevworks_core_modules/engine.rb
384
403
  - lib/phcdevworks_core_modules/version.rb
@@ -386,7 +405,11 @@ files:
386
405
  homepage: https://phcdevworks.com/
387
406
  licenses:
388
407
  - MIT
389
- metadata: {}
408
+ metadata:
409
+ allowed_push_host: https://rubygems.org/
410
+ homepage_uri: https://phcdevworks.com/
411
+ source_code_uri: https://github.com/phcdevworks/phcdevworks_core_modules
412
+ changelog_uri: https://github.com/phcdevworks/phcdevworks_core_modules/releases
390
413
  post_install_message:
391
414
  rdoc_options: []
392
415
  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/