]> git.parisson.com Git - teleforma.git/commitdiff
fix user message, add profile links, fix double query user views
authoryomguy <yomguy@parisson.com>
Fri, 27 Apr 2012 23:01:27 +0000 (01:01 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 27 Apr 2012 23:01:27 +0000 (01:01 +0200)
teleforma/templates/postman/base_write.html
teleforma/templates/telemeta/profile_detail.html
teleforma/views.py

index 80982c15f12e056284d26d82802b015f1d6d7340..35bc0a35a782dc75b5c986c2bc4fbcaa387b0c95 100644 (file)
@@ -20,5 +20,5 @@
 <a href="#" class="component_icon button icon_next" onclick="f=document.getElementById('_messageForm'); f.submit(); return false;">{% trans "Send" %}</a>
 </form>
 </div>
-<script type="text/javascript">document.getElementById("id_body").focus();</script>
+<script type="text/javascript">document.getElementById("id_subject").focus();</script>
 {% endblock %}
\ No newline at end of file
index 5479a6c4da0a2f1b45b894afc2f9882ae5c09b14..0ef97c888fc4f9320bfdf9cddbf50e732e199cad 100644 (file)
@@ -31,7 +31,7 @@
 
   {% if user.is_authenticated %}
    <div class="module_action">
-    <a href="{% url postman_write user.username %}" class="component_icon button" id="action_red">{% trans "Send a message" %}</a>
+    <a href="{% url postman_write usr.username %}" class="component_icon button" id="action_red">{% trans "Send a message" %}</a>
    </div>
   {%  endif %}
  </div>
@@ -58,8 +58,8 @@
       <dt>{% trans "Username" %}</dt><dd>{{ usr.username }}</dd>
 
       {% if usr.student.get %}
-        <dt>{% trans "IEJ" %}</dt><dd>{{ usr.student.get.iej }}</dd>
-        <dt>{% trans "Training" %}</dt><dd>{{ usr.student.get.training }}</dd>
+        <dt>{% trans "IEJ" %}</dt><dd><a href="{% url teleforma-iej-users usr.student.get.iej.id %}">{{ usr.student.get.iej }}</a></dd>
+        <dt>{% trans "Training" %}</dt><dd><a href="{% url teleforma-training-users usr.student.get.training.id %}">{{ usr.student.get.training }}</a></dd>
         <dt>{% trans "Procedure"%}</dt><dd>{{ usr.student.get.procedure.code }}</dd>
         <dt>{% trans "Oral spe"%}</dt><dd>{{ usr.student.get.oral_speciality.code }}</dd>
         <dt>{% trans "Written spe"%}</dt><dd>{{ usr.student.get.written_speciality.code }}</dd>
index ebba53d8c25e5b963cd322bbe3e652f827e45f66..f1e156ad23e25566cb61bd88c7ee33ac599a4623 100755 (executable)
@@ -256,7 +256,7 @@ class UsersTrainingView(UsersView):
     def get_context_data(self, **kwargs):
         context = super(UsersTrainingView, self).get_context_data(**kwargs)
         context['training'] = Training.objects.get(id=self.args[0])
-        context['all_users'] = User.objects.filter(student__training__in=self.training).all()
+        context['all_users'] = self.object_list.all()
         return context
 
     @method_decorator(login_required)
@@ -272,7 +272,7 @@ class UsersIejView(UsersView):
     def get_context_data(self, **kwargs):
         context = super(UsersIejView, self).get_context_data(**kwargs)
         context['iej'] = IEJ.objects.get(id=self.args[0])
-        context['all_users'] = User.objects.filter(student__iej__in=self.iej).all()
+        context['all_users'] = self.object_list.all()
         return context
 
     @method_decorator(login_required)
@@ -288,7 +288,7 @@ class UsersCourseView(UsersView):
     def get_context_data(self, **kwargs):
         context = super(UsersCourseView, self).get_context_data(**kwargs)
         context['course'] = Course.objects.get(id=self.args[0])
-        context['all_users'] = User.objects.filter(student__training__courses__in=self.course).all()
+        context['all_users'] = self.object_list.all()
         return context
 
     @method_decorator(login_required)