|
@ -43,6 +43,7 @@ from upload import UploadUpdatedFiles |
|
|
|
|
|
|
|
|
# UserPengguna |
|
|
# UserPengguna |
|
|
from statuspengguna.helper import IsZipUploaded |
|
|
from statuspengguna.helper import IsZipUploaded |
|
|
|
|
|
from statuspengguna.helper import IsCssSelected |
|
|
from statuspengguna.helper import CurrentDistribusi |
|
|
from statuspengguna.helper import CurrentDistribusi |
|
|
from statuspengguna.helper import ResetUserState |
|
|
from statuspengguna.helper import ResetUserState |
|
|
from statuspengguna.loginuser import LoginUser |
|
|
from statuspengguna.loginuser import LoginUser |
|
@ -86,6 +87,7 @@ def distribusi(): |
|
|
selectorvisible = SelectorVisible() |
|
|
selectorvisible = SelectorVisible() |
|
|
current_distribusi = CurrentDistribusi() |
|
|
current_distribusi = CurrentDistribusi() |
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
|
|
|
css_selected = IsCssSelected(current_distribusi) |
|
|
user = User.query.filter_by(email=current_user.email).first() |
|
|
user = User.query.filter_by(email=current_user.email).first() |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusiname=current_distribusi |
|
|
distribusiname=current_distribusi |
|
@ -122,6 +124,7 @@ def distribusi(): |
|
|
themeform=themeform, |
|
|
themeform=themeform, |
|
|
selectorform=selectorform, |
|
|
selectorform=selectorform, |
|
|
files_uploaded=files_uploaded, |
|
|
files_uploaded=files_uploaded, |
|
|
|
|
|
css_selected=css_selected, |
|
|
selectorvisible=selectorvisible, |
|
|
selectorvisible=selectorvisible, |
|
|
) |
|
|
) |
|
|
return template |
|
|
return template |
|
@ -143,7 +146,7 @@ def upload(): |
|
|
else: |
|
|
else: |
|
|
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"]) |
|
|
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"]) |
|
|
files_uploaded = IsZipUploaded(uploadform.sitename.data) |
|
|
files_uploaded = IsZipUploaded(uploadform.sitename.data) |
|
|
|
|
|
css_selected = IsCssSelected(current_distribusi) |
|
|
template = render_template( |
|
|
template = render_template( |
|
|
"distribusi.html", |
|
|
"distribusi.html", |
|
|
uploadform=uploadform, |
|
|
uploadform=uploadform, |
|
@ -151,6 +154,7 @@ def upload(): |
|
|
themeform=themeform, |
|
|
themeform=themeform, |
|
|
selectorform=selectorform, |
|
|
selectorform=selectorform, |
|
|
files_uploaded=files_uploaded, |
|
|
files_uploaded=files_uploaded, |
|
|
|
|
|
css_selected=css_selected, |
|
|
selectorvisible=selectorvisible, |
|
|
selectorvisible=selectorvisible, |
|
|
) |
|
|
) |
|
|
return template |
|
|
return template |
|
@ -168,7 +172,7 @@ def theme(): |
|
|
selectorvisible = SelectorVisible() |
|
|
selectorvisible = SelectorVisible() |
|
|
current_distribusi = CurrentDistribusi() |
|
|
current_distribusi = CurrentDistribusi() |
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
|
|
|
css_selected = IsCssSelected(current_distribusi) |
|
|
if themeform.validate_on_submit(): |
|
|
if themeform.validate_on_submit(): |
|
|
newuserfolder = os.path.join("stash", current_distribusi) |
|
|
newuserfolder = os.path.join("stash", current_distribusi) |
|
|
copycssfile = os.path.join( |
|
|
copycssfile = os.path.join( |
|
@ -176,6 +180,7 @@ def theme(): |
|
|
"{}.css".format(themeform.theme.data), |
|
|
"{}.css".format(themeform.theme.data), |
|
|
) |
|
|
) |
|
|
shutil.copy(copycssfile, newuserfolder) |
|
|
shutil.copy(copycssfile, newuserfolder) |
|
|
|
|
|
css_selected = IsCssSelected(current_distribusi) |
|
|
|
|
|
|
|
|
template = render_template( |
|
|
template = render_template( |
|
|
"distribusi.html", |
|
|
"distribusi.html", |
|
@ -184,6 +189,7 @@ def theme(): |
|
|
themeform=themeform, |
|
|
themeform=themeform, |
|
|
selectorform=selectorform, |
|
|
selectorform=selectorform, |
|
|
files_uploaded=files_uploaded, |
|
|
files_uploaded=files_uploaded, |
|
|
|
|
|
css_selected=css_selected, |
|
|
selectorvisible=selectorvisible, |
|
|
selectorvisible=selectorvisible, |
|
|
) |
|
|
) |
|
|
return template |
|
|
return template |
|
@ -242,6 +248,7 @@ def selector(): |
|
|
uploadform.tags.data = distribusi.tags |
|
|
uploadform.tags.data = distribusi.tags |
|
|
|
|
|
|
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
files_uploaded = IsZipUploaded(current_distribusi) |
|
|
|
|
|
css_selected = IsCssSelected(current_distribusi) |
|
|
selectorvisible = SelectorVisible() |
|
|
selectorvisible = SelectorVisible() |
|
|
|
|
|
|
|
|
template = render_template( |
|
|
template = render_template( |
|
@ -251,6 +258,7 @@ def selector(): |
|
|
themeform=themeform, |
|
|
themeform=themeform, |
|
|
selectorform=selectorform, |
|
|
selectorform=selectorform, |
|
|
files_uploaded=files_uploaded, |
|
|
files_uploaded=files_uploaded, |
|
|
|
|
|
css_selected=css_selected, |
|
|
selectorvisible=selectorvisible, |
|
|
selectorvisible=selectorvisible, |
|
|
) |
|
|
) |
|
|
return template |
|
|
return template |
|
|