cityssm/attendance-tracking

View on GitHub
views/admin.tables.ejs

Summary

Maintainability
Test Coverage
<%- include('_header'); -%>

<div class="columns">
  <div class="column is-3"><%- include('_admin.menu.ejs') %></div>
  <div class="column">
    <nav class="breadcrumb is-hidden-mobile">
      <ul>
        <li class="is-active">
          <a href="#"> Administration </a>
        </li>
        <li class="is-active">
          <a href="#" aria-current="page">
            <span>Table Maintenance</span>
          </a>
        </li>
      </ul>
    </nav>
    <h1 class="title is-1 is-size-3-mobile">Table Maintenance</h1>

    <div class="tabs is-boxed">
      <ul role="presentation">
        <li class="is-active">
          <a href="#tab--absenceTypes">
            <span class="icon is-small">
              <i class="fas fa-table" aria-hidden="true"></i>
            </span>
            <span>Absence Types</span>
          </a>
        </li>
        <li>
          <a href="#tab--callOutResponseTypes">
            <span class="icon is-small">
              <i class="fas fa-table" aria-hidden="true"></i>
            </span>
            <span>Call Out Response Types</span>
          </a>
        </li>
        <li>
          <a href="#tab--afterHoursReasons">
            <span class="icon is-small">
              <i class="fas fa-table" aria-hidden="true"></i>
            </span>
            <span>After Hours Reasons</span>
          </a>
        </li>
      </ul>
    </div>
    <div class="tabs-container">
      <div id="tab--absenceTypes">
        <div class="columns is-vcentered">
          <div class="column">
            <h2 class="title is-4">Absence Types</h2>
          </div>
          <div class="column is-narrow has-text-right">
            <button class="button is-success is-add-button" data-cy="add" type="button">
              <span class="icon is-small">
                <i class="fas fa-plus" aria-hidden="true"></i>
              </span>
              <span>Add Absence Type</span>
            </button>
          </div>
        </div>
        <% if (!configFunctions.getConfigProperty('features.attendance.absences')) { %>
          <div class="message is-warning">
            <p class="message-body">
              Absence Tracking is currently disabled.
            </p>
          </div>
        <% } %>
        <div id="container--absenceTypes"></div>
        <p class="has-text-centered is-size-7 mt-4">
          <a href="<%= urlPrefix %>/reports/absenceTypes-active" download>
            <span class="icon is-small"><i class="fas fa-file-csv" aria-hidden="true"></i></span>
            <span>Export</span>
          </a>
        </p>
      </div>
      <div class="is-hidden" id="tab--callOutResponseTypes">
        <div class="columns is-vcentered">
          <div class="column">
            <h2 class="title is-4">Call Out Response Types</h2>
          </div>
          <div class="column is-narrow has-text-right">
            <button class="button is-success is-add-button" data-cy="add" type="button">
              <span class="icon is-small">
                <i class="fas fa-plus" aria-hidden="true"></i>
              </span>
              <span>Add Response Type</span>
            </button>
          </div>
        </div>
        <% if (!configFunctions.getConfigProperty('features.attendance.callOuts')) { %>
          <div class="message is-warning">
            <p class="message-body">
              Call Out Tracking is currently disabled.
            </p>
          </div>
        <% } %>
        <div id="container--callOutResponseTypes"></div>
        <p class="has-text-centered is-size-7 mt-4">
          <a href="<%= urlPrefix %>/reports/callOutResponseTypes-active" download>
            <span class="icon is-small"><i class="fas fa-file-csv" aria-hidden="true"></i></span>
            <span>Export</span>
          </a>
        </p>
      </div>
      <div class="is-hidden" id="tab--afterHoursReasons">
        <div class="columns is-vcentered">
          <div class="column">
            <h2 class="title is-4">After Hours Reasons</h2>
          </div>
          <div class="column is-narrow has-text-right">
            <button class="button is-success is-add-button" data-cy="add" type="button">
              <span class="icon is-small">
                <i class="fas fa-plus" aria-hidden="true"></i>
              </span>
              <span>Add Reason</span>
            </button>
          </div>
        </div>
        <% if (!configFunctions.getConfigProperty('features.attendance.afterHours')) { %>
          <div class="message is-warning">
            <p class="message-body">
              After Hours Tracking is currently disabled.
            </p>
          </div>
        <% } %>
        <div id="container--afterHoursReasons"></div>
        <p class="has-text-centered is-size-7 mt-4">
          <a href="<%= urlPrefix %>/reports/afterHoursReasons-active" download>
            <span class="icon is-small"><i class="fas fa-file-csv" aria-hidden="true"></i></span>
            <span>Export</span>
          </a>
        </p>
      </div>
    </div>
  </div>
</div>

<%- include('_footerA'); -%>

<script>
  exports.absenceTypes = <%- JSON.stringify(absenceTypes) %>;
  exports.callOutResponseTypes = <%- JSON.stringify(callOutResponseTypes) %>;
  exports.afterHoursReasons = <%- JSON.stringify(afterHoursReasons) %>;
</script>

<script src="<%= urlPrefix %>/javascripts/admin.tables.min.js"></script>

<%- include('_footerB'); -%>