Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 {# | 1 {# |
2 # This file is part of the Adblock Plus website, | 2 # This file is part of the Adblock Plus website, |
3 # Copyright (C) 2006-2015 Eyeo GmbH | 3 # Copyright (C) 2006-2015 Eyeo GmbH |
4 # | 4 # |
5 # Adblock Plus is free software: you can redistribute it and/or modify | 5 # Adblock Plus is free software: you can redistribute it and/or modify |
6 # it under the terms of the GNU General Public License version 3 as | 6 # it under the terms of the GNU General Public License version 3 as |
7 # published by the Free Software Foundation. | 7 # published by the Free Software Foundation. |
8 # | 8 # |
9 # Adblock Plus is distributed in the hope that it will be useful, | 9 # Adblock Plus is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 {%- endfor %} | 60 {%- endfor %} |
61 </td> | 61 </td> |
62 </tr> | 62 </tr> |
63 {%- if not parent -%} | 63 {%- if not parent -%} |
64 {%- for supplement in subscription["supplemented"]|subscription_sort -%} | 64 {%- for supplement in subscription["supplemented"]|subscription_sort -%} |
65 {{ process_subscription(supplement, subscription) }} | 65 {{ process_subscription(supplement, subscription) }} |
66 {%- endfor -%} | 66 {%- endfor -%} |
67 {%- endif -%} | 67 {%- endif -%} |
68 {%- endmacro %} | 68 {%- endmacro %} |
69 | 69 |
70 {% macro display_subscriptions(subscriptions) %} | 70 {% 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
| |
71 {%- set current_type = subscriptions[0]["type"] -%} | |
72 <h2 id="type_{{ current_type }}">{{ get_string("type_" + current_type, "subscr iptions") }}</h2> | |
73 | |
74 <table class="subscriptions"> | |
75 {%- for subscription in subscriptions|subscription_sort -%} | 71 {%- for subscription in subscriptions|subscription_sort -%} |
76 {%- if not subscription["supplements"] or current_type != subscription["type "] -%} | 72 {%- if not (subscription["supplements"] and current_type == subscription["ty pe"]) -%} |
77 {%- if current_type != subscription["type"] -%} | 73 {%- if current_type != subscription["type"] -%} |
74 {%- if current_type %} | |
75 </table> | |
76 {%- endif -%} | |
78 {%- set current_type = subscription["type"] %} | 77 {%- set current_type = subscription["type"] %} |
79 </table> | |
80 | |
81 <h2 id="type_{{ current_type }}">{{ get_string("type_" + current_type, "subscr iptions") }}</h2> | 78 <h2 id="type_{{ current_type }}">{{ get_string("type_" + current_type, "subscr iptions") }}</h2> |
82 | 79 |
83 <table class="subscriptions"> | 80 <table class="subscriptions"> |
84 {%- endif -%} | 81 {%- endif -%} |
85 {%- endif -%} | 82 {%- endif -%} |
86 {%- if subscription["type"] not in subscription["supplementsType"] -%} | 83 {%- if subscription["type"] not in subscription["supplementsType"] -%} |
87 {{ process_subscription(subscription) }} | 84 {{ process_subscription(subscription) }} |
88 {%- endif -%} | 85 {%- endif -%} |
89 {%- endfor %} | 86 {%- endfor %} |
90 </table> | 87 </table> |
91 {% endmacro %} | 88 {% endmacro %} |
LEFT | RIGHT |