|
@ -1,3 +1,4 @@ |
|
|
|
|
|
import os |
|
|
from flask import ( |
|
|
from flask import ( |
|
|
Blueprint, |
|
|
Blueprint, |
|
|
render_template, |
|
|
render_template, |
|
@ -20,6 +21,7 @@ from models.distribusi_model import Distribusis |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
from describer.forms.describe_files_form import DescribeFilesForm |
|
|
from describer.forms.describe_files_form import DescribeFilesForm |
|
|
from describer.forms.redistribusi_form import ReDistribusiForm |
|
|
from describer.forms.redistribusi_form import ReDistribusiForm |
|
|
|
|
|
from distribusikan.distribusi_workflow import run_distribusi, get_css_file |
|
|
|
|
|
|
|
|
describer = Blueprint( |
|
|
describer = Blueprint( |
|
|
"describer", |
|
|
"describer", |
|
@ -47,19 +49,22 @@ def show_distribusi_files(distribusiname): |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@describer.route("/redistribusi/<string:distribusiname>") |
|
|
@describer.route("/redistribusi/<string:distribusiname>", methods=["POST"]) |
|
|
@login_required |
|
|
@login_required |
|
|
def re_distribusi_files(distribusiname): |
|
|
def re_distribusi_files(distribusiname): |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusiname=distribusiname |
|
|
distribusiname=distribusiname |
|
|
).first() |
|
|
).first() |
|
|
redistribusi_form = ReDistribusiForm() |
|
|
redistribusi_form = ReDistribusiForm() |
|
|
distribusi_file_forms = get_distribusi_file_forms(distribusi.id) |
|
|
if redistribusi_form.validate_on_submit(): |
|
|
return render_template( |
|
|
userfolder = os.path.join("stash", distribusi.distribusiname) |
|
|
"describe.html", |
|
|
cssfile = get_css_file(distribusi) |
|
|
distribusiname=distribusiname, |
|
|
run_distribusi(userfolder, cssfile) |
|
|
redistribusi_form=redistribusi_form, |
|
|
return redirect( |
|
|
distribusi_file_forms=distribusi_file_forms, |
|
|
url_for( |
|
|
|
|
|
"describer.show_distribusi_files", |
|
|
|
|
|
distribusiname=distribusi.distribusiname, |
|
|
|
|
|
) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|