New organization view
This commit is contained in:
parent
e51c76c68c
commit
f174c921fb
5 changed files with 106 additions and 41 deletions
|
@ -1,17 +1,38 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title_row %}{% endblock %}
|
||||
{% block title_ruler %}{% endblock %}
|
||||
|
||||
<!-- {% block media %}
|
||||
{% block media %}
|
||||
<style>
|
||||
.post {
|
||||
margin: 0 1.4em;
|
||||
#control-button {
|
||||
margin-left: 0.8em;
|
||||
background: lightgray;
|
||||
color: black !important;
|
||||
border: 0;
|
||||
}
|
||||
.post:first-child {
|
||||
margin-top: 0.6em;
|
||||
#control-button:hover {
|
||||
background: gray;
|
||||
}
|
||||
{% if request.user.is_authenticated and is_member %}
|
||||
#control-panel {
|
||||
display: none;
|
||||
}
|
||||
{% endif %}
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
{% endblock %} -->
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
<script type="text/javascript">
|
||||
|
@ -42,11 +63,40 @@
|
|||
$('.blog-content').hide();
|
||||
$('.blog-sidebar').show();
|
||||
});
|
||||
$('#control-button').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#control-panel').toggle("fast");
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block title_row %}
|
||||
<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 %}
|
||||
<input type="submit" class="unselectable button" value="{{ _('Join organization') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
<a href="{{ url('request_organization', organization.id, organization.slug) }}"
|
||||
class="unselectable button">{{ _('Request membership') }}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<button id="control-button"><i class="fa fa-ellipsis-h"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block title_ruler %} {% endblock %}
|
||||
{% block body %}
|
||||
{% block before_posts %}{% endblock %}
|
||||
<div id="mobile" class="tabs">
|
||||
|
@ -59,7 +109,7 @@
|
|||
</div>
|
||||
<div id="blog-container">
|
||||
<div class="blog-content sidebox">
|
||||
<h3>{{ _('About') }} {{ organization.name }} <i class="fa fa-info-circle"></i></h3>
|
||||
<h3>{{ _('About') }}<i class="fa fa-info-circle"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<div style="margin: 1.4em;">
|
||||
{% cache 3600 'organization_html' organization.id MATH_ENGINE %}
|
||||
|
@ -83,45 +133,49 @@
|
|||
</div>
|
||||
|
||||
<div class="blog-sidebar">
|
||||
<div class="blog-sidebox sidebox">
|
||||
<div id="control-panel" class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Controls') }} <i class="fa fa-cog"></i></h3>
|
||||
<div class="sidebox-content" style="padding: 1em;">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if is_member %}
|
||||
<form method="post" action="{{ url('leave_organization', organization.id, organization.slug) }}">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="unselectable button full leave-organization" value="{{ _('Leave organization') }}">
|
||||
</form>
|
||||
{% elif organization.is_open or can_edit %}
|
||||
<form method="post" action="{{ url('join_organization', organization.id, organization.slug) }}">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="unselectable button full" value="{{ _('Join organization') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
<a href="{{ url('request_organization', organization.id, organization.slug) }}"
|
||||
class="unselectable button full">{{ _('Request membership') }}</a>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% endif %}
|
||||
<ul id="control-list" class="sidebox-content" style="padding: 1em;">
|
||||
{% if can_edit %}
|
||||
<div>
|
||||
<a href="{{ url('edit_organization', organization.id, organization.slug) }}">{{ _('Edit organization') }}</a>
|
||||
</div>
|
||||
{% if not organization.is_open %}
|
||||
<li>
|
||||
<div>
|
||||
<a href="{{ url('organization_requests_pending', organization.id, organization.slug) }}">{{ _('View requests') }}</a>
|
||||
<a href="{{ url('edit_organization', organization.id, organization.slug) }}">{{ _('Edit organization') }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if perms.judge.change_organization %}
|
||||
<li>
|
||||
<div>
|
||||
<a href="{{ url('admin:judge_organization_change', organization.id) }}">{{ _('Admin organization') }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
<div>
|
||||
<a href="{{ organization.get_users_url() }}">{{ _('View members') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<li>
|
||||
<div>
|
||||
<a href="{{ organization.get_users_url() }}">{{ _('View members') }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{% if is_member and not can_edit %}
|
||||
<li>
|
||||
<form method="post" action="{{ url('leave_organization', organization.id, organization.slug) }}">
|
||||
{% csrf_token %}
|
||||
<a type="submit" href="#" class="leave-organization">{{ _('Leave organization') }}</a>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if (is_member or can_edit) %}
|
||||
{% if new_contests %}
|
||||
|
@ -133,7 +187,10 @@
|
|||
{% for contest in new_contests %}
|
||||
<li><a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
<hr>
|
||||
<center><a target="_blank" href="{{url('contest_list')+'?orgs='+str(organization.id)}}">{{_('View all')}} <i class="fa fa-chevron-right"></i></a></center>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -147,6 +204,8 @@
|
|||
<li><a href="{{ url('problem_detail', problem.code) }}">{{ problem.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<hr>
|
||||
<center><a target="_blank" href="{{url('problem_list')+'?orgs='+str(organization.id)}}">{{_('View all')}} <i class="fa fa-chevron-right"></i></a></center>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue