ama_layout 10.2.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +44 -0
- data/Dangerfile +19 -0
- data/README.md +2 -2
- data/ama_layout.gemspec +2 -2
- data/app/assets/javascripts/ama_layout/desktop/foundation-custom.js +1 -0
- data/app/assets/javascripts/ama_layout/mailcheck/email_suggestion.coffee +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/agent/_siteheader.html.erb +1 -1
- 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/v2/_font_awesome_pro_kit.html.erb +3 -0
- data/app/views/ama_layout/{_footer.html.erb → v2/_footer.html.erb} +9 -9
- 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/{_member_links.html.erb → v2/_member_links.html.erb} +0 -0
- data/app/views/ama_layout/{_mobile_links.html.erb → v2/_mobile_links.html.erb} +2 -2
- 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} +2 -2
- 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/{_top_nav.html.erb → v2/_top_nav.html.erb} +0 -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/_font_awesome_pro_kit.html.erb +3 -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 +1 -1
- data/lib/ama_layout/ama_layout_view.rb +6 -0
- data/lib/ama_layout/decorators/agent/navigation_decorator.rb +5 -3
- data/lib/ama_layout/decorators/navigation_decorator.rb +8 -8
- 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/notification_set.rb +2 -1
- data/lib/ama_layout/notifications/redis_store.rb +2 -2
- data/lib/ama_layout/version.rb +1 -1
- data/spec/ama_layout/decorators/moneris_decorator_spec.rb +10 -7
- data/spec/ama_layout/moneris_spec.rb +22 -3
- data/spec/ama_layout/notification_set_spec.rb +0 -6
- data/spec/ama_layout/notifications/redis_store_spec.rb +0 -14
- data/spec/helpers/ama_layout_content_helper_spec.rb +64 -62
- data/spec/spec_helper.rb +3 -1
- metadata +74 -36
- data/.travis.yml +0 -6
@@ -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}/help", class: 'm-side-nav__link' %>
|
14
|
+
</li>
|
15
|
+
<li class="m-side-nav__item">
|
16
|
+
<%= link_to 'Contact Us', "#{Rails.configuration.amaabca_site}/contact", 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 %>/help" target="_blank">Help</a>
|
16
|
+
</li>
|
17
|
+
<li>
|
18
|
+
<a href="<%= Rails.configuration.amaabca_site %>/contact">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
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module AmaLayout
|
2
4
|
module Agent
|
3
5
|
class NavigationDecorator
|
@@ -14,19 +16,19 @@ module AmaLayout
|
|
14
16
|
def sign_out_link
|
15
17
|
return '' unless user
|
16
18
|
|
17
|
-
h.render partial: '
|
19
|
+
h.render partial: ama_layout_partial('sign_out_link')
|
18
20
|
end
|
19
21
|
|
20
22
|
def top_nav
|
21
23
|
return '' unless user
|
22
24
|
|
23
|
-
h.render partial: '
|
25
|
+
h.render partial: ama_layout_partial('agent/top_nav'), locals: { navigation: self }
|
24
26
|
end
|
25
27
|
|
26
28
|
def sidebar
|
27
29
|
return '' unless user
|
28
30
|
|
29
|
-
h.render partial: '
|
31
|
+
h.render partial: ('sidebar'), locals: { navigation: self }
|
30
32
|
end
|
31
33
|
|
32
34
|
def cash_drawer_name
|
@@ -15,25 +15,25 @@ module AmaLayout
|
|
15
15
|
def sign_out_link
|
16
16
|
return '' unless user
|
17
17
|
|
18
|
-
h.render partial: '
|
18
|
+
h.render partial: ama_layout_partial('sign_out_link')
|
19
19
|
end
|
20
20
|
|
21
21
|
def member_links
|
22
22
|
return '' unless user && %w[member member_renewal member_outstanding_balance].include?(user.try(:menu_key))
|
23
23
|
|
24
|
-
h.render partial: '
|
24
|
+
h.render partial: ama_layout_partial('member_links')
|
25
25
|
end
|
26
26
|
|
27
27
|
def top_nav
|
28
28
|
return '' unless user
|
29
29
|
|
30
|
-
h.render partial: '
|
30
|
+
h.render partial: ama_layout_partial('top_nav'), locals: { navigation: self }
|
31
31
|
end
|
32
32
|
|
33
33
|
def sidebar
|
34
34
|
return '' if items.none?
|
35
35
|
|
36
|
-
h.render partial: '
|
36
|
+
h.render partial: ama_layout_partial('sidebar'), locals: { navigation: self }
|
37
37
|
end
|
38
38
|
|
39
39
|
def name_or_email
|
@@ -47,19 +47,19 @@ module AmaLayout
|
|
47
47
|
def notification_icon
|
48
48
|
return '' unless user
|
49
49
|
|
50
|
-
h.render '
|
50
|
+
h.render ama_layout_partial('notification_icon'), navigation: self
|
51
51
|
end
|
52
52
|
|
53
53
|
def mobile_notification_icon
|
54
54
|
return '' unless user
|
55
55
|
|
56
|
-
h.render '
|
56
|
+
h.render ama_layout_partial('mobile_notification_icon'), navigation: self
|
57
57
|
end
|
58
58
|
|
59
59
|
def mobile_links
|
60
60
|
return '' if user
|
61
61
|
|
62
|
-
h.render '
|
62
|
+
h.render ama_layout_partial('mobile_links')
|
63
63
|
end
|
64
64
|
|
65
65
|
def notification_badge
|
@@ -78,7 +78,7 @@ module AmaLayout
|
|
78
78
|
def notification_sidebar
|
79
79
|
return '' unless user
|
80
80
|
|
81
|
-
h.render '
|
81
|
+
h.render ama_layout_partial('notification_sidebar'), navigation: self, notifications: decorated_notifications
|
82
82
|
end
|
83
83
|
|
84
84
|
def notifications_heading
|
@@ -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;
|
@@ -21,11 +21,11 @@ module AmaLayout
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def set(key, value, opts = {})
|
24
|
-
base.write(key, value, opts)
|
24
|
+
base.write(key, value, opts)
|
25
25
|
end
|
26
26
|
|
27
27
|
def delete(key, opts = {})
|
28
|
-
base.delete(key, opts)
|
28
|
+
base.delete(key, opts)
|
29
29
|
end
|
30
30
|
|
31
31
|
def transaction
|