added alert classes and supporting functions
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="html" encoding="utf-8" indent="yes"/>
|
||||
|
||||
<!-- Parameters -->
|
||||
|
||||
<xsl:param name="VERSION">1.0</xsl:param>
|
||||
<xsl:param name="PAGE-TITLE">Add Alert</xsl:param>
|
||||
<xsl:param name="PAGE-NAME">addAlert</xsl:param>
|
||||
|
||||
<xsl:template match="/">
|
||||
|
||||
<script src="js/{$PAGE-NAME}.js?version={$VERSION}"/>
|
||||
<script src="js/ckeditor.js?version={$VERSION}"/>
|
||||
|
||||
<div class="{$PAGE-NAME}">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header bg-primary text-white p-1 ps-3 border-bottom-0">
|
||||
<i class="bi bi-plus-lg me-2"/>
|
||||
<xsl:value-of select="$PAGE-TITLE"/>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<form action="" name="{$PAGE-NAME}" method="post" id="{$PAGE-NAME}" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="action" value="Alerts.addAlert"/>
|
||||
<input type="hidden" name="step" value="add"/>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 mb-3">
|
||||
<label class="form-label" for="alert_title">Title</label>
|
||||
<input type="text" class="form-control form-control-sm" name="alert_title" id="alert_title" maxlength="100" autocomplete="off" autofocus="yes"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_starts_date">Start Date</label>
|
||||
|
||||
<div class="input-group input-group-sm starts-date">
|
||||
|
||||
<span class="input-group-text">Date:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_starts_date" id="alert_starts_date" autocomplete="off" maxlength="10"
|
||||
value="{$TODAY_YYYYMMDD}"/>
|
||||
<button class="btn btn-outline-primary btnAlertStartDateCalendar" type="button" data-target="#alert_starts_date" data-bs-toggle="tooltip" data-bs-title="Calendar" tabindex="-1">
|
||||
<i class="bi bi-calendar3"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_starts_time">Start Time <span class="text-small text-muted text-nowrap ml-2">(24-Hour format)</span></label>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
|
||||
<span class="input-group-text">Time:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_starts_time" id="alert_starts_time" autocomplete="off" maxlength="10"
|
||||
value="{$TODAY_HHMM}"/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_expires_date">Expires Date</label>
|
||||
|
||||
<div class="input-group input-group-sm expires-date">
|
||||
|
||||
<span class="input-group-text">Date:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_expires_date" id="alert_expires_date" autocomplete="off" maxlength="10"/>
|
||||
<button class="btn btn-outline-primary btnAlertExpiresDateCalendar" type="button" data-target="#alert_expires_date" data-bs-toggle="tooltip" data-bs-title="Calendar" tabindex="-1">
|
||||
<i class="bi bi-calendar3"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_expires_time">Expires Time <span class="text-small text-muted text-nowrap ml-2">(24-Hour format)</span></label>
|
||||
|
||||
<div class="input-group input-group-sm start_date">
|
||||
|
||||
<span class="input-group-text">Time:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_expires_time" id="alert_expires_time" autocomplete="off" maxlength="10"/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="form-label" for="alert_message">Alert Message</label>
|
||||
<textarea class="form-control form-control-sm" name="alert_message" id="alert_message"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="buttons mt-1 mb-2">
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnCancel">
|
||||
<i class="bi bi-box-arrow-left me-2"/>Cancel</button>
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnSave">
|
||||
<i class="bi bi-save me-2"/>Save</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
+4
-1
@@ -178,6 +178,9 @@
|
||||
<xsl:if test="$USER_ROLE = 'Administrator' or $USER_ROLE = 'System Administrator'">
|
||||
|
||||
<div class="dropdown-divider mt-1 mb-1"/>
|
||||
|
||||
<a class="dropdown-item ps-2 setup-alerts" href="javascript:void(0);">
|
||||
<i class="bi bi-info-circle me-2"/>Alerts</a>
|
||||
|
||||
<a class="dropdown-item ps-2 setup-counties" href="javascript:void(0);">
|
||||
<i class="bi bi-building me-2"/>Counties
|
||||
@@ -218,7 +221,7 @@
|
||||
<i class="bi bi-journal me-2"/>Journal
|
||||
</a>
|
||||
|
||||
<!-- <a class="dropdown-item ps-2 view-support-tickets" href="javascript:void(0);">
|
||||
<!-- <a class="dropdown-item ps-2 view-support-tickets" href="javascript:void(0);">
|
||||
<i class="bi bi-question-circle me-2"/>Support Tickets
|
||||
</a>-->
|
||||
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="html" encoding="utf-8" indent="yes"/>
|
||||
|
||||
<!-- Parameters -->
|
||||
|
||||
<xsl:param name="VERSION">1.0</xsl:param>
|
||||
<xsl:param name="PAGE-TITLE">Edit Alert</xsl:param>
|
||||
<xsl:param name="PAGE-NAME">editAlert</xsl:param>
|
||||
|
||||
<xsl:template match="/">
|
||||
|
||||
<script src="js/{$PAGE-NAME}.js?version={$VERSION}"/>
|
||||
<script src="js/ckeditor.js?version={$VERSION}"/>
|
||||
|
||||
<div class="{$PAGE-NAME}">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header bg-primary text-white p-1 ps-3 border-bottom-0">
|
||||
|
||||
<i class="bi bi-chat-square-dots me-2"/>
|
||||
<xsl:value-of select="$PAGE-TITLE"/>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<form action="" name="{$PAGE-NAME}" method="post" id="{$PAGE-NAME}" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="action" value="Alerts.editAlert"/>
|
||||
<input type="hidden" name="step" value="update"/>
|
||||
|
||||
<input type="hidden" name="alert_serial" id="alert_serial" value="{//alerts/record/alert_serial}"/>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 mb-3">
|
||||
<label class="form-label" for="alert_title">Title</label>
|
||||
<input type="text" class="form-control form-control-sm" name="alert_title" id="alert_title" maxlength="100" autocomplete="off" value="{//alerts/record/alert_title}"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_starts_date">Start Date</label>
|
||||
|
||||
<div class="input-group input-group-sm starts-date">
|
||||
|
||||
<span class="input-group-text">Date:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_starts_date" id="alert_starts_date" autocomplete="off" maxlength="10"
|
||||
value="{//alerts/record/alert_started_date}"/>
|
||||
<button class="btn btn-outline-primary btnAlertStartDateCalendar" type="button" data-target="#alert_starts_date" data-bs-toggle="tooltip" data-bs-title="Calendar" tabindex="-1">
|
||||
<i class="bi bi-calendar3"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_starts_time">Start Time <span class="text-small text-muted text-nowrap ml-2">(24-Hour format)</span></label>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
|
||||
<span class="input-group-text">Time:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_starts_time" id="alert_starts_time" autocomplete="off" maxlength="10"
|
||||
value="{//alerts/record/alert_started_time}"/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_expires_date">Expires Date</label>
|
||||
|
||||
<div class="input-group input-group-sm expires-date">
|
||||
|
||||
<span class="input-group-text">Date:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_expires_date" id="alert_expires_date" autocomplete="off" maxlength="10"
|
||||
value="{//alerts/record/alert_expired_date}"/>
|
||||
<button class="btn btn-outline-primary btnAlertExpiresDateCalendar" type="button" data-target="#alert_expires_date" data-bs-toggle="tooltip" data-bs-title="Calendar" tabindex="-1">
|
||||
<i class="bi bi-calendar3"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mb-3">
|
||||
|
||||
<label class="form-label" for="alert_expires_time">Expires Time <span class="text-small text-muted text-nowrap ml-2">(24-Hour format)</span></label>
|
||||
|
||||
<div class="input-group input-group-sm start_date">
|
||||
|
||||
<span class="input-group-text">Time:</span>
|
||||
<input type="text" class="form-control form-control-sm date-mask" name="alert_expires_time" id="alert_expires_time" autocomplete="off" maxlength="10" value="{//alerts/record/alert_expired_time}"/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="form-label" for="alert_message">Alert Message</label>
|
||||
<textarea class="form-control form-control-sm" name="alert_message" id="alert_message">
|
||||
<xsl:value-of select="//alerts/record/alert_message"/>
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="buttons mt-1 mb-2">
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnCancel">
|
||||
<i class="bi bi-box-arrow-left me-2"/>Cancel</button>
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnSave">
|
||||
<i class="bi bi-save me-2"/>Save</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="html" encoding="utf-8" indent="yes"/>
|
||||
|
||||
<!-- Parameters -->
|
||||
|
||||
<xsl:param name="VERSION">1.0</xsl:param>
|
||||
<xsl:param name="PAGE-TITLE">Alerts</xsl:param>
|
||||
<xsl:param name="PAGE-NAME">setupAlerts</xsl:param>
|
||||
|
||||
<!-- Variables -->
|
||||
|
||||
<xsl:variable name="PAGINATION_COUNT" select="//alerts/@count"/>
|
||||
<xsl:variable name="PAGINATION_START" select="//alerts/@start"/>
|
||||
<xsl:variable name="PAGINATION_END" select="//alerts/@end"/>
|
||||
<xsl:variable name="PAGINATION_PAGE" select="//alerts/@page"/>
|
||||
|
||||
<!-- Main Template -->
|
||||
|
||||
<xsl:template match="/">
|
||||
|
||||
<script src="js/{$PAGE-NAME}.js?version={$VERSION}"/>
|
||||
|
||||
<div class="{$PAGE-NAME}">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header bg-primary text-white p-1 ps-3 border-bottom-0">
|
||||
<i class="bi bi-info-circle me-2"/>
|
||||
<xsl:value-of select="$PAGE-TITLE"/>
|
||||
<xsl:if test="$PAGINATION_COUNT > 0">
|
||||
<xsl:text> | Showing </xsl:text>
|
||||
<xsl:value-of select="format-number($PAGINATION_START, '###,##0')"/>
|
||||
<xsl:text> to </xsl:text>
|
||||
<xsl:value-of select="format-number($PAGINATION_END, '###,##0')"/>
|
||||
<xsl:text> of </xsl:text>
|
||||
<xsl:value-of select="format-number($PAGINATION_COUNT, '###,##0')"/>
|
||||
</xsl:if>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row align-items-center mt-2 mb-3">
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control autosave" name="find_alert" id="find_alert" maxlength="100" autocomplete="off" placeholder="{//popovers/record[popover_name = 'find_alert']/popover_placeholder}" autofocus="autofocus"/>
|
||||
<button type="button" class="btn btn-primary fw-bold btnFind" data-bs-toggle="tooltip" data-bs-title="{//popovers/record[popover_name = 'find_alert']/popover_text}" data-bs-html="true" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-search"/>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary fw-bold btnClearFind" data-bs-toggle="tooltip" data-bs-title="Clear Find" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-arrow-clockwise"/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<div class="input-group input-group-sm" data-bs-toggle="tooltip" data-bs-title="Show Per Page" data-bs-custom-class="custom-tooltip">
|
||||
<div class="input-group-text">
|
||||
<i class="bi bi-list-ol"/>
|
||||
</div>
|
||||
<select class="form-select autosave" name="alerts_per_page" id="alerts_per_page">
|
||||
<option value="20">20</option>
|
||||
<option value="40">40</option>
|
||||
<option value="60">60</option>
|
||||
<option value="80">80</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
|
||||
<div class="buttons mt-3 mb-2">
|
||||
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnDone">
|
||||
<i class="bi bi-box-arrow-left me-2"/>Done</button>
|
||||
<button type="button" class="btn btn-sm btn-primary me-2 btnAdd">
|
||||
<i class="bi bi-plus-lg me-2"/>Add</button>
|
||||
|
||||
<div class="btn-group ms-2" role="group">
|
||||
<xsl:if test="$PAGINATION_PAGE > 1">
|
||||
<button type="button" class="btn btn-sm btn-primary btnPagination" data-pagination="first" data-bs-toggle="tooltip" data-bs-title="First Page" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-chevron-bar-left me-1"/>First</button>
|
||||
<button type="button" class="btn btn-sm btn-primary btnPagination" data-pagination="previous" data-bs-toggle="tooltip" data-bs-title="Previous Page" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-chevron-left me-1"/>Previous</button>
|
||||
</xsl:if>
|
||||
<xsl:if test="$PAGINATION_COUNT > $PAGINATION_END">
|
||||
<button type="button" class="btn btn-sm btn-primary btnPagination" data-pagination="next" data-bs-toggle="tooltip" data-bs-title="Next Page" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-chevron-right me-1"/>Next</button>
|
||||
<button type="button" class="btn btn-sm btn-primary btnPagination" data-pagination="last" data-bs-toggle="tooltip" data-bs-title="Last Page" data-bs-custom-class="custom-tooltip">
|
||||
<i class="bi bi-chevron-bar-right me-1"/>Last</button>
|
||||
</xsl:if>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr class="mt-3 mb-2"/>
|
||||
|
||||
<xsl:choose>
|
||||
|
||||
<xsl:when test="count(//alerts/record) = 0">
|
||||
|
||||
<div class="fs-5 text-danger fw-bold fst-italic mt-3 mb-1">
|
||||
<xsl:text>There are no Alerts to view...</xsl:text>
|
||||
</div>
|
||||
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
|
||||
<div class="table-wrapper table-responsive">
|
||||
<table class="table table-sm table-striped table-hover base-table table-auto" id="alerts-table">
|
||||
<thead>
|
||||
<th>Title</th>
|
||||
<th>Starts</th>
|
||||
<th>Expires</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:apply-templates select="//alerts"/>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</xsl:otherwise>
|
||||
|
||||
</xsl:choose>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- Template for table rows -->
|
||||
|
||||
<xsl:template match="alerts/record">
|
||||
|
||||
<tr class="hoverable alert-row" data-alert-serial="{alert_serial}" data-alert-name="{alert_title}">
|
||||
|
||||
<td class="alert_title">
|
||||
<xsl:value-of select="alert_title"/>
|
||||
</td>
|
||||
<td class="alert_start">
|
||||
<xsl:value-of select="alert_started_verbose"/>
|
||||
</td>
|
||||
<td class="alert_end">
|
||||
<xsl:value-of select="alert_expires_verbose"/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -16,6 +16,26 @@
|
||||
<script src="js/{$PAGE-NAME}.js?version={$VERSION}"/>
|
||||
|
||||
<div class="{$PAGE-NAME}">
|
||||
|
||||
<xsl:choose>
|
||||
|
||||
<xsl:when test="count(//alerts/record) > 0">
|
||||
|
||||
<div class="card mb-4">
|
||||
|
||||
<div class="card-header bg-danger text-white p-1 ps-3">
|
||||
<i class="bi bi-info-circle me-2"/>
|
||||
Messages
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<xsl:apply-templates select="//alerts"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</xsl:when>
|
||||
|
||||
</xsl:choose>
|
||||
|
||||
<div class="card">
|
||||
|
||||
@@ -101,5 +121,29 @@
|
||||
</tr>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- Template to create Alerts objects -->
|
||||
|
||||
<xsl:template match="alerts">
|
||||
|
||||
<xsl:for-each select="record">
|
||||
|
||||
<div class="row">
|
||||
<xsl:value-of select="alert_message" disable-output-escaping="yes"/>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row alert-time-elapsed-row mb-0 text-muted">
|
||||
<div class="col alert-company">
|
||||
<xsl:value-of select="alert_time_elapsed"/>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<xsl:if test="position() != last()">
|
||||
<hr class="mt-1 mb-1"/>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
Reference in New Issue
Block a user