Browse Source

redistribusi for adding exif

pull/12/head
crunk 5 months ago
parent
commit
c8b1171cad
  1. 21
      verse/describer/describe_files.py
  2. 4
      verse/describer/forms/redistribusi_form.py
  3. 3
      verse/describer/templates/describe_files/describe.html
  4. 14
      verse/describer/templates/describe_files/redistribusi.html

21
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/<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,
)

4
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!")

3
verse/describer/templates/describe_files/describe.html

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

14
verse/describer/templates/describe_files/redistribusi.html

@ -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>
Loading…
Cancel
Save