commit before merge. Add "All contents" page.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html Thu Jan 12 16:16:24 2012 +0100
@@ -0,0 +1,30 @@
+{% extends "front/front_base.html" %}
+{% load i18n %}
+{% load thumbnail %}
+{% load front_tags %}
+
+{% block title %}Lignes de temps : groupe "{{group.name}}"{% endblock %}
+
+{% block css_import %}
+{{block.super}}
+<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/front_home.css" type="text/css"/>
+{% endblock %}
+
+{% block body %}
+{{block.super}}
+<!-- Last annotated contents -->
+<ul class="floatlist full_width" id="derniers_medias">
+ <li class="li_h2">
+ <h2>{% trans 'All medias' %}</h2>
+ </li>
+ {% for content in content_list %}
+ <li class="li_media">
+ <a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">{% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}">{% endthumbnail %}</a>
+ <div class="bulle_annot">{{ content.nb_annotation }}</div>
+ <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}"><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p>
+ <p>{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
+ </li>
+ {% endfor %}
+</ul>
+{% endblock %}
+
--- a/src/ldt/ldt/ldt_utils/templates/front/front_home.html Thu Jan 12 12:52:59 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_home.html Thu Jan 12 16:16:24 2012 +0100
@@ -16,7 +16,12 @@
<!-- Last annotated contents -->
<ul class="floatlist full_width" id="derniers_medias">
<li class="li_h2">
- <h2>{% trans 'Last annotated medias' %}</h2>
+ <ul class="title_ul">
+ <li><h2>{% trans 'Last annotated medias' %}</h2></li>
+ <li class="li_right">
+ <a class="blue" href="{% url ldt.ldt_utils.views.front.all_contents %}"><img src="{{LDT_MEDIA_PREFIX}}img/little_plus.png" alt="" /> {% trans 'All medias' %}</a>
+ </li>
+ </ul>
</li>
{% for content in last_contents %}
<li class="li_media">
@@ -30,7 +35,12 @@
<!-- Most annotated contents -->
<ul class="floatlist" id="plus_annotes">
<li class="li_h2">
- <h2>{% trans 'Most annotated medias' %}</h2>
+ <ul class="title_ul">
+ <li><h2>{% trans 'Most annotated medias' %}</h2></li>
+ <li class="li_right">
+ <a class="blue" href="{% url ldt.ldt_utils.views.front.all_contents %}"><img src="{{LDT_MEDIA_PREFIX}}img/little_plus.png" alt="" /> {% trans 'All medias' %}</a>
+ </li>
+ </ul>
</li>
{% for content in most_contents %}
<li class="li_media">
--- a/src/ldt/ldt/ldt_utils/urls.py Thu Jan 12 12:52:59 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/urls.py Thu Jan 12 16:16:24 2012 +0100
@@ -45,6 +45,7 @@
url(r'^front/player/(?P<content_iri_id>.*)$', 'views.front.annot_content'),
url(r'^front/search/$', 'views.front.search_index'),
url(r'^front/searchListing', 'views.front.search_listing'),
+ url(r'^front/medias', 'views.front.all_contents'),
)
urlpatterns += patterns('',
--- a/src/ldt/ldt/ldt_utils/views/front.py Thu Jan 12 12:52:59 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/views/front.py Thu Jan 12 16:16:24 2012 +0100
@@ -48,6 +48,19 @@
@login_required
+def all_contents(request):
+ # Get all the public contents group
+ content_list = add_change_attr(request.user, Content.safe_objects.all())
+
+ is_gecko = ((request.META['HTTP_USER_AGENT'].lower().find("firefox")) > -1);
+
+ return render_to_response("front/front_all_contents.html",
+ {'content_list':content_list,
+ 'is_gecko': is_gecko},
+ context_instance=RequestContext(request))
+
+
+@login_required
def annot_content(request, content_iri_id):
# Get the wanted content
content = Content.objects.get(iri_id=content_iri_id)
--- a/src/ldt/ldt/static/ldt/css/front_home.css Thu Jan 12 12:52:59 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/front_home.css Thu Jan 12 16:16:24 2012 +0100
@@ -8,10 +8,20 @@
width: 960px;
}
+#derniers_medias .li_right {
+ float: right; margin-top:10px;
+}
+
#derniers_medias .li_media {
+ height: 225px;
width: 300px;
}
+/* Communs */
+.title_ul {
+ list-style: none;
+}
+
/* Plus annotés */
#plus_annotes {
@@ -22,6 +32,10 @@
width: 630px; margin-right: 10px;
}
+#plus_annotes .li_right {
+ float: right; margin-top:10px;
+}
+
#plus_annotes .li_media {
width: 140px;
height: 140px;