Migrate albums and pictures to their own tables

This commit is contained in:
imperosol
2025-01-26 12:51:54 +01:00
parent 9c8e3b7cac
commit 2e2676fd1f
23 changed files with 1490 additions and 259 deletions

View File

@ -20,7 +20,7 @@
{% block content %}
<code>
<a href="{{ url('sas:main') }}">SAS</a> / {{ print_path(album.parent) }} {{ album.get_display_name() }}
<a href="{{ url('sas:main') }}">SAS</a> / {{ print_path(album.parent) }} {{ album.name }}
</code>
{% set is_sas_admin = user.can_edit(album) %}
@ -30,7 +30,7 @@
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="album-navbar">
<h3>{{ album.get_display_name() }}</h3>
<h3>{{ album.name }}</h3>
<div class="toolbar">
<a href="{{ url('sas:album_edit', album_id=album.id) }}">{% trans %}Edit{% endtrans %}</a>

View File

@ -1,6 +1,6 @@
{% macro display_album(a, edit_mode) %}
<a href="{{ url('sas:album', album_id=a.id) }}">
{% if a.file %}
{% if a.thumbnail %}
{% set img = a.get_download_url() %}
{% set src = a.name %}
{% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
@ -31,7 +31,7 @@
{% macro print_path(file) %}
{% if file and file.parent %}
{{ print_path(file.parent) }}
<a href="{{ url('sas:album', album_id=file.id) }}">{{ file.get_display_name() }}</a> /
<a href="{{ url("sas:album", album_id=file.id) }}">{{ file.name }}</a> /
{% endif %}
{% endmacro %}
@ -39,7 +39,7 @@
record of albums with alpine
This needs to be used inside an alpine environment.
Downloaded pictures will be `pictures` from the
Downloaded pictures will be `pictures` from the
parent data store.
Note:

View File

@ -1,9 +1,9 @@
{% extends "core/base.jinja" %}
{%- block additional_css -%}
<link defer rel="stylesheet" href="{{ static('bundled/core/components/ajax-select-index.css') }}">
<link defer rel="stylesheet" href="{{ static('core/components/ajax-select.scss') }}">
<link defer rel="stylesheet" href="{{ static('sas/css/picture.scss') }}">
<link rel="stylesheet" href="{{ static('bundled/core/components/ajax-select-index.css') }}">
<link rel="stylesheet" href="{{ static('core/components/ajax-select.scss') }}">
<link rel="stylesheet" href="{{ static('sas/css/picture.scss') }}">
{%- endblock -%}
{%- block additional_js -%}
@ -104,7 +104,7 @@
<span
x-text="Intl.DateTimeFormat(
'{{ LANGUAGE_CODE }}', {dateStyle: 'long'}
).format(new Date(currentPicture.date))"
).format(new Date(currentPicture.created_at))"
>
</span>
</div>