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

Unified Diff: includes/subscriptionList.tmpl

Issue 5636796054503424: Issue 1170 - [adblockplus.org Anwiki to CMS migration] Migrate content (Closed)
Patch Set: Brought in changes to website made over last few months. Created Jan. 19, 2015, 12:18 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
Index: includes/subscriptionList.tmpl
diff --git a/includes/subscriptionList.tmpl b/includes/subscriptionList.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..926bc54a47c6d12f1ba5af25da3c87bb246d5948
--- /dev/null
+++ b/includes/subscriptionList.tmpl
@@ -0,0 +1,69 @@
+{%- 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.
+ <tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}>
+ {%- if subscription["supplements"] %}
+ <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.
+ {%- else %}
+ <td rowspan="2" colspan="2">
+ {%- endif %}
+ <strong class="subscriptionTitle">{{subscription["name"]}}</strong><br />
+ {{subscription["specialization"]}}
+ {%- if subscription["supplements"] %}
+ <br />{{ "supplements_prefix" |translate }} {{' / '.join(subscription["supplements"])}} {{ "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.
+ {%- endif %}
+ </td>
+ <td>
+ {%- if subscription["maintainer"] %}
+ {{ "maintainer_prefix" |translate }} {{subscription["maintainer"]}} {{ "maintainer_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.
+ {%- endif %}
+ {%- set isFirst = True %}
+ {% for key in ('homepage', 'forum', 'contact', 'faq', 'blog', 'changelog', 'policy') -%}
+ {%- set url = subscription[key] -%}
+ {%- if url -%}
+ {%- if not isFirst %}, {% endif -%}
+ {%- set isFirst = False -%}
+ <a href="{{url}}">{{key |translate}}</a>
+ {%- endif %}
+ {%- endfor %}
+ </td>
+ </tr>
+ <tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}>
+ <td>
+ {%- if subscription["deprecated"] %}
+ <strong>{{ "deprecation_warning" |translate }}</strong><br />
+ {%- endif %}
+ {{ "subscribe" |translate}}{{' '}}
+ {%- for title, url, complete in subscription["variants"] -%}
+ <a href="abp:subscribe?location={{url|urlencode}}&amp;title={{title|urlencode}}
+ {%- if parent and not complete -%}
+ {%- set mainTitle, mainURL, mainComplete = parent.variants[0] -%}
+ &amp;requiresLocation={{mainURL|urlencode}}&amp;requiresTitle={{mainTitle|urlencode}}
+ {%- endif -%}
+ ">{{title}}</a>{%- if not loop.last %}, {% endif -%}
+ {%- endfor %}
+ </td>
+ </tr>
+ {%- if not parent -%}
+ {%- for supplement in subscription["supplemented"] |subscription_sort -%}
+ {{ processSubscription(supplement, subscription) }}
+ {%- endfor -%}
+ {%- endif -%}
+{%- endmacro %}
+
+{%- set currentType = subscriptions[0]["type"] -%}
+ <h2>{{ ("type_" + currentType) |translate }}</h2>
+
+<table class="subscriptions">
+{%- for subscription in subscriptions |subscription_sort -%}
+ {%- if not subscription["supplements"] -%}
+ {%- if currentType != subscription["type"] -%}
+ {%- set currentType = subscription["type"] %}
+</table>
+
+<h2>{{ ("type_" + currentType) |translate }}</h2>
+
+<table class="subscriptions">
+ {%- endif -%}
+ {{ processSubscription(subscription) }}
+ {%- endif -%}
+{%- endfor %}
+</table>

Powered by Google App Engine
This is Rietveld