Commit e82e35b8 authored by Michal Čihař's avatar Michal Čihař

Show all color variants of widget

parent ff463c64
......@@ -22,19 +22,24 @@
<h3>{% trans "Image widgets" %}</h3>
{% for widget in widget_list %}
<h4>{% blocktrans %}Image {{ widget }}{% endblocktrans %}</h4>
<h4>{% blocktrans with widget.name as widget %}Image {{ widget }}{% endblocktrans %}</h4>
<p>{% trans "Example:" %}</p>
<p>{% trans "Color variants:" %}</p>
<p><a href="{{ engage_url }}"><img src="{{ widget_base_url }}{{ widget }}/" /></a></p>
{% for color in widget.colors %}
<p><a href="{{ engage_url }}"><img src="{{ widget_base_url }}{{ widget.name }}/?color={{ color }}" /></a></p>
{% endfor %}
<p>{% trans "Code:" %}</p>
{% for color in widget.colors %}
<pre class="ui-widget-content ui-corner-all code">
&lt;a href="{{ engage_url }}"&gt;
&lt;img src="{{ widget_base_url }}{{ widget }}/" /&gt;
&lt;img src="{{ widget_base_url }}{{ widget.name }}/?color={{ color }}" /&gt;
&lt;/a&gt;
</pre>
{% endfor %}
{% endfor %}
......
......@@ -75,9 +75,7 @@ def widgets(request, project):
reverse('weblate.trans.widgets.widgets', kwargs = {'project': obj.slug}),
)
widget_list = [
'287x66',
]
widget_list = [{'name': w, 'colors': list(WIDGETS[w]['colors'])} for w in WIDGETS]
return render_to_response('widgets.html', RequestContext(request, {
'engage_url': engage_url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment