]> git.parisson.com Git - teleforma.git/commitdiff
fix many content styles, add XLS user list export
authoryomguy <yomguy@parisson.com>
Tue, 10 Apr 2012 21:13:38 +0000 (23:13 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 10 Apr 2012 21:13:38 +0000 (23:13 +0200)
15 files changed:
teleforma/htdocs/css/teleforma_black.css
teleforma/management/commands/teleforma-export-users.py [new file with mode: 0644]
teleforma/models.py
teleforma/templates/postman/base.html
teleforma/templates/postman/base_folder.html
teleforma/templates/postman/base_write.html
teleforma/templates/postman/view.html
teleforma/templates/teleforma/course_detail.html
teleforma/templates/teleforma/course_media.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/templates/telemeta/inc/user_list.html
teleforma/templates/telemeta/users.html

index 5158468827692cb595e6f62f8bd9f167ec5e3785..5abbab571588c7dbf03c3db89cd7590b0e76003f 100644 (file)
@@ -1323,12 +1323,20 @@ input,textarea{
             font-weight: bold;
             }
 
+
+#module-set-left .module h3 a {
+            color: #FFF;
+            }
+
 #module-set-left .module ul {
         margin: 0em 0em 0em 0.5em;
         font-size: 0.8125em;
         background-color: #FFF;
         color: #0000 ;
         font-weight: bold;
+        max-height: 250px;
+        overflow-y: scroll;
+
         }
 
 #module-set-left .module a {
@@ -1340,14 +1348,29 @@ input,textarea{
     float: left;
     width:55%;
     padding: 0em 0em 0em 1em;
+    max-height: 600px;
+    overflow-y: scroll;
     }
 
 .desk_large {
+    float: left;
+    width:75%;
+    padding: 0em 0.8em 0em 1em;
+    max-height: 600px;
+    overflow-y: scroll;
+    }
+
+.desk_course {
     float: left;
     width:75%;
     padding: 0em 0em 0em 1em;
     }
 
