From: yomguy Date: Thu, 19 Apr 2012 11:27:11 +0000 (+0200) Subject: add profile links to message users, begin document view X-Git-Tag: 0.3~23 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9a53c0267f760b2bc590910c12476bf08c2bfe0d;p=teleforma.git add profile links to message users, begin document view --- diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 90e68fbc..9e2a4c78 100644 Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ diff --git a/teleforma/locale/fr/LC_MESSAGES/django.po b/teleforma/locale/fr/LC_MESSAGES/django.po index 424c417a..de492f42 100644 --- a/teleforma/locale/fr/LC_MESSAGES/django.po +++ b/teleforma/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-19 11:39+0200\n" +"POT-Creation-Date: 2012-04-19 13:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \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