Browse Source

small fixes

current_wdka_release
crunk 3 years ago
parent
commit
4db5ee438f
  1. 15
      verse/forms/uploadform.py
  2. 74
      verse/static/css/tags.css
  3. 1
      verse/static/js/script.js
  4. 1
      verse/templates/base.html
  5. 4
      verse/templates/distribusiworkflow/selector.html

15
verse/forms/uploadform.py

@ -1,7 +1,12 @@
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired, FileSize
from wtforms import validators
from wtforms.validators import Length, NumberRange, DataRequired
from wtforms.validators import (
Length,
NumberRange,
DataRequired,
ValidationError,
)
from wtforms import (
SubmitField,
StringField,
@ -13,9 +18,13 @@ from wtforms import (
class UploadForm(FlaskForm):
"""File upload class for a new site in distribusi-verse"""
def distribusiname(form, field):
if field.data.lower() == "new":
raise ValidationError("Name has to be unique and not just new.")
sitename = StringField(
"Name of your website:",
validators=[validators.InputRequired(), Length(2, 100)],
validators=[validators.InputRequired(), Length(2, 100), distribusiname],
)
academicyear = StringField(
"Academic year:",
@ -36,7 +45,7 @@ class UploadForm(FlaskForm):
validators=[DataRequired()]
)
tags = StringField(
"Add search tags, comma-separated:",
"Add tags, press enter or add a comma after each tag:",
validators=[validators.InputRequired(), Length(2, 500)],
)

74
verse/static/css/tags.css

@ -0,0 +1,74 @@
::selection{
color: #fff;
background: #5372F0;
}
.wrapper{
width: 496px;
background: #fff;
padding: 18px 25px 20px;
box-shadow: 0 0 30px rgba(0,0,0,0.06);
}
.wrapper :where(.title, li, li i, .details){
display: flex;
align-items: center;
}
.title img{
max-width: 21px;
}
.title h2{
font-size: 21px;
font-weight: 600;
margin-left: 8px;
}
.wrapper .content{
margin: 10px 0;
}
.tags p{
font-size: 15px;
}
.tags ul{
display: flex;
flex-wrap: wrap;
padding: 7px;
margin: 12px 0;
border-radius: 5px;
border: 1px solid #a6a6a6;
}
.tags ul li{
color: #333;
margin: 4px 3px;
list-style: none;
background: #F2F2F2;
padding: 5px 8px 5px 10px;
border: 1px solid #e3e1e1;
}
.tags ul li i{
height: 20px;
width: 20px;
color: #808080;
margin-left: 8px;
font-size: 12px;
cursor: pointer;
border-radius: 50%;
background: #dfdfdf;
justify-content: center;
}
.tags ul input{
flex: 1;
padding: 5px;
border: none;
outline: none;
font-size: 16px;
}
.wrapper .details{
justify-content: space-between;
}
.details button{
border: none;
background: #E0B0FF;
text-decoration: none;
margin: 1px;
}
.details button:hover{
background: #2c52ed;
}

1
verse/static/js/script.js

@ -16,6 +16,7 @@ function scrollToLaunch() {
}
}
document.addEventListener("DOMContentLoaded", scrollToTheme);
document.addEventListener("DOMContentLoaded", scrollToLaunch);

1
verse/templates/base.html

@ -6,6 +6,7 @@
<title>Autonomous Practices X Distribusi-Verse</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css')}}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/selector.css')}}">
<!-- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/tags.css')}}"> -->
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='icons/apple-touch-icon.png')}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon-32x32.png')}}">

4
verse/templates/distribusiworkflow/selector.html

@ -13,17 +13,13 @@
</div>
</fieldset>
<fieldset class="button required multiselect">
{{ selectorform.update.label }}
{{ selectorform.update }}
</fieldset>
<fieldset class="button required multiselect warning">
{{ selectorform.delete.label }}
{{ selectorform.delete }}
</fieldset>
<p>Alternatively you can make a new site</p>
<fieldset class="button required multiselect">
{{ selectorform.new.label }}
{{ selectorform.new }}
</fieldset>
</form>

Loading…
Cancel
Save