src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html
author grandjoncl
Wed, 28 Nov 2012 12:27:08 +0100
changeset 995 94f9d36371f6
parent 762 292b15799db2
child 1187 73403060f297
permissions -rwxr-xr-x
new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX new absurl template tag can be used instead of template tag url to have absolute url replacement of all LDT_MEDIA_PREFIX in different templates and views
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
     1
{% extends "front/front_base.html" %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
     2
{% load i18n %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
     3
{% load thumbnail %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
     4
{% load front_tags %}
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 762
diff changeset
     5
{% load absstatic %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
     6
504
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
     7
{% block title %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
     8
{% if tag_label %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
     9
{% blocktrans %}Lignes de temps : {{tag_label}}{% endblocktrans %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
    10
{% else %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
    11
{% trans "Lignes de temps : all medias" %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
    12
{% endif %}
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 482
diff changeset
    13
{% endblock %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    14
370
2ac316b4d55a Update all contents page with volume graph.
cavaliet
parents: 364
diff changeset
    15
{% block js_import %}
2ac316b4d55a Update all contents page with volume graph.
cavaliet
parents: 364
diff changeset
    16
{{block.super}}
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 762
diff changeset
    17
<script src='{% absstatic "ldt/js/raphael.js" %}' type="text/javascript"></script>
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 762
diff changeset
    18
<script src='{% absstatic "ldt/js/Ldt_front_sparkline.js" %}' type="text/javascript"></script>
370
2ac316b4d55a Update all contents page with volume graph.
cavaliet
parents: 364
diff changeset
    19
{% endblock %}
2ac316b4d55a Update all contents page with volume graph.
cavaliet
parents: 364
diff changeset
    20
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    21
{% block css_import %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    22
{{block.super}}
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 762
diff changeset
    23
<link rel="stylesheet" href='{% absstatic "ldt/css/front_home.css" %}' type="text/css"/>
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    24
{% endblock %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    25
520
10284a1810fe Sparkline correction
veltr
parents: 504
diff changeset
    26
{% block js_declaration %}
10284a1810fe Sparkline correction
veltr
parents: 504
diff changeset
    27
{{block.super}}
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    28
<script type="text/javascript">
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    29
    $(document).ready(function () {
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    30
        $("#home_tag_cloud").toggle(false);
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    31
        $("#hide_tag_cloud").toggle(false);
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    32
        $("#show_tag_cloud").toggle(true);
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    33
        $("#tag_cloud_link").click(function(){
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    34
            $("#home_tag_cloud").slideToggle("fast");
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    35
            $("#hide_tag_cloud").toggle();
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    36
            $("#show_tag_cloud").toggle();         
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    37
        });
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    38
    });
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    39
</script> 
520
10284a1810fe Sparkline correction
veltr
parents: 504
diff changeset
    40
{% endblock %}
10284a1810fe Sparkline correction
veltr
parents: 504
diff changeset
    41
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    42
{% block body %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    43
{{block.super}}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    44
<!-- Last annotated contents -->
605
ad9f20fbf4f9 Wording for front and french translations updated.
cavaliet
parents: 570
diff changeset
    45
{% if front_tags|length > 0 %}<p class="tag_link">{% trans 'Filter the medias by category' %} : {% for t in front_tags %}<a href="{% url ldt.ldt_utils.views.front.all_contents %}?tag={{t}}">{{t}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>{% endif %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    46
<ul class="floatlist full_width" id="derniers_medias">
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    47
    <li class="li_h2">
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    48
      <ul class="title_ul">
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    49
        <li><h2>
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    50
        {% if tag_label %}<a href="{% url ldt.ldt_utils.views.front.all_contents %}">{% trans 'All medias' %}</a>{% if tag_label %}<span class="pink"> &gt; {{tag_label}}</span>{% endif %}
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    51
        {% elif media_title %}<a href="{% url ldt.ldt_utils.views.front.all_contents %}">{% trans 'All medias' %}</a>{% if media_title %}<span class="pink"> &gt; "{{media_title}}"</span>{% endif %}
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    52
        {% else %}{% trans 'All medias' %}{% endif %}</h2>
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    53
        </li>
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    54
        <li class="li_right">
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 762
diff changeset
    55
          <span class="tag_link"><a href="#" id="tag_cloud_link" title="{% trans 'Filter the medias' %}"><img id="hide_tag_cloud" src='{% absstatic "ldt/img/little_minus_pink.png" %}' alt="{% trans 'Filter the medias' %}" /><img id="show_tag_cloud" src='{% absstatic "ldt/img/little_plus_pink.png" %}' alt="{% trans 'Filter the medias' %}" />&nbsp;{% trans 'Filter the medias' %}</a></span>
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    56
        </li>
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    57
      </ul>
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    58
    </li>
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    59
    <li class="li_h2" id="home_tag_cloud">
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    60
      <form id="media_search" method="GET" action="">
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    61
        {% trans 'Search in the medias title' %} : 
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    62
        <input id="input_media_title" type="text" name="title"> <input id="search_media_title" type="submit" value=""/>
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    63
      </form>
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    64
    {% if tag_cloud|length > 0 %}<p class="left tag_link">{% trans 'All categories of medias' %} : {% for t in tag_cloud %}<a href="{% url ldt.ldt_utils.views.front.all_contents %}?tag={{t.name}}">
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    65
      <span style="font-size:{{t.font_size|add:"12"}}px;">{{t.name}}</span></a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
    66
    {% endif %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    67
    </li>
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    68
      <!-- Pagination -->
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    69
        <li id="result_pagination" class="li_h2">
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    70
            <p>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    71
            {% if results.has_previous %}
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    72
                <a class="blue under" href="{% url ldt.ldt_utils.views.front.all_contents %}?page={{ results.previous_page_number }}{% if tag_label %}&tag={{tag_label}}{% endif %}{% if media_title %}&title={{media_title}}{% endif %}" title="{% trans 'previous' %}">{% trans "previous" %}</a>
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    73
            {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    74
            {% if results.paginator.num_pages > 1 %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    75
            <span class="current">
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    76
                {% for i in results.paginator.num_pages|get_range %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    77
                <span class="current">
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    78
                    {% if i|add:'1' == results.number %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    79
                    <span class="pink">{{i|add:'1'}}</span>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    80
                    {% else %}
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    81
                    <a class="blue under" href="{% url ldt.ldt_utils.views.front.all_contents %}?page={{i|add:'1'}}{% if tag_label %}&tag={{tag_label}}{% endif %}{% if media_title %}&title={{media_title}}{% endif %}">{{i|add:'1'}}</a>
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    82
                    {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    83
                    {% if i|add:'1' < results.paginator.num_pages and 1 < results.paginator.num_pages %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    84
                    {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    85
                </span>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    86
                {% endfor %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    87
            </span>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    88
            {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    89
            {% if results.has_next %}
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    90
                <a class="blue under" href="{% url ldt.ldt_utils.views.front.all_contents %}?page={{ results.next_page_number }}{% if tag_label %}&tag={{tag_label}}{% endif %}{% if media_title %}&title={{media_title}}{% endif %}" title="{% trans 'next' %}">{% trans "next" %}</a>
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    91
            {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    92
            {% if results.paginator.num_pages > 1 %}
762
292b15799db2 quick search in media title in the front. Languages updated.
cavaliet
parents: 740
diff changeset
    93
                . <a class="blue under" href="{% url ldt.ldt_utils.views.front.all_contents %}?page=x{% if tag_label %}&tag={{tag_label}}{% endif %}{% if media_title %}&title={{media_title}}{% endif %}"">({% trans 'All' %})</a>
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    94
            {% endif %}
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    95
            </p>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    96
        </li>
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    97
      <!-- Fin Pagination -->
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 703
diff changeset
    98
    {% for content in results.object_list %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
    99
    <li class="li_media">
466
4e8c6e580e78 Minor corrections for FF3.6
veltr
parents: 456
diff changeset
   100
        <div class="img_and_overlay">
4e8c6e580e78 Minor corrections for FF3.6
veltr
parents: 456
diff changeset
   101
            <a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
4e8c6e580e78 Minor corrections for FF3.6
veltr
parents: 456
diff changeset
   102
                {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
4e8c6e580e78 Minor corrections for FF3.6
veltr
parents: 456
diff changeset
   103
            </a>
456
0ca8b95b54fb Added polemic volumes to all medias
veltr
parents: 444
diff changeset
   104
            <div class="overlay">
0ca8b95b54fb Added polemic volumes to all medias
veltr
parents: 444
diff changeset
   105
                <ul class="polemics">
473
a400c401f78b Merge with Jacques last revision
veltr
parents: 472 471
diff changeset
   106
                    <li class="pol-negative" style="width:{{content.pol_negative_rate}}%"><span>{{content.pol_negative_rate}}%</span></li>
a400c401f78b Merge with Jacques last revision
veltr
parents: 472 471
diff changeset
   107
                    <li class="pol-positive" style="width:{{content.pol_positive_rate}}%"><span>{{content.pol_positive_rate}}%</span></li>
482
c802e00c7131 Lot of bugfixes
verrierj
parents: 473
diff changeset
   108
                    <!-- <li class="pol-reference" style="width:{{content.pol_reference_rate}}%"><span>{{content.pol_reference_rate}}%</span></li>
c802e00c7131 Lot of bugfixes
verrierj
parents: 473
diff changeset
   109
                    <li class="pol-question" style="width:{{content.pol_question_rate}}%"><span>{{content.pol_question_rate}}%</span></li> -->
456
0ca8b95b54fb Added polemic volumes to all medias
veltr
parents: 444
diff changeset
   110
                </ul>
473
a400c401f78b Merge with Jacques last revision
veltr
parents: 472 471
diff changeset
   111
                <span class="graph_annotation" id="sp_{{ content.iri_id }}">{{ content.annotation_volume|list2str }}</span>
456
0ca8b95b54fb Added polemic volumes to all medias
veltr
parents: 444
diff changeset
   112
            </div>
466
4e8c6e580e78 Minor corrections for FF3.6
veltr
parents: 456
diff changeset
   113
        </div>
542
54dfa397baa3 export stat to extarnal object. does not fully work
ymh <ymh.work@gmail.com>
parents: 520
diff changeset
   114
        <div class="bulle_annot" title="{% blocktrans count nb=content.nb_annotations %}{{nb}} annotation on this media{% plural %}{{nb}} annotations on this media{% endblocktrans %}">{{ content.nb_annotations }}</div>
562
28988fcccad1 Fix bug in search results front page
verrierj
parents: 542
diff changeset
   115
        <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}" title="{% trans 'open this media' %}" ><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p>
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   116
        <p>{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   117
    </li>
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   118
    {% endfor %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   119
</ul>
605
ad9f20fbf4f9 Wording for front and french translations updated.
cavaliet
parents: 570
diff changeset
   120
{% if tag_cloud|length > 0 %}<p class="left tag_link">{% trans 'All categories of medias' %} : {% for t in tag_cloud %}<a href="{% url ldt.ldt_utils.views.front.all_contents %}?tag={{t.name}}">
702
d50cb79f96ee Add category cloud in front and media page. Correct js pagination in workspace. Languages updated.
cavaliet
parents: 605
diff changeset
   121
  <span style="font-size:{{t.font_size|add:"12"}}px;">{{t.name}}</span>
409
e4855d669c55 First step of tag management for contents.
cavaliet
parents: 376
diff changeset
   122
  </a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>
e4855d669c55 First step of tag management for contents.
cavaliet
parents: 376
diff changeset
   123
{% endif %}
364
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   124
{% endblock %}
0d1a9d5922ed commit before merge. Add "All contents" page.
cavaliet
parents:
diff changeset
   125