phcdevworks_core_modules 7.0.0 → 7.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee +3 -0
  3. data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +3 -0
  4. data/app/assets/stylesheets/scaffolds.scss +65 -0
  5. data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -0
  6. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +1 -1
  7. data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -0
  8. data/app/models/phcdevworks_core_modules/affiliate.rb +7 -0
  9. data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -0
  10. data/app/models/phcdevworks_core_modules/affiliate_link_versions.rb +5 -0
  11. data/app/views/layouts/phcdevworks_core_modules/application.html.erb +2 -2
  12. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +25 -8
  13. data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +27 -0
  14. data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +47 -0
  15. data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +86 -0
  16. data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +47 -0
  17. data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -0
  18. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +3 -3
  19. data/config/routes.rb +11 -2
  20. data/config/spring.rb +2 -0
  21. data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -0
  22. data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -0
  23. data/lib/phcdevworks_core_modules/engine.rb +3 -1
  24. data/lib/phcdevworks_core_modules/version.rb +1 -1
  25. metadata +48 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30ac8d6358fcbf47857965ccc3e0ea06b080ddbfb8d9564fc2a9a1d865cdc662
4
- data.tar.gz: bc75a4c488d765dc5bbbb0a99ffbf6cc45049ff20b6dbd373d8486bdf3ea12db
3
+ metadata.gz: 7a8e8f5072c8a86df640010491822d58434b5cbc756702abceb6d4d619b82a9d
4
+ data.tar.gz: ac9ebf6400b188784d83c9c8dbca1c0d19328dccec175f7008bc58cdda3bfac8
5
5
  SHA512:
