ama_layout 9.5.3 → 11.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +45 -0
- data/.ruby-version +1 -0
- data/Dangerfile +19 -0
- data/ama_layout.gemspec +33 -18
- data/app/assets/javascripts/ama_layout/desktop/foundation-custom.js +1 -0
- data/app/helpers/ama_layout_breadcrumb_helper.rb +7 -1
- data/app/helpers/ama_layout_content_helper.rb +28 -17
- data/app/helpers/ama_layout_partial_helper.rb +11 -0
- data/app/views/ama_layout/{_alert.html.erb → v2/_alert.html.erb} +0 -0
- data/app/views/ama_layout/{_applogo.html.erb → v2/_applogo.html.erb} +0 -0
- data/app/views/ama_layout/{_breadcrumbs.html.erb → v2/_breadcrumbs.html.erb} +0 -0
- data/app/views/ama_layout/{_custom_nav_links.html.erb → v2/_custom_nav_links.html.erb} +0 -0
- data/app/views/ama_layout/{_custom_sidebar.html.erb → v2/_custom_sidebar.html.erb} +0 -0
- data/app/views/ama_layout/v2/_font.html.erb +1 -0
- data/app/views/ama_layout/{_footer.html.erb → v2/_footer.html.erb} +0 -0
- data/app/views/ama_layout/{_main_nav_item.html.erb → v2/_main_nav_item.html.erb} +0 -0
- data/app/views/ama_layout/{_main_top_nav_item.html.erb → v2/_main_top_nav_item.html.erb} +0 -0
- data/app/views/ama_layout/v2/_member_links.html.erb +6 -0
- data/app/views/ama_layout/{_mobile_links.html.erb → v2/_mobile_links.html.erb} +0 -0
- data/app/views/ama_layout/{_mobile_notification_icon.html.erb → v2/_mobile_notification_icon.html.erb} +0 -0
- data/app/views/ama_layout/{_notice.html.erb → v2/_notice.html.erb} +0 -0
- data/app/views/ama_layout/{_notices.html.erb → v2/_notices.html.erb} +0 -0
- data/app/views/ama_layout/{_notification.html.erb → v2/_notification.html.erb} +0 -0
- data/app/views/ama_layout/{_notification_icon.html.erb → v2/_notification_icon.html.erb} +0 -0
- data/app/views/ama_layout/{_notification_sidebar.html.erb → v2/_notification_sidebar.html.erb} +1 -1
- data/app/views/ama_layout/{_sidebar.html.erb → v2/_sidebar.html.erb} +0 -0
- data/app/views/ama_layout/{_sign_out_link.html.erb → v2/_sign_out_link.html.erb} +0 -0
- data/app/views/ama_layout/{_siteheader.html.erb → v2/_siteheader.html.erb} +0 -0
- data/app/views/ama_layout/{_sub_nav.html.erb → v2/_sub_nav.html.erb} +0 -0
- data/app/views/ama_layout/{_sub_nav_item.html.erb → v2/_sub_nav_item.html.erb} +0 -0
- data/app/views/ama_layout/{_success.html.erb → v2/_success.html.erb} +0 -0
- data/app/views/ama_layout/v2/_top_nav.html.erb +16 -0
- data/app/views/ama_layout/{_top_sub_nav.html.erb → v2/_top_sub_nav.html.erb} +0 -0
- data/app/views/ama_layout/{_top_sub_nav_item.html.erb → v2/_top_sub_nav_item.html.erb} +0 -0
- data/app/views/ama_layout/v3/_alert.html.erb +5 -0
- data/app/views/ama_layout/v3/_applogo.html.erb +3 -0
- data/app/views/ama_layout/v3/_breadcrumbs.html.erb +3 -0
- data/app/views/ama_layout/v3/_custom_nav_links.html.erb +0 -0
- data/app/views/ama_layout/v3/_custom_sidebar.html.erb +1 -0
- data/app/views/ama_layout/v3/_font.html.erb +2 -0
- data/app/views/ama_layout/v3/_footer.html.erb +69 -0
- data/app/views/ama_layout/v3/_main_nav_item.html.erb +6 -0
- data/app/views/ama_layout/v3/_main_top_nav_item.html.erb +4 -0
- data/app/views/ama_layout/v3/_member_links.html.erb +6 -0
- data/app/views/ama_layout/v3/_mobile_links.html.erb +19 -0
- data/app/views/ama_layout/v3/_mobile_notification_icon.html.erb +4 -0
- data/app/views/ama_layout/v3/_notice.html.erb +5 -0
- data/app/views/ama_layout/v3/_notices.html.erb +3 -0
- data/app/views/ama_layout/v3/_notification.html.erb +10 -0
- data/app/views/ama_layout/v3/_notification_icon.html.erb +6 -0
- data/app/views/ama_layout/v3/_notification_sidebar.html.erb +22 -0
- data/app/views/ama_layout/v3/_sidebar.html.erb +8 -0
- data/app/views/ama_layout/v3/_sign_out_link.html.erb +3 -0
- data/app/views/ama_layout/v3/_siteheader.html.erb +37 -0
- data/app/views/ama_layout/v3/_sub_nav.html.erb +3 -0
- data/app/views/ama_layout/v3/_sub_nav_item.html.erb +3 -0
- data/app/views/ama_layout/v3/_success.html.erb +5 -0
- data/app/views/ama_layout/v3/_top_nav.html.erb +16 -0
- data/app/views/ama_layout/v3/_top_sub_nav.html.erb +3 -0
- data/app/views/ama_layout/v3/_top_sub_nav_item.html.erb +3 -0
- data/config.ru +9 -0
- data/lib/ama_layout/ama_layout_view.rb +6 -0
- data/lib/ama_layout/decorators/agent/navigation_decorator.rb +11 -6
- data/lib/ama_layout/decorators/navigation_decorator.rb +41 -26
- data/lib/ama_layout/draper_replacement.rb +6 -0
- data/lib/ama_layout/moneris.rb +10 -1
- data/lib/ama_layout/moneris/{textbox.txt → v2/textbox.txt} +0 -0
- data/lib/ama_layout/moneris/v3/textbox.txt +62 -0
- data/lib/ama_layout/navigation.rb +16 -9
- data/lib/ama_layout/navigation.yml +2 -2
- data/lib/ama_layout/version.rb +3 -1
- data/spec/ama_layout/decorators/moneris_decorator_spec.rb +10 -7
- data/spec/ama_layout/decorators/navigation_decorator_spec.rb +115 -60
- data/spec/ama_layout/moneris_spec.rb +22 -3
- data/spec/factories/agent_navigation.rb +3 -1
- data/spec/factories/navigation.rb +3 -1
- data/spec/factories/navigation_item.rb +6 -4
- data/spec/factories/users.rb +20 -13
- data/spec/helpers/ama_layout_content_helper_spec.rb +64 -62
- data/spec/internal/app/assets/config/manifest.js +0 -0
- data/spec/internal/db/schema.rb +4 -1
- data/spec/spec_helper.rb +3 -1
- metadata +104 -80
- data/.travis.yml +0 -6
- data/app/views/ama_layout/_top_nav.html.erb +0 -11
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="m-side-nav__content off-canvas position-left" id="offCanvasLeft" data-off-canvas>
|
2
|
+
<ul class="m-side-nav__list vertical menu drilldown" data-drilldown>
|
3
|
+
<li class="side-nav__item">
|
4
|
+
<%= link_to 'Sign In', "#{Rails.configuration.gatekeeper_site}/login", class: 'side-nav__link' %>
|
5
|
+
</li>
|
6
|
+
<li class="m-side-nav__item">
|
7
|
+
<%= link_to 'AMA Website', Rails.configuration.amaabca_site, class: 'm-side-nav__link' %>
|
8
|
+
</li>
|
9
|
+
<li class="m-side-nav__item">
|
10
|
+
<%= link_to 'AMA Road Reports', 'https://roadreports.ama.ab.ca', class: 'm-side-nav__link' %>
|
11
|
+
</li>
|
12
|
+
<li class="m-side-nav__item">
|
13
|
+
<%= link_to 'Help', "#{Rails.configuration.amaabca_site}/knowledge-base/articles", class: 'm-side-nav__link' %>
|
14
|
+
</li>
|
15
|
+
<li class="m-side-nav__item">
|
16
|
+
<%= link_to 'Contact Us', "#{Rails.configuration.amaabca_site}/membership/contact-us--centre-locations-hours-and-contact-information", class: 'm-side-nav__link' %>
|
17
|
+
</li>
|
18
|
+
</ul>
|
19
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="row <%= notification.active_class %>">
|
2
|
+
<div class="small-2 column">
|
3
|
+
<%= notification.icon %>
|
4
|
+
</div>
|
5
|
+
<div class="small-10 column">
|
6
|
+
<p class="bold"><%= notification.header %></p>
|
7
|
+
<p><%= sanitize notification.content, scrubber: AmaLayout::NotificationScrubber.new %></p>
|
8
|
+
<p class="micetype"><%= notification.created_at %></p>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="off-canvas position-right right-sidebar" id="offCanvasRight" data-off-canvas>
|
2
|
+
<div class="row column right-sidebar__header">
|
3
|
+
<h2 class="mt1">Notification Centre</h2>
|
4
|
+
<button class="close-button" aria-label="Close menu" type="button" data-close>
|
5
|
+
<span aria-hidden="true">×</span>
|
6
|
+
</button>
|
7
|
+
</div>
|
8
|
+
<div class="row column">
|
9
|
+
<%= navigation.notifications_heading %>
|
10
|
+
</div>
|
11
|
+
<%= render partial: ama_layout_partial('notification'), collection: notifications %>
|
12
|
+
<div class="row column">
|
13
|
+
<p class="mt1">Did You Know?</p>
|
14
|
+
<div class="section-content">
|
15
|
+
<p class="bold">Sign up for Vehicle Registration Auto-Renew</p>
|
16
|
+
<p>
|
17
|
+
We'll process your payment and mail you a new registration certificate and licence plate sticker. It's that simple!
|
18
|
+
</p>
|
19
|
+
<%= link_to 'Sign up now', "#{Rails.configuration.registries_site}/order/registrations/new", class: 'button--right button--expand-small-down' %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<aside class="side-nav" data-equalizer-watch="page-container-equalize">
|
2
|
+
<h2 class="side-nav__header">Online Account</h2>
|
3
|
+
<div class="side-nav__content">
|
4
|
+
<ul class="side-nav__list">
|
5
|
+
<%= render partial: "ama_layout/main_nav_item", collection: navigation.items, as: :nav_item %>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
</aside>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="header">
|
2
|
+
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="large">
|
3
|
+
<button class="menu-icon" type="button" data-toggle="offCanvasLeft"></button>
|
4
|
+
<%= link_to(image_tag("ama-logo.png"), Rails.configuration.amaabca_site, class: "title-bar__logo") %>
|
5
|
+
<%= navigation.mobile_notification_icon %>
|
6
|
+
</div>
|
7
|
+
<div class="top-bar" id="main-menu">
|
8
|
+
<div class="top-bar-left">
|
9
|
+
<a href="<%= Rails.configuration.amaabca_site %>" class="ml1 pl1"><i class="fas fa-chevron-left pr1"></i> Back to Other AMA Services</a>
|
10
|
+
</div>
|
11
|
+
<div class="top-bar-right">
|
12
|
+
<ul class="menu" data-responsive-menu="drilldown medium-dropdown">
|
13
|
+
<%= navigation.notification_icon %>
|
14
|
+
<li>
|
15
|
+
<a href="<%= Rails.configuration.amaabca_site %>/knowledge-base/articles" target="_blank">Help</a>
|
16
|
+
</li>
|
17
|
+
<li>
|
18
|
+
<a href="<%= Rails.configuration.amaabca_site %>/membership/contact-us--centre-locations-hours-and-contact-information">Contact Us</a>
|
19
|
+
</li>
|
20
|
+
<%= navigation.account_toggle(self) %>
|
21
|
+
<%= navigation.top_nav %>
|
22
|
+
</ul>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<%= navigation.mobile_links %>
|
27
|
+
<%= navigation.notification_sidebar %>
|
28
|
+
<div class="javascript_errors error_notification" hidden></div>
|
29
|
+
<noscript>
|
30
|
+
<div class="mt1 large-12 columns text-center error_notification">
|
31
|
+
<h2 class="mt1">There seems to be an issue with your browser.</h2>
|
32
|
+
<h5>Javascript is disabled in your web browser.</h5>
|
33
|
+
<div class='fieldset text-center small mb1 block'>
|
34
|
+
For full functionality of this site it is necessary to enable JavaScript. Here are the <a href="http://www.enable-javascript.com/" target="_blank"> instructions how to enable JavaScript in your web browser</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</noscript>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<li class="has-submenu">
|
2
|
+
<%= link_to navigation.display_name_text, '#', class: 'link--no-underline' %>
|
3
|
+
<ul class="submenu menu vertical">
|
4
|
+
<li class="bold">
|
5
|
+
<%= link_to 'Account Settings', "#{Rails.configuration.gatekeeper_site}/account_settings" %>
|
6
|
+
</li>
|
7
|
+
<li class="small-text">
|
8
|
+
<%= link_to 'Change Email/Password', "#{Rails.configuration.gatekeeper_site}/user/edit" %>
|
9
|
+
</li>
|
10
|
+
<li class="small-text">
|
11
|
+
<%= link_to 'Email Subscriptions', "#{Rails.configuration.youraccount_site}/subscriptions" %>
|
12
|
+
</li>
|
13
|
+
<%= navigation.member_links %>
|
14
|
+
<%= navigation.sign_out_link %>
|
15
|
+
</ul>
|
16
|
+
</li>
|
data/config.ru
ADDED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module AmaLayout
|
2
4
|
module Agent
|
3
5
|
class NavigationDecorator
|
@@ -12,18 +14,21 @@ module AmaLayout
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def sign_out_link
|
15
|
-
return
|
16
|
-
|
17
|
+
return '' unless user
|
18
|
+
|
19
|
+
h.render partial: ama_layout_partial('sign_out_link')
|
17
20
|
end
|
18
21
|
|
19
22
|
def top_nav
|
20
|
-
return
|
21
|
-
|
23
|
+
return '' unless user
|
24
|
+
|
25
|
+
h.render partial: ama_layout_partial('agent/top_nav'), locals: { navigation: self }
|
22
26
|
end
|
23
27
|
|
24
28
|
def sidebar
|
25
|
-
return
|
26
|
-
|
29
|
+
return '' unless user
|
30
|
+
|
31
|
+
h.render partial: ('sidebar'), locals: { navigation: self }
|
27
32
|
end
|
28
33
|
|
29
34
|
def cash_drawer_name
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module AmaLayout
|
2
4
|
class NavigationDecorator
|
3
5
|
include AmaLayout::DraperReplacement
|
@@ -11,16 +13,27 @@ module AmaLayout
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def sign_out_link
|
14
|
-
return
|
15
|
-
|
16
|
+
return '' unless user
|
17
|
+
|
18
|
+
h.render partial: ama_layout_partial('sign_out_link')
|
19
|
+
end
|
20
|
+
|
21
|
+
def member_links
|
22
|
+
return '' unless user && %w[member member_renewal member_outstanding_balance].include?(user.try(:menu_key))
|
23
|
+
|
24
|
+
h.render partial: ama_layout_partial('member_links')
|
16
25
|
end
|
17
26
|
|
18
27
|
def top_nav
|
19
|
-
|
28
|
+
return '' unless user
|
29
|
+
|
30
|
+
h.render partial: ama_layout_partial('top_nav'), locals: { navigation: self }
|
20
31
|
end
|
21
32
|
|
22
33
|
def sidebar
|
23
|
-
|
34
|
+
return '' if items.none?
|
35
|
+
|
36
|
+
h.render partial: ama_layout_partial('sidebar'), locals: { navigation: self }
|
24
37
|
end
|
25
38
|
|
26
39
|
def name_or_email
|
@@ -28,42 +41,44 @@ module AmaLayout
|
|
28
41
|
end
|
29
42
|
|
30
43
|
def account_toggle(view_data = {})
|
31
|
-
h(view_data).render partial:
|
44
|
+
h(view_data).render partial: 'account_toggle'
|
32
45
|
end
|
33
46
|
|
34
47
|
def notification_icon
|
35
|
-
|
36
|
-
|
37
|
-
|
48
|
+
return '' unless user
|
49
|
+
|
50
|
+
h.render ama_layout_partial('notification_icon'), navigation: self
|
38
51
|
end
|
39
52
|
|
40
53
|
def mobile_notification_icon
|
41
|
-
|
42
|
-
|
43
|
-
|
54
|
+
return '' unless user
|
55
|
+
|
56
|
+
h.render ama_layout_partial('mobile_notification_icon'), navigation: self
|
44
57
|
end
|
45
58
|
|
46
59
|
def mobile_links
|
47
|
-
|
60
|
+
return '' if user
|
61
|
+
|
62
|
+
h.render ama_layout_partial('mobile_links')
|
48
63
|
end
|
49
64
|
|
50
65
|
def notification_badge
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
66
|
+
return '' unless new_notifications?
|
67
|
+
|
68
|
+
h.content_tag(
|
69
|
+
:div,
|
70
|
+
active_notification_count,
|
71
|
+
class: 'notification__badge',
|
72
|
+
data: {
|
73
|
+
notification_count: true
|
74
|
+
}
|
75
|
+
)
|
61
76
|
end
|
62
77
|
|
63
78
|
def notification_sidebar
|
64
|
-
|
65
|
-
|
66
|
-
|
79
|
+
return '' unless user
|
80
|
+
|
81
|
+
h.render ama_layout_partial('notification_sidebar'), navigation: self, notifications: decorated_notifications
|
67
82
|
end
|
68
83
|
|
69
84
|
def notifications_heading
|
@@ -85,7 +100,7 @@ module AmaLayout
|
|
85
100
|
end
|
86
101
|
|
87
102
|
def new_notifications?
|
88
|
-
active_notification_count
|
103
|
+
active_notification_count.positive?
|
89
104
|
end
|
90
105
|
end
|
91
106
|
end
|
@@ -1,8 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../app/helpers/ama_layout_partial_helper'
|
4
|
+
|
1
5
|
module AmaLayout
|
2
6
|
module DraperReplacement
|
3
7
|
extend ActiveSupport::Concern
|
4
8
|
|
5
9
|
included do
|
10
|
+
include AmaLayoutPartialHelper
|
11
|
+
|
6
12
|
attr_accessor :object, :controller
|
7
13
|
|
8
14
|
def h(view_data = {})
|
data/lib/ama_layout/moneris.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module AmaLayout
|
2
4
|
class Moneris
|
3
5
|
include ActiveModel::Model
|
@@ -9,7 +11,14 @@ module AmaLayout
|
|
9
11
|
attr_accessor :textbox_style_file
|
10
12
|
|
11
13
|
def textbox_style_file
|
12
|
-
@textbox_style_file ||= File.join
|
14
|
+
@textbox_style_file ||= File.join(
|
15
|
+
Gem.loaded_specs['ama_layout'].full_gem_path,
|
16
|
+
'lib',
|
17
|
+
'ama_layout',
|
18
|
+
'moneris',
|
19
|
+
Rails.configuration.stylesheet_resolver.version,
|
20
|
+
'textbox.txt'
|
21
|
+
)
|
13
22
|
end
|
14
23
|
end
|
15
24
|
end
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
1
|
+
-webkit-appearance: none;
|
2
|
+
-webkit-box-shadow: none;
|
3
|
+
-webkit-rtl-ordering: logical;
|
4
|
+
-webkit-transition-delay: 0s, 0s;
|
5
|
+
-webkit-transition-duration: 0.45s, 0.45s;
|
6
|
+
-webkit-transition-property: box-shadow, border-color;
|
7
|
+
-webkit-transition-timing-function: ease, ease-in-out;
|
8
|
+
-webkit-user-select: text;
|
9
|
+
-webkit-writing-mode: horizontal-tb;
|
10
|
+
background-color: rgb(255, 255, 255);
|
11
|
+
border-bottom-color: rgb(160, 160, 161);
|
12
|
+
border-bottom-style: solid;
|
13
|
+
border-bottom-width: 2px;
|
14
|
+
border-image-outset: 0px;
|
15
|
+
border-image-repeat: stretch;
|
16
|
+
border-image-slice: 100%;
|
17
|
+
border-image-source: none;
|
18
|
+
border-image-width: 1;
|
19
|
+
border-left-color: rgb(160, 160, 161);
|
20
|
+
border-left-style: solid;
|
21
|
+
border-left-width: 2px;
|
22
|
+
border-right-color: rgb(160, 160, 161);
|
23
|
+
border-right-style: solid;
|
24
|
+
border-right-width: 2px;
|
25
|
+
border-top-color: rgb(160, 160, 161);
|
26
|
+
border-top-style: solid;
|
27
|
+
border-top-width: 2px;
|
28
|
+
box-shadow: none;
|
29
|
+
border-radius: 9px;
|
30
|
+
box-sizing: border-box;
|
31
|
+
color: rgba(0, 0, 0, 0.74902);
|
32
|
+
cursor: auto;
|
33
|
+
display: block;
|
34
|
+
font-family: 'Open Sans', Helvetica, Roboto, Arial, sans-serif;
|
35
|
+
font-size: 18px;
|
36
|
+
font-style: normal;
|
37
|
+
font-variant: normal;
|
38
|
+
font-weight: normal;
|
39
|
+
height: 63px !important;
|
40
|
+
overflow: hidden;
|
41
|
+
letter-spacing: normal;
|
42
|
+
line-height: normal;
|
43
|
+
margin-bottom: 0px;
|
44
|
+
margin-left: 0px;
|
45
|
+
margin-right: 0px;
|
46
|
+
margin-top: 0px;
|
47
|
+
outline-color: rgb(36, 108, 169);
|
48
|
+
padding-bottom: 8px;
|
49
|
+
padding-left: 8px;
|
50
|
+
padding-right: 8px;
|
51
|
+
padding-top: 8px;
|
52
|
+
text-align: start;
|
53
|
+
text-indent: 0px;
|
54
|
+
text-shadow: none;
|
55
|
+
text-transform: none;
|
56
|
+
transition-delay: 0s, 0s;
|
57
|
+
transition-duration: 0.45s, 0.45s;
|
58
|
+
transition-property: box-shadow, border-color;
|
59
|
+
transition-timing-function: ease, ease-in-out;
|
60
|
+
width: 100%;
|
61
|
+
word-spacing: 0px;
|
62
|
+
writing-mode: lr-tb;
|