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: Addressed a few more comments. Created Feb. 26, 2015, 10:10 p.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..0a2a732555cde846a53f6bc370876d8b0738773b
--- /dev/null
+++ b/includes/subscriptionList.tmpl
@@ -0,0 +1,89 @@
+{#
+ # This file is part of the Adblock Plus website,
+ # Copyright (C) 2006-2015 Eyeo GmbH
+ #
+ # Adblock Plus is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License version 3 as
+ # published by the Free Software Foundation.
+ #
+ # Adblock Plus is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ #}
+
+{%- macro process_subscription(subscription, parent=None) %}
+ <tr{% if subscription["deprecated"] %} class="deprecated"{% endif %}>
+ {%- if subscription["supplements"] %}
+ <td rowspan="2" class="dummy"></td>
+ <td rowspan="2">
+ {%- 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 }}
+ {%- endif %}
+ </td>
+ <td>
+ {%- if subscription["maintainer"] %}
+ {{ "maintainer_prefix"|translate }} {{subscription["maintainer"]}} {{ "maintainer_suffix"|translate }}<br>
+ {%- endif %}
+ {%- set is_first = True %}
+ {% for key in ('homepage', 'forum', 'contact', 'faq', 'blog', 'changelog', 'policy') -%}
+ {%- set url = subscription[key] -%}
+ {%- if url -%}
+ {%- if not is_first %}, {% endif -%}
+ {%- set is_first = 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 main_title, main_url, main_complete = parent.variants[0] -%}
+ &amp;requiresLocation={{main_url|urlencode}}&amp;requiresTitle={{main_title|urlencode}}
Sebastian Noack 2015/02/27 11:10:49 Nit: For consistency, one space before the opening
kzar 2015/02/27 14:21:07 Done.
+ {%- endif -%}
+ ">{{title}}</a>{%- if not loop.last %}, {% endif -%}
+ {%- endfor %}
+ </td>
+ </tr>
+ {%- if not parent -%}
+ {%- for supplement in subscription["supplemented"]|subscription_sort -%}
+ {{ process_subscription(supplement, subscription) }}
+ {%- endfor -%}
+ {%- endif -%}
+{%- endmacro %}
+
+{% macro display_subscriptions(subscriptions) %}
+ {%- set current_type = subscriptions[0]["type"] -%}
+ <h2>{{ ("type_" + current_type)|translate }}</h2>
+
+ <table class="subscriptions">
+ {%- for subscription in subscriptions|subscription_sort -%}
+ {%- if not subscription["supplements"] -%}
+ {%- if current_type != subscription["type"] -%}
+ {%- set current_type = subscription["type"] %}
+ </table>
+
+ <h2>{{ ("type_" + current_type)|translate }}</h2>
+
+ <table class="subscriptions">
+ {%- endif -%}
+ {{ process_subscription(subscription) }}
+ {%- endif -%}
+ {%- endfor %}
+ </table>
+{% endmacro %}

Powered by Google App Engine
This is Rietveld