# HG changeset patch # User cavaliet # Date 1372340566 -7200 # Node ID 8f6eef1d1fc86428c85b78d59ea7107cbc9b3aaa # Parent 6d37a4bd893aa96d4689038f0bc28542d446afcc collection available in list and mosaic diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/models.py --- a/src/egonomy/models.py Thu Jun 27 15:37:29 2013 +0200 +++ b/src/egonomy/models.py Thu Jun 27 15:42:46 2013 +0200 @@ -57,7 +57,7 @@ return self.thesaurus_pertimm.replace("|", ",").split(",") @property - def tags(self): + def tag_list(self): # all keywords mots_cles + titre_pertimm+ description_pertimm + thesaurus_pertimmreturn # merged into one sorted list moc = self.mots_cles.split(",") @@ -84,6 +84,10 @@ id = models.CharField(null=False, blank=False, max_length=15, primary_key=True) metadata = models.ForeignKey(ImageMetadata) info = models.ForeignKey(ImageInfo, null=True, blank=True) + + @property + def tag_list(self): + return self.metadata.tag_list class Fragment(models.Model): diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/static/egonomy/css/style.css --- a/src/egonomy/static/egonomy/css/style.css Thu Jun 27 15:37:29 2013 +0200 +++ b/src/egonomy/static/egonomy/css/style.css Thu Jun 27 15:42:46 2013 +0200 @@ -206,7 +206,7 @@ .box-edition h3{color: #777;font-family: 'Lato'; font-size: 14px; margin-bottom: 6px;} .list-key-search a{ background-image: url(../img/icon-search.png);} -.list-key-add a{ background-image: url(../img/icon-plus-15.png);} +.list-key-add a{background-image: url(../img/icons-15.png); background-position: right 6px top -53px !important; } .list-keywords li{display: inline-block; float: left; margin: 0 8px 8px 0;} .list-keywords a{color: #7F7F7F; font-family: 'Lato'; font-size: 12px; display: inline-block; height: 28px; line-height: 28px; padding: 0 30px 0 6px; @@ -270,6 +270,10 @@ height: 110px; width: 110px; } +.square-fragment-177 { + height: 177px; + width: 177px; +} .square-fragment-225 { height: 225px; width: 225px; diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/templates/egonomy_annotate_picture.html --- a/src/egonomy/templates/egonomy_annotate_picture.html Thu Jun 27 15:37:29 2013 +0200 +++ b/src/egonomy/templates/egonomy_annotate_picture.html Thu Jun 27 15:42:46 2013 +0200 @@ -93,7 +93,7 @@

{% trans "Keywords" %} :

diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/templates/egonomy_create_fragment.html --- a/src/egonomy/templates/egonomy_create_fragment.html Thu Jun 27 15:37:29 2013 +0200 +++ b/src/egonomy/templates/egonomy_create_fragment.html Thu Jun 27 15:42:46 2013 +0200 @@ -101,7 +101,7 @@ {% trans "Source picture's keywords" %} : @@ -145,119 +145,6 @@ {% endblock %} -{% comment %} -
-
-
- × - -

{% if frg_to_modify %}{{ frg_data.title }}{% else %}{% trans 'New fragment' %}{% endif %} :

-
-
- {% with img.info.image_file as image %} - {% if image|ratio > 0.8 %} - {% thumbnail image "476" format="PNG" crop="center" as im %} - - {% empty %} - - {% endthumbnail %} - {% else %} - {% thumbnail image "x600" format="PNG" crop="center" as im %} - - {% empty %} - - {% endthumbnail %} - {% endif %} - {% endwith %} -
-
-
- - - {% if frg_to_modify %}{% endif %} - {% csrf_token %} -
-
- - - - - - - - - - - - - - - - - - {% if img.metadata.mots_cles %} - - - - - {% endif %} - {% if img.metadata.titre_pertimm %} - - - - - {% endif %} - {% if img.metadata.description_pertimm %} - - - - - {% endif %} - {% if img.metadata.thesaurus_pertimm %} - - - - - {% endif %} - - - - - -
- -
-
-
-
-
-
-

{% trans "Fragments from this picture" %}

- -
-
- -{% endcomment %} - {% block js_page %} diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/templates/egonomy_view_collection.html --- a/src/egonomy/templates/egonomy_view_collection.html Thu Jun 27 15:37:29 2013 +0200 +++ b/src/egonomy/templates/egonomy_view_collection.html Thu Jun 27 15:42:46 2013 +0200 @@ -3,7 +3,7 @@ {% load i18n %} {% load thumbnail %} -{% block title %}{% trans "View a fragment" %}{% endblock %} +{% block title %}{% trans "View a collection" %}{% endblock %} {% block popins %}
@@ -83,120 +83,58 @@

