# HG changeset patch # User cavaliet # Date 1326118335 -3600 # Node ID 631c0edee9ea995d0f2fa3b93742f715933c3800 # Parent 496bd82719e539e0092979527a00fdaaba663e1e First commit for front pages. View, templates, and css img added. diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Fri Jan 06 15:39:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/models.py Mon Jan 09 15:12:15 2012 +0100 @@ -156,6 +156,22 @@ self.duration = 0 self.save() return self.duration + + def duration_str(self): + if self.duration is None: + return "?" + # We take off the milliseconds + sec = self.duration//1000 + if sec < 60 : + return str(dur) + "s" + hours = sec//3600 + min = (sec - (hours * 3600))//60 + if min<10: + min_str = "0" + str(min) + else: + min_str = str(min) + return str(hours) + "h" + min_str + def mimetype(): #@NoSelf def fget(self): diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/templates/front/front_base.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_base.html Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,59 @@ +{% load i18n %} +{% load logintag %} +{% load navigation %} + + + +{% block head %} + + + + {% block title %}{% trans "page_title" %}{% endblock %} + {% block js_import %}{% endblock %} + {% block css_declaration %}{% endblock %} + {% block css_import %} + + {% endblock %} + {% block js_declaration %}{% endblock %} +{% endblock %} + + +
+ +{% block body %} +{% endblock %} + + + +
+
+ + + diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/templates/front/front_group.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_group.html Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,54 @@ +{% extends "front/front_base.html" %} +{% load i18n %} +{% load thumbnail %} + +{% block title %}Home{% endblock %} +{% block css_import %} +{{block.super}} + +{% endblock %} + +{% block body %} +{{block.super}} + + + + +
+ +
+

{% trans 'About the group' %}

+
+

+ {{group.profile.description|safe}} +

+ {% thumbnail group.profile.image "54x40" format="PNG" crop="center" as im %}{{content.title}}{% endthumbnail %} +

 

+ +
+

{% trans 'Members' %} ({{users|length}})

