mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-01 15:45:17 +00:00
See description
- Made paste button disabled if the clipboard is empty - Rework main page of the SAS, thus commented block to manage albums as there is currently no possibility to delete them from this page
This commit is contained in:
parent
238d41b84c
commit
f8903cbdca
@ -27,6 +27,11 @@
|
|||||||
&:hover {
|
&:hover {
|
||||||
background-color: #d4d4d4;
|
background-color: #d4d4d4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
color: #d4d4d4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +149,8 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
||||||
|
border: 1px solid rgba(0, 0, 0, .3);
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@ -162,7 +169,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, .7);
|
background: rgba(0, 0, 0, .5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,8 +199,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .album > div {
|
> .album > div {
|
||||||
background: rgba(0, 0, 0, .3);
|
background: rgba(0, 0, 0, .5);
|
||||||
background: linear-gradient(0deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, 0) 100%);
|
background: linear-gradient(0deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 100%);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<a href="{{ url('sas:album_edit', album_id=album.id) }}">{% trans %}Edit{% endtrans %}</a>
|
<a href="{{ url('sas:album_edit', album_id=album.id) }}">{% trans %}Edit{% endtrans %}</a>
|
||||||
<input name="delete" type="submit" value="{% trans %}Delete{% endtrans %}">
|
<input name="delete" type="submit" value="{% trans %}Delete{% endtrans %}">
|
||||||
<input name="cut" type="submit" value="{% trans %}Cut{% endtrans %}">
|
<input name="cut" type="submit" value="{% trans %}Cut{% endtrans %}">
|
||||||
<input name="paste" type="submit" value="{% trans %}Paste{% endtrans %}">
|
<input {% if not clipboard %}disabled{% endif %} name="paste" type="submit" value="{% trans %}Paste{% endtrans %}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -112,7 +112,7 @@
|
|||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if edit_mode %}
|
{% if user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
||||||
<form class="add-files" id="upload_form" action="" method="post" enctype="multipart/form-data">
|
<form class="add-files" id="upload_form" action="" method="post" enctype="multipart/form-data">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="inputs">
|
<div class="inputs">
|
||||||
|
@ -1,56 +1,103 @@
|
|||||||
{% extends "core/base.jinja" %}
|
{% extends "core/base.jinja" %}
|
||||||
|
|
||||||
|
{%- block additional_css -%}
|
||||||
|
<link rel="stylesheet" href="{{ scss('core/override.scss') }}">
|
||||||
|
<link rel="stylesheet" href="{{ scss('sas/album.scss') }}">
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans %}SAS{% endtrans %}
|
{% trans %}SAS{% endtrans %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% macro display_album(a) %}
|
{% set edit_mode = user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
||||||
{% if a.is_moderated %}
|
|
||||||
<a href="{{ url("sas:album", album_id=a.id) }}">
|
{% macro display_album(a, checkbox) %}
|
||||||
<div class="album">
|
<a href="{{ url('sas:album', album_id=a.id) }}">
|
||||||
<div>
|
|
||||||
{% if a.file %}
|
{% if a.file %}
|
||||||
<img src="{{ a.get_download_url() }}" alt="{% trans %}preview{% endtrans %}">
|
{% set img = a.get_download_url() %}
|
||||||
{% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
|
{% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
|
||||||
<img src="{{ a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() }}" alt="{% trans %}preview{% endtrans %}">
|
{% set img = a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="{{ static('core/img/sas.jpg') }}" alt="{% trans %}preview{% endtrans %}">
|
{% set img = static('core/img/sas.jpg') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
<div
|
||||||
|
class="album"
|
||||||
|
style="background-image: url('{{ img }}');"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
{{ a.name }}
|
{{ a.name }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
{% elif user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
{# {% if edit_mode and checkbox %}
|
||||||
<div style="display: inline-block; border: solid 1px red; text-align: center">
|
<input type="checkbox" name="file_list" value="{{ a.id }}">
|
||||||
<p><a href="{{ url('core:file_moderate', file_id=a.id) }}?next={{ url('sas:moderation') }}">Moderate</a> or <a href="">Delete</a></p>
|
{% endif %} #}
|
||||||
<a href="{{ url("sas:album", album_id=a.id) }}">{{ a.name }}</a>
|
</a>
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>{% trans %}SAS{% endtrans %}</h3>
|
<h3>{% trans %}SAS{% endtrans %}</h3>
|
||||||
<hr>
|
<br>
|
||||||
<h4>{% trans %}Latest albums{% endtrans %}</h4>
|
<h4>{% trans %}Latest albums{% endtrans %}</h4>
|
||||||
<div>
|
<div class="albums">
|
||||||
{% for a in latest %}
|
{% for a in latest %}
|
||||||
{{ display_album(a) }}
|
{{ display_album(a) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
<h4>{% trans %}All categories{% endtrans %}</h4>
|
<br>
|
||||||
<div>
|
|
||||||
{% for a in categories %}
|
{% if edit_mode %}
|
||||||
{{ display_album(a) }}
|
<form action="" method="post" enctype="multipart/form-data">
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% if user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<div class="navbar">
|
||||||
|
<h4>{% trans %}All categories{% endtrans %}</h4>
|
||||||
|
|
||||||
|
{# <div class="toolbar">
|
||||||
|
<input name="delete" type="submit" value="{% trans %}Delete{% endtrans %}">
|
||||||
|
</div> #}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if clipboard %}
|
||||||
|
<div class="clipboard">
|
||||||
|
{% trans %}Clipboard: {% endtrans %}
|
||||||
|
<ul>
|
||||||
|
{% for f in clipboard %}
|
||||||
|
<li>{{ f.get_full_path() }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
<input name="clear" type="submit" value="{% trans %}Clear clipboard{% endtrans %}">
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<h4>{% trans %}All categories{% endtrans %}</h4>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="albums">
|
||||||
|
{% for a in categories %}
|
||||||
|
{{ display_album(a, true) }}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if edit_mode %}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<form class="add-files" action="" method="post" enctype="multipart/form-data">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<div class="inputs">
|
||||||
|
<div>
|
||||||
|
<label for="{{ form.album_name.name }}">{{ form.album_name.label }}</label>
|
||||||
|
{{ form.album_name }}
|
||||||
|
</div>
|
||||||
|
<input type="submit" value="{% trans %}Create{% endtrans %}" />
|
||||||
|
</div>
|
||||||
|
|
||||||
{{ form.non_field_errors() }}
|
{{ form.non_field_errors() }}
|
||||||
<p>{{ form.album_name.errors }}<label for="{{ form.album_name.name }}">{{ form.album_name.label }}</label>
|
{{ form.album_name.errors }}
|
||||||
{{ form.album_name }}</p>
|
</form>
|
||||||
<p><input type="submit" value="{% trans %}Create{% endtrans %}" /></p>
|
{% endif %}
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user