From 9a53c0267f760b2bc590910c12476bf08c2bfe0d Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 19 Apr 2012 13:27:11 +0200 Subject: [PATCH] add profile links to message users, begin document view --- teleforma/locale/fr/LC_MESSAGES/django.mo | Bin 3741 -> 3764 bytes teleforma/locale/fr/LC_MESSAGES/django.po | 51 +++++++++++------ teleforma/templates/postman/base_folder.html | 4 +- teleforma/templates/postman/view.html | 10 +++- .../templates/teleforma/course_document.html | 52 ++++++++++++++++++ teleforma/templatetags/teleforma_tags.py | 22 ++++++-- 6 files changed, 113 insertions(+), 26 deletions(-) create mode 100644 teleforma/templates/teleforma/course_document.html diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 90e68fbc5c1fc013818c06ffed92a41b73c4c3eb..9e2a4c7837ca4fcc85467e5894fabafb8d2a72e9 100644 GIT binary patch delta 1474 zcmXZbPe@cz6vy#1I-@h0m1a?xgj$hG;Ge{(G#i_&oLrP4QDKWBT}T<^%6b$AA}x$j zu*e8&6_k)to6L<+w1^f$EzCe7q(#vm4BFK9m*+9(ecrk6-gE!V%t*mRK`@sa9x|>Z zv4QAGGdqj3VQyR(GR(5E3)K{07WQH$4&X8z_V)Xzeq$KJ35?aZaT4MWT+iOolG0%U?*zA!1F%T25+M_@(^`GPqH|F6?#g;TAV}` zn(>bFs6t=7{U>U|5UW$cEL8t|)Q(F~?{^?wEsi>wX7@O*BR_*Wfy)68TG0S%;4o_7 zDC#60qY6y8Q`koS8ny6JX4k|OsB!hE{z=rywR-zW)JED-|E4a~e8Dw;aRaGoLzsu7 zoh$KAu25*N0&oz*KyS3vdKA@AdyYZsUGq z0yXg$CgTih;w)xifLUrJ2N|*zsQbmJ2Fg5-q8f~OzSr}Ep0|2_8p9ShyF7Pc){U7= zyyNyF9~ii+(_GBQ0L#=$ zGu=E?fkMyMqF%7k$0MkM)t)z^c5okRhmIqqtsOP*Eau<^Y!8^-(*7@IV1_E1kj8S< zNET{Bf#-$D$4WVAr=my=t3mBZBWB|v)C*5~ejc^J>!^j?N9{}>s?MWy_CJ@4#|)^@ zOMh@2Rp^V4e@DG=3RQ5{$5ZK6E6zpTFG6lvDQah;ZXM>4H=%am1gfE~I2W3D4K=X` zwG$6f1^V4VJW4)->U;^^>cz`Y^GZ<9M^HN#^YMDrLYh(kq9dsHb@+Jv5*O68tGEbz zJRd+6e&)VFb^I2!g&$CbK6yTYYG4xQeq5-PPNV7v=~nl%-F##rZC1>M3a>}4e3R#u zsEIMui<(g1@nO_+r+oYzs?jc7h&PenmX#4}h(cmp;%BfSP@RZ`)>UmK-$1Cj5~7Y+ zNvNiNi@S&-LPw0KAR36(#O_3YXjQn1D;<@Iu~6*}UF{^66XnEGLjBI&K=rnr(5C5| mt08I$9Z_O4Q9sn2@*rtwIyEH_EZ\n" "Language-Team: LANGUAGE \n" @@ -320,12 +320,12 @@ msgstr "" msgid "g:i A,M j,n/j/y" msgstr "" -#: templates/postman/base_folder.html:56 templates/postman/view.html:35 +#: templates/postman/base_folder.html:56 templates/postman/view.html:39 #: templates/telemeta/lists.html:58 msgid "Delete" msgstr "" -#: templates/postman/base_folder.html:59 templates/postman/view.html:39 +#: templates/postman/base_folder.html:59 templates/postman/view.html:43 msgid "Archive" msgstr "" @@ -341,6 +341,7 @@ msgstr "Messages" #: templates/postman/base_write.html:20 #: templates/teleforma/course_conference.html:57 #: templates/teleforma/course_detail.html:69 +#: templates/teleforma/course_document.html:45 #: templates/teleforma/course_media.html:72 #: templates/teleforma/courses.html:102 msgid "Send" @@ -439,8 +440,8 @@ msgstr "Messages" msgid "Received" msgstr "" -#: templates/postman/reply.html:3 templates/postman/view.html:43 -#: templates/postman/view.html.py:46 templates/postman/view.html:49 +#: templates/postman/reply.html:3 templates/postman/view.html:47 +#: templates/postman/view.html.py:50 templates/postman/view.html:53 msgid "Reply" msgstr "" @@ -468,15 +469,15 @@ msgstr "" msgid "Message" msgstr "Messages" -#: templates/postman/view.html:21 +#: templates/postman/view.html:25 msgid "Rejected" msgstr "" -#: templates/postman/view.html:21 +#: templates/postman/view.html:25 msgid ":" msgstr "" -#: templates/postman/view.html:32 +#: templates/postman/view.html:36 msgid "Back" msgstr "" @@ -491,6 +492,7 @@ msgstr "Documents" #: templates/teleforma/course.html:18 templates/teleforma/course.html.py:34 #: templates/teleforma/course_conference.html:33 +#: templates/teleforma/course_document.html:21 #: templates/teleforma/inc/document_list.html:11 #: templates/teleforma/inc/media_list.html:11 templates/telemeta/lists.html:69 #: templates/telemeta/search_criteria.html:97 @@ -520,31 +522,37 @@ msgstr "Conférences" #: templates/teleforma/course.html:51 #: templates/teleforma/course_conference.html:34 -#: templates/teleforma/inc/conference_list.html:11 +#: templates/teleforma/course_document.html:22 +#: templates/teleforma/inc/conference_list.html:13 msgid "Session" msgstr "Session" #: templates/teleforma/course.html:52 #: templates/teleforma/course_conference.html:35 -#: templates/teleforma/inc/conference_list.html:12 +#: templates/teleforma/course_document.html:23 +#: templates/teleforma/inc/conference_list.html:14 #: templates/telemeta/inc/user_list.html:51 msgid "Professor" msgstr "Professeur" #: templates/teleforma/course_conference.html:36 +#: templates/teleforma/course_document.html:24 msgid "Begin" msgstr "" #: templates/teleforma/course_conference.html:37 +#: templates/teleforma/course_document.html:25 msgid "End" msgstr "" #: templates/teleforma/course_conference.html:38 +#: templates/teleforma/course_document.html:26 msgid "Live" msgstr "" #: templates/teleforma/course_conference.html:50 #: templates/teleforma/course_detail.html:62 +#: templates/teleforma/course_document.html:38 #: templates/teleforma/course_media.html:65 msgid "Local tweeter" msgstr "Tweeter local" @@ -578,12 +586,22 @@ msgstr "Tweeter général" msgid "Live conferences" msgstr "Conférences en direct" -#: templates/teleforma/inc/conference_list.html:13 +#: templates/teleforma/inc/conference_list.html:11 +#: templates/telemeta/lists.html:70 +#: templates/telemeta/inc/module_revisions.html:18 +msgid "Type" +msgstr "" + +#: templates/teleforma/inc/conference_list.html:12 +msgid "Room" +msgstr "" + +#: templates/teleforma/inc/conference_list.html:15 #, fuzzy msgid "Date begin" msgstr "Date d'ajout" -#: templates/teleforma/inc/conference_list.html:14 +#: templates/teleforma/inc/conference_list.html:16 msgid "Streaming" msgstr "Diffusion" @@ -680,11 +698,6 @@ msgstr "" msgid "Edit" msgstr "" -#: templates/telemeta/lists.html:70 -#: templates/telemeta/inc/module_revisions.html:18 -msgid "Type" -msgstr "" - #: templates/telemeta/lists.html:71 msgid "Code" msgstr "" @@ -857,6 +870,10 @@ msgstr "" msgid "Unknown" msgstr "" +#: templatetags/teleforma_tags.py:89 +msgid "me" +msgstr "moi" + #~ msgid "Modify profile" #~ msgstr "Modifier le profil" diff --git a/teleforma/templates/postman/base_folder.html b/teleforma/templates/postman/base_folder.html index 38dc8c8a..077e7ac4 100644 --- a/teleforma/templates/postman/base_folder.html +++ b/teleforma/templates/postman/base_folder.html @@ -1,5 +1,7 @@ {% extends "postman/base.html" %} -{% load i18n postman_tags %}{% load pagination_tags %} +{% load i18n postman_tags %} +{% load teleforma_tags %} +{% load pagination_tags %} {% block content %} diff --git a/teleforma/templates/postman/view.html b/teleforma/templates/postman/view.html index f68e7a61..b0a2b460 100644 --- a/teleforma/templates/postman/view.html +++ b/teleforma/templates/postman/view.html @@ -1,7 +1,7 @@ {% extends "postman/base.html" %} {% load i18n %} -{% load teleforma_tags %} {% load postman_tags %} +{% load teleforma_tags %} {% block content %}
@@ -14,8 +14,12 @@ {% for message in pm_messages %}
- {{ message.obfuscated_sender|or_me:user }} » - {{ message.obfuscated_recipient|or_me:user }} | + + {{ message.obfuscated_sender|or_me:user }} + » + + {{ message.obfuscated_recipient|or_me:user }} + | {{ message.sent_at|date:"DATETIME_FORMAT"}} | {{ message.subject }} {% if message.is_rejected %}
{% trans "Rejected" %}{% if message.moderation_reason %}{% trans ":" %} {{ message.moderation_reason }}{% endif %}
{% endif %} diff --git a/teleforma/templates/teleforma/course_document.html b/teleforma/templates/teleforma/course_document.html new file mode 100644 index 00000000..2132afce --- /dev/null +++ b/teleforma/templates/teleforma/course_document.html @@ -0,0 +1,52 @@ +{% extends "teleforma/course_media.html" %} +{% load telemeta_utils %} +{% load i18n %} + + +{% block course %} +
+ +
{{ document.title }}{% if document.description %} - {{ document.description }}{% endif %} +
+ +
+ + + +
+ +{% block general_info %} +
+
+
{% trans "Title" %}
{{ conference.course.title }}
+
{% trans "Session" %}
{{ conference.session }}
+
{% trans "Professor" %}
{{ conference.professor }}
+
{% trans "Begin" %}
{{ conference.date_begin }}
+
{% trans "End" %}
{{ conference.date_end }}
+
{% trans "Live" %}
{{ conference.streaming }}
+
+
+{% endblock general_info %} + +
+{% endblock course %} + +{% block chat %} +{% if room %} +
+
+

rss{% trans "Local tweeter" %}

+ +
+
Loading...
+
{% csrf_token %} + + + +
+ +
+
+
+{% endif %} +{% endblock chat %} diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 5698599c..820540dc 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -16,6 +16,9 @@ import os import datetime from django.conf import settings from django.template.defaultfilters import stringfilter +import django.utils.timezone as timezone +from timezones.utils import localtime_for_timezone +from django.utils.translation import ugettext_lazy as _ register = template.Library() @@ -67,11 +70,20 @@ def to_recipients(users): list.append(user.username) return ':'.join(list) - - -import django.utils.timezone as timezone -from timezones.utils import localtime_for_timezone - @register.filter def localtime(value, timezone): return localtime_for_timezone(value, timezone) + +@register.filter +def or_me(value, arg): + """ + Replace the value by a fixed pattern, if it equals the argument. + + Typical usage: sender|or_me:user + + """ + if not isinstance(value, (unicode, str)): + value = unicode(value) + if not isinstance(arg, (unicode, str)): + arg = unicode(arg) + return _('me') if value == arg else value -- 2.39.5