+
+ +
+{% endblock %} + diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/templates/front/front_home.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_home.html Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,61 @@ +{% extends "front/front_base.html" %} +{% load i18n %} +{% load thumbnail %} + +{% block title %}Home{% endblock %} +{% block css_import %} +{{block.super}} + +{% endblock %} + +{% block body %} +{{block.super}} + + + + + + +{% endblock %} + diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/urls.py --- a/src/ldt/ldt/ldt_utils/urls.py Fri Jan 06 15:39:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/urls.py Mon Jan 09 15:12:15 2012 +0100 @@ -40,6 +40,8 @@ url(r'^segmentHighlight/(?P.*)/(?P.*)/(?P.*)/(?P.*)/(?P.*)/$', 'views.lignesdetemps.highlight_segment'), url(r'^createGroup/$', 'views.group.create_group'), url(r'^updateGroup/(?P.*)$', 'views.group.update_group'), + url(r'^front/$', 'views.front.front_home'), + url(r'^front/group/(?P.*)$', 'views.front.group_info'), ) urlpatterns += patterns('', diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/ldt_utils/views/front.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/views/front.py Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,51 @@ +from django.conf import settings +from django.contrib.auth.decorators import login_required +from django.contrib.auth.models import Group, User +from django.http import HttpResponseServerError +from django.shortcuts import render_to_response, get_object_or_404 +from django.template import RequestContext +from guardian.shortcuts import get_objects_for_group +from ldt.ldt_utils.models import Content, Project +from ldt.security.utils import add_change_attr + + + + + +@login_required +def front_home(request): + # Get the 3 last annotated contents + last_contents = Content.objects.all()[:3] + # Get the most annotated contents + most_contents = Content.objects.all()[4:12] + # Get the active groups + active_groups = Group.objects.exclude(name=settings.PUBLIC_GROUP_NAME)[:5] + + + is_gecko = ((request.META['HTTP_USER_AGENT'].lower().find("firefox")) > -1); + + return render_to_response("front/front_home.html", + {'last_contents': last_contents, 'most_contents':most_contents, 'active_groups':active_groups, + 'is_gecko': is_gecko}, + context_instance=RequestContext(request)) + + +@login_required +def group_info(request, group_id): + # Get the active group + group = Group.objects.get(id=group_id) + # list of contents annotated by the group (or everyone) + everyone = Group.objects.get(name=settings.PUBLIC_GROUP_NAME) + content_list = get_objects_for_group(group, 'ldt_utils.view_content') | get_objects_for_group(everyone, 'ldt_utils.view_content') + # Group's users + users = User.objects.filter(groups__in=[group]) + + is_gecko = ((request.META['HTTP_USER_AGENT'].lower().find("firefox")) > -1); + + return render_to_response("front/front_group.html", + {'group': group, 'content_list':content_list, 'users':users, + 'is_gecko': is_gecko}, + context_instance=RequestContext(request)) + + + diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/front_common.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/static/ldt/css/front_common.css Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,225 @@ +/* Browser-reset CSS */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +table { + border-collapse: separate; border-spacing: 0; +} + +th, td { + vertical-align: top; +} + +body { + font-family: Helvetica, Arial, sans-serif; color: #484848; background: url(./imgs/main_bg.png) repeat-x #f8f6f7; +} + +/* usual selectors */ + +a { + color: #484848; text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +b { + font-weight: 800; +} + +h1 { + font-family: "DIN-Light", Helvetica, Arial, sans-serif; font-size: 22px; +} + +h1 bold { + font-family: "DIN-Bold", Helvetica, Arial, sans-serif; +} + +h2 { + font-family: "DIN-Light", Helvetica, Arial, sans-serif; font-size: 21px; color: #0068c4; margin: 4px 2px; +} + +h3 { + font-size: 18px; color: #0068c4; +} + +h4 { + margin: 2px 0; font-size: 15px; +} + +h5 { + float: left; clear: left; font-weight: bold; margin: 2px 0; min-width: 70px; font-size: 13px; padding: 0; +} + +p { + margin: 2px 0; font-size: 13px; +} + +p, h2, h3, h4, h5 { + text-shadow: 1px 1px 1px #ffffff; +} + +/* Frequently-used classes */ + +.highlight { + background: #fff080; +} + +div.pad { + padding: 10px; +} + +ul.floatlist { + float: left; list-style: none; +} + +.floatlist li { + float: left; +} + +div.fl, li.fl, p.fl, img.fl { + float: left; +} + +div.fr, li.fr, p.fr, img.fr { + float: right; +} + +.clear { + clear: both; +} + +.li_h2 { + border-bottom: 1px solid #484848; margin: 5px 0; +} + +.li_media { + margin: 10px; +} + +.img_media { + background: #000000; border: 2px solid #ffffff; padding: 1px; +} + +.under, a.under { + text-decoration: underline; +} + +a.under:hover { + text-decoration: none; +} + +.blue, a.blue { + color: #0068c4; +} + +.pink, a.pink { + color: #ff3b77; +} + +.b, a.b { + font-weight: bold; +} + +.bigmargin { + margin: 10px 0; +} + +.bulle_annot, .bulle_people { + float: right; width: 18px; height: 10px; font-size: 9px; margin: 3px 0 0; padding: 1px 0 2px 10px; color: #ffffff; text-align: center; overflow: hidden; +} + +.bulle_annot { + background: url(./imgs/bulle_annot.png); +} + +.bulle_people { + background: url(./imgs/bulle_people.png); +} + +.font_16 { + font-size: 16px; +} + +.font_11 { + font-size: 11px; +} + +.btn { + border: 1px solid #c0c0c0; padding: 5px; font-size: 14px; font-weight: bold; +} + +.btn a { + color: #606060; +} + +/* General container */ + +#general_container { + width: 960px; margin: 0 auto; +} + +/* Barre de titre */ + +#title_bar { + font-family: "DIN-Light", Helvetica, Arial, sans-serif; height: 50px; font-size: 22px; margin: 0 0 1px 0; +} + +#title_bar a { + color: #ffffff; +} + +#title_bar li { + height: 38px; margin: 0; padding: 10px 20px 0; background: url(./imgs/sep_title.png) right no-repeat; +} + +li#li_h1 { + padding-left: 0; width: 210px; +} + +#form_search { + position: relative; width: 378px; margin: 2px 0; height: 20px; border: 1px solid #000000; background: url(./imgs/search_icon.png) left no-repeat #ffffff; +} + +#search_text { + position: absolute; top: 0; left: 25px; width: 250px; height: 20px; border: 0; padding: 0; +} + +#search_submit { + position: absolute; top: 0; right: 0; height: 16px; width: 100px; font-size: 12px; color: #ffffff; background: #0068c4; border: 0; margin: 2px; padding: 0; text-align: center; +} + +#annot_icon { + margin: 3px 10px 0 0; +} + + +/* Footer */ + +#footer { + float: right; list-style: none; border-top: 1px solid #484848; padding: 10px; width: 940px; margin-top: 15px; /* 960 - padding */ +} + +#footer li { + font-size: 12px; float: right; padding: 5px 20px; border-right: 1px solid #484848; +} \ No newline at end of file diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/front_group.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/static/ldt/css/front_group.css Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,40 @@ +/* Médias du groupe */ + +#medias_groupe { + width: 640px; margin: 5px 0; +} + +#medias_groupe .li_h2 { + width: 630px; margin-right: 10px; +} + +#medias_groupe .li_media { + width: 140px; + height: 140px; +} + +/* Colonne droite */ + +#groupe_droite { + float: left; width: 310px; margin: 5px 0 5px 10px; +} + +#groupe_droite .li_h2 { + float: left; width: 310px; +} + +#embed_search { + background: url(./imgs/embed_search.png) 5px center no-repeat; padding-left: 40px; +} + +li.li_membre_groupe { + width: 150px; margin: 0 5px 3px 0; +} + +.li_membre_groupe .img_media { + float: left; margin-top: 2px; +} + +.li_membre_groupe p { + margin-left: 45px; +} \ No newline at end of file diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/front_home.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/static/ldt/css/front_home.css Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,54 @@ +/* Derniers médias */ + +#derniers_medias { + width: 960px; margin: 5px 0; +} + +#derniers_medias .li_h2 { + width: 960px; +} + +#derniers_medias .li_media { + width: 300px; +} + +/* Plus annotés */ + +#plus_annotes { + width: 640px; margin: 5px 0; +} + +#plus_annotes .li_h2 { + width: 630px; margin-right: 10px; +} + +#plus_annotes .li_media { + width: 140px; + height: 140px; +} + +/* Groupes actifs */ + +#groupes_actifs { + width: 320px; margin: 5px 0; +} + +#groupes_actifs .li_h2 { + width: 310px; margin-left: 10px; +} + +#groupes_actifs .li_media { + width: 300px; margin: 5px 10px; +} + +div.img_groupes_actifs { + float: left; position: relative; padding: 5px 10px 0 0; +} + +div.txt_groupes_actifs { + float: left; width: 230px; +} + +.lock_group { + background: url(./imgs/lock.png); width: 11px; height: 13px; position: absolute; left: 45px; top: 34px; +} \ No newline at end of file diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/front_player.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/static/ldt/css/front_player.css Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,65 @@ +#player_col_g { + float: left; width: 550px; +} + +#top_media { + width: 550px; border-bottom: 1px solid #484848; +} + +#media_share { + float: right; margin-top: 5px; +} + +li.share_li { + padding: 5px 0 0 5px; height: 20px; +} + +#ann_fleche_cont { + width: 550px; height: 21px; overflow: hidden; position: relative; +} + +#ann_fleche { + width: 1100px; height: 21px; position: absolute; margin-left: -550px; +} + +#ann_fleche div { + float: left; width: 550px; height: 21px; +} + +#ann_fl_left { + background:url(./imgs/anarl.png); +} + +#ann_fl_right { + background:url(./imgs/anarr.png); +} + +#annotation_bas { + float: left; width: 550px; background: url(./imgs/annot_bg.png); margin: 0 0 25px; +} + +/* COLONNE DE DROITE */ + +#player_col_d { + float: left; width: 410px; +} + +#player_col_d .li_h2 { + width: 400px; margin-left: 10px; +} + +#annot_media { + width: 400px; margin: 5px 0 10px 10px; max-height: 400px; overflow: auto; +} + +#annot_media li { + padding: 5px 0; +} + +#annot_media li.selected { + background: url(./imgs/annot_bg.png); +} + +div.une_annot { + width: 280px; +} diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/front_search.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/static/ldt/css/front_search.css Mon Jan 09 15:12:15 2012 +0100 @@ -0,0 +1,126 @@ +#tbl_rech { + float: left; clear: both; +} + + +/* LISTE DES RÉSULTATS DE RECHERCHE */ + +#liste_resultats { + width: 640px; +} + +#li_haut_resultats { + width: 630px; padding: 5px 9px 5px 0; border-right: 1px solid #484848; +} + +#ul_haut_resultats { + width: 630px; border-bottom: 1px solid #484848; +} + +#title_resultats { + width: 250px; +} + +#title_resultats h2 { + font-size: 19px; +} + +#p_nb_resultats { + margin : 10px 0 0; +} + +#resultats_options { + font-family: "DIN-Light", Helvetica, Arial, sans-serif; float: right; padding: 0 20px; margin: 4px 0; font-size: 19px; background:url(./imgs/fl_bas.png) right 80% no-repeat; color: #0068c4; +} + +/* TITRE DU MÉDIA */ + +div.titre_result_media { + float: left; width: 630px; padding: 10px 9px 0 0; border-right: 1px solid #484848; +} + +.titre_result_media div { + float: left; border-color: #d0d0d0; border-width: 1px; border-style: solid none; height: 25px; +} + +.h3_result_media { + width: 240px; +} + +.h3_result_media h3 { + font-family: "DIN-Bold", Helvetica, Arial, sans-serif; font-weight: 800; margin: 2px 0 0 2px; +} + +div.duree_result_media { + width: 49px; border-right: 1px solid #d0d0d0; +} + +.duree_result_media p { + font-size: 11px; text-align: right; margin: 10px 2px 0 0; +} + +.graph_result_media { + width: 350px; height: 25px; +} + +/* LISTE DES SEGMENTS */ + +ul.list_segments { + width: 640px; +} + +li.li_segment { + width: 630px; padding: 3px 9px 3px 0; border-right: 1px solid #484848; +} + +li.li_segment.selected { + background: url(./imgs/preview_arrows.png) right center no-repeat #fbfafa; padding: 2px 10px 1px 0; border-width: 1px; border-color: #484848; border-style: solid none; +} + +div.left_segment { + float: left; width: 87px; height: 47px; padding: 5px; position: relative; +} + +.left_segment img { + border: 1px solid #f0f0f0; +} + +p.duree_segment { + position: absolute; margin: 0; right: 10px; bottom: 10px; color: #ffffff; font-size: 11px; +} + +div.color_zone { + float: left; width: 5px; height: 45px; margin: 1px 0; +} + +p.text_segment, h4.title_segment { + margin-left: 100px; +} + +li.plus_result { + width: 630px; padding: 0 9px 0 0; border-right: 1px solid #484848; +} + +.plus_result p { + width: 630px; margin: 0 0 10px; padding: 0 0 5px; text-align: right; border-bottom: 1px solid #d0d0d0; +} + +/* PAGINATION DES RESULTATS */ + +#result_pagination { + width: 630px; padding: 0 0 10px 10px; +} + +/* APERÇU À DROITE */ + +#result_preview { + width: 300px; height: 100%; border-right: 1px solid #484848; background: #fbfafa; vertical-align: top; padding: 38px 9px 0 10px; +} + +#preview_metadataplayer { + width: 300px; height: 200px; +} + +#tl_position { + width: 300px; margin: 10px 0; height: 16px; border-bottom: 1px solid #909090; +} \ No newline at end of file diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/anarl.png Binary file src/ldt/ldt/static/ldt/css/imgs/anarl.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/anarr.png Binary file src/ldt/ldt/static/ldt/css/imgs/anarr.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/annot_bg.png Binary file src/ldt/ldt/static/ldt/css/imgs/annot_bg.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/bulle_annot.png Binary file src/ldt/ldt/static/ldt/css/imgs/bulle_annot.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/bulle_people.png Binary file src/ldt/ldt/static/ldt/css/imgs/bulle_people.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/embed_search.png Binary file src/ldt/ldt/static/ldt/css/imgs/embed_search.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/fl_bas.png Binary file src/ldt/ldt/static/ldt/css/imgs/fl_bas.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/lock.png Binary file src/ldt/ldt/static/ldt/css/imgs/lock.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/main_bg.png Binary file src/ldt/ldt/static/ldt/css/imgs/main_bg.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/preview_arrows.png Binary file src/ldt/ldt/static/ldt/css/imgs/preview_arrows.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/search_icon.png Binary file src/ldt/ldt/static/ldt/css/imgs/search_icon.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/css/imgs/sep_title.png Binary file src/ldt/ldt/static/ldt/css/imgs/sep_title.png has changed diff -r 496bd82719e5 -r 631c0edee9ea src/ldt/ldt/static/ldt/img/annot_icon.png Binary file src/ldt/ldt/static/ldt/img/annot_icon.png has changed diff -r 496bd82719e5 -r 631c0edee9ea web/ldtplatform/templates/registration/login.html --- a/web/ldtplatform/templates/registration/login.html Fri Jan 06 15:39:01 2012 +0100 +++ b/web/ldtplatform/templates/registration/login.html Mon Jan 09 15:12:15 2012 +0100 @@ -4,6 +4,66 @@ {% endblock %} @@ -52,6 +112,7 @@ {% endif %} +

clic ici

{% endblock %}