NDOJ/templates/organization/list.html

61 lines
2.2 KiB
HTML
Raw Permalink Normal View History

2020-01-21 06:35:58 +00:00
{% extends "base.html" %}
{% block js_media %}
<script src="{{ static('libs/tablesorter.js') }}" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#organization-table").tablesorter();
2020-12-28 05:45:58 +00:00
{% if request.user.is_authenticated %}
$('#show-my-org-checkbox').click(function() {
let checked = $('#show-my-org-checkbox').is(':checked');
if (checked) {
$('.other-organization').hide();
$('.my-organization').last().find('td').css({'border-bottom-width':
'1px', 'border-color': '#ccc'});
}
else {
$('.other-organization').show();
$('.my-organization').last().find('td').css({'border-bottom-width':
'', 'border-color': ''});
}
})
$('#show-my-org-checkbox').click()
{% endif %}
2020-01-21 06:35:58 +00:00
});
</script>
2020-12-28 05:45:58 +00:00
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block title_ruler %}{% endblock %}
{% block title_row %}
{% set tab = 'organizations' %}
{% set title = _('Organizations') %}
{% include "user/user-list-tabs.html" %}
{% endblock %}
{% block body %}
2020-12-28 05:45:58 +00:00
{% if request.user.is_authenticated %}
<div style="margin-bottom: 0.5em">
<input id="show-my-org-checkbox" type="checkbox" style="vertical-align: bottom;">
<label for="show-my-org-checkbox" style="vertical-align: bottom; margin-right: 1em;">{{ _('Show my organizations only') }}</label>
</div>
{% endif %}
2020-01-21 06:35:58 +00:00
<table id="organization-table" class="table">
<thead>
<tr>
<th style="width:85%">{{ _('Name') }}</th>
<th>{{ _('Members') }}</th>
</tr>
</thead>
<tbody>
{% for org in organizations %}
2020-12-28 05:45:58 +00:00
<tr class="{{ 'my-organization' if org in my_organizations else 'other-organization'}}">
2020-01-21 06:35:58 +00:00
<td><a href="{{ org.get_absolute_url() }}">{{ org.name }}</a></td>
<td><a href="{{ org.get_users_url() }}">{{ org.member_count }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}