]> git.parisson.com Git - teleforma.git/commitdiff
add messages
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 17 Jul 2014 11:40:17 +0000 (13:40 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 17 Jul 2014 11:40:17 +0000 (13:40 +0200)
teleforma/exam/templates/exam/inc/script_list.html
teleforma/management/commands/teleforma-exam-submit-scripts.py
teleforma/static/teleforma/css/teleforma.css
teleforma/templates/postman/base_folder.html
teleforma/templates/postman/email_user_init.txt

index 6d544bf829d4913c6eeffb19ebcd82aa49ac4ca0..7b72c1c5fa4af4ad3c9a05546a7c338c5c7a5ccc 100644 (file)
@@ -6,6 +6,16 @@
 {% autopaginate object_list 8 %}
 {% paginate %}
 
+<script>
+$(document).ready(function(){
+    $('table tr').click(function(){
+        window.location = $(this).data('href');
+        return false;
+    });
+});
+</script>
+
+
 <div id="users">
   <table class="listing" width="100%">
    <thead>
     <th>{% trans "Score"%}</th>
     </tr>
     </thead>
-    <tbody id="spacing">
+    <tbody id="spacing" class="script-list">
     {% for script in object_list %}
-    <tr style="font-weight: bold;">
-    <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.course.title }}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.session }}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.type }}</a></td>
-
-     <td><a href="{% url teleforma-profile-detail script.author.username %}">{{ script.author.last_name }}</a></td>
-     <td><a href="{% url teleforma-profile-detail script.author.username %}">{{ script.author.first_name }}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.date_submitted }}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{% if script.date_marked %}{{ script.date_marked }}{% endif %}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{% if script.corrector %}{{ script.corrector }}{% endif %}</a></td>
-     <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{% if script.score %}{{ script.score|floatformat }}{% endif %}</a></td>
+    <tr data-href="{% url teleforma-exam-script-detail period.id script.id %}">
+    <td>{{ script.course.title }}</td>
+     <td>{{ script.session }}</td>
+     <td>{{ script.type }}</td>
+     <td>{{ script.author.last_name }}</td>
+     <td>{{ script.author.first_name }}</td>
+     <td>{{ script.date_submitted }}</td>
+     <td>{% if script.date_marked %}{{ script.date_marked }}{% endif %}</td>
+     <td>{% if script.corrector %}{{ script.corrector }}{% endif %}</td>
+     <td>{% if script.score %}{{ script.score|floatformat }}{% endif %}</td>
     </tr>
     {% endfor %}
     </tbody>
index f6b7cbd8c1f9b2cee5271387688c3291a833795f..6be69a8b6eaa07fb5cf0d50f355bb9c3cec3f24f 100644 (file)
@@ -1,3 +1,4 @@
+
 from optparse import make_option
 from django.conf import settings
 from django.core.management.base import BaseCommand, CommandError
@@ -8,12 +9,28 @@ from telemeta.util.unaccent import unaccent
 from teleforma.exam.models import *
 import logging
 import codecs
+import time
+
+
+class Logger:
+    """A logging object"""
+
+    def __init__(self, file):
+        self.logger = logging.getLogger('teleforma')
+        self.hdlr = logging.FileHandler(file)
+        self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+        self.hdlr.setFormatter(self.formatter)
+        self.logger.addHandler(self.hdlr)
+        self.logger.setLevel(logging.INFO)
 
 
 class Command(BaseCommand):
     help = "submit all script to Box View"
 
     def handle(self, *args, **options):
+       logger = Logger(args[0])
        for script in Script.objects.filter(status=2):
-               print unicode(script)
+               logger.logger.info(script.title)
                script.submit()
+               logger.logger.info('OK')
+               time.sleep(10)
index 8ad5695cebd16d41e1a93b61f0bbb4b041b2fc93..e3483c3a2873054e80feae7e4411de4e581f6fae 100644 (file)
@@ -1713,3 +1713,9 @@ input,textarea{
 .errorlist li {
     font-size: 1.2em;
 }
+
+.script-list tr {
+    cursor: pointer;
+    font-weight: bold;
+}
+
index e51ce2ded4dac80b2a001fc52c9085a12fb2f553..a46c0661fcc80a662a9e267ac0a91392869227ff 100644 (file)
 {% autopaginate pm_messages %}{% paginate %}
 </div>
 
+{% if messages %}
+    <div class="messages">
+        {% for message in messages %}
+          <div{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</div>
+        {% endfor %}
+    </div>
+{% endif %}
+
 <form id="_messageForm" action="{% block pm_form_action %}{% endblock %}" method="post">{% csrf_token %}
 <table id="pm_messages" class="listing" >
  <thead>
index 108fdfe6e3631ca780ca77e581c1c2483bdfba7f..4a718e77876dfc98f99adb350ded5ecab726b059 100644 (file)
@@ -1,6 +1,6 @@
 {% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %}{% autoescape off %}{% trans "Hello" %} {{ object.recipient.first_name }} {{ object.recipient.last_name }},
 
-Suite à votre inscription à la formation semestrielle 2014 du Pré-Barreau, nous vous invitons à initialiser votre compte sur notre plateforme e-learning interactive et multi-média. Pour cela, merci de cliquer sur le lien suivant puis d'indiquez votre adresse e-mail :
+Suite à votre inscription à la formation estivale 2014 du Pré-Barreau, nous vous invitons à initialiser votre compte sur notre plateforme e-learning interactive et multi-média. Pour cela, merci de cliquer sur le lien suivant puis d'indiquez votre adresse e-mail :
 
 http://{{ site.domain }}/accounts/password_reset/