license renew page

This commit is contained in:
Zin Moe
2020-06-04 10:10:04 +06:30
parent da75403437
commit bd18958b96
16 changed files with 181 additions and 55 deletions

View File

@@ -59,7 +59,8 @@
</p>
<% end %>
<% end %>
<% end %>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</section>
</body>

View File

@@ -53,6 +53,7 @@
<%= message %>
</div>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</section>
</body>

View File

@@ -56,7 +56,8 @@
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
</p>
<% end %>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</section>
</body>

View File

@@ -51,7 +51,8 @@
</div>
<% end %>
<% end %>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</section>
</body>

View File

@@ -60,6 +60,7 @@
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
</p>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</section>
</body>

View File

@@ -22,6 +22,7 @@
<%= message %>
</div>
<% end %>
<%= render 'shared/license_expire_warning' %>
<%= yield %>
</div>

View File

@@ -0,0 +1,72 @@
<% renewable_date = current_license.read_license("renewable_date") %>
<% date_count = (renewable_date.to_date - Date.today).to_i %>
<% day = pluralize( date_count, 'day' )%>
<% if @license_status == 0
text = 'Your license has been expired.'
elsif @license_status == 2
text = "Your license will expire in #{day}."
end
%>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2"></div>
<div class="card col-md-8 h-100" style="padding-left: 60px;">
<div class="card-block">
<h3 class="pt-2 d-inline">Renew Your License</h3>
<%= link_to origami_dashboard_url do %>
<img src="/image/logo.png" style="margin-left: 25pc; width: 150px">
<% end %>
<% if params[:message].present?
if params[:status].to_i == 1
color = 'text-success'
else
color = 'text-danger'
end
%>
<p class="<%= color %> m-t--30" style="font-weight: bold; font-size: 18px;"><%= params[:message] %></p><br>
<% end %>
<% if text %>
<h6 class="mb-2 "><%= text %></h6><br>
<% end %>
<h6 class="mb-2">Call Center Phone No: <a href="tel:+6494461709">+959 445 665 311</a></h6>
<br>
<h6>License Info:</h6>
<br>
<div class="container">
<div class="form-group row">
<label class="card-subtitle mb-2 col-md-4">Business Name:</label>
<label class="card-subtitle mb-2 "><strong><%= @bis_name %></strong></label>
</div>
<div class="form-group row">
<label class="card-subtitle mb-2 col-md-4">Plan:</label>
<label class="card-subtitle mb-2 "><strong><%= @plan %></strong></label>
</div>
</div>
<div class="form-group row">
<label class="card-subtitle mb-2 col-md-4 pl-4">Expired At: </label>
<label class="card-subtitle mb-2 "><strong><%= @expired_at.to_date.strftime('%B %d, %Y') %></strong></label>
</div>
</div>
<div class="col-md-12" style="padding-bottom: 20px;">
<%= link_to 'Home', origami_dashboard_url, class: 'btn btn-primary btn-lg' %>
<%= link_to 'Renew License', renew_url, class: 'btn btn-primary btn-lg float-right m-l-5 m-r-5' %>
<button onclick="history.back();" type='button' class="btn btn-lg btn-default float-right">Cancel</button>
</div>
</div>
<div class="col-sm-2"></div>
</div>
</div>
<script>
$(document).ready(function() {
$('.alert-warning, .navbar').hide()
$('html, section').css('background-color', '#61B8C9')
$('html').css('overflow-x', 'hidden')
$('section.content').css('margin', '70px 0 0 0')
})
</script>

View File

@@ -0,0 +1,21 @@
<% license_status = current_license.detail_with_local_file %>
<% renewable_date = current_license.read_license("renewable_date") %>
<% date_count = (renewable_date.to_date - Date.today).to_i %>
<% day = pluralize( date_count, 'day' )%>
<% if license_status == 0
text = 'Your license has expired.'
elsif license_status == 2
text = "Your license will expire in #{day}."
end
%>
<% if license_status == 0 || license_status == 2 %>
<div class="alert alert-warning fade show" role="alert" style="margin-top: -15px;">
<strong style="margin-left: 40px !important"><%= text %></strong>
<%= link_to 'Renew License', expire_url, class: 'btn btn-sm btn-primary', style: "margin-left: 40px !important"%>
<button type="button" class="close" data-dismiss="alert" aria-label="Close" style="padding-top: 5px;">
<span aria-hidden="true" class="text-white">&times;</span>
</button>
</div>
<% end %>