forked from crunk/distribusi-verse
crunk
3 years ago
8 changed files with 98 additions and 68 deletions
@ -0,0 +1,17 @@ |
|||
import os |
|||
from flask_login import current_user |
|||
from usermodel import User |
|||
|
|||
def AreFilesUploaded(): |
|||
user = User.query.filter_by(email=current_user.email).first() |
|||
if user.distribusiname is None: |
|||
print("distribusi name is empty") |
|||
return False; |
|||
userfolder = os.path.join("stash", user.distribusiname) |
|||
if os.path.exists(userfolder): |
|||
print("folder found, files are uploaded") |
|||
return True; |
|||
|
|||
#def IsThemeSelected |
|||
#def IsCustomThemePresent |
|||
#def IsDistribusiLive |
@ -1,66 +1,20 @@ |
|||
{% extends "base.html" %} |
|||
{% block main %} |
|||
<div id="mainworkflow"> |
|||
|
|||
<div id="upload" class="workflow"> |
|||
<h3>Step 1: Upload</h3> |
|||
<p>Upload your files here, the only accepted file type is a zip file</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('upload') }}"> |
|||
{{ uploadform.csrf_token }} |
|||
<fieldset class="required"> |
|||
{{ uploadform.sitename.label }} |
|||
{{ uploadform.sitename }} |
|||
{% for message in uploadform.sitename.errors %} |
|||
<div class="error">{{ message }}</div> |
|||
{% endfor %} |
|||
</fieldset> |
|||
<fieldset class="required"> |
|||
{{ uploadform.zipfile.label }} |
|||
{{ uploadform.zipfile }} |
|||
{% for message in uploadform.zipfile.errors %} |
|||
<div class="error">{{ message }}</div> |
|||
{% endfor %} |
|||
</fieldset> |
|||
<fieldset class="button required"> |
|||
{{ uploadform.submit }} |
|||
</fieldset> |
|||
</form> |
|||
{% if success %} |
|||
<p>Your file has been uploaded successfully</h2> |
|||
{% endif %} |
|||
</div> |
|||
{% block upload %} |
|||
{% include "distribusiworkflow/upload.html" %} |
|||
{% endblock upload%} |
|||
<img src="{{ url_for('static', filename='svg/arrow_1.svg')}}" /> |
|||
<div id="theme" class="workflow"> |
|||
<h3>(Optional) Step 2: Theme</h3> |
|||
<p>Select your Theme here. If you want your own custom css, skip and go to |
|||
step 3. Don't forget to press Save</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('theme') }}"> |
|||
{{ themeform.csrf_token }} |
|||
<fieldset class="required"> |
|||
{{ themeform.theme.label }} |
|||
{{ themeform.theme }} |
|||
</fieldset> |
|||
<fieldset class="button required"> |
|||
{{ themeform.save }} |
|||
</fieldset> |
|||
</form> |
|||
</div> |
|||
<img src="{{ url_for('static', filename='svg/arrow_2.svg')}}" /> |
|||
<div id="edit" class="workflow"> |
|||
<h3>(Optional) Step 3: Edit</h3> |
|||
<a href="/editor"><p>Go to CSS editor</p></a> |
|||
</div> |
|||
{% block theme %} |
|||
{% include "distribusiworkflow/theme.html" %} |
|||
{% endblock theme%} |
|||
<img src="{{ url_for('static', filename='svg/arrow_2.svg')}}" /> |
|||
{% block editcss %} |
|||
{% include "distribusiworkflow/editcss.html" %} |
|||
{% endblock editcss%} |
|||
<img src="{{ url_for('static', filename='svg/arrow_3.svg')}}" /> |
|||
<div id="distribusi" class="workflow"> |
|||
<h3>Step 4: Distribusi</h3> |
|||
<p>run distribusi on your files, this will generate your website and make |
|||
your content public.</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('distribusi') }}"> |
|||
{{ distribusiform.csrf_token }} |
|||
<fieldset class="button required"> |
|||
{{ distribusiform.submit }} |
|||
</fieldset> |
|||
</form> |
|||
</div> |
|||
{% block launch %} |
|||
{% include "distribusiworkflow/launch.html" %} |
|||
{% endblock launch%} |
|||
</div> |
|||
{% endblock main %} |
|||
|
@ -0,0 +1,4 @@ |
|||
<div id="edit" class="workflow"> |
|||
<h3>(Optional) Step 3: Edit</h3> |
|||
<a href="/editor"><p>Go to CSS editor</p></a> |
|||
</div> |
@ -0,0 +1,11 @@ |
|||
<div id="distribusi" class="workflow"> |
|||
<h3>Step 4: Distribusi</h3> |
|||
<p>run distribusi on your files, this will generate your website and make |
|||
your content public.</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('distribusi') }}"> |
|||
{{ distribusiform.csrf_token }} |
|||
<fieldset class="button required"> |
|||
{{ distribusiform.submit }} |
|||
</fieldset> |
|||
</form> |
|||
</div> |
@ -0,0 +1,15 @@ |
|||
<div id="theme" class="workflow"> |
|||
<h3>(Optional) Step 2: Theme</h3> |
|||
<p>Select your Theme here. If you want your own custom css, skip and go to |
|||
step 3. Don't forget to press Save</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('theme') }}"> |
|||
{{ themeform.csrf_token }} |
|||
<fieldset class="required"> |
|||
{{ themeform.theme.label }} |
|||
{{ themeform.theme }} |
|||
</fieldset> |
|||
<fieldset class="button required"> |
|||
{{ themeform.save }} |
|||
</fieldset> |
|||
</form> |
|||
</div> |
@ -0,0 +1,27 @@ |
|||
<div id="upload" class="workflow"> |
|||
<h3>Step 1: Upload</h3> |
|||
<p>Upload your files here, the only accepted file type is a zip file</p> |
|||
<form method="POST" enctype="multipart/form-data" action="{{ url_for('upload') }}"> |
|||
{{ uploadform.csrf_token }} |
|||
<fieldset class="required"> |
|||
{{ uploadform.sitename.label }} |
|||
{{ uploadform.sitename }} |
|||
{% for message in uploadform.sitename.errors %} |
|||
<div class="error">{{ message }}</div> |
|||
{% endfor %} |
|||
</fieldset> |
|||
<fieldset class="required"> |
|||
{{ uploadform.zipfile.label }} |
|||
{{ uploadform.zipfile }} |
|||
{% for message in uploadform.zipfile.errors %} |
|||
<div class="error">{{ message }}</div> |
|||
{% endfor %} |
|||
</fieldset> |
|||
<fieldset class="button required"> |
|||
{{ uploadform.submit }} |
|||
</fieldset> |
|||
</form> |
|||
{% if files_uploaded %} |
|||
<p>Your files have been uploaded successfully</p> |
|||
{% endif %} |
|||
</div> |
Loading…
Reference in new issue