Browse Source

Step 2,3 and 4 are disabled if files are not yet uploaded.

current_wdka_release
crunk 3 years ago
parent
commit
4a12caf31c
  1. 5
      verse/start.py
  2. 1
      verse/static/css/style.css
  3. 8
      verse/templates/distribusiworkflow/editcss.html
  4. 8
      verse/templates/distribusiworkflow/launch.html
  5. 8
      verse/templates/distribusiworkflow/theme.html
  6. 30
      verse/templates/editor.html

5
verse/start.py

@ -73,6 +73,9 @@ def login():
if loginform.validate_on_submit(): if loginform.validate_on_submit():
try: try:
user = User.query.filter_by(email=loginform.email.data).first() user = User.query.filter_by(email=loginform.email.data).first()
if user is None:
loginform.password.errors.append("Invalid email or password!")
return render_template("login.html", loginform=loginform)
if check_password_hash(user.password, loginform.password.data): if check_password_hash(user.password, loginform.password.data):
login_user(user) login_user(user)
flash("Logged in successfully.", "success") flash("Logged in successfully.", "success")
@ -81,7 +84,7 @@ def login():
return abort(400) return abort(400)
return redirect(next or url_for("index")) return redirect(next or url_for("index"))
else: else:
flash("Invalid Username or password!", "danger") flash("Invalid email or password!", "danger")
loginform.password.errors.append("Invalid email or password!") loginform.password.errors.append("Invalid email or password!")
return render_template("login.html", loginform=loginform) return render_template("login.html", loginform=loginform)
except Exception as e: except Exception as e:

1
verse/static/css/style.css

@ -37,6 +37,7 @@ div#upload form {
border: 3px solid #E0B0FF; border: 3px solid #E0B0FF;
background-color:#383C4A; background-color:#383C4A;
text-decoration: none; text-decoration: none;
scroll-behavior: smooth;
} }
#mainworkflow #mainworkflow
{ {

8
verse/templates/distribusiworkflow/editcss.html

@ -1,4 +1,12 @@
<div id="edit" class="workflow"> <div id="edit" class="workflow">
<h3>(Optional) Step 3: Edit</h3> <h3>(Optional) Step 3: Edit</h3>
{% if files_uploaded %}
<a href="/editor"><p>Go to CSS editor</p></a> <a href="/editor"><p>Go to CSS editor</p></a>
{% else %}
<p>
You need to upload your files first before you can a css theme
for your files.
</p>
<a href="#upload">Go to Step 1</a>
{% endif %}
</div> </div>

8
verse/templates/distribusiworkflow/launch.html

@ -4,8 +4,16 @@
your content public.</p> your content public.</p>
<form method="POST" enctype="multipart/form-data" action="{{ url_for('distribusi') }}"> <form method="POST" enctype="multipart/form-data" action="{{ url_for('distribusi') }}">
{{ distribusiform.csrf_token }} {{ distribusiform.csrf_token }}
{% if files_uploaded %}
<fieldset class="button required"> <fieldset class="button required">
{{ distribusiform.submit }} {{ distribusiform.submit }}
</fieldset> </fieldset>
{% else %}
<p>
You need to upload your files first before you can run distribusi
on your files.
</p>
<a href="#upload">Go to Step 1</a>
{% endif %}
</form> </form>
</div> </div>

8
verse/templates/distribusiworkflow/theme.html

@ -8,8 +8,16 @@
{{ themeform.theme.label }} {{ themeform.theme.label }}
{{ themeform.theme }} {{ themeform.theme }}
</fieldset> </fieldset>
{% if files_uploaded %}
<fieldset class="button required"> <fieldset class="button required">
{{ themeform.save }} {{ themeform.save }}
</fieldset> </fieldset>
{% else %}
<p>
You need to upload your files first before you can a css theme
for your files.
</p>
<a href="#upload">Go to Step 1</a>
{% endif %}
</form> </form>
</div> </div>

30
verse/templates/editor.html

@ -18,21 +18,21 @@
</div> </div>
<div class="editarea"> <div class="editarea">
{% if files_uploaded %} {% if files_uploaded %}
<fieldset class="required"> <fieldset class="required">
{{ editorform.cssname.label }} {{ editorform.cssname.label }}
{{ editorform.cssname }} {{ editorform.cssname }}
{% for message in editorform.cssname.errors %} {% for message in editorform.cssname.errors %}
<div class="error">{{ message }}</div> <div class="error">{{ message }}</div>
{% endfor %} {% endfor %}
</fieldset> </fieldset>
<fieldset class="button required"> <fieldset class="button required">
{{ editorform.submit }} {{ editorform.submit }}
</fieldset> </fieldset>
{% else %} {% else %}
<p> <p>
You need to upload your files first before you can save a css file. You need to upload your files first before you can save a css file.
</p> </p>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</form> </form>

Loading…
Cancel
Save