small fixes

This commit is contained in:
crunk 2022-03-04 22:15:08 +01:00
parent 0cb57548fa
commit 4db5ee438f
5 changed files with 88 additions and 7 deletions

View File

@ -1,7 +1,12 @@
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired, FileSize from flask_wtf.file import FileField, FileAllowed, FileRequired, FileSize
from wtforms import validators from wtforms import validators
from wtforms.validators import Length, NumberRange, DataRequired from wtforms.validators import (
Length,
NumberRange,
DataRequired,
ValidationError,
)
from wtforms import ( from wtforms import (
SubmitField, SubmitField,
StringField, StringField,
@ -13,9 +18,13 @@ from wtforms import (
class UploadForm(FlaskForm): class UploadForm(FlaskForm):
"""File upload class for a new site in distribusi-verse""" """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( sitename = StringField(
"Name of your website:", "Name of your website:",
validators=[validators.InputRequired(), Length(2, 100)], validators=[validators.InputRequired(), Length(2, 100), distribusiname],
) )
academicyear = StringField( academicyear = StringField(
"Academic year:", "Academic year:",
@ -36,7 +45,7 @@ class UploadForm(FlaskForm):
validators=[DataRequired()] validators=[DataRequired()]
) )
tags = StringField( tags = StringField(
"Add search tags, comma-separated:", "Add tags, press enter or add a comma after each tag:",
validators=[validators.InputRequired(), Length(2, 500)], validators=[validators.InputRequired(), Length(2, 500)],
) )

74
verse/static/css/tags.css Normal file
View File

@ -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;
}

View File

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

View File

@ -6,6 +6,7 @@
<title>Autonomous Practices X Distribusi-Verse</title> <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/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/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="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="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')}}"> <link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon-32x32.png')}}">

View File

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