redistribusi for adding exif

This commit is contained in:
crunk 2024-06-23 14:42:30 +02:00
parent e5d8da2568
commit c8b1171cad
4 changed files with 39 additions and 3 deletions

View File

@ -19,7 +19,7 @@ from app import db
from models.distribusi_model import Distribusis
from models.distribusi_file_model import DistribusiFiles
from describer.forms.describe_files_form import DescribeFilesForm
from describer.forms.redistribusi_form import ReDistribusiForm
describer = Blueprint(
"describer",
@ -37,9 +37,28 @@ def show_distribusi_files(distribusiname):
distribusi = Distribusis.query.filter_by(
distribusiname=distribusiname
).first()
redistribusi_form = ReDistribusiForm()
distribusi_file_forms = get_distribusi_file_forms(distribusi.id)
return render_template(
"describe.html",
distribusiname=distribusiname,
redistribusi_form=redistribusi_form,
distribusi_file_forms=distribusi_file_forms,
)
@describer.route("/redistribusi/<string:distribusiname>")
@login_required
def re_distribusi_files(distribusiname):
distribusi = Distribusis.query.filter_by(
distribusiname=distribusiname
).first()
redistribusi_form = ReDistribusiForm()
distribusi_file_forms = get_distribusi_file_forms(distribusi.id)
return render_template(
"describe.html",
distribusiname=distribusiname,
redistribusi_form=redistribusi_form,
distribusi_file_forms=distribusi_file_forms,
)

View File

@ -2,7 +2,7 @@ from flask_wtf import FlaskForm
from wtforms import SubmitField
class DistribusiForm(FlaskForm):
"""Distribusi class to launch your distribusi website"""
class ReDistribusiForm(FlaskForm):
"""Re-Distribusi form class to re-distrusi with desribed files"""
submit = SubmitField("Re-Distribusi!")

View File

@ -70,5 +70,8 @@
</div>
{% endfor%}
</div>
{% block redistribusi %}
{% include "redistribusi.html" %}
{% endblock redistribusi%}
</div>
{% endblock %}

View File

@ -0,0 +1,14 @@
<div class="redistribusi">
<p class="tooltip">Run distribusi again after describing your files.<span class="tooltiptext">Distribusi will run again and add your alttext and descriptions.
</span></p>
<form id={{distribusiname}} method="POST" enctype="multipart/form-data" action="{{ url_for('describer.re_distribusi_files', distribusiname=distribusiname) }}">
{{ redistribusi_form.csrf_token }}
<fieldset class="">
{{ redistribusi_form.submit.label }}
{{ redistribusi_form.submit }}
{% for message in redistribusi_form.submit.errors %}
<div class="error">{{ message }}</div>
{% endfor %}
</fieldset>
</form>
</div>