diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-27 17:50:33 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-05-04 14:54:43 +0300 |
commit | 7684217d6806408cd338260119364419260d1720 (patch) | |
tree | 7b913d6c6c051a463d99ad286e2ac04a6b8d5632 /app/views/layouts | |
parent | 10aa55a770c2985c22c92d17b8a7ea90b0a09085 (diff) |
Enforces terms in the web application
This enforces the terms in the web application. These cases are
specced:
- Logging in: When terms are enforced, and a user logs in that has not
accepted the terms, they are presented with the screen. They get
directed to their customized root path afterwards.
- Signing up: After signing up, the first screen the user is presented
with the screen to accept the terms. After they accept they are
directed to the dashboard.
- While a session is active:
- For a GET: The user will be directed to the terms page first,
after they accept the terms, they will be directed to the page
they were going to
- For any other request: They are directed to the terms, after they
accept the terms, they are directed back to the page they came
from to retry the request. Any information entered would be
persisted in localstorage and available on the page.
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_flash.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/terms.html.haml | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 05ddd0ec733..8bd5708d490 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -1,8 +1,10 @@ +- extra_flash_class = local_assigns.fetch(:extra_flash_class, nil) + .flash-container.flash-container-page -# We currently only support `alert`, `notice`, `success` - flash.each do |key, value| -# Don't show a flash message if the message is nil - if value %div{ class: "flash-#{key}" } - %div{ class: (container_class) } + %div{ class: "#{container_class} #{extra_flash_class}" } %span= value diff --git a/app/views/layouts/terms.html.haml b/app/views/layouts/terms.html.haml index b04dbc595a5..a30d6e2688c 100644 --- a/app/views/layouts/terms.html.haml +++ b/app/views/layouts/terms.html.haml @@ -4,17 +4,15 @@ = render "layouts/head" %body{ data: { page: body_data_page } } - = render 'peek/bar' - .layout-page.terms - .content-wrapper + .layout-page.terms{ class: page_class } + .content-wrapper.prepend-top-0 .mobile-overlay .alert-wrapper = render "layouts/broadcast" = render 'layouts/header/read_only_banner' - = yield :flash_message - = render "layouts/flash" + = render "layouts/flash", extra_flash_class: 'limit-container-width' - %div{ class: "#{container_class}" } + %div{ class: "#{container_class} limit-container-width" } .content{ id: "content-body" } .panel.panel-default .panel-heading @@ -22,7 +20,7 @@ = brand_header_logo - logo_text = brand_header_logo_type - if logo_text.present? - %span.logo-text.hidden-xs + %span.logo-text.hidden-xs.prepend-left-8 = logo_text - if header_link?(:user_dropdown) .navbar-collapse.collapse @@ -34,4 +32,3 @@ .dropdown-menu-nav.dropdown-menu-align-right = render 'layouts/header/current_user_dropdown' = yield - = yield :scripts_body |