save/load selected email frequency on query review step

This commit is contained in:
Bilal Catic
2019-11-01 19:21:37 +01:00
parent 1117592f4c
commit 7cc9550031
3 changed files with 67 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
<form method="POST" id="form-queryreview">
<div class="row center-align">
<ul class="collection with-header">
<% for(const stepData of queryReviewData) { %>
<% for(const stepData of queryReviewTableData) { %>
<li class="collection-item" >
<div id="<%= stepData.id %>" ><%= stepData.title || '-' %>
<a href="<%= stepData.url %>" class="kivi-color secondary-content">
@@ -13,6 +13,26 @@
<% } %>
</ul>
</div>
<div class="row center-align">
<h6>Slanje obavještenja</h6>
<span class="segmented">
<label>
<input type="radio" name="emailFrequency" value="<%= EMAIL_FREQUENCY.ASAP.id %>"
<% if (selectedEmailFrequency === EMAIL_FREQUENCY.ASAP.id) { %>
checked
<% } %>>
<span class="label"><%= EMAIL_FREQUENCY.ASAP.title %></span>
</label>
<label>
<input type="radio" name="emailFrequency" value="<%= EMAIL_FREQUENCY.DAILY.id %>"
<% if (selectedEmailFrequency === EMAIL_FREQUENCY.DAILY.id) { %>
checked
<% } %>>
<span class="label"><%= EMAIL_FREQUENCY.DAILY.title %></span>
</label>
</span>
</div>
<div class="row center-align">
<div class="col">
<input id="email" name="email" type="email" placeholder="vas.email@mail.com" <% if (email) { %>value="<%= email %>" <% } %> required size="250" />
@@ -47,6 +67,7 @@
</form>
<script>
$(document).ready( () => {
$("#submit").click( () => {
const simpleEmailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;