2024-06-19 03:11:36 +00:00
|
|
|
{% extends "three-column-content.html" %}
|
|
|
|
|
|
|
|
{% block three_col_js %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
$('#mine-tab').attr('href', changeTabParameter('mine'));
|
|
|
|
$('#public-tab').attr('href', changeTabParameter('public'));
|
|
|
|
$('#private-tab').attr('href', changeTabParameter('private'));
|
|
|
|
|
|
|
|
var $form = $('form#filter-form');
|
|
|
|
|
|
|
|
$('#go').click(function() {
|
|
|
|
submitFormWithParams($form, "GET");
|
|
|
|
});
|
|
|
|
|
|
|
|
$form.on('keypress', function(e) {
|
|
|
|
if (e.key === 'Enter') {
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
});
|
2022-06-18 07:32:37 +00:00
|
|
|
|
2024-06-19 03:11:36 +00:00
|
|
|
$('#search-organization').keypress(function (e) {
|
|
|
|
if (e.keyCode === 13) {
|
|
|
|
$('#go').click();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#order').select2();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% block contest_list_js %}{% endblock %}
|
|
|
|
{% endblock %}
|
2020-01-21 06:35:58 +00:00
|
|
|
|
2022-06-18 07:32:37 +00:00
|
|
|
{% block left_sidebar %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<div class="left-sidebar">
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
{{ make_tab_item('mine', 'fa fa-user', request.path + '?tab=mine', _('Mine')) }}
|
|
|
|
{% endif %}
|
|
|
|
{{ make_tab_item('public', 'fa fa-globe', request.path + '?tab=public', _('Public')) }}
|
|
|
|
{{ make_tab_item('private', 'fa fa-lock', request.path + '?tab=private', _('Private')) }}
|
|
|
|
{% if request.user.is_superuser %}
|
|
|
|
{{ make_tab_item('import', 'fa fa-table', url('import_users'), _('Import'), force_new_page=True) }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block right_sidebar %}
|
|
|
|
<div class="right-sidebar">
|
|
|
|
{% include "organization/search-form.html" %}
|
|
|
|
</div>
|
2020-01-21 06:35:58 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
2024-06-19 03:11:36 +00:00
|
|
|
{% macro org_list(queryset, tab) %}
|
2023-01-27 23:11:10 +00:00
|
|
|
{% if queryset %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<div class="organization-container">
|
2023-01-27 23:11:10 +00:00
|
|
|
{% for org in queryset %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<div class="organization-card" style="cursor: pointer;" onclick="location.href='{{ org.get_absolute_url() }}';">
|
2024-04-12 06:51:57 +00:00
|
|
|
{% if org.logo_override_image %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<img class="org-logo" loading="lazy" src="{{ org.logo_override_image }}">
|
2024-04-12 06:51:57 +00:00
|
|
|
{% else %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<img class="org-logo" loading="lazy" src="{{ static('icons/icon.svg') }}" onerror="this.onerror=null;this.src='{{ static('icons/logo.svg') }}';">
|
2024-04-12 06:51:57 +00:00
|
|
|
{% endif %}
|
2024-06-19 03:11:36 +00:00
|
|
|
<div class="org-details">
|
|
|
|
<span style="font-weight: bold;">{{ org.name }}</span>
|
|
|
|
<span style="margin-bottom: 0"><i>{{ org.member_count }} {{ _('members') }}</i></span>
|
|
|
|
</div>
|
|
|
|
{% if tab == 'mine' %}
|
|
|
|
<div class="background-royalblue button small">{{ _('View') }}</div>
|
|
|
|
{% elif tab == 'public' %}
|
|
|
|
<form method="post" action="{{ url('join_organization', org.id, org.slug) }}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="submit" style="width: 100%" class="background-royalblue button small" value="{{ _('Join') }}">
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ url('request_organization', org.id, org.slug) }}" style="font-size: 15px;" class="background-royalblue button small">{{ _('Request membership') }}</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2023-01-27 23:11:10 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2024-06-19 03:11:36 +00:00
|
|
|
{% if page_obj and page_obj.num_pages > 1 %}
|
|
|
|
{% include "list-pages.html" %}
|
|
|
|
{% endif %}
|
2023-01-27 23:11:10 +00:00
|
|
|
{% endif %}
|
2022-06-18 07:32:37 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
2022-09-15 07:05:02 +00:00
|
|
|
{% block middle_content %}
|
2024-06-19 03:11:36 +00:00
|
|
|
{% if current_tab == 'mine' %}
|
|
|
|
{% if organizations %}
|
|
|
|
{{ org_list(organizations, 'mine') }}
|
|
|
|
{% else %}
|
|
|
|
<i> {{ _('You have not joined any organization yet.') }} </i>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if current_tab == 'public' %}
|
|
|
|
{% if organizations %}
|
|
|
|
{{ org_list(organizations, 'public') }}
|
|
|
|
{% else %}
|
|
|
|
<i> {{ _('There is no public organization.') }} </i>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if current_tab == 'private' %}
|
|
|
|
{% if organizations %}
|
|
|
|
{{ org_list(organizations, 'private') }}
|
|
|
|
{% else %}
|
|
|
|
<i> {{ _('There is no private organization.') }} </i>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|