]> git.parisson.com Git - teleforma.git/commitdiff
update desk tables, fix livestream properties, imgs to come..
authoryomguy <yomguy@parisson.com>
Tue, 19 Jun 2012 15:44:35 +0000 (17:44 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 19 Jun 2012 15:44:35 +0000 (17:44 +0200)
teleforma/models.py
teleforma/static/teleforma/css/teleforma.css
teleforma/templates/postman/base_write.html
teleforma/templates/teleforma/course_document.html
teleforma/templates/teleforma/courses.html
teleforma/templates/teleforma/inc/conference_list.html
teleforma/templates/teleforma/inc/document_list.html
teleforma/templates/teleforma/inc/media_list.html
teleforma/templatetags/teleforma_tags.py
teleforma/views.py

index 8709ed56f7cf0aef659a1098235ccb9b3c17f793..1a854ff7e3bcec9167942a3709f382b5059ee59c 100755 (executable)
@@ -247,21 +247,28 @@ class LiveStream(Model):
     stream_type = CharField(_('Streaming type'),
                             choices=streaming_choices, max_length=32)
 
+    @property
+    def slug(self):
+        slug = '-'.join([self.course.department.slug, self.course.slug,
+                         self.course_type.name.lower()])
+        return slug
+
     @property
     def mount_point(self):
-        slug = '-'.join([self.conference.course.department.slug, self.conference.course.slug,
-                         self.conference.course_type.name.lower()])
         if self.server.type == 'stream-m':
-            return  'consume/' + slug
+            return  'consume/' + self.slug
         else:
-            return slug + '.' + self.stream_type
+            return self.slug + '.' + self.stream_type
 
     @property
     def url(self):
         return 'http://' + self.server.host + ':' + self.server.port + '/' + self.mount_point
 
     def __unicode__(self):
-        return self.conference.description
+        if self.conference:
+            return self.conference.description
+        else:
+            return self.slug
 
     class Meta:
         db_table = app_label + '_' + 'live_stream'
index 04f2fb82c34fc9a21710e23286cc58f0f3c582df..29d1dbedbb8754e334929fad2515194abec353a0 100644 (file)
@@ -885,9 +885,9 @@ table.listing tbody td a:hover, table.listing tbody th a:hover {
     background-color: transparent;
 }
 table.listing tbody tr { border-top: 1px solid #ddd }
-table.listing tbody tr.even { background-color: #fcfcfc }
-table.listing tbody tr.odd { background-color: #f7f7f7 }
-table.listing tbody tr:hover { background: #f7f8fa !important }
+table.listing tbody tr.even { background-color: transparent }
+table.listing tbody tr.odd { background-color: transparent }
+table.listing tbody tr:hover { background: transparent !important }
 
 table td.error {
     color: red;
@@ -1464,7 +1464,6 @@ input,textarea{
 
 .course_subtitle {
     padding: 0.3em;
-
 }
 
 .course_content p {
index 23ad3cee4f9362bf6a041948619f6b193bd67e8c..5b0e269006010af33e1d8b36abb6c566769b53d6 100644 (file)
@@ -1,5 +1,7 @@
 {% extends "postman/base.html" %}
 {% load i18n %}
+{% load teleforma_tags %}
+
 {% block extrahead %}{{ block.super }}
 {% if is_autocompleted %}
 {# using the available admin jQuery is enough #}
 <link href="{{ MEDIA_URL }}css/jquery.autocomplete.css" type="text/css" media="all" rel="stylesheet" />
 {% endif %}
 {% endblock %}
+
 {% block content %}
 <div id="postman" class="desk_messages">
 <h1>{% block pm_write_title %}{% endblock %}</h1>
+
+{% if user.student.all %}
 <div style="padding-top: 0.5em;">
+
 <select id="_professorSelect" name="professors" onchange="update_recipients();">
 <option>{% trans "Choose a professor" %}</option>
-<option value="admin">me</option>
-<option value="a.abou-el-haja">You</option>
+{% get_professors as professors %}
+{% for p in professors %}
+<option value="{{ p.user.username }}">{{p.user.first_name}} {{p.user.last_name}}</option>
+{% endfor %}
 </select>
+
+<select id="_adminSelect" name="admins" onchange="update_recipients();">
+<option>{% trans "Choose an administrator" %}</option>
+{% get_admins as admins %}
+{% for a in admins %}
+<option value="{{ a.username }}">{{a.first_name}} {{a.last_name}}</option>
+{% endfor %}
+</select>
+
 </div>
+{% endif %}
+
 <div class="write_content">
 <form id="_messageForm" action="{% if next_url %}?next={{ next_url|urlencode }}{% endif %}" method="post">{% csrf_token %}
 <table>
@@ -36,8 +55,14 @@ $("#_professorSelect").click(function () {
       var htmlStr = $(this).val();
       $("#id_recipients").val(htmlStr);
     });
+$("#_adminSelect").click(function () {
+      var htmlStr = $(this).val();
+      $("#id_recipients").val(htmlStr);
+    });
+
 }
 
+
 $('#send_button').click(function() {
   $('#_messageForm').submit();
 });
index e7f71d5d74c12e93be749c8386741bf1d1f2ec62..c89cd2c59695b879adeabfa6ce1d0f16a6244b7e 100644 (file)
@@ -56,7 +56,6 @@ PDFJS.getDocument('{% url teleforma-document-download document.id %}').then(func
 <div class="course_media">
 
 <div class="course_title">{{ document.course.title }}{% for type in document.course_type.all%} - {{ type }}{% endfor %}{% if document.type %} - {{ document.type }}{% endif %}<br />
-{% if document.title %}<h4>{{ document.title }}</h4>{% endif %}
 </div>
 
 {% if access_error %}
index 669a573809d5d179d6db0d1095fd45e1baa9b2a2..f0f2d7bf135aade4ef615c03e42f5967a15e2b10 100644 (file)
@@ -58,7 +58,8 @@ $(document).ready(function(){
      {% with c.course as course %}
       {% for type in c.types %}
       <div class="course">
-        <div class="course_title">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}
+        <div class="course_title">
+         <a href="{% url teleforma-course-detail course.id %}" style="color: #000;">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}</a>
         </div>
 
         {% block conference %}
index 5c28763da677bbd5f647fb9fab5c3f76e889bf48..89d247b9e1b60e233cb646335be87c211499c1d5 100644 (file)
@@ -1,24 +1,16 @@
 {% load teleforma_tags %}
 {% load i18n %}
 
-{% if course.conference.all|from_course_type:type %}
+{% if course.livestream.all|from_course_type:type %}
 <div class="course_content">
 <div class="course_subtitle">
-    <h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Live conference"%}</h3>
+    <h3><img src="{% url telemeta-images "item_title.png" %}" width="10px" alt="" /> {% trans "Live conference"%}</h3>
 </div>
     <table class="listing" width="100%">
-    <thead>
-        <tr>
-        <th class="highlight">{% trans "Session" %}</th>
-        <th>{% trans "Professor" %}</th>
-        <th>{% trans "Begin date" %}</th>
-        <th>{% trans "Streaming" %}</th>
-        </tr>
-    </thead>
     <tbody>
-        {% for conference in course.conference.all|from_course_type:type %}
+        {% for stream in course.livestream.all|from_course_type:type %}
             <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
-            <td><a href="{% url teleforma-conference-detail conference.id %}">{{ conference.session }}</a></td>
+            <td><a href="{% url teleforma-conference-detail conference.id %}" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/network-wireless_r.png" style="vertical-align:middle" alt="" /> {{ stream.slug }}</a></td>
             <td>{% if conference.professor.user %}<a href="{% url teleforma-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a>{% endif %}</td>
             <td><a href="{% url teleforma-conference-detail conference.id %}">{{ conference.date_begin }}</a></td>
              <td align="center">
index 42ad3422c32dce08c0b605ea837bfb933af75c31..c10438eb6ef5dda25d991689d1fb3599e2d0dfd5 100644 (file)
@@ -4,32 +4,24 @@
 {% if course.document.all|from_course_type:type %}
 <div class="course_content">
 <div class="course_subtitle">
-<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Documents"%}</h3>
+<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Documents"%}</h3>
 </div>
 
 {% for doc_type in doc_types %}
 {% if course.document.all|from_course_type:type|from_doc_type:doc_type %}
 <span class="doc_type_title">{{ doc_type }}</span>
 <table class="listing" width="100%">
-    <thead>
-        <tr>
-        <th class="highlight">{% trans "Title" %}</th>
-        <th>{% trans "Annal" %}</th>
-        <th>{% trans "Date modified" %}</th>
-        <th>{% trans "Download" %}</th>
-        </tr>
-    </thead>
     <tbody>
         {% for document in course.document.all|from_course_type:type|from_doc_type:doc_type %}
-        <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
-        <td>{% if document.file %}<a href="{% url teleforma-document-view document.id %}" target="_blank">{% endif %}{{ document.title }}{% if document.file %}</a>{% endif %}</td>
-        <td align="center">
+        <tr>
+        <td>{% if document.file %}<a href="{% url teleforma-document-view document.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/icon_doc_16.png" style="vertical-align:middle" alt="" />{% endif %} {{ document.title }}{% if document.file %}</a>{% endif %}</td>
+        <!--<td align="center">
         {% if document.is_annal %}
           <img src="images/ok.png" alt="yes" style="vertical-align:middle" />&nbsp;
         {% endif %}
-        </td>
+        </td>-->
         <td>{{ document.date_added }}</td>
-        <td align="center">{% if document.file %}<a href="{% url teleforma-document-download document.id %}"><img src="{% url telemeta-images "download.png" %}" width="16px"  style="vertical-align:middle" /></a>{% endif %}</td>
+        <td align="center">{% if document.file %}<a href="{% url teleforma-document-download document.id %}"><img src="{% url telemeta-images "download.png" %}" width="16px"  style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
         </tr>
     {% endfor %}
     </tbody>
index 8001a0a68d4ff2ee2a55e394f8202df4496bd907..aa50533a958e404b9beda1c63c85d356dcdd44ea 100644 (file)
@@ -4,23 +4,14 @@
 {% if course.media.all|from_course_type:type %}
 <div class="course_content">
 <div class="course_subtitle">
-    <h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Passed conferences"%}</h3>
+    <h3><img src="{% url telemeta-images "item_title.png" %}" width="10px" alt="" /> {% trans "Passed conferences"%}</h3>
 </div>
     <table class="listing" width="100%">
-    <thead>
-        <tr>
-        <th class="highlight">{% trans "Title" %}</th>
-        <th>{% trans "Session" %}</th>
-        <th>{% trans "Professor" %}</th>
-        <th>{% trans "Begin date" %}</th>
-        <th>{% trans "Duration" %}</th>
-        </tr>
-    </thead>
     <tbody>
         {% for media in course.media.all|from_course_type:type %}
          {% if media.published or user.is_staff %}
-            <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
-            <td><a href="{% url teleforma-media-detail media.id %}">{{ media.title }}</a></td>
+            <tr>
+            <td><a href="{% url teleforma-media-detail media.id %}" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/tool-animator_r.png" style="vertical-align:middle" alt="" /> {{ media.title }}</a></td>
             <td><a href="{% url teleforma-media-detail media.id %}">{{ media.conference.session }}</a></td>
             <td>{% if media.conference.professor.user %}<a href="{% url teleforma-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a>{% endif %}</td>
             <td>{% if media.conference.date_begin %}<a href="{% url teleforma-media-detail media.id %}">{{ media.conference.date_begin }}</a>{% endif %}</td>
index 1cf493d4019e4391f7b06c629a663ebf83b03786..b77488f83b08b2e47173450a1316240329421fea 100644 (file)
@@ -106,3 +106,25 @@ def from_course_type(docs, type):
 @register.filter
 def from_doc_type(docs, type):
     return docs.filter(type=type)
+
+@register.assignment_tag
+def get_professors():
+    return Professor.objects.all()
+
+@register.assignment_tag
+def get_admins():
+    return User.objects.filter(is_staff=True)
+
+@register.assignment_tag
+def get_trainings():
+    return Training.objects.all()
+
+@register.assignment_tag
+def get_eijs():
+    return IEJ.objects.all()
+
+@register.assignment_tag
+def get_courses():
+    return Course.objects.all()
+
+
index 7b51408b0f88b5ac92d54bdf7dbadb81e65166b8..2766d762d293b208b1e88e4dd595665577bfea95 100755 (executable)
@@ -52,13 +52,15 @@ def format_courses(courses, course=None, queryset=None, types=None):
             'date': course.date_modified, 'number': course.number})
     return courses
 
+
 def get_courses(user, date_order=False, num_order=False):
+    courses = []
+
     if not user.is_authenticated():
-        return []
+        return courses
 
     professor = user.professor.all()
     student = user.student.all()
-    courses = []
 
     if professor:
         professor = user.professor.get()