|
@ -4,7 +4,6 @@ import zipfile |
|
|
import shutil |
|
|
import shutil |
|
|
from datetime import timedelta |
|
|
from datetime import timedelta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from flask import ( |
|
|
from flask import ( |
|
|
render_template, |
|
|
render_template, |
|
|
redirect, |
|
|
redirect, |
|
@ -32,20 +31,24 @@ from forms.editorform import EditorForm |
|
|
from forms.selectorform import SelectorForm |
|
|
from forms.selectorform import SelectorForm |
|
|
|
|
|
|
|
|
# CRUD! |
|
|
# CRUD! |
|
|
from selector import SelectNewDistribusi |
|
|
from selector import ( |
|
|
from selector import SelectUpdateDistribusi |
|
|
SelectNewDistribusi, |
|
|
from selector import DeleteDistribusi |
|
|
SelectUpdateDistribusi, |
|
|
from selector import SelectorVisible |
|
|
DeleteDistribusi, |
|
|
|
|
|
SelectorVisible, |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
# Upload |
|
|
# Upload |
|
|
from upload import UploadNewDistribusi |
|
|
from upload import UploadNewDistribusi, UploadUpdatedFiles |
|
|
from upload import UploadUpdatedFiles |
|
|
|
|
|
|
|
|
|
|
|
# UserPengguna |
|
|
# UserPengguna |
|
|
from statuspengguna.helper import IsZipUploaded |
|
|
from statuspengguna.helper import ( |
|
|
from statuspengguna.helper import IsCssSelected |
|
|
IsZipUploaded, |
|
|
from statuspengguna.helper import CurrentDistribusi |
|
|
IsCssSelected, |
|
|
from statuspengguna.helper import ResetUserState |
|
|
CurrentDistribusi, |
|
|
|
|
|
HasDistribusi, |
|
|
|
|
|
ResetUserState, |
|
|
|
|
|
) |
|
|
from statuspengguna.loginuser import LoginUser |
|
|
from statuspengguna.loginuser import LoginUser |
|
|
from statuspengguna.registeruser import RegisterUser |
|
|
from statuspengguna.registeruser import RegisterUser |
|
|
|
|
|
|
|
@ -73,7 +76,7 @@ def index(): |
|
|
for distribusi in distribusis: |
|
|
for distribusi in distribusis: |
|
|
user = User.query.filter_by(id=distribusi.userid).first() |
|
|
user = User.query.filter_by(id=distribusi.userid).first() |
|
|
singledistribusi = { |
|
|
singledistribusi = { |
|
|
"useremail": user.email, |
|
|
"username": user.username, |
|
|
"term": distribusi.term, |
|
|
"term": distribusi.term, |
|
|
"course": distribusi.course, |
|
|
"course": distribusi.course, |
|
|
"year": distribusi.year, |
|
|
"year": distribusi.year, |
|
@ -160,7 +163,7 @@ def upload(): |
|
|
selectorvisible = SelectorVisible() |
|
|
selectorvisible = SelectorVisible() |
|
|
|
|
|
|
|
|
current_distribusi = CurrentDistribusi() |
|
|
current_distribusi = CurrentDistribusi() |
|
|
if current_distribusi == "new": |
|
|
if current_distribusi == "new" or HasDistribusi() == False: |
|
|
uploadform = UploadNewDistribusi(APP.config["UPLOAD_FOLDER"]) |
|
|
uploadform = UploadNewDistribusi(APP.config["UPLOAD_FOLDER"]) |
|
|
else: |
|
|
else: |
|
|
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"]) |
|
|
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"]) |
|
|