Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: APPS-1198 Add a terms of use reminder modal #104

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions app/assets/stylesheets/base/layout/body/_body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,149 @@
}
}

// Terms of User Modal

/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 5; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
}

/* Modal Content/Box */
.modal-content {
background-color: #f7f2ea;
margin: 4% auto;
padding: 25%;
border: 1px solid #87331a;
width: 92%;
}

.modal-terms {
margin: 20px auto;
}

.modal-terms-of-use {
font-size: $text-18;
padding: 20px;
}

// Modal Header
.modal-header {
padding: 2px 5px;
background-color: #87331a;
color: white;
}

.modal-logo-block {
display: flex;
align-items: flex-start;
justify-content: center;
white-space: nobreak;

@media (min-width: 1430px) {
width: 520px;
}

@media (max-width: 991px) {
margin-bottom: 0.5rem;
padding-left: 1.5rem;
}

@media (max-width: 767px) {
padding-left: 1rem;
display: flex;
flex-direction: column;
}

@media (max-width: 374px) {
flex-direction: column;
align-items: flex-start;
justify-content: unset;
}
}

.modal__logo-img--sinai {
color: white;
padding-right: 5px;
height: 66px;
}

.modal__logo-block--sinai-text-logo {
font-family: 'Dosis', sans-serif;
line-height: 1.25;
align-self: flex-end;
}

.modal__logo-title {
font-size: $text-28;
color: white;
text-transform: uppercase;
}

.modal-logo-subtitle--sinai {
display: block;
font-size: $text-18;
font-weight: 500;
color: white;
}

/* The Close Button */
.modal-button {
cursor: pointer;
background: linear-gradient(#87331a, #962605);
opacity:unset;
width: 50%;
padding: 10px;
margin-bottom:50px;
border-radius: 5px;
color: white;
text-align: center;
text-shadow: 0 0 0 0;
font-weight: 400;

@media (max-width: 767px) {
width: 100%;
}
}

.modal-button:hover {
background: linear-gradient(gray, rgb(72, 71, 71));
color: white;
text-decoration: none;
cursor: pointer;
font-size: 18px;
text-align: center;
text-shadow: 0 0 0 0;
opacity:unset;
padding: 10px;
margin-bottom:50px;
}

.modal-close {
color: white;
font-size: 18px;
text-shadow: 0 0 0 0;
float:none;
opacity:unset;
}

.close {
text-shadow: 0 0 0 0;
}

/* Margin over Terms of Use */
.terms {
margin-top: 50px;
}

/* ------------------------- */

.main-content-container {
margin-top: 4.25rem;
margin-bottom: 4.25rem;
Expand Down
61 changes: 46 additions & 15 deletions app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@

<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>

<%= favicon_link_tag 'favicon.ico' %>
<%= favicon_link_tag 'favicon.ico' %>

<% if Flipflop.sinai? %>
<%= stylesheet_link_tag 'https://fonts.googleapis.com/css2?family=Dosis:wght@400;500;600&display=swap' %>
<%= stylesheet_link_tag 'https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap' %>
<% end %>

<%= stylesheet_link_tag (Flipflop.sinai? ? "sinai" : "ursus"), media: "all" %>
<%= javascript_include_tag "application", defer: Rails.env.development? ? false : true %>
<%#= javascript_include_tag('terms_of_use_modal.js') %>
<%= csrf_meta_tags %>
<%= content_for(:head) %>
</head>
Expand All @@ -46,24 +45,56 @@

<div class="site-container" <%= schema_org_markup %>>
<%= render partial: 'shared/header/header_navbar' %>

<%= render 'catalog/banners/homepage_banner' %>

<% if Flipflop.sinai? && controller.controller_name == 'catalog' && controller.action_name == 'show' %>
<!-- TERMS OF USE MODAL -->

<!-- Trigger/Open The Modal -->
<button id="myBtn">Open Modal</button>

<!-- The Modal -->
<div id="modalTermsOfUse" class="modal modal-dialog-centered">

<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<div class='site-navbar__logo-block site-navbar__logo-block--sinai'>
<%= image_tag('sinai-logos/logo-sinai-no-text-wht.png', class: 'site-navbar__logo-img--sinai', alt: 'Sinai Manuscripts Digital Library') %>
<div class='modal__logo-block--sinai-text-logo'>
<span class='modal__logo-title'>Sinai Manuscripts Digital Library</span>
<span class="modal__logo-subtitle--sinai">A publication of St. Catherine's Monastery of the Sinai, Egypt</span>
</div>
</div>
</div>

<div class='modal-terms-of-use'>
<p class='modal-terms'>Manuscript images from the Sinai Manuscripts Digital Library should not be used without the express consent of St. Catherine's Monastery of the Sinai.</p>

<p class='modal-terms'>This includes use in published works and social media.</p>

<main class="main-content-container container-constrained container-constrained__item-page--sinai">
<%= content_for(:container_header) %>
<%= content_for?(:content) ? yield(:content) : yield %>
</main>
<p class='modal-terms'>For more information, see the Terms of Use below.</p>

<% else %>
<main class="main-content-container container-constrained">
<%= content_for(:container_header) %>
<%= content_for?(:content) ? yield(:content) : yield %>
</main>
<% end %>
<p class='modal-terms'>Click "I AGREE..." to continue using the site.</p>
</div>

<button class="modal-button"><span class="close modal-close">I AGREE <br>to the Sinai Manuscripts Digital Library<br>Terms of Use</span></button>

<hr />

<%= render partial: 'shared/terms_of_use_modal' %>
</div>
</div>

<!-- BODY -->
<main class="main-content-container container-constrained container-constrained__item-page--sinai">
<%= content_for(:container_header) %>
<%= content_for?(:content) ? yield(:content) : yield %>
</main>

<%= render partial: 'shared/footer/footer' %>
<%= render partial: 'shared/modal' %>
</div>
</body>
</html>


37 changes: 37 additions & 0 deletions app/views/shared/_terms_of_use_modal.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- TERMS OF USE MODAL -->
<!-- render partial: 'shared/terms_of_use_modal' -->
<!-- Trigger/Open The Modal -->
<button id="myBtn">Open Modal</button>

<!-- The Modal -->
<div id="modalTermsOfUse" class="modal modal-dialog-centered">

<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<div class='site-navbar__logo-block site-navbar__logo-block--sinai'>
<%= image_tag('sinai-logos/logo-sinai-no-text-wht.png', class: 'site-navbar__logo-img--sinai', alt: 'Sinai Manuscripts Digital Library') %>
<div class='modal__logo-block--sinai-text-logo'>
<span class='modal__logo-title'>Sinai Manuscripts Digital Library</span>
<span class="modal__logo-subtitle--sinai">A publication of St. Catherine's Monastery of the Sinai, Egypt</span>
</div>
</div>
</div>

<div class='modal-terms-of-use'>
<p class='modal-terms'>Manuscript images from the Sinai Manuscripts Digital Library should not be used without the express consent of St. Catherine's Monastery of the Sinai.</p>

<p class='modal-terms'>This includes use in published works and social media.</p>

<p class='modal-terms'>For more information, see the Terms of Use below.</p>

<p class='modal-terms'>Click "I AGREE..." to continue using the site.</p>
</div>

<button class="modal-button"><span class="close modal-close">I AGREE <br>to the Sinai Manuscripts Digital Library<br>Terms of Use</span></button>

<hr />

<%= render partial: 'shared/terms_of_use_modal' %>
</div>
</div>