2022-05-28 04:28:22 +00:00
|
|
|
{% extends "three-column-content.html" %}
|
|
|
|
{% block three_col_media %}
|
2020-12-28 05:45:58 +00:00
|
|
|
<style>
|
2021-10-10 22:37:15 +00:00
|
|
|
.leave-organization, .leave-organization:hover {
|
|
|
|
color: red;
|
|
|
|
}
|
|
|
|
#control-list li {
|
|
|
|
border-bottom: 1px solid black;
|
|
|
|
}
|
|
|
|
#pending-count-box {
|
|
|
|
float: right;
|
|
|
|
text-align: center;
|
|
|
|
background: red;
|
|
|
|
color: white;
|
|
|
|
border-radius: 3px;
|
|
|
|
padding-left: 0.3em;
|
|
|
|
padding-right: 0.3em;
|
2020-12-28 05:45:58 +00:00
|
|
|
}
|
|
|
|
</style>
|
2021-10-10 22:37:15 +00:00
|
|
|
{% endblock %}
|
2020-12-28 05:45:58 +00:00
|
|
|
|
2022-05-28 04:28:22 +00:00
|
|
|
{% block three_col_js %}
|
2020-01-21 06:35:58 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
2022-05-28 04:28:22 +00:00
|
|
|
$('.time-remaining').each(function () {
|
|
|
|
count_down($(this));
|
|
|
|
});
|
2020-01-21 06:35:58 +00:00
|
|
|
$('.leave-organization').click(function () {
|
2021-12-27 08:43:03 +00:00
|
|
|
if (confirm('{{ _('Are you sure you want to leave this organization?') }}\n' +
|
2020-01-21 06:35:58 +00:00
|
|
|
{% if organization.is_open %}
|
|
|
|
'{{ _('You will have to rejoin to show up on the organization leaderboard.') }}'
|
|
|
|
{% else %}
|
|
|
|
'{{ _('You will have to request membership in order to join again.') }}'
|
|
|
|
{% endif %}
|
2021-12-27 08:43:03 +00:00
|
|
|
)) {
|
|
|
|
$(this).parent().submit();
|
|
|
|
}
|
2020-01-21 06:35:58 +00:00
|
|
|
});
|
2020-12-28 05:45:58 +00:00
|
|
|
|
|
|
|
$(document).ready(function () {
|
2021-11-21 04:23:03 +00:00
|
|
|
$('.control-button').click(function(e) {
|
2021-10-10 22:37:15 +00:00
|
|
|
e.preventDefault();
|
|
|
|
$('#control-panel').toggle("fast");
|
|
|
|
})
|
2020-12-28 05:45:58 +00:00
|
|
|
});
|
2020-01-21 06:35:58 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|
|
|
|
|
2022-05-28 04:28:22 +00:00
|
|
|
{% block left_sidebar %}
|
|
|
|
{% include "organization/org-left-sidebar.html" %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block title_ruler %}{% endblock %}
|
|
|
|
{% block middle_content %}
|
|
|
|
{% block before_posts %}{% endblock %}
|
2021-10-10 22:37:15 +00:00
|
|
|
<div class="page-title">
|
|
|
|
<div class="tabs">
|
|
|
|
<h2>{{title}}</h2>
|
|
|
|
<span class="spacer"></span>
|
|
|
|
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
{% if is_member or can_edit %}
|
|
|
|
|
|
|
|
{% elif organization.is_open or can_edit %}
|
|
|
|
<form method="post" action="{{ url('join_organization', organization.id, organization.slug) }}">
|
|
|
|
{% csrf_token %}
|
2021-12-27 08:43:03 +00:00
|
|
|
<input type="submit" class="unselectable button" value="{{ _('Join organization') }}" style="margin-right: 1em">
|
2021-10-10 22:37:15 +00:00
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ url('request_organization', organization.id, organization.slug) }}"
|
|
|
|
class="unselectable button">{{ _('Request membership') }}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-05-28 04:28:22 +00:00
|
|
|
{% if is_member or can_edit %}
|
|
|
|
{% for post in posts %}
|
|
|
|
{% include "blog/content.html" %}
|
|
|
|
{% if posts.paginator.num_pages > 1 %}
|
|
|
|
<div style="margin-bottom:10px;margin-top:10px">{% include "list-pages.html" %}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<div class="blog-sidebox sidebox">
|
2021-10-10 22:37:15 +00:00
|
|
|
<h3>{{ _('About') }}<i class="fa fa-info-circle"></i></h3>
|
2020-12-28 05:45:58 +00:00
|
|
|
<div class="sidebox-content">
|
2022-05-28 04:28:22 +00:00
|
|
|
<div style="margin: 0.3em;">
|
2020-12-28 05:45:58 +00:00
|
|
|
{% cache 3600 'organization_html' organization.id MATH_ENGINE %}
|
|
|
|
{{ organization.about|markdown('organization-about', MATH_ENGINE)|reference|str|safe }}
|
|
|
|
{% endcache %}
|
|
|
|
</div>
|
2020-01-21 06:35:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-05-28 04:28:22 +00:00
|
|
|
{% endif %}
|
|
|
|
{% block after_posts %}{% endblock %}
|
|
|
|
{% endblock %}
|
2020-01-21 06:35:58 +00:00
|
|
|
|
2022-05-28 04:28:22 +00:00
|
|
|
{% block right_sidebar %}
|
|
|
|
<div class="right-sidebar">
|
|
|
|
{% if (is_member or can_edit) %}
|
|
|
|
{% include 'contests-countdown.html' %}
|
|
|
|
{% endif %}
|
|
|
|
{% if is_member or can_edit %}
|
|
|
|
<div class="blog-sidebox sidebox">
|
|
|
|
<h3>{{ _('About') }}<i class="fa fa-info-circle"></i></h3>
|
|
|
|
<div class="sidebox-content">
|
|
|
|
<div style="margin: 0.3em;">
|
|
|
|
{% cache 3600 'organization_html' organization.id MATH_ENGINE %}
|
|
|
|
{{ organization.about|markdown('organization-about', MATH_ENGINE)|reference|str|safe }}
|
|
|
|
{% endcache %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if can_edit %}
|
2021-10-10 22:37:15 +00:00
|
|
|
<div id="control-panel" class="blog-sidebox sidebox">
|
2020-12-28 05:45:58 +00:00
|
|
|
<h3>{{ _('Controls') }} <i class="fa fa-cog"></i></h3>
|
2021-10-10 22:37:15 +00:00
|
|
|
<ul id="control-list" class="sidebox-content" style="padding: 1em;">
|
|
|
|
<li>
|
2020-12-28 05:45:58 +00:00
|
|
|
<div>
|
2022-05-28 04:28:22 +00:00
|
|
|
<a href="{{ url('edit_organization', organization.id, organization.slug) }}">{{ _('Edit organization') }}</a>
|
2020-12-28 05:45:58 +00:00
|
|
|
</div>
|
2021-10-10 22:37:15 +00:00
|
|
|
</li>
|
2022-05-28 04:28:22 +00:00
|
|
|
{% if not organization.is_open %}
|
|
|
|
<li>
|
|
|
|
<div>
|
|
|
|
<a href="{{ url('organization_requests_pending', organization.id, organization.slug) }}">{{ _('View requests') }}</a>
|
|
|
|
{% if pending_count > 0 %}
|
|
|
|
<span id="pending-count-box">
|
|
|
|
{{pending_count}}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-12-28 05:45:58 +00:00
|
|
|
{% endif %}
|
2021-10-10 22:37:15 +00:00
|
|
|
{% if is_member and not can_edit %}
|
|
|
|
<li>
|
|
|
|
<form method="post" action="{{ url('leave_organization', organization.id, organization.slug) }}">
|
|
|
|
{% csrf_token %}
|
2021-12-27 08:43:03 +00:00
|
|
|
<a href="#" class="leave-organization">{{ _('Leave organization') }}</a>
|
2021-10-10 22:37:15 +00:00
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
2020-12-28 05:45:58 +00:00
|
|
|
</div>
|
2022-05-28 04:28:22 +00:00
|
|
|
{% endif %}
|
|
|
|
{% include 'top-users.html' %}
|
2020-01-21 06:35:58 +00:00
|
|
|
</div>
|
2020-12-28 05:45:58 +00:00
|
|
|
{% endblock %}
|