Files
realestatedatainc/xsl/userSubscriptions.xsl
T

142 lines
4.6 KiB
XML
Raw Normal View History

2026-05-29 14:52:16 -04:00
<?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">My Subscriptions</xsl:param>
<xsl:param name="PAGE-NAME">userSubscriptions</xsl:param>
<!-- Main Template -->
<xsl:template match="/">
<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">
<div class="card-header bg-primary text-white p-1 ps-3">
<i class="bi bi-list-check me-2"/>
<xsl:value-of select="$PAGE-TITLE"/>
</div>
<div class="card-body">
<xsl:choose>
<xsl:when test="count(//usersubscriptions/record) = 0">
<div class="fs-5 text-danger fw-bold fst-italic mt-2 mb-2">
<xsl:text>There are no Subscriptions to view... Please Contact Support</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="usersubscription-table">
<thead class="sticky-header" data-theme="{$THEME}">
<th class="text-nowrap">Name</th>
<th class="text-nowrap">Start Date</th>
<th class="text-nowrap">End Date</th>
</thead>
<tbody>
<xsl:apply-templates select="//usersubscriptions"/>
</tbody>
</table>
</div>
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</div>
</xsl:template>
<!-- Template for table rows -->
<xsl:template match="usersubscriptions/record">
<tr class="hoverable usersubscription-row" data-usersubscription-subscription="{usersubscription_subscription}" data-usersubscription-serial="{usersubscription_serial}">
<td class="subscription_title">
<xsl:value-of select="subscription_full_title"/>
</td>
<td class="usersubscription_start_date_verbose">
<xsl:value-of select="usersubscription_start_date_verbose"/>
</td>
<td class="usersubscription_end_date_verbose">
<xsl:value-of select="usersubscription_end_date_verbose"/>
</td>
</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>