From c8b1171cadf69daca465014392ddf230b8ba72d0 Mon Sep 17 00:00:00 2001 From: crunk Date: Sun, 23 Jun 2024 14:42:30 +0200 Subject: [PATCH] redistribusi for adding exif --- verse/describer/describe_files.py | 21 ++++++++++++++++++- verse/describer/forms/redistribusi_form.py | 4 ++-- .../templates/describe_files/describe.html | 3 +++ .../describe_files/redistribusi.html | 14 +++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 verse/describer/templates/describe_files/redistribusi.html diff --git a/verse/describer/describe_files.py b/verse/describer/describe_files.py index b7f7ea8..a3106ee 100644 --- a/verse/describer/describe_files.py +++ b/verse/describer/describe_files.py @@ -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/") +@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, ) diff --git a/verse/describer/forms/redistribusi_form.py b/verse/describer/forms/redistribusi_form.py index 71c5bd8..1d7676a 100644 --- a/verse/describer/forms/redistribusi_form.py +++ b/verse/describer/forms/redistribusi_form.py @@ -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!") diff --git a/verse/describer/templates/describe_files/describe.html b/verse/describer/templates/describe_files/describe.html index 7616461..9267722 100644 --- a/verse/describer/templates/describe_files/describe.html +++ b/verse/describer/templates/describe_files/describe.html @@ -70,5 +70,8 @@ {% endfor%} + {% block redistribusi %} + {% include "redistribusi.html" %} + {% endblock redistribusi%} {% endblock %} diff --git a/verse/describer/templates/describe_files/redistribusi.html b/verse/describer/templates/describe_files/redistribusi.html new file mode 100644 index 0000000..9269d45 --- /dev/null +++ b/verse/describer/templates/describe_files/redistribusi.html @@ -0,0 +1,14 @@ +
+

Run distribusi again after describing your files.Distribusi will run again and add your alttext and descriptions. +

+
+ {{ redistribusi_form.csrf_token }} +
+ {{ redistribusi_form.submit.label }} + {{ redistribusi_form.submit }} + {% for message in redistribusi_form.submit.errors %} +
{{ message }}
+ {% endfor %} +
+
+