Merge branch 'master' into stock

This commit is contained in:
Skia
2017-04-24 18:07:25 +02:00
178 changed files with 8217 additions and 951 deletions

View File

@ -54,8 +54,8 @@
<ul id="notif">
{% for n in user.notifications.filter(viewed=False).order_by('-id') %}
<li><a href="{{ url("core:notification", notif_id=n.id) }}">
<span style="font-size: small; ">{{ n.date|date(DATE_FORMAT) }} {{
n.date|time(DATETIME_FORMAT) }}</span><br>
<span style="font-size: small; ">{{ n.date|localtime|date(DATE_FORMAT) }} {{
n.date|localtime|time(DATETIME_FORMAT) }}</span><br>
{{ n }}</a></li>
{% endfor %}
<li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a>
@ -91,7 +91,7 @@
<a href="https://ae.utbm.fr/matmatronch/">{% trans %}Matmatronch{% endtrans %}</a>
<a href="{{ url('core:page', page_name="Index") }}">{% trans %}Wiki{% endtrans %}</a>
<a href="{{ url('sas:main') }}">{% trans %}SAS{% endtrans %}</a>
<a href="https://ae.utbm.fr/forum2/">{% trans %}Forum{% endtrans %}</a>
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
<a href="{{ url('core:page', "services") }}">{% trans %}Services{% endtrans %}</a>
<a href="{{ url('core:file_list') }}">{% trans %}Files{% endtrans %}</a>
<a href="https://ae.utbm.fr/article.php?name=liens">{% trans %}Sponsors{% endtrans %}</a>
@ -100,6 +100,12 @@
{% endif %}
{% endblock %}
<ul id="quick_notif">
{% for n in quick_notifs %}
<li>{{ n }}</li>
{% endfor %}
</ul>
<div id="content">
{% if list_of_tabs %}
<div class="tool-bar">

View File

@ -14,8 +14,8 @@
<li style="background: lightgrey;">
{% endif %}
<a href="{{ url("core:notification", notif_id=n.id) }}">
<span style="font-size: small; ">{{ n.date|date(DATE_FORMAT) }} {{
n.date|time(DATETIME_FORMAT) }}</span><br>
<span style="font-size: small; ">{{ n.date|localtime|date(DATE_FORMAT) }} {{
n.date|localtime|time(DATETIME_FORMAT) }}</span><br>
{{ n }}</a>
</li>
{% endfor %}

View File

@ -9,7 +9,7 @@
<h3>{% trans %}Page list{% endtrans %}</h3>
<ul>
{% for p in page_list %}
<li><a href="{{ url('core:page', page_name=p.get_full_name()) }}">{{ p.get_display_name() }}</a></li>
<li><a href="{{ p.get_absolute_url() }}">{{ p.get_display_name() }}</a></li>
{% endfor %}
</ul>
{% else %}

View File

@ -4,10 +4,12 @@
{{ super() }}
<script>
function make_preview() {
text = $("#id_content").val();
console.log("Rendering text: " + text);
$.ajax({
url: "{{ url('api:api_markdown') }}",
method: "GET",
data: { text: $("#id_content").val() }
method: "POST",
data: { text: text, csrfmiddlewaretoken: "{{ csrf_token }}"}
}).done(function (msg) {
$("#preview").html(msg);
});
@ -23,6 +25,7 @@ function make_preview() {
<p><input type="button" value="{% trans %}Preview{% endtrans %}" onclick="javascript:make_preview();" /></p>
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
<a href="{{ url('core:page_delete', page_id=page.id)}}">{% trans %}Delete{% endtrans %}</a>
<div id="preview">
</div>
{% endblock %}

View File

@ -54,7 +54,7 @@
{% if user.memberships.filter(end_date=None).exists() or user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user == profile %}
{# if the user is member of a club, he can view the subscription state #}
<p>
{% if profile.is_subscribed() %}
{% if profile.is_subscribed %}
{% if user == profile or user.is_root or user.is_board_member %}
{{ user_subscription(profile) }}
{% endif %}

View File

@ -5,27 +5,19 @@
{% endblock %}
{% block content %}
{% set album = None %}
{% set new_album = True %}
{% for r in profile.pictures.exclude(picture=None).order_by('-picture__parent__id', 'id') -%}
{%- if album != r.picture.parent %}
{%- if album %}
</div>
{% endif -%}
{% set new_album = True %}
{% set album = r.picture.parent %}
{% set picture_qs = profile.pictures.exclude(picture=None).order_by('-picture__parent__id', 'id').select_related('picture__parent__parent__name') %}
{% for a in picture_qs.distinct('picture__parent') %}
<div style="padding: 10px">
<h4>{{ album.name }}</h4>
<h4>{{ a.picture.parent.name }}</h4>
<hr>
{% else %}
{% set new_album = False %}
{%- endif %}
{% for r in picture_qs.filter(picture__parent=a.picture.parent) -%}
<div class="picture">
<a href="{{ url("sas:picture", picture_id=r.picture.id) }}#pict">
<img src="{{ r.picture.get_download_thumb_url() }}" alt="{{ r.picture.get_display_name() }}" style="max-width: 100%"/>
</a>
</div>
{%- endfor %}
{% endfor %}
</div>
{% endfor %}
{% endblock %}

View File

@ -75,6 +75,10 @@
<h4>{% trans %}Communication{% endtrans %}</h4>
<ul>
{% if user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) or user.is_root %}
<li><a href="{{ url('com:weekmail_article') }}">{% trans %}Create weekmail article{% endtrans %}</a></li>
<li><a href="{{ url('com:weekmail') }}">{% trans %}Weekmail{% endtrans %}</a></li>
<li><a href="{{ url('com:weekmail_destinations') }}">{% trans %}Weekmail destinations{% endtrans %}</a></li>
<li><a href="{{ url('com:news_new') }}">{% trans %}Create news{% endtrans %}</a></li>
<li><a href="{{ url('com:news_admin_list') }}">{% trans %}Moderate news{% endtrans %}</a></li>
<li><a href="{{ url('com:index_edit') }}">{% trans %}Edit index page{% endtrans %}</a></li>
<li><a href="{{ url('com:alert_edit') }}">{% trans %}Edit alert message{% endtrans %}</a></li>
@ -98,7 +102,7 @@
<h4>{% trans %}Elections{% endtrans %}</h4>
<ul>
<li><a href="{{ url('election:list') }}">{% trans %}See available elections{% endtrans %}</a></li>
{%- if user.is_subscribed() -%}
{%- if user.is_subscribed -%}
<li><a href="{{ url('election:create') }}">{% trans %}Create a new election{% endtrans %}</a></li>
{%- endif -%}
</ul>