{{ col.title }} / par {{ col.author }}

{% if items %} {% ifequal display "slideshow" %} {% endifequal %} + {% ifequal display "mosaic" %} +
+
+
    + {% for item in items %} + {% for t in item.content_object.tag_list %} + {% if t != "" %} +
  • + {{ t }} +
  • + {% endif %} + {% endfor %} + {% endfor %} +
+
+
    + {% for item in items %} + {% include 'partial/item_in_collection_mosaic.html' %} + {% endfor %} +
+
+ {% endifequal %} {% else %}
diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/templates/partial/item_in_collection_list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/egonomy/templates/partial/item_in_collection_list.html Thu Jun 27 15:42:46 2013 +0200 @@ -0,0 +1,98 @@ +{% load static %} +{% load i18n %} +{% load thumbnail %} +{% ifequal item.content_type.model "fragment" %} +
  • + {% with fragment=item.content_object %} +
    + +
    +
    + {% with image=fragment.image.info.image_file %} + {% include "partial/fragment_only.html" %} + {% endwith %} +
    +
    +
    +
    +
      +
    • +
    • +
    • {% if user.is_authenticated %} + + {% else %} + + {% endif %}
    • +
    • +
    • +
    +
    +
    +
    +
    + {% if col.author == user %}{% endif %} +

    {{ fragment.title }}

    +

    {{ fragment.author }}

    +
    +

    desc : {{ item.description }}
    contenttype : {{ item.content_type.model }}
    object_id : {{ item.object_id }}
    content_object : {{ item.content_object }}

    +
    + {% endwith %} +
  • +{% else %} +{% with img=item.content_object %} + {% with img.info.image_file as image %} + {% if image %} + {% if image|is_portrait %} +
  • +
  • +
  • +
    + > + + + {% endif %} +
    +
      +
    • +
    • +
    • {% if user.is_authenticated %} + + {% else %} + + {% endif %}
    • +
    • +
    • +
    +
    +
    +
    +
    + {% if col.author == user %}{% endif %} +

    {{ img.metadata.titre }}

    +

    {{ img.metadata.auteur }}

    +
    +

    desc : {{ item.description }}
    contenttype : {{ item.content_type.model }}
    object_id : {{ item.object_id }}
    content_object : {{ item.content_object }}

    +
    +
  • + {% endwith %} +{% endwith %} +{% endifequal %} \ No newline at end of file diff -r 6d37a4bd893a -r 8f6eef1d1fc8 src/egonomy/templates/partial/item_in_collection_mosaic.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/egonomy/templates/partial/item_in_collection_mosaic.html Thu Jun 27 15:42:46 2013 +0200 @@ -0,0 +1,87 @@ +{% load static %} +{% load i18n %} +{% load thumbnail %} +
  • +
    +
    + {% ifequal item.content_type.model "fragment" %} + {% with fragment=item.content_object %} + +
    +
    + {% with image=fragment.image.info.image_file %} + {% include "partial/fragment_only.html" %} + {% endwith %} +
    +
    +
    +
    +
    +

    {{ fragment.title }}

    +

    {{ fragment.author }}

    +
    +
      +
    • +
    • +
    • {% if user.is_authenticated %} + + {% else %} + + {% endif %}
    • +
    • +
    • +
    +
    +
    +
    + {% if col.author == user %}{% endif %} +

    {{ fragment.title }}

    +

    {{ fragment.author }}

    +
    +

    desc : {{ item.description }}
    contenttype : {{ item.content_type.model }}
    object_id : {{ item.object_id }}
    content_object : {{ item.content_object }}

    +
    + {% endwith %} + {% else %} + {% with img=item.content_object %} + {% with img.info.image_file as image %} + + {% if image %} + {% thumbnail image "177" format="PNG" crop="center" as im %} + + {% empty %} + + {% endthumbnail %} + {% else %} + + {% endif %} + +
    +
    +

    {{ img.metadata.titre }}

    +

    {{ img.metadata.auteur }}

    +
    +
      +
    • +
    • +
    • {% if user.is_authenticated %} + + {% else %} + + {% endif %}
    • +
    • +
    • +
    +
    +
    +
    + {% if col.author == user %}{% endif %} +

    {{ img.metadata.titre }}

    +

    {{ img.metadata.auteur }}

    +
    +

    desc : {{ item.description }}
    contenttype : {{ item.content_type.model }}
    object_id : {{ item.object_id }}
    content_object : {{ item.content_object }}

    +
    + {% endwith %} + {% endwith %} + {% endifequal %} +
    +
  • \ No newline at end of file