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 feedback. Created Feb. 20, 2015, 2:54 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..0efb2c2d079d426abea9376292e335d52f32d127
--- /dev/null
+++ b/includes/subscriptionList.tmpl
@@ -0,0 +1,87 @@
+{#
+ # 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}}
+ {%- 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 %}
+
+{%- 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>

Powered by Google App Engine
This is Rietveld