]> git.parisson.com Git - teleforma.git/commitdiff
add QuotasView
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 30 Jul 2014 15:19:33 +0000 (17:19 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 30 Jul 2014 15:19:33 +0000 (17:19 +0200)
teleforma/exam/templates/exam/quotas.html [new file with mode: 0644]
teleforma/exam/urls.py
teleforma/exam/views.py

diff --git a/teleforma/exam/templates/exam/quotas.html b/teleforma/exam/templates/exam/quotas.html
new file mode 100644 (file)
index 0000000..550e3af
--- /dev/null
@@ -0,0 +1,44 @@
+{% extends "exam/scripts.html" %}
+{% load telemeta_utils %}
+{% load teleforma_tags %}
+{% load i18n %}
+
+{% block extra_javascript %}
+{% endblock extra_javascript %}
+
+{% block answers %}
+
+<div class="course_title">
+{% trans "Quotas and levels" %}
+</div>
+<br />
+
+<div id="users">
+  <table class="listing" width="100%">
+   <thead>
+   <tr>
+    <th>{% trans "Corrector"%}</th>
+    <th>{% trans "Course"%}</th>
+    <th>{% trans "date start"%}</th>
+    <th>{% trans "date end"%}</th>
+    <th>{% trans "Value"%}</th>
+    <th>{% trans "Level"%} (%)</th>
+    </tr>
+    </thead>
+    <tbody id="spacing" class="script-list">
+    {% for quota in object_list %}
+    <tr>
+     <td><a href="{% url teleforma-profile-detail quota.corrector.username %}">{{ quota.corrector.username }}</a></td>
+     <td>{{ quota.course.title }}</td>
+     <td>{{ quota.date_start }}</td>
+     <td>{{ quota.date_end }}</td>
+     <td>{{ quota.value }}</td>
+     <td>{{ quota.level }}</td>
+    </tr>
+    {% endfor %}
+    </tbody>
+  </table>
+</div>
+
+
+{% endblock answers %}
index 836677785ef7c07ba52825b9d7351d8ad020e9ba..6aebcf8e4d7517659d71d50a4662d008d802ffc5 100644 (file)
@@ -56,4 +56,6 @@ urlpatterns = patterns('',
     url(r'^desk/periods/(?P<period_id>.*)/exam/scripts_treated/$', ScriptsTreatedView.as_view(), name="teleforma-exam-scripts-treated"),
     url(r'^desk/periods/(?P<period_id>.*)/exam/scripts_rejected/$', ScriptsRejectedView.as_view(), name="teleforma-exam-scripts-rejected"),
 
+    url(r'^desk/periods/(?P<period_id>.*)/exam/quotas/$', QuotasView.as_view(), name="teleforma-exam-quotas"),
+
 )
index 4296e13bf0c930e9eb8dc71ed62d3e5c6338df9c..687c1c430104b0e57ef5656d5088cb4e5e4dc06c 100644 (file)
@@ -150,3 +150,17 @@ class ScriptUpdateView(UpdateView):
     model = Script
     fields = ['score']
 
+
+class QuotasView(ListView):
+
+    model = Quota
+    template_name='exam/quotas.html'
+
+    def get_context_data(self, **kwargs):
+        context = super(QuotasView, self).get_context_data(**kwargs)
+        context['period'] = Period.objects.get(id=self.kwargs['period_id'])
+        return context
+
+    @method_decorator(login_required)
+    def dispatch(self, *args, **kwargs):
+        return super(QuotasView, self).dispatch(*args, **kwargs)
\ No newline at end of file