| 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 %} |
| @@ -68,20 +68,20 @@ |
| {%- endmacro %} |
| {% macro display_subscriptions(subscriptions) %} |
| - {%- set current_type = subscriptions[0]["type"] -%} |
| - <h2>{{ get_string("type_" + current_type, "subscriptions") }}</h2> |
| - |
| - <table class="subscriptions"> |
| + {%- set current_type = None -%} |
|
kzar
2015/09/15 15:54:55
Subscriptions always have a type right? If so we c
Thomas Greiner
2015/09/16 12:06:28
Done. It was just a personal preference to make th
|
| {%- for subscription in subscriptions|subscription_sort -%} |
| - {%- if not subscription["supplements"] -%} |
| + {%- if not subscription["supplements"] or current_type != subscription["type"] -%} |
|
kzar
2015/09/15 15:54:55
How about an application of De Morgan's law?
{% i
Thomas Greiner
2015/09/16 12:06:28
Done. Haven't heard about that theorem yet so than
|
| {%- if current_type != subscription["type"] -%} |
| + {%- if current_type != None %} |
|
kzar
2015/09/15 15:54:55
Nit: In Python I think you should use `is` for che
Thomas Greiner
2015/09/16 12:06:28
Done. `is not` was throwing a Jinja2 exception whe
|
| + </table> |
| + {%- endif -%} |
| {%- 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 %} |