sunrise-cms/views/funeralHome-view.ejs

139 lines
4.5 KiB
Plaintext

<%- include('_header'); -%>
<nav class="breadcrumb">
<ul>
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
<li>
<a href="<%= urlPrefix %>/funeralHomes">
<span class="icon is-small"><i class="fas fa-place-of-worship" aria-hidden="true"></i></span>
<span>Funeral Homes</span>
</a>
</li>
<li class="is-active">
<a href="#" aria-current="page">
<%= funeralHome.funeralHomeName || "(No Name)" %>
</a>
</li>
</ul>
</nav>
<h1 class="title is-1">
<%= funeralHome.funeralHomeName || "(No Name)" %>
</h1>
<div class="columns is-vcentered p-0 is-fixed-bottom has-background-white has-shadow is-hidden-print">
<div class="column">
<span class="has-text-weight-bold">
<%= funeralHome.funeralHomeName || "(No Name)" %>
</span>
</div>
<div class="column is-narrow has-text-right">
<% if (user.userProperties.canUpdate) { %>
<a class="button is-primary"
href="<%= urlPrefix %>/funeralHomes/<%= funeralHome.funeralHomeId %>/edit"
accesskey="e">
<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
<span>
Edit
<span class="is-hidden-mobile">Funeral Home</span>
</span>
</a>
<% } %>
</div>
</div>
<div class="panel">
<div class="panel-block is-block">
<div class="columns">
<div class="column">
<strong>Address</strong><br />
<% if (funeralHome.funeralHomeAddress1 !== "") { %>
<%= funeralHome.funeralHomeAddress1 %><br />
<% } %>
<% if (funeralHome.funeralHomeAddress2 !== "") { %>
<%= funeralHome.funeralHomeAddress2 %><br />
<% } %>
<%= funeralHome.funeralHomeCity %>, <%= funeralHome.funeralHomeProvince %><br />
<%= funeralHome.funeralHomePostalCode %>
</div>
<% if (funeralHome.funeralHomePhoneNumber !== "") { %>
<div class="column">
<strong>Phone Number</strong><br />
<%= funeralHome.funeralHomePhoneNumber %>
</div>
<% } %>
</div>
</div>
</div>
<div class="panel">
<div class="panel-heading">
<div class="level is-mobile">
<div class="level-left">
<h2 class="has-text-weight-bold">Contracts with Upcoming Funerals</h2>
</div>
<div class="level-right">
<i class="fas fa-file-contract" aria-hidden="true"></i>
</div>
</div>
</div>
<div class="panel-block is-block">
<% if (contracts.length === 0) { %>
<div class="message is-info">
<div class="message-body">
<p>No contracts with upcoming funerals.</p>
</div>
</div>
<% } else { %>
<% const todayDateString = dateTimeFunctions.dateToString(new Date()); %>
<table class="table is-striped is-fullwidth is-hoverable has-sticky-header">
<thead>
<tr>
<th>Funeral Date</th>
<th>Contract Type</th>
<th>Interments</th>
<th>Funeral Director</th>
</tr>
</thead>
<tbody id="burialSite--contractsTbody">
<% for (const contract of contracts) { %>
<tr>
<td class="<%= contract.funeralDateString === todayDateString ? 'has-background-warning-light' : '' %>">
<%= contract.funeralDateString %>
<%= contract.funeralTime === null || contract.funeralTime === 0 ? '' : contract.funeralTimePeriodString %>
</td>
<td>
<a class="has-text-weight-bold"
href="<%= urlPrefix %>/contracts/<%= contract.contractId %>">
<%= contract.contractType %>
</a><br />
<span class="is-size-7">#<%= contract.contractId %></span>
</td>
<td>
<% if (contract.contractInterments.length === 0) { %>
<span class="has-text-grey">(No Interments)</span>
<% } else { %>
<ul class="fa-ul ml-5">
<% for (const interment of contract.contractInterments) { %>
<li>
<span class="fa-li"><i class="fas fa-user"></i></span>
<%= interment.deceasedName %>
</li>
<% } %>
</ul>
<% } %>
</td>
<td>
<%= contract.funeralDirectorName %><br />
</td>
</tr>
<% } %>
</tbody>
</table>
<% } %>
</div>
</div>
<%- include('_footerA'); -%>
<%- include('_footerB'); -%>