🎉 Huge update, added Python virtualenv, updated dependencies...

This commit is contained in:
Finn Christiansen 2023-11-07 20:28:19 +01:00
parent fc8697f1a2
commit fdbb29fb5a
6 changed files with 30 additions and 3 deletions

View file

@ -3,7 +3,7 @@ from icalendar import Calendar, Alarm
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired
from wtforms import IntegerField, SubmitField
from wtforms.widgets.html5 import NumberInput
from wtforms.widgets import NumberInput
import tempfile
index = Blueprint('index', __name__, template_folder='templates')
@ -41,7 +41,7 @@ def addreminder():
new_ics = tempfile.TemporaryFile()
new_ics.write(calendar.to_ical())
new_ics.seek(0)
new_filename = file.filename.rstrip('.ics')+'_with_reminders'+'.ics'
new_filename = file.filename.rstrip('.ics') + '_with_reminders' + '.ics'
return send_file(new_ics, as_attachment=True,
attachment_filename=new_filename)

153
app/static/css/style.css Normal file
View file

@ -0,0 +1,153 @@
body {
background-color: #EEEEEE;
font-family: sans-serif;
text-align: center;
margin: 0px;
}
main {
padding: 12px;
}
h1 {
font-size: 1.25em;
}
label {
text-align: left;
}
ol {
text-align: left;
}
a:link,
a:visited {
text-decoration: none;
color: #0066cc;
}
a:hover,
a:active {
text-decoration: underline;
color: #0066cc;
}
div.form {
width: 420px;
margin: 0 auto;
}
div.form-group {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
}
div.form label {
font-size: 18px;
}
div.form input[type="number"] {
width: 80px;
}
footer {
width: 100vw;
position: absolute;
bottom: 0px;
padding: 10px 0px;
}
input[type="submit"] {
width: 150px;
color: white;
background-color: #0066cc;
padding: 14px 20px;
margin: 18px;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: bold;
font-size: 18px;
}
input[type="submit"]:hover {
background-color: #0044aa;
}
.file {
position: relative;
display: inline-block;
cursor: pointer;
height: 2.5rem;
width: 100%;
margin-bottom: 16px;
}
.file input {
min-width: 14rem;
margin: 0;
filter: alpha(opacity=0);
opacity: 0;
}
.file-custom::before {
position: absolute;
top: -.075rem;
right: -.075rem;
bottom: -.075rem;
z-index: 6;
display: block;
content: "Browse";
height: 2.5rem;
padding: .5rem 1rem;
line-height: 1.5;
color: #555;
background-color: #eee;
border: .075rem solid #ddd;
border-radius: 0 .25rem .25rem 0;
}
.file-custom {
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 5;
height: 2.5rem;
padding: .5rem 1rem;
line-height: 1.5;
color: #555;
background-color: #fff;
border: .075rem solid #ddd;
border-radius: .25rem;
box-shadow: inset 0 .2rem .4rem rgba(0,0,0,.05);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
*, ::before, ::after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.file-custom::after {
content: attr(data-content);
}
div.error {
color: #721c24;
background-color: #f8d7da;
padding: .75rem 1.25rem;
border: 1px solid #f5c6cb;
border-radius: .25rem;
}
@media all and (max-width: 500px) {
div.form {
width: 100%;
margin: 0 auto;
}
}

View file

@ -0,0 +1,6 @@
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById('icsfile').addEventListener("change", function(e){
var filename = this.value.replace(/^.*[\\\/]/, '');
document.getElementById('filename').setAttribute('data-content', filename);
});
});