mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-01 07:35: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 {
|
||||
background-color: #d4d4d4;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
background-color: #f2f2f2;
|
||||
color: #d4d4d4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,6 +149,8 @@
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
|
||||
border: 1px solid rgba(0, 0, 0, .3);
|
||||
|
||||
@media (max-width: 500px) {
|
||||
width: 100%;
|
||||
}
|
||||
@ -162,7 +169,7 @@
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .7);
|
||||
background: rgba(0, 0, 0, .5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,8 +199,8 @@
|
||||
}
|
||||
|
||||
> .album > div {
|
||||
background: rgba(0, 0, 0, .3);
|
||||
background: linear-gradient(0deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, 0) 100%);
|
||||
background: rgba(0, 0, 0, .5);
|
||||
background: linear-gradient(0deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 100%);
|
||||
text-align: left;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
<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="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>
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
</form>
|
||||
{% 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">
|
||||
{% csrf_token %}
|
||||
<div class="inputs">
|
||||
|
@ -1,56 +1,103 @@
|
||||
{% 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 %}
|
||||
{% trans %}SAS{% endtrans %}
|
||||
{% trans %}SAS{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% macro display_album(a) %}
|
||||
{% if a.is_moderated %}
|
||||
<a href="{{ url("sas:album", album_id=a.id) }}">
|
||||
<div class="album">
|
||||
<div>
|
||||
{% set edit_mode = user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
||||
|
||||
{% macro display_album(a, checkbox) %}
|
||||
<a href="{{ url('sas:album', album_id=a.id) }}">
|
||||
{% 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() %}
|
||||
<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 %}
|
||||
<img src="{{ static('core/img/sas.jpg') }}" alt="{% trans %}preview{% endtrans %}">
|
||||
{% set img = static('core/img/sas.jpg') %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="album"
|
||||
style="background-image: url('{{ img }}');"
|
||||
>
|
||||
<div>
|
||||
{{ a.name }}
|
||||
</div>
|
||||
</a>
|
||||
{% elif user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
||||
<div style="display: inline-block; border: solid 1px red; text-align: center">
|
||||
<p><a href="{{ url('core:file_moderate', file_id=a.id) }}?next={{ url('sas:moderation') }}">Moderate</a> or <a href="">Delete</a></p>
|
||||
<a href="{{ url("sas:album", album_id=a.id) }}">{{ a.name }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{# {% if edit_mode and checkbox %}
|
||||
<input type="checkbox" name="file_list" value="{{ a.id }}">
|
||||
{% endif %} #}
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{% trans %}SAS{% endtrans %}</h3>
|
||||
<hr>
|
||||
<h4>{% trans %}Latest albums{% endtrans %}</h4>
|
||||
<div>
|
||||
<h3>{% trans %}SAS{% endtrans %}</h3>
|
||||
<br>
|
||||
<h4>{% trans %}Latest albums{% endtrans %}</h4>
|
||||
<div class="albums">
|
||||
{% for a in latest %}
|
||||
{{ display_album(a) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr>
|
||||
<h4>{% trans %}All categories{% endtrans %}</h4>
|
||||
<div>
|
||||
{% for a in categories %}
|
||||
{{ display_album(a) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
{% if edit_mode %}
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% 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() }}
|
||||
<p>{{ form.album_name.errors }}<label for="{{ form.album_name.name }}">{{ form.album_name.label }}</label>
|
||||
{{ form.album_name }}</p>
|
||||
<p><input type="submit" value="{% trans %}Create{% endtrans %}" /></p>
|
||||
</form>
|
||||
{% endif %}
|
||||
{{ form.album_name.errors }}
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user