# HG changeset patch # User cavaliet # Date 1326819201 -3600 # Node ID e4855d669c559c4b9fe301060cd11f2e21f39305 # Parent b7662f1c13daaddafdd6b191e50525baf494dc3c First step of tag management for contents. diff -r b7662f1c13da -r e4855d669c55 src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Tue Jan 17 16:30:40 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/models.py Tue Jan 17 17:53:21 2012 +0100 @@ -18,6 +18,7 @@ import mimetypes import os.path import tagging.fields +from tagging.models import Tag import uuid @@ -370,6 +371,10 @@ assign('ldt_utils.change_content', request_user, self) self.save() + + # Tag management + def get_tags(self): + return Tag.objects.get_for_object(self) diff -r b7662f1c13da -r e4855d669c55 src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html Tue Jan 17 16:30:40 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html Tue Jan 17 17:53:21 2012 +0100 @@ -63,9 +63,11 @@ {% block body %} {{block.super}} +{% if tag_cloud|length > 0 %}
{% trans 'Filter the medias' %} : {% for t in tag_cloud|slice:":5" %}{{t.name}}{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}{% trans 'All tags' %} : {% for t in tag_cloud %} + {{t.name}} + {% if not forloop.last %}, {% endif %}{% endfor %}
+{% endif %} {% endblock %} diff -r b7662f1c13da -r e4855d669c55 src/ldt/ldt/ldt_utils/templates/front/front_base.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_base.html Tue Jan 17 16:30:40 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_base.html Tue Jan 17 17:53:21 2012 +0100 @@ -34,10 +34,11 @@{% trans 'Filter the medias' %} : {% for t in tag_cloud %}{{t.name}}{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}