]> git.parisson.com Git - teleforma.git/commitdiff
add profile links to message users, begin document view
authoryomguy <yomguy@parisson.com>
Thu, 19 Apr 2012 11:27:11 +0000 (13:27 +0200)
committeryomguy <yomguy@parisson.com>
Thu, 19 Apr 2012 11:27:11 +0000 (13:27 +0200)
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/templates/postman/base_folder.html
teleforma/templates/postman/view.html
teleforma/templates/teleforma/course_document.html [new file with mode: 0644]
teleforma/templatetags/teleforma_tags.py

index 90e68fbc5c1fc013818c06ffed92a41b73c4c3eb..9e2a4c7837ca4fcc85467e5894fabafb8d2a72e9 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index 424c417acafef618cddce8247c7b7119b7e7349a..de492f426a4f7a2f75d2a43dedb9852797e8319f 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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"
 
index 38dc8c8a6522c3ce91ef44c413a7702d9ed0f26e..077e7ac4cd374cc2a1fd4b87e5a2e802abc67ebf 100644 (file)
@@ -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 %}
 
index f68e7a615b96fab7cab76eb19ac260bef2e650cd..b0a2b4600fdf971c723456288770aea6cc790f50 100644 (file)
@@ -1,7 +1,7 @@
 {% extends "postman/base.html" %}
 {% load i18n %}
-{% load teleforma_tags %}
 {% load postman_tags %}
+{% load teleforma_tags %}
 
 {% block content %}
 <div id="postman" class="desk_messages">
 {% for message in pm_messages %}
 <div class="pm_message{% if message.is_pending %} pm_pending{% endif %}{% if message.is_rejected %} pm_rejected{% endif %}{% if message.sender == user and message.sender_archived or message.recipient == user and message.recipient_archived %} pm_archived{% endif %}{% if message.sender == user and message.sender_deleted_at or message.recipient == user and message.recipient_deleted_at %} pm_deleted{% endif %}{% if message.recipient == user and not message.read_at %} pm_unread{% endif %}">
  <div class="pm_header">
-  <span class="pm_sender">{{ message.obfuscated_sender|or_me:user }}</span> &raquo;
-  <span class="pm_recipient">{{ message.obfuscated_recipient|or_me:user }}</span> |
+  <a href="{% url telemeta-profile-detail message.obfuscated_sender %}">
+  <span class="pm_sender">{{ message.obfuscated_sender|or_me:user }}</span>
+  </a>&raquo;
+  <a href="{% url telemeta-profile-detail message.obfuscated_recipient %}">
+  <span class="pm_recipient">{{ message.obfuscated_recipient|or_me:user }}</span>
+  </a> |
   <span class="pm_date">{{ message.sent_at|date:"DATETIME_FORMAT"}}</span> |
   <span class="pm_subject">{{ message.subject }}</span>
 {% if message.is_rejected %}  <div class="pm_status">{% trans "Rejected" %}{% if message.moderation_reason %}{% trans ":" %} {{ message.moderation_reason }}{% endif %}</div>{% endif %}
diff --git a/teleforma/templates/teleforma/course_document.html b/teleforma/templates/teleforma/course_document.html
new file mode 100644 (file)
index 0000000..2132afc
--- /dev/null
@@ -0,0 +1,52 @@
+{% extends "teleforma/course_media.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+
+{% block course %}
+<div class="course_media">
+
+<div class="course_title">{{ document.title }}{% if document.description %} - {{ document.description }}{% endif %}
+</div>
+
+<div class="media">
+
+
+
+</div>
+
+{% block general_info %}
+<div class="course_content" id="media_infos">
+<dl class="listing">
+<dt>{% trans "Title" %}</dt><dd>{{ conference.course.title }}</dd>
+<dt>{% trans "Session" %}</dt><dd>{{ conference.session }}</dd>
+<dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
+<dt>{% trans "Begin" %}</dt><dd>{{ conference.date_begin }}</dd>
+<dt>{% trans "End" %}</dt><dd>{{ conference.date_end }}</dd>
+<dt>{% trans "Live" %}</dt><dd>{{ conference.streaming }}</dd>
+</dl>
+</div>
+{% endblock general_info %}
+
+</div>
+{% endblock course %}
+
+{% block chat %}
+{% if room %}
+<div id="module-set" style="width: 22%">
+<div class="module">
+<h3><img src="{% url telemeta-images "vox_wh.png" %}" alt="rss" style="vertical-align:middle" />{% trans "Local tweeter" %}</h3>
+
+<div style="background: white;">
+<div id="chatwindow"><span id="loading">Loading...</span></div>
+<form id="chatform">{% csrf_token %}
+<label for="msg"></label>
+<input type="text" id="msg" size="16" />
+<input type="submit" value="{% trans "Send" %}" />
+</form>
+<!-- <script type="text/javascript">document.getElementById("msg").focus();</script> -->
+</div>
+</div>
+</div>
+{% endif %}
+{% endblock chat %}
index 5698599cc31584ba15303932ca1273e764123188..820540dc68473ef4bde16bd76fccc26edea97923 100644 (file)
@@ -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