6
- metadata.gz: 1b15dfa9d785ff498415af72a1471b6711c73fba6162ff8a4cb9f76a65b381b446093cfa96f128068d676c5a21a8d3a332610dbb5767426993365a2472c8a5f4
7
- data.tar.gz: 73022c91595a8dfee511900c94d4d2b8f61fbe9ab6b710056970aa02345bdb386a4d0fb0a199ae81d01fa141bfc7914ca256ee75ba38aa46729d6d6cfa9d99dc
6
+ metadata.gz: 94be373f8a20f4404403b7cd7301f79b6bae6769b762924c71956e42790e6af23c9ee0bfd117c5b5af1292435a12d6287bc32ebe90c3ee0a296f9dead3541bc0
7
+ data.tar.gz: 5beff1ce3ea3ed244d28c34d2c9a87adb68af19f971360e8ac635391fcee6d8c9d72aa3dc7f7e101263052afd2aa931cb58153c38589e895d389ddbab5bf0838
@@ -0,0 +1,3 @@
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/
@@ -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/
@@ -0,0 +1,65 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ margin: 33px; }
5
+
6
+ body, p, ol, ul, td {
7
+ font-family: verdana, arial, helvetica, sans-serif;
8
+ font-size: 13px;
9
+ line-height: 18px; }
10
+
11
+ pre {
12
+ background-color: #eee;
13
+ padding: 10px;
14
+ font-size: 11px; }
15
+
16
+ a {
17
+ color: #000; }
18
+
19
+ a:visited {
20
+ color: #666; }
21
+
22
+ a:hover {
23
+ color: #fff;
24
+ background-color: #000; }
25
+
26
+ th {
27
+ padding-bottom: 5px; }
28
+
29
+ td {
30
+ padding: 0 5px 7px; }
31
+
32
+ div.field,
33
+ div.actions {
34
+ margin-bottom: 10px; }
35
+
36
+ #notice {
37
+ color: green; }
38
+
39
+ .field_with_errors {
40
+ padding: 2px;
41
+ background-color: red;
42
+ display: table; }
43
+
44
+ #error_explanation {
45
+ width: 450px;
46
+ border: 2px solid red;
47
+ padding: 7px 7px 0;
48
+ margin-bottom: 20px;
49
+ background-color: #f0f0f0; }
50
+
51
+ #error_explanation h2 {
52
+ text-align: left;
53
+ font-weight: bold;
54
+ padding: 5px 5px 5px 15px;
55
+ font-size: 12px;
56
+ margin: -7px -7px 0;
57
+ background-color: #c00;
58
+ color: #fff; }
59
+
60
+ #error_explanation ul li {
61
+ font-size: 12px;
62
+ list-style: square; }
63
+
64
+ label {
65
+ display: block; }
@@ -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,25 @@
260
277
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
261
278
  <% end %>
262
279
 
280
+ <li class="nav-header">Administration</li>
263
281
  <% if current_user && current_user.admin? %>
264
282
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
265
- <li class="nav-header">User Administration</li>
266
283
  <li class="has-sub">
267
284
  <a href="javascript:;">
268
285
  <b class="caret"></b>
269
286
  <i class="fad fa-user"></i>
270
- <span>Admin</span>
287
+ <span>User Auth</span>
271
288
  </a>
272
289
  <ul class="sub-menu">
273
290
  <li class="<%= phc_menu_active_controller("phcdevworks_accounts/admin/users") %>"><%= link_to "User List", phcdevworks_accounts.admin_users_all_path %></li>
274
291
  </ul>
275
292
  </li>
276
293
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
277
- <% end %>
278
-
279
- <% if current_user %>
294
+ <% end %>
295
+
296
+ <li class="nav-header">Your Account</li>
297
+ <% if current_user %>
280
298
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts User Options -->
281
- <li class="nav-header">Your Account</li>
282
299
  <li class="has-sub">
283
300
  <a href="javascript:;">
284
301
  <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 ADDED
@@ -0,0 +1,2 @@
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
@@ -29,8 +29,9 @@ module PhcdevworksCoreModules
29
29
  # Mailer Dependencies
30
30
  require "mail_form"
31
31
 
32
- # Load User Accounts
32
+ # Load Required PHC Plugins
33
33
  require "phcdevworks_accounts"
34
+ require "phcdevworks_accounts_stripe"
34
35
 
35
36
  # Engine Namespace
36
37
  isolate_namespace PhcdevworksCoreModules
@@ -40,6 +41,7 @@ module PhcdevworksCoreModules
40
41
  g.test_framework :rspec
41
42
  g.fixture_replacement :factory_bot
42
43
  g.factory_bot dir: 'spec/factories'
44
+ g.factory_bot suffix: "factory"
43
45
  end
44
46
 
45
47
  end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '7.0.0'
2
+ VERSION = "7.1.4"
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: 7.0.0
4
+ version: 7.1.4
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-24 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
@@ -248,6 +248,20 @@ dependencies:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
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.4
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.4
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,17 +343,25 @@ files:
335
343
  - README.md
336
344
  - Rakefile
337
345
  - app/assets/config/phcdevworks_core_modules_manifest.js
346
+ - app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee
347
+ - app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss
338
348
  - app/assets/stylesheets/phcdevworks_core_modules/application.scss
339
349
  - app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss
340
350
  - app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss
351
+ - app/assets/stylesheets/scaffolds.scss
352
+ - app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb
341
353
  - app/controllers/phcdevworks_core_modules/application_controller.rb
342
354
  - app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb
343
355
  - app/controllers/phcdevworks_core_modules/post/categories_controller.rb
356
+ - app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb
344
357
  - app/helpers/phcdevworks_core_modules/application_helper.rb
345
358
  - app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb
346
359
  - app/helpers/phcdevworks_core_modules/post/categories_helper.rb
347
360
  - app/jobs/phcdevworks_core_modules/application_job.rb
348
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
349
365
  - app/models/phcdevworks_core_modules/application_record.rb
350
366
  - app/models/phcdevworks_core_modules/marketing.rb
351
367
  - app/models/phcdevworks_core_modules/marketing/optimization.rb
@@ -358,6 +374,11 @@ files:
358
374
  - app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb
359
375
  - app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb
360
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
361
382
  - app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb
362
383
  - app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb
363
384
  - app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb
@@ -369,11 +390,14 @@ files:
369
390
  - app/views/phcdevworks_core_modules/post/categories/new.html.erb
370
391
  - app/views/phcdevworks_core_modules/post/categories/show.html.erb
371
392
  - config/routes.rb
393
+ - config/spring.rb
372
394
  - db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb
373
395
  - db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb
374
396
  - db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb
375
397
  - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
376
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
377
401
  - lib/phcdevworks_core_modules.rb
378
402
  - lib/phcdevworks_core_modules/engine.rb
379
403
  - lib/phcdevworks_core_modules/version.rb