Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: includes/subscriptionList.tmpl

Issue 29326085: Issue 2823 - Display new subscription types on subscriptions page (Closed)
Patch Set: Created Sept. 8, 2015, 10:10 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | locales/en/subscriptions.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: includes/subscriptionList.tmpl
===================================================================
--- a/includes/subscriptionList.tmpl
+++ b/includes/subscriptionList.tmpl
@@ -17,7 +17,7 @@
{%- macro process_subscription(subscription, parent=None) %}
<tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}>
- {%- if subscription["supplements"] %}
+ {%- if parent and subscription["supplements"] %}
<td rowspan="2" class="dummy"></td>
<td rowspan="2">
{%- else %}
@@ -69,19 +69,21 @@
{% macro display_subscriptions(subscriptions) %}
kzar 2015/09/09 12:23:35 The logic in this macro is getting increasingly ha
Thomas Greiner 2015/09/15 13:21:05 I agree, that this entire template is quite convol
{%- set current_type = subscriptions[0]["type"] -%}
- <h2>{{ get_string("type_" + current_type, "subscriptions") }}</h2>
+ <h2 id="type_{{ current_type }}">{{ get_string("type_" + current_type, "subscriptions") }}</h2>
<table class="subscriptions">
{%- for subscription in subscriptions|subscription_sort -%}
- {%- if not subscription["supplements"] -%}
+ {%- if not subscription["supplements"] or current_type != subscription["type"] -%}
{%- if current_type != subscription["type"] -%}
{%- set current_type = subscription["type"] %}
</table>
- <h2>{{ get_string("type_" + current_type, "subscriptions") }}</h2>
+ <h2 id="type_{{ current_type }}">{{ get_string("type_" + current_type, "subscriptions") }}</h2>
<table class="subscriptions">
{%- endif -%}
+ {%- endif -%}
+ {%- if subscription["type"] not in subscription["supplementsType"] -%}
{{ process_subscription(subscription) }}
{%- endif -%}
{%- endfor %}
« no previous file with comments | « no previous file | locales/en/subscriptions.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld