haikal/templates/plans/plan_table.html
Marwan Alwali aaf12c950b update
2025-01-26 13:33:57 +03:00

128 lines
5.4 KiB
HTML

{% load i18n %}
<div class="table-responsive mt-2">
<table class="plan_table table fs-9 mb-0">
<thead>
<tr>
<th></th>
{% for plan in plan_list %}
<th class="plan_header {% if forloop.counter0 == current_userplan_index %}current{% endif %}">
{% if plan.url %}<a href="{{ plan.url }}" class="info_link plan">{% endif %}
<span class="plan_name">{{ plan.name }}</span>
{% if plan == userplan.plan %}
<span class="current current_plan">{% trans "your current plan" %}</span>
{% endif %}
{% if plan.url %}</a>{% endif %}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for quota_row in plan_table %}
<tr class="quota_row">
<th class="quota_header">
{% if quota_row.0.url %}<a href="{{ quota_row.0.url }}" class="info_link quota">{% endif %}
<span class="quota_name">{{ quota_row.0.name }}</span>
<span class="quota_description">{{ quota_row.0.description }}</span>
{% if quota_row.0.url %}</a>{% endif %}
</th>
{% for plan_quota in quota_row.1 %}
<td class="{% if forloop.counter0 == current_userplan_index %}current{% endif %}">
{% if plan_quota != None %}
{% if quota_row.0.is_boolean %}
{% if plan_quota.value %} + {% else %} - {% endif %}
{% else %}
{% if plan_quota.value == None %}{% trans 'no limit' %}{% else %}{{ plan_quota.value }} {{ quota_row.0.unit }}{% endif %}
{% endif %}
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th></th>
<th colspan="{{ plan_list|length }}" class="periods_footer">{% trans 'Pricing' %}</th>
</tr>
{% if user.is_authenticated %}
<tr>
<th></th>
{% for plan in plan_list %}
<th class="planpricing_footer {% if forloop.counter0 == current_userplan_index %}current{% endif %}">
{% if plan != userplan.plan and not userplan.is_expired and not userplan.plan.is_free %}
<a href="{% url 'create_order_plan_change' pk=plan.id %}" class="change_plan">{% trans "Change" %}</a>{% endif %}
</th>
{% endfor %}
</tr>
{% endif %}
<tr>
<th></th>
{% for plan in plan_list %}
<th class="planpricing_footer {% if forloop.counter0 == current_userplan_index %}current{% endif %}">
{% if plan.available %}
<ul>
{% if not plan.is_free %}
{% for plan_pricing in plan.planpricing_set.all %}
{% if plan_pricing.visible %}
<li>
{% if plan_pricing.pricing.url %}<a href="{{ plan_pricing.pricing.url }}" class="info_link pricing">{% endif %}
<span class="plan_pricing_name">{{ plan_pricing.pricing.name }}</span>
<span class="plan_pricing_period">({{ plan_pricing.pricing.period }} {% trans "days" %})</span>
{% if plan_pricing.pricing.url %}</a>{% endif %}
<span class="plan_pricing_price">{{ plan_pricing.price }}&nbsp;{{ CURRENCY }}</span>
{% if plan_pricing.plan == userplan.plan or userplan.is_expired or userplan.plan.is_free %}
<a href="{% url 'create_order_plan' pk=plan_pricing.pk %}" class="buy">{% trans "Buy" %}</a>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{# Allow selecting plans with no pricings #}
<li>
<span class="plan_pricing_name">{% trans "Free" %}</span>
<span class="plan_pricing_period">({% trans "no expiry" %})</span>
<span class="plan_pricing_price">0&nbsp;{{ CURRENCY }}</span>
{% if plan != userplan.plan or userplan.is_expired %}
<a href="{% url 'create_order_plan_change' pk=plan.id %}" class="change_plan">
{% if userplan.is_expired %}
{% trans "Select" %}
{% else %}
{% trans "Change" %}
{% endif %}
</a>
{% endif %}
</li>
{% endif %}
</ul>
{% else %}
<span class="plan_not_available">
{% url 'upgrade_plan' as upgrade_url %}
{% blocktrans %}
This plan is not available anymore and cannot be extended.<p>
You need to upgrade your account to any of <a href="{{ upgrade_url }}">currently available plans</a>.
{% endblocktrans %}
</span>
{% endif %}
</th>
{% endfor %}
</tr>
</tfoot>
</table>
</div>
<p style="text-align: right;">
{% trans "Net prices" %}
</p>