djeuscan: enhance email template

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary
2012-08-14 11:45:52 +02:00
parent 2b823fb905
commit 88b15c18d2
6 changed files with 111 additions and 70 deletions

View File

@ -83,35 +83,7 @@
</ul>
</dd>
{% endif %}
{% if vlog %}
<dt>Version history</dt>
<dd>
<ul class="log">
{% for version in vlog %}
{% if version.action == version.VERSION_ADDED %}
<li class="added">
{% else %}
<li class="removed">
{% endif %}
{% if version.overlay == "gentoo" %}
<img src="{{ STATIC_URL }}img/gentoo-icon.png" alt="gentoo" title="In Gentoo" />
{% elif version.overlay %}
<img src="{{ STATIC_URL }}img/overlay-icon.png" alt="overlays" title="In Overlays" />
{% else %}
<img src="{{ STATIC_URL }}img/upstream-icon.png" alt="upstream" title="Upstream" />
{% endif %}
{% if version.vtype and not version.vtype|is_stable %}
<img src="{{ STATIC_URL }}img/unstable-icon.png" alt="unstable" title="{{ version.vtype }}" />
{% endif %}
{{ version }} - {{ version.datetime }}
</li>
{% endfor %}
</ul>
</dd>
{% endif %}
{% include "euscan/_package_vlogs.html" %}
{% if log %}
<dt>euscan log</dt>
<dd>

View File

@ -1,6 +1,50 @@
{% load djeuscan_helpers %}
{% load sub %}
Hello {{ user }},
euscan news:
{% if vlogs %}euscan news:
{% for vlog in vlogs %}
* {{ vlog.package.category }}/{{ vlog.package.name }}-{{ vlog.version }}-{{ vlog.revision }}:{{ vlog.slot }} [{{ vlog.vtype }}]
{% endfor %}
* {{ vlog }} {% if vlog.vtype and not vlog.vtype|is_stable %}({{ vlog.vtype }}){% endif %} - {{ vlog.datetime }} {% endfor %}
{% endif %}
Summary:
{% with categories|length as num_categories %}{% if num_categories %}
Watching {{ num_categories }} categor{{ num_categories|pluralize:"y,ies"}}
{{ categories_upstream }} new upstream version{{ categories_upstream|pluralize:"s"}}
{% if categories_upstream %}
Hot categories:
{% for c in categories|slice:":3" %}
* {{ c.category }} ({{ c.n_versions|sub:c.n_packaged|sub:c.n_overlay }}){% endfor %}
{% endif %}{% endif %}{% endwith %}
{% with herds|length as num_herds %}{% if num_herds %}
Watching {{ num_herds }} herd{{ num_herds|pluralize:"s"}}
{{ herds_upstream }} new upstream version{{ herds_upstream|pluralize:"s"}}
{% if herds_upstream %}
Hot herds:
{% for c in herds|slice:":3" %}
* {{ c.herds__herd }} ({{ c.n_versions|sub:c.n_packaged|sub:c.n_overlay }}){% endfor %}
{% endif %}{% endif %}{% endwith %}
{% with maintainers|length as num_maintainers %}{% if num_maintainers %}
Watching {{ num_maintainers }} maintainer{{ num_maintainers|pluralize:"s"}}
{{ maintainers_upstream }} new upstream version{{ maintainers_upstream|pluralize:"s"}}
{% if maintainers_upstream %}
Hot maintainers:
{% for c in maintainers|slice:":3" %}
* {{ c.maintainers__name }} ({{ c.n_versions|sub:c.n_packaged|sub:c.n_overlay }}){% endfor %}
{% endif %}{% endif %}{% endwith %}
{% with packages|length as num_packages %}{% if num_packages %}
Watching {{ num_packages }} package{{ num_packages|pluralize:"s"}}
{{ packages_upstream }} new upstream version{{ packages_upstream|pluralize:"s"}}
{% if packages_upstream %}
Hot packages:
{% for c in packages|slice:":3" %}
* {{ c }} ({{ c.n_versions|sub:c.n_packaged|sub:c.n_overlay }}){% endfor %}
{% endif %}{% endif %}{% endwith %}
--
This email was sent by euscan

View File

@ -113,4 +113,8 @@
{% endwith %}
</div>
</div>
<dl>
{% include "euscan/_package_vlogs.html" %}
</dl>
{% endblock %}