Add some desktop styling

This commit is contained in:
Sage Vaillancourt 2021-07-24 01:08:18 -04:00
parent 5be8d759c3
commit 42c67985a6
6 changed files with 66 additions and 35 deletions

47
flaskr/static/styles.css Normal file
View File

@ -0,0 +1,47 @@
html {
height: 100%;
}
body {
min-height: 90%;
text-size: 150%;
line-height: 200%;
width: 40vw;
margin-left: auto;
margin-right: auto;
display: flex;
flex-direction: column;
}
form {
display: flex;
flex-grow: 1;
flex-direction: column;
}
dl {
display: flex;
flex-grow: 1;
flex-direction: column;
}
dd {
display: flex;
}
textarea {
width: 90%;
flex-grow: 1;
}
.bigtext {
flex-grow: 1;
}
#body {
flex-grow: 1;
}
#closingtext {
width: 50%;
}

View File

@ -1,6 +1,6 @@
{% macro render_field(field) %}
<dt>{{ field.label }}
<dd>{{ field(**kwargs)|safe }}
{% macro render_field(field, extra="") %}
<dt>{{ field.label }}:
<dd {{extra}}>{{ field(**kwargs)|safe }}
{% if field.errors %}
<ul class=errors>
{% for error in field.errors %}

View File

@ -1,9 +1,12 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="
{{ url_for('static', filename='styles.css') }}">
</head>
<body>
<h1>UnderCover: The secret cover letter generator</h1>
<h1>UnderCover</h1>
<h2>The secret cover letter generator</h2>
{% from "_formhelpers.html" import render_field %}
<form method=post>
@ -13,7 +16,7 @@
{{ render_field(form.jobandpronoun) }}
{{ render_field(form.skilltypes) }}
{{ render_field(form.myskills) }}
{{ render_field(form.body) }}
{{ render_field(form.body, 'class=bigtext') }}
{{ render_field(form.closingtext) }}
</dl>
<p><input type=submit value="Submit"></p>

View File

@ -21,15 +21,15 @@ class CLData():
closingtext: str
body: str
def get_pairs():
def get_pairs(self):
return [
("username", username),
("company", company),
("jobandpronoun", jobandpronoun),
("skilltypes", skilltypes),
("myskills", myskills),
("closingtext", closingtext),
("body", body),
("username", self.username),
("company", self.company),
("jobandpronoun", self.jobandpronoun),
("skilltypes", self.skilltypes),
("myskills", self.myskills),
("closingtext", self.closingtext),
("body", self.body),
]
def define(file, name, data, whitespace=""): file.write("\\def \\" + name + "{" + data + whitespace + "}\n")
@ -42,7 +42,7 @@ def generate(data: CLData, unique):
define(f, "username", data.username)
define(f, "thecompany", data.company)
define(f, "jobandpronoun", data.jobandpronoun, " ")
define(f, "skilltypes", data.skilltypes)
define(f, "skilltypes", data.skilltypes, " ")
define(f, "myskills", data.myskills, " ")
define(f, "closingtext", data.closingtext)
define(f, "body", data.body)

View File

@ -19,7 +19,7 @@ class CLForm(Form):
)
jobandpronoun = StringField('Job and Pronoun',
[validators.Length(min=4, max=99)],
default="Banana Stocker"
default="a banana stocker"
)
skilltypes = StringField('Skill Type',
[validators.Length(min=4, max=99)],
@ -27,7 +27,7 @@ class CLForm(Form):
)
myskills = StringField('My Skills',
[validators.Length(min=4, max=99)],
default="stocking"
default="stocking bananas"
)
closingtext = StringField('Closing Text',
[validators.Length(min=4, max=99)],

View File

@ -1,22 +1,3 @@
%\def \username {Sage Vaillancourt}
%\def \thecompany {BananCorp}
%\def \jobandpronoun {PusherBoy }
%\def \skilltypes {broad, practical }
%\def \myskills {software design principles }
%\def \closingtext {I am looking forward to hearing from you}
%\def \body {
% My name is \username. I would like to work as \jobandpronoun with your
% company. I think my knowledge of \myskills will contribute well to your
% team.
%
% I am passionate about my work, and think we would work well together.
%
% Thank you for your consideration.
%
%}
\documentclass[12pt]{letter}
\signature{\username}