Skip to content

Commit

Permalink
Merge 8be0117 into 426bfcf
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriaaoka committed Jul 5, 2017
2 parents 426bfcf + 8be0117 commit db4921d
Show file tree
Hide file tree
Showing 8 changed files with 525 additions and 8 deletions.
8 changes: 8 additions & 0 deletions wger/core/static/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(document).ready( function () {
/* Make table sortable */
$('#main_member_list').DataTable({
paging: false,
bFilter: true,
bInfo : false
});
});
3 changes: 2 additions & 1 deletion wger/core/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def get_context_data(self, **kwargs):
_('Username'),
_('Name'),
_('Last activity'),
_('Gym')],
_('Gym'),
_('Status')],
'users': context['object_list']['members']}
return context
62 changes: 62 additions & 0 deletions wger/gym/templates/gym/active_gym_users_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% load i18n staticfiles %}

<link rel="stylesheet" type="text/css" href="{% static 'bower_components/datatables/media/css/dataTables.bootstrap.min.css' %}">
<script src="{% static 'bower_components/datatables/media/js/jquery.dataTables.min.js' %}" ></script>
<script src="{% static 'bower_components/datatables/media/js/dataTables.bootstrap.min.js' %}" ></script>
<script>
$(document).ready( function () {
/* Make table sortable */
$('#main_member_list').DataTable({
paging: false,
bFilter: true,
bInfo : false
});
});
</script>

<table class="table table-hover" id="main_member_list">
<thead>
<tr>
{% for key in user_table.keys %}
<th>{{ key }}</th>
{% endfor %}

</tr>
</thead>
<tbody>
{% for current_user in user_table.users %}
{% if current_user.obj.is_active %}
<tr>
<td>
{{current_user.obj.pk}}
</td>
<td>
<a href="{% url 'core:user:overview' current_user.obj.pk %}">{{current_user.obj}}</a>
</td>
<td>
{{current_user.obj.get_full_name}}
</td>
<td data-order="{{current_user.last_log|date:'U'}}">
{{current_user.last_log|default:'-/-'}}
</td>
{% if show_gym %}
<td>
{% if current_user.obj.userprofile.gym_id %}
<a href="{{ current_user.obj.userprofile.gym.get_absolute_url }}">
{{ current_user.obj.userprofile.gym }}
</a>
{% else %}
-/-
{% endif %}
</td>
{% endif %}
<td>
<a href="{{ current_user.obj.userprofile.gym.get_absolute_url }}">
</a>
Active
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
Loading

0 comments on commit db4921d

Please sign in to comment.