#content {
/*margin-top: 1em;*/
position: relative;
- margin-left: 10%;
+ margin-left: 5%;
margin-right: 2em;
margin-bottom: 0em;
}
background-repeat:repeat;
font: normal verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
border-top: 1px solid #333;
- padding-left:10%;
+ padding-left: 5.5%;
}
#menu a, #menu a:visited{
font-weight: normal;
}
table.listing tbody td {
- font-weight: bold;
+ font-weight: normal;
}
table.listing tbody td.tmp {
width: 100%;
.desk_center {
float: left;
- width:58%;
+ width:55%;
+ padding: 0em 0em 0em 1em;
+ }
+
+.desk_large {
+ float: left;
+ width:75%;
padding: 0em 0em 0em 1em;
}
+
.course {
margin: 0em 0em 2em 0em;
background-color: #FFF;
}
.pm_body {
- padding: 0em 0em 0em 1em;
+ padding: 0em 0em 0em 0em;
}
.pm_message {
-moz-border-radius: 8px 0px 8px 8px;
-webkit-border-radius: 8px 0px 8px 8px;
border-radius: 8px 0px 8px 8px;
- padding: 0.8em 0.8em 0.8em 1em;
+
}
#pm_messages {
{% block chat %}
{% if room %}
-<div id="module-set" style="width: 240px">
+<div id="module-set" style="width: 290px">
<div class="module">
<h3><img src="{% url telemeta-images "search_wh2.png" %}" alt="rss" style="vertical-align:middle" />{% trans "Questions" %}</h3>
{% endif %}
{% if user.is_authenticated %}
+
<li><a href="/messages" class="green">{% trans "Messages" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
<li><a href="{% url teleforma-users %}" class="yellow">{% trans "Users" %}</a></li>
- <li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a></li>
+ <li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Search" %}</a></li>
{% if user.is_staff %}
-
<li><a href="#archives#" class="red">{% trans "Archives" %}</a>
<ul>
<li><a href="{% url telemeta-fonds %}">{% trans "Fonds" %}</a></li>
</ul>
</li>
- <li><a href="#admin#" class="violet">{% trans "Admin" %}</a>
- <ul>
- <li><a href="{% url telemeta-admin-general %}">{% trans "General" %}</a></li>
- </ul>
- </li>
+ {% else %}
+ <li><a href="{% url telemeta-flatpage "help" %}" class="red">{% trans "Help" %}</a></li>
{% endif %}
{% if user.is_authenticated %}
- <li><a href="#profil#" class="origin"><img src="{% url telemeta-images "user_tr.png" %}" alt="user" style="vertical-align:middle" width="13px" />{% if user.first_name and user.last_name %}
+ <li><a href="#profil#" class="violet"><img src="{% url telemeta-images "user_tr.png" %}" alt="user" style="vertical-align:middle" width="13px" />{% if user.first_name and user.last_name %}
{{ user.first_name }} {{ user.last_name }}
{% else %}
{{ user.username }}
</ul>
</li>
+ {% if user.is_staff %}
+ <li><a href="#admin#" class="violet">{% trans "Admin" %}</a>
+ <ul>
+ <li><a href="{% url telemeta-admin-general %}">{% trans "General" %}</a></li>
+ </ul>
+ </li>
+ {% endif %}
{% endif %}
-
{% endif %}
</ul>
{% block head_title %}{% trans "Users" %} - {{ block.super }}{% endblock %}
+
{% block title %}
- <img src="{% url telemeta-images "user_red.png" %}" alt="user" style="vertical-align:middle" /> {% trans "Users" %}
+
{% endblock %}
{% block content %}
+<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 "Trainings" %}</h3>
+<div style="background: white;">
+<ul>
+{% block courses %}
+{% for training in trainings %}
+<li><a href="{% url teleforma-training-users training.id %}">{{ training.code }}</a></li>
+{% endfor %}
+{% endblock courses %}
+</ul>
+</div>
+</div>
+</div>
+
+<div class="desk_large">
+<div class="course_title">{% trans "Users" %}</div>
{% if users %}
{% include "telemeta/inc/user_list.html" %}
{% else %}
<p class="help">{% trans "No users" %}</p>
{% endif %}
+</div>
{% endblock %}
# Postman
url(r'^messages/', include('postman.urls')),
+ # Users
url(r'^all_users/$', UsersView.as_view(), name="teleforma-users"),
+ url(r'^all_users/by_trainings/(\w+)$', UsersTrainingView.as_view(), name="teleforma-training-users"),
# CSS+Images (FIXME: for developement only)
url(r'^teleforma/css/(?P<path>.*)$', 'django.views.static.serve',
paginate_by = 12
def get_queryset(self):
- return User.objects.all().order_by('last_name')
+ return User.objects.all().select_related(depth=1).order_by('last_name')
+
+ def get_context_data(self, **kwargs):
+ context = super(UsersView, self).get_context_data(**kwargs)
+ context['trainings'] = Training.objects.all()
+ return context
+
+class UsersTrainingView(UsersView):
+
+ def get_queryset(self):
+ users = User.objects.all().select_related(depth=2)
+ trainings = Training.objects.filter(id=self.args[0])
+ return User.objects.filter(student__training__in=trainings)
+