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

Unified Diff: includes/subscriptionList.tmpl

Issue 6265373108207616: Issue #1170 adblockplus.org migration from Anwiki to our CMS. (Closed)
Patch Set: Created Sept. 17, 2014, 8:22 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
« no previous file with comments | « includes/preftable.tmpl ('k') | includes/subscriptions.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) %}
+ <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 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>
« no previous file with comments | « includes/preftable.tmpl ('k') | includes/subscriptions.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld