Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 {%- macro processSubscription(subscription, parent=None) %} | |
Sebastian Noack
2015/02/13 17:51:49
You seem to mix camcelcase with underscore notatio
kzar
2015/02/20 14:55:18
Done.
| |
2 <tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}> | |
3 {%- if subscription["supplements"] %} | |
4 <td rowspan="2" class="dummy"></td><td rowspan="2"> | |
Sebastian Noack
2015/02/13 17:51:49
Nit: I think there should be a newline, at least a
kzar
2015/02/20 14:55:18
Done.
| |
5 {%- else %} | |
6 <td rowspan="2" colspan="2"> | |
7 {%- endif %} | |
8 <strong class="subscriptionTitle">{{subscription["name"]}}</strong><br /> | |
9 {{subscription["specialization"]}} | |
10 {%- if subscription["supplements"] %} | |
11 <br />{{ "supplements_prefix" |translate }} {{' / '.join(subscription["sup plements"])}} {{ "supplements_suffix" |translate }} | |
Sebastian Noack
2015/02/13 17:51:49
Assuming this is HTML (not XHTML), there shouldn't
kzar
2015/02/20 14:55:18
Done.
| |
12 {%- endif %} | |
13 </td> | |
14 <td> | |
15 {%- if subscription["maintainer"] %} | |
16 {{ "maintainer_prefix" |translate }} {{subscription["maintainer"]}} {{ "ma intainer_suffix" |translate }}<br /> | |
Sebastian Noack
2015/02/13 17:51:49
Nit: Any reason you add a space before the pipe in
kzar
2015/02/20 14:55:18
Done.
| |
17 {%- endif %} | |
18 {%- set isFirst = True %} | |
19 {% for key in ('homepage', 'forum', 'contact', 'faq', 'blog', 'changelog', 'policy') -%} | |
20 {%- set url = subscription[key] -%} | |
21 {%- if url -%} | |
22 {%- if not isFirst %}, {% endif -%} | |
23 {%- set isFirst = False -%} | |
24 <a href="{{url}}">{{key |translate}}</a> | |
25 {%- endif %} | |
26 {%- endfor %} | |
27 </td> | |
28 </tr> | |
29 <tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}> | |
30 <td> | |
31 {%- if subscription["deprecated"] %} | |
32 <strong>{{ "deprecation_warning" |translate }}</strong><br /> | |
33 {%- endif %} | |
34 {{ "subscribe" |translate}}{{' '}} | |
35 {%- for title, url, complete in subscription["variants"] -%} | |
36 <a href="abp:subscribe?location={{url|urlencode}}&title={{title|urle ncode}} | |
37 {%- if parent and not complete -%} | |
38 {%- set mainTitle, mainURL, mainComplete = parent.variants[0] -%} | |
39 &requiresLocation={{mainURL|urlencode}}&requiresTitle={{main Title|urlencode}} | |
40 {%- endif -%} | |
41 ">{{title}}</a>{%- if not loop.last %}, {% endif -%} | |
42 {%- endfor %} | |
43 </td> | |
44 </tr> | |
45 {%- if not parent -%} | |
46 {%- for supplement in subscription["supplemented"] |subscription_sort -%} | |
47 {{ processSubscription(supplement, subscription) }} | |
48 {%- endfor -%} | |
49 {%- endif -%} | |
50 {%- endmacro %} | |
51 | |
52 {%- set currentType = subscriptions[0]["type"] -%} | |
53 <h2>{{ ("type_" + currentType) |translate }}</h2> | |
54 | |
55 <table class="subscriptions"> | |
56 {%- for subscription in subscriptions |subscription_sort -%} | |
57 {%- if not subscription["supplements"] -%} | |
58 {%- if currentType != subscription["type"] -%} | |
59 {%- set currentType = subscription["type"] %} | |
60 </table> | |
61 | |
62 <h2>{{ ("type_" + currentType) |translate }}</h2> | |
63 | |
64 <table class="subscriptions"> | |
65 {%- endif -%} | |
66 {{ processSubscription(subscription) }} | |
67 {%- endif -%} | |
68 {%- endfor %} | |
69 </table> | |
OLD | NEW |