diff options
author | volpino <fox91@anche.no> | 2012-09-03 15:09:12 +0200 |
---|---|---|
committer | volpino <fox91@anche.no> | 2012-09-03 15:09:12 +0200 |
commit | 80ca711565e8639b508319fc9e4e4293c7e16389 (patch) | |
tree | 441a222b696237be40622df65183299d7d07dffd /euscanwww | |
parent | euscan: Adding config file support (diff) | |
download | euscan-80ca711565e8639b508319fc9e4e4293c7e16389.tar.gz euscan-80ca711565e8639b508319fc9e4e4293c7e16389.tar.bz2 euscan-80ca711565e8639b508319fc9e4e4293c7e16389.zip |
euscanwww: Improved email template
Now the code is quite cryptic but it's to remove useless blank lines
in the final output.
Signed-off-by: volpino <fox91@anche.no>
Diffstat (limited to 'euscanwww')
-rw-r--r-- | euscanwww/djeuscan/tasks.py | 2 | ||||
-rw-r--r-- | euscanwww/djeuscan/templates/euscan/accounts/euscan_email.txt | 65 |
2 files changed, 25 insertions, 42 deletions
diff --git a/euscanwww/djeuscan/tasks.py b/euscanwww/djeuscan/tasks.py index bf936b0..f70c8fe 100644 --- a/euscanwww/djeuscan/tasks.py +++ b/euscanwww/djeuscan/tasks.py @@ -304,6 +304,8 @@ def process_emails(profiles, only_if_vlogs=False): if only_if_vlogs and not vlogs.count(): continue + vlogs = vlogs.order_by("-datetime") + infos = get_user_fav_infos(user) infos["user"] = user infos["vlogs"] = vlogs diff --git a/euscanwww/djeuscan/templates/euscan/accounts/euscan_email.txt b/euscanwww/djeuscan/templates/euscan/accounts/euscan_email.txt index fe609d2..c17c339 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/euscan_email.txt +++ b/euscanwww/djeuscan/templates/euscan/accounts/euscan_email.txt @@ -1,50 +1,31 @@ -{% load djeuscan_helpers %} -{% load sub %} -Hello {{ user }}, +{% load djeuscan_helpers %}{% load sub %}Hello {{ user }}, {% if vlogs %}euscan news: - -{% for vlog in vlogs %} - * {{ vlog }} {% if vlog.vtype and not vlog.vtype|is_stable %}({{ vlog.vtype }}){% endif %} - {{ vlog.datetime }} {% endfor %} +{% for vlog in vlogs %} * {{ vlog.package|ljust:"35" }} {{ vlog.version }} {% if vlog.vtype and not vlog.vtype|is_stable %}({{ vlog.vtype }}){% endif %} +{% 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 %} +Watching {{ num_categories }} categor{{ num_categories|pluralize:"y,ies"}}: {{ categories_upstream }} 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 }} 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 }} 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 }} 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 %} - -{% 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 +This email was sent by euscan, please do not reply. |