crunk
4 years ago
10 changed files with 204 additions and 5 deletions
@ -1 +0,0 @@ |
|||
,shambler,caprice,14.02.2021 19:03,file:///home/shambler/.config/libreoffice/4; |
@ -0,0 +1,45 @@ |
|||
#uploadform { |
|||
max-width: 60%; |
|||
margin-top: 3em; |
|||
margin-left: 1em; |
|||
margin-right: 1em; |
|||
padding: 1em; |
|||
z-index: 10; |
|||
border: 3px solid black; |
|||
background-color: #f1f1f1; |
|||
border-spacing: 0; |
|||
border-collapse: collapse; |
|||
clear: both; |
|||
position: relative; |
|||
} |
|||
|
|||
.uploadform-field { |
|||
margin: 0; |
|||
padding: 1em; |
|||
} |
|||
|
|||
input[type=text], select { |
|||
width: 100%; |
|||
padding: 1em 3em; |
|||
padding-left: 0.5em; |
|||
margin: 1em 0; |
|||
display: inline-block; |
|||
border: 1px solid #ccc; |
|||
border-radius: 4px; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
input[type=submit] { |
|||
background-color: #DD4F77; |
|||
text-align: right; |
|||
color: white; |
|||
padding: 1em 3em; |
|||
margin: 1em 1em; |
|||
border: none; |
|||
border-radius: 4px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
input[type=submit]:hover { |
|||
background-color: #404d81; |
|||
} |
@ -0,0 +1,76 @@ |
|||
{% extends "base.html" %} |
|||
{% block main %} |
|||
<div id="nav" class="container"> |
|||
<button id="leftmostbtn"><a href="/">All books</a></button> |
|||
<button><a href="/upload">Upload</a></button> |
|||
</div> |
|||
<div id="uploadform"> |
|||
<h2 id="uploadformtitle">Upload a new book</h2> |
|||
|
|||
<form method="POST" action="{{ url_for('upload') }}"> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.uploadpublication.label }} |
|||
{{ uploadform.uploadpublication(size=20) }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.author.label }} |
|||
{{ uploadform.author }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.year.label }} |
|||
{{ uploadform.year }} |
|||
</fieldset> |
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.custodian.label }} |
|||
{{ uploadform.custodian(size=20) }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.fields.label }} |
|||
{{ uploadform.fields }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.type.label }} |
|||
{{ uploadform.type }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.publishers.label }} |
|||
{{ uploadform.publishers(size=20) }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.license.label }} |
|||
{{ uploadform.license }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.licenseshort.label }} |
|||
{{ uploadform.licenseshort }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.highlights.label }} |
|||
{{ uploadform.highlights(size=20) }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.comments.label }} |
|||
{{ uploadform.comments }} |
|||
</fieldset> |
|||
|
|||
<fieldset class="uploadform-field"> |
|||
{{ uploadform.borrowed.label }} |
|||
{{ uploadform.borrowed }} |
|||
</fieldset> |
|||
|
|||
{{ uploadform.submit }} |
|||
|
|||
</form> |
|||
</div> |
|||
<script src="{{ url_for('static', filename='js/dropdown.js')}}"></script> |
|||
{% endblock %} |
@ -0,0 +1,63 @@ |
|||
"""Form object declaration.""" |
|||
from flask_wtf import FlaskForm |
|||
from wtforms import StringField, IntegerField, TextField, RadioField, SubmitField |
|||
from wtforms.validators import DataRequired, Length |
|||
|
|||
|
|||
class PublicationForm(FlaskForm): |
|||
"""Contact form.""" |
|||
uploadpublication = StringField( |
|||
'Title of the publication:', |
|||
[DataRequired()] |
|||
) |
|||
author = StringField( |
|||
'The author or editor:', |
|||
[DataRequired()] |
|||
) |
|||
year = IntegerField( |
|||
'Year:', |
|||
[DataRequired()] |
|||
) |
|||
custodian = StringField( |
|||
'Custodian:', |
|||
[DataRequired()] |
|||
) |
|||
fields = StringField( |
|||
'Fields:', |
|||
[DataRequired()] |
|||
) |
|||
type = StringField( |
|||
'Type:', |
|||
[DataRequired()] |
|||
) |
|||
publishers = StringField( |
|||
'Publishers:', |
|||
[DataRequired()] |
|||
) |
|||
license = StringField( |
|||
'License:', |
|||
[DataRequired()] |
|||
) |
|||
licenseshort = RadioField( |
|||
'Select the closest license type:', |
|||
choices = [ |
|||
('Anti-copyright','Anti-copyright'), |
|||
('No License Mentioned','No License Mentioned'), |
|||
('Free Art License','Free Art License'), |
|||
('Copyright','Copyright'), |
|||
('Copyleft','Copyleft'), |
|||
('Creative Commons','Creative Commons'), |
|||
('Public Domain','Public Domain'), |
|||
('GNU Free Documentation License','GNU Free Documentation License'), |
|||
] |
|||
) |
|||
highlights = TextField( |
|||
'Highlights from the publication:' |
|||
) |
|||
comments = TextField( |
|||
'Comments on the publication:' |
|||
) |
|||
borrowed = StringField( |
|||
'Currently borrowed by:' |
|||
) |
|||
submit = SubmitField('Submit') |
@ -1,2 +1,5 @@ |
|||
flask |
|||
icalendar |
|||
feedparser |
|||
flask |
|||
flask_wtf |
|||
requests |
|||
|
Loading…
Reference in new issue