forked from crunk/distribusi-verse
crunk
3 years ago
7 changed files with 117 additions and 7 deletions
@ -0,0 +1,38 @@ |
|||
#notes |
|||
pip install git+file:///distribusi#egg=distribusi |
|||
|
|||
|
|||
# Shit! We need entire CRUD functionality. |
|||
|
|||
##Create: |
|||
|
|||
### Uploading |
|||
User can upload based on $distribusiname field in db. |
|||
the zip file is changed to $distribusiname. |
|||
and a folder is made in the stash called $distribusiname |
|||
|
|||
### CSS editing. |
|||
a user can edit CSS of a file in the folder called $distribusiname |
|||
|
|||
### Theme selection |
|||
a user can select a CSS file from a dropdown menu. |
|||
|
|||
### Distribusi |
|||
A flag in de DB is set to true and distribusi is run on the folder of the users |
|||
called $distribusiname |
|||
|
|||
## Read: |
|||
Based on flags set in the user DB the distribusi folders are set to visible. |
|||
on the main index page there is a listing of distribusi sites. |
|||
|
|||
## Update: |
|||
Same as create, uploading just redoes the entire process. |
|||
$distribusiname is overwritten. |
|||
|
|||
CSS editing, and Theme selection is editing a single file in the folder. |
|||
$distribusiname stays the same |
|||
|
|||
Distribusi button can only be reset when a new file is uploaded. |
|||
|
|||
## Delete |
|||
$distribusiname is deleted, files are removed, visible flag is set to false. |
@ -1,4 +1,29 @@ |
|||
{% extends "base.html" %} |
|||
{% block main %} |
|||
|
|||
<h3>Upload</h3> |
|||
<p>Upload button</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> |
|||
{{ uploadform.submit }} |
|||
</form> |
|||
<h3>Theme</h3> |
|||
<p>dropdown css file selector</p> |
|||
<h3>Edit</h3> |
|||
<p>go to CSS editor</p> |
|||
<h3>Distribusi</h3> |
|||
<p>run distribusi on your files</p> |
|||
{% endblock main %} |
|||
|
@ -0,0 +1,24 @@ |
|||
from flask_wtf import FlaskForm |
|||
from flask_wtf.file import FileField, FileAllowed |
|||
from wtforms import validators |
|||
from wtforms.validators import Length |
|||
from wtforms import ( |
|||
FileField, |
|||
SubmitField, |
|||
StringField, |
|||
) |
|||
|
|||
|
|||
class UploadForm(FlaskForm): |
|||
"""File upload class for a new site in distribusi-verse""" |
|||
|
|||
sitename = StringField( |
|||
"Name of your website:", |
|||
validators=[validators.InputRequired(), Length(6, 100)], |
|||
) |
|||
zipfile = FileField( |
|||
'Upload your zip file with content here:', |
|||
validators=[FileAllowed(['zip'], 'Zip archives only!')] |
|||
) |
|||
|
|||
submit = SubmitField("Upload") |
Loading…
Reference in new issue