distribusi-verse: medium-tech web app content management system for the web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
1.9 KiB

from flask import render_template
from app import APP
from distribusikan.distribusi_selector import SelectorVisible
from distribusikan.distribusis_info import DistribusisInfo
from distribusikan.upload import upload_new_distribusi, upload_updates_files
from distribusikan.forms.distribusiform import DistribusiForm
from distribusikan.forms.publicthemeform import PublicThemeForm
from distribusikan.forms.selectorform import SelectorForm
from distribusikan.forms.themeform import ThemeForm
# UserPengguna
from statuspengguna.helper import UserHelper
def upload_page():
"render upload page section of distribusi workflow"
uploadfolder = APP.config["UPLOAD_FOLDER"]
distribusiform = DistribusiForm()
themeform = ThemeForm()
publicthemeform = PublicThemeForm()
publicthemeform.publicthemes.choices = DistribusisInfo.public_themes()
selectorform = SelectorForm()
selectorform.distribusis.choices = DistribusisInfo.user_distribusinames()
selectorvisible = SelectorVisible()
current_distribusi = UserHelper.current_distribusi()
if current_distribusi == "new" or UserHelper.has_distribusi() is False:
uploadform = upload_new_distribusi(uploadfolder)
else:
uploadform = upload_updates_files(uploadfolder)
files_uploaded = UserHelper.is_zip_uploaded(uploadform.sitename.data)
distribusi_live = UserHelper.is_distribusi_live(current_distribusi)
css_selected = UserHelper.is_css_selected(current_distribusi)
limit_reached = UserHelper.distribusi_limit_reached()
template = render_template(
"distribusi.html",
uploadform=uploadform,
distribusiform=distribusiform,
themeform=themeform,
publicthemeform=publicthemeform,
selectorform=selectorform,
files_uploaded=files_uploaded,
distribusi_live=distribusi_live,
css_selected=css_selected,
selectorvisible=selectorvisible,
limit_reached=limit_reached,
)
return template