|
@ -1,5 +1,5 @@ |
|
|
from flask import Blueprint, render_template, redirect, url_for |
|
|
from flask import Blueprint, render_template, redirect, url_for |
|
|
from flask_login import current_user |
|
|
from flask_login import current_user, login_required |
|
|
from models.distribusi_model import Distribusis |
|
|
from models.distribusi_model import Distribusis |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
from describer.forms.describe_file_form import DescribeFileForm |
|
|
from describer.forms.describe_file_form import DescribeFileForm |
|
@ -13,6 +13,7 @@ describer = Blueprint( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@describer.route("/<string:distribusiname>") |
|
|
@describer.route("/<string:distribusiname>") |
|
|
|
|
|
@login_required |
|
|
def describe_distribusi_files(distribusiname): |
|
|
def describe_distribusi_files(distribusiname): |
|
|
if not current_user.is_authenticated: |
|
|
if not current_user.is_authenticated: |
|
|
return redirect(url_for("index")) |
|
|
return redirect(url_for("index")) |
|
@ -30,3 +31,12 @@ def describe_distribusi_files(distribusiname): |
|
|
distribusi_files=distribusi_files, |
|
|
distribusi_files=distribusi_files, |
|
|
describe_form=describe_form, |
|
|
describe_form=describe_form, |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@describer.route("/describe_file", methods=["POST"]) |
|
|
|
|
|
@login_required |
|
|
|
|
|
def describe_file(file_name): |
|
|
|
|
|
describe_form = DescribeFileForm() |
|
|
|
|
|
if describe_form.validate_on_submit(): |
|
|
|
|
|
print(f"{file_name} description: {describe_form.description.data}") |
|
|
|
|
|
return |
|
|