Media upload
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{% extends "base" %}
|
||||
{% import "macros" as macros %}
|
||||
|
||||
{% block title %}
|
||||
Your medias
|
||||
{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ "Media details" }}</h1>
|
||||
<section>
|
||||
<a href="/medias">Go back to the gallery</a>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<figure class="media">
|
||||
{{ media.html | safe }}
|
||||
<figcaption>{{ media.alt_text }}</figcaption>
|
||||
</figure>
|
||||
<div>
|
||||
<a href="/medias/{{ media.id }}/avatar" class="button inline-block">Use as avatar</a>
|
||||
<a href="/medias/{{ media.id }}/delete" class="button inline-block">Delete</a>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends "base" %}
|
||||
{% import "macros" as macros %}
|
||||
|
||||
{% block title %}
|
||||
Your medias
|
||||
{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ "Your medias" }}</h1>
|
||||
<div>
|
||||
<a href="/medias/new" class="inline-block button">Upload</a>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
{% if medias | length < 1 %}
|
||||
<p>{{ "You don't have any media yet." | _ }}</p>
|
||||
{% endif %}
|
||||
<div class="list">
|
||||
{% for media in medias %}
|
||||
<div class="card flex">
|
||||
{{ media.html_preview | safe }}
|
||||
<main class="grow">
|
||||
<p><a href="/medias/{{ media.id }}">{{ media.alt_text }}</a></p>
|
||||
</main>
|
||||
<a href="/medias/{{ media.id }}/delete">Delete</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{# macros::paginate(page=page, total=n_pages) #}
|
||||
</section>
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends "base" %}
|
||||
{% import "macros" as macros %}
|
||||
|
||||
{% block title %}
|
||||
{{ "Media upload" | _ }}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ "Media upload" | _ }}</h1>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{{ macros::input(name="alt", label="Description", errors=errors, form=form, props='required minlength="1"', details='Useful for visually impaired people and licensing') }}
|
||||
{{ macros::input(name="cw", label="Content warning", errors=errors, form=form, details='Let it empty if there is none') }}
|
||||
{{ macros::input(name="file", type='file', label="File", errors=errors, form=form, props='required') }}
|
||||
|
||||
<input type="submit" value="{{ "Send" | _ }}"/>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user