+.desk_media {
+    float: left;
+    width: 640px;
+    padding: 0em 0em 0em 1em;
+    }
 
 .course {
     margin: 0em 0em 2em 0em;
@@ -1372,26 +1395,26 @@ input,textarea{
     }
 
 .course_content {
-    /*max-height: 200px;
-    overflow-y: scroll;*/
     background-color: #FFF;
     -moz-border-radius: 8px 0px 8px 8px;
     -webkit-border-radius: 8px 0px 8px 8px;
     border-radius: 8px 0px 8px 8px;
-    padding: 0em 0em 0em 0.3em;
+    padding: 0em 0em 0em 0em;
 }
 
 
 .course_content h2 {
-    padding: 0.5em 0em 0em 0.3em;
+    padding: 0.5em 0.8em 0em 0.8em;
     }
 
 .course_media {
+    float: left;
     background-color: transparent;
-    margin: 0em 0em 2em 0em;
+    margin: 0em 0em 2em 1em;
     -moz-border-radius: 8px 0px 8px 8px;
     -webkit-border-radius: 8px 0px 8px 8px;
     border-radius: 8px 0px 8px 8px;
+    width: 640px;
 /*     border: 2px solid #CCC; */
     }
 
@@ -1427,7 +1450,7 @@ input,textarea{
     -moz-border-radius: 8px 0px 8px 8px;
     -webkit-border-radius: 8px 0px 8px 8px;
     border-radius: 8px 0px 8px 8px;
-
+    padding: 0.5em 0.8em 0.8em 0.8em;
     }
 
 #pm_messages {
@@ -1457,7 +1480,6 @@ input,textarea{
 
 #chatwindow {
     height: 340px;
-    width: 187px;
     border-bottom: 1px solid;
     padding: 0.8em 2em 0em 0em;
     overflow: auto;
diff --git a/teleforma/management/commands/teleforma-export-users.py b/teleforma/management/commands/teleforma-export-users.py
new file mode 100644 (file)
index 0000000..efd285d
--- /dev/null
@@ -0,0 +1,58 @@
+from optparse import make_option
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.contrib.auth.models import User
+from django.template.defaultfilters import slugify
+from telemeta.models import *
+from telemeta.util.unaccent import unaccent
+from teleforma.models import *
+import logging
+import codecs
+import xlrd
+from xlwt import Workbook
+
+class Command(BaseCommand):
+    help = "Export users to a XLS file (see an example in example/data/"
+    args = "path"
+    first_row = 2
+    admin_email = 'webmaster@parisson.com'
+
+    def export_user(self, count, user):
+        student = Student.objects.filter(user=user)
+        if student:
+            student = Student.objects.get(user=user)
+            row = self.sheet.row(count)
+            row.write(0, user.last_name)
+            row.write(1, user.first_name)
+            row.write(9, user.email)
+
+            row.write(2, unicode(student.iej))
+            row.write(3, unicode(student.training))
+            row.write(4, unicode(student.procedure))
+            row.write(5, unicode(student.written_speciality))
+            row.write(6, unicode(student.oral_speciality))
+            row.write(7, unicode(student.oral_1))
+            row.write(8, unicode(student.oral_2))
+            row.write(15, unicode(student.category))
+#            address     = row[10].value
+#            p_code      = row[11].value
+#            city        = row[12].value
+#            tel         = row[13].value
+#            date        = row[14].value
+
+            print 'exported: ' + user.first_name + ' ' + user.last_name + ' ' + user.username
+
+
+
+    def handle(self, *args, **options):
+        file = args[0]
+        self.book = Workbook()
+        self.sheet = self.book.add_sheet('Etudiants')
+        users = User.objects.all()
+        count = 0
+        for user in users:
+            self.export_user(count, user)
+            count += 1
+        self.book.save(file)
+
+
index 608fdf2ec4f57848d9f16375d053aab55cdbe462..90bf1eadb3232e523c9130235f37e0fec98d70dd 100755 (executable)
@@ -128,6 +128,7 @@ class Course(Model):
     class Meta:
         db_table = app_label + '_' + 'course'
         verbose_name = _('course')
+        ordering = ['title']
 
 
 class Professor(Model):
@@ -182,6 +183,7 @@ class Conference(Model):
     class Meta:
         db_table = app_label + '_' + 'conference'
         verbose_name = _('conference')
+        ordering = ['-date_begin']
 
 
 class MediaBase(Model):
@@ -199,7 +201,7 @@ class MediaBase(Model):
 
     class Meta:
         abstract = True
-        ordering = ['date_added']
+        ordering = ['-date_added']
 
 
 class Document(MediaBase):
index 54e88b8030ce4892f84dd3e6d41b440f386094d7..aea8d35697269ab2c8b09289cbabc09472f39b9c 100644 (file)
@@ -24,6 +24,4 @@
 </div>
 </div>
 
-
-
 {% endblock postman_menu %}
\ No newline at end of file
index f4bbfcb981d56f2dd8dbed8a9dfb6a7761fce996..aca852d170e4f6b918fdd39e4c93a46a87c1a448 100644 (file)
@@ -3,7 +3,7 @@
 
 {% block content %}
 
-<div id="postman" class="desk_center">
+<div id="postman" class="desk_media">
 <h1>{% block pm_folder_title %}{% endblock %}</h1>
 {% autopaginate pm_messages %}
 {% if invalid_page %}
index b8ca60de756eb2193dc1360b0dfb7e6f0749c2b2..a6331bc2476d8e65820b46e615603b008a81fe37 100644 (file)
@@ -10,7 +10,7 @@
 {% endif %}
 {% endblock %}
 {% block content %}
-<div id="postman" class="desk_center">
+<div id="postman" class="desk_course">
 <h1>{% block pm_write_title %}{% endblock %}</h1>
 <form id="_messageForm" action="{% if next_url %}?next={{ next_url|urlencode }}{% endif %}" method="post">{% csrf_token %}
 <table>
index 4e4899c1ec69022981d21a177b134310a1ba92c8..d726be28d94604a958c66f6ceadaefbd879c0f4a 100644 (file)
@@ -4,7 +4,7 @@
 {% load postman_tags %}
 
 {% block content %}
-<div id="postman" class="desk_center">
+<div id="postman" class="desk_media">
 <h1>{% if pm_messages|length > 1 %}{% trans "Conversation" %}{% else %}{% trans "Message" %}{% endif %}</h1>
 <br /><br />
 {% for message in pm_messages %}
index c07814d70ab94909cc09f6e5328abd441cb8f16e..312f780d9d3aa3794334a2a2b720ba056789468f 100644 (file)
@@ -8,7 +8,7 @@
 {% endblock courses %}
 
 {% block course %}
-
+<div class="desk_course">
 <div class="course">
 
 <div class="course_title">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}
@@ -32,5 +32,6 @@
 {% endwith %}
 {% endblock %}
 
+</div>
 </div>
 {% endblock course %}
index ce4d8987f64db9abb839b87325b1a3e27ea051e1..94a434cd7c285d759a4412d91ed7b2f90d0a1208 100644 (file)
@@ -20,7 +20,6 @@ $(document).ready(function(){
 {% endblock extra_javascript %}
 
 {% block course %}
-
 <div class="course_media">
 
 <div class="course_title">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}
@@ -62,7 +61,7 @@ $(document).ready(function(){
 {% block chat %}
 {% if room %}
 
-<div id="module-set" style="width: 290px">
+<div id="module-set" style="width: 270px">
 
 <div class="module">
 <h3><img src="{% url telemeta-images "search_wh2.png" %}" alt="rss" style="vertical-align:middle" />{% trans "Questions" %}</h3>
index 1fc6c6c08de3d0531b4a403442566cb87634a41f..9ddfe7f649fa967f861d0e9388b3fe50333b9229 100644 (file)
@@ -10,7 +10,7 @@
 <div id="module-set-left" style="width: 20%">
 
 <div class="module">
-<h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlists" style="vertical-align:middle" />{% trans "My courses" %}</h3>
+<h3><a href="{% url teleforma-courses %}"><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlists" style="vertical-align:middle" />{% trans "My courses" %}</a></h3>
 <div style="background: white;">
 <ul>
 {% block courses %}
 </div>
 
 
-
-<div class="desk_center">
-    {% block course %}
+{% block course %}
+<div class="desk_large">
     {% for course in object_list %}
       <div class="course">
         <div class="course_title">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}
         </div>
 
+        {% if course.conference.all or course.document.all or course.media.all %}
         {% block document %}
-        {% with course as course and %}
+        {% with course as course %}
         {% include "teleforma/inc/document_list.html" %}
         {% endwith %}
         {% endblock %}
 
         {% block media %}
-        {% with course as course and %}
+        {% with course as course %}
         {% include "teleforma/inc/media_list.html" %}
         {% endwith %}
         {% endblock %}
 
         {% block conference %}
-        {% with course as course and %}
+        {% with course as course %}
         {% include "teleforma/inc/conference_list.html" %}
         {% endwith %}
         {% endblock %}
-
+        {% else %}
+        <div class="course_content">
+         <h2>{% trans "No document" %}</h2>
+        </div>
+        {% endif %}
       </div>
     {% endfor %}
-    {% endblock course %}
-    </div>
+
+</div>
+{% endblock course %}
 </div>
 
 {% block chat %}
index 5af6bbe1f454e7764ec980baa4c388a94dca6441..f3f840c1fa5fe22e7de48eee174b6e1d1762c91a 100644 (file)
@@ -1,5 +1,6 @@
 {% load i18n %}
 
+{% if course.conference.all %}
 <div class="course_content">
     <h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Conferences"%}</h2>
     <table class="listing" width="100%">
@@ -20,4 +21,5 @@
         {% endfor %}
     </tbody>
     </table>
-</div>
\ No newline at end of file
+</div>
+{% endif %}
\ No newline at end of file
index 79ccc43cbe3d39082269fa7df1df313b369acce2..971667d37c17b0ffba1c176ecef0d79ccc9f488f 100644 (file)
@@ -1,5 +1,6 @@
 {% load i18n %}
 
+{% if course.document.all %}
 <div class="course_content">
 <h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Documents"%}</h2>
 <table class="listing" width="100%">
@@ -20,4 +21,5 @@
     {% endfor %}
     </tbody>
 </table>
-</div>
\ No newline at end of file
+</div>
+{% endif %}
\ No newline at end of file
index 7c55cd7880a9ed6c6359a71bfc51d39341f054c3..35cd4cc7e44b90d875fba3c3309843e5c1ba1fba 100644 (file)
@@ -1,5 +1,6 @@
 {% load i18n %}
 
+{% if course.media.all %}
 <div class="course_content">
     <h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Medias"%}</h2>
     <table class="listing" width="100%">
@@ -20,4 +21,5 @@
         {% endfor %}
     </tbody>
     </table>
-</div>
\ No newline at end of file
+</div>
+{% endif %}
\ No newline at end of file
index e3f4c420c377d1379dcf6a627a9c8b10c318a98a..7e14b44db1206ad1055d1571fbb333f82ef17979 100644 (file)
    <tr><th>{% trans "Last Name"%}</th>
     <th>{% trans "First Name"%}</th>
     <th>{% trans "User"%}</th>
-    <th>{% trans "Training"%}</th>
     <th>{% trans "IEJ"%}</th>
     <th>{% trans "Procedure"%}</th>
     <th>{% trans "Oral spe"%}</th>
     <th>{% trans "Written spe"%}</th>
     <th>{% trans "Oral 1"%}</th>
     <th>{% trans "Oral 2"%}</th>
-    <th>{% trans "Synthesis"%}</th>
     <th>{% trans "Messages"%}</th>
     </tr>
     </thead>
 
      {% if user.student.get %}
       {% with user.student.get as student %}
-        <td>{{ student.training.code }}</td>
         <td>{{ student.iej.name }}</td>
         <td>{{ student.procedure.code }}</td>
         <td>{{ student.oral_speciality.code }}</td>
         <td>{{ student.written_speciality.code }}</td>
         <td>{{ student.oral_1.code }}</td>
         <td>{{ student.oral_2.code }}</td>
-        <td></td>
      {% endwith %}
     {% elif user.professor.get %}
         <td>{% trans "Professor" %}</td>
@@ -57,8 +53,6 @@
         <td></td>
         <td></td>
         <td></td>
-        <td></td>
-        <td></td>
 
     {% endif %}
     <td><a href="{% url postman_write user.username %}" class="component_icon button" id="action_green">{% trans "Write" %}</a></td>
index 4b174782f682d038ca51477949cdcda7c4995ee2..0de0536b95434e4d35dda36b3868904a464c2b6a 100644 (file)
@@ -25,7 +25,7 @@
 </div>
 </div>
 
-<div class="desk_large">
+<div class="desk_course">
 <div class="course_title">{% trans "Users" %}</div>
  {% if users %}
   {% include "telemeta/inc/user_list.html" %}