From 8d269c8ed36b22a9f0d87d43dbd56e96c262c47e Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Thu, 22 Sep 2022 16:51:53 -0400 Subject: [PATCH] Try using underscores in variable names. Makes for pretty ugly latex, but looks better on the frontend. --- flaskr/static/styles.css | 2 +- flaskr/templates/writing.jinja2 | 8 ++++---- latty.py | 16 ++++++++-------- writing.py | 23 ++++++++++++----------- writing_templates/base.tex | 2 +- writing_templates/default.tex | 16 ++++++++-------- 6 files changed, 34 insertions(+), 33 deletions(-) diff --git a/flaskr/static/styles.css b/flaskr/static/styles.css index e385a75..8d70228 100644 --- a/flaskr/static/styles.css +++ b/flaskr/static/styles.css @@ -113,7 +113,7 @@ input, textarea { dl { margin-top: 0; } - #closingtext { + #closing_text { width: 50%; } } diff --git a/flaskr/templates/writing.jinja2 b/flaskr/templates/writing.jinja2 index d788396..6aa3ee3 100644 --- a/flaskr/templates/writing.jinja2 +++ b/flaskr/templates/writing.jinja2 @@ -40,11 +40,11 @@
{{ render_field(form.username) }} {{ render_field(form.company) }} - {{ render_field(form.jobandpronoun) }} - {{ render_field(form.skilltypes) }} - {{ render_field(form.myskills) }} + {{ render_field(form.job_and_pronoun) }} + {{ render_field(form.skill_types) }} + {{ render_field(form.my_skills) }} {{ render_field(form.body, 'class=bigtext') }} - {{ render_field(form.closingtext) }} + {{ render_field(form.closing_text) }}
{% if errors %} diff --git a/latty.py b/latty.py index e9e6366..abbfd47 100644 --- a/latty.py +++ b/latty.py @@ -28,20 +28,20 @@ base_tex_text = open(proj_dir + "/writing_templates/base.tex", "r").read() class CLData: username: str company: str - jobandpronoun: str - skilltypes: str - myskills: str - closingtext: str + job_and_pronoun: str + skill_types: str + my_skills: str + closing_text: str body: str def get_pairs(self): return [ ("username", self.username), ("company", self.company), - ("jobandpronoun", self.jobandpronoun), - ("skilltypes", self.skilltypes), - ("myskills", self.myskills), - ("closingtext", self.closingtext), + ("job_and_pronoun", self.job_and_pronoun), + ("skill_types", self.skill_types), + ("my_skills", self.my_skills), + ("closing_text", self.closing_text), ("body", self.body), ] diff --git a/writing.py b/writing.py index b1d6a1f..f55b524 100644 --- a/writing.py +++ b/writing.py @@ -26,22 +26,23 @@ class CLForm(Form): [validators.Length(min=2, max=99)], default="BananaCorp" ) - jobandpronoun = StringField( + job_and_pronoun = StringField( 'Job and Pronoun (a/an):', [validators.Length(min=4, max=99)], default="a banana stocker" ) - skilltypes = StringField( + skill_types = StringField( 'Skill Type:', [validators.Length(min=2, max=99)], default="practical" ) - myskills = StringField( + my_skills = StringField( 'My Skills:', [validators.Length(min=2, max=99)], default="stocking bananas" ) - closingtext = TextAreaField( + + closing_text = TextAreaField( 'Closing Text:', [validators.Length(min=2, max=99)], default="I look forward to hearing from you" @@ -52,8 +53,8 @@ class CLForm(Form): [validators.Length(min=4, max=9999)], default=( "My name is {\\username}. I'm excited for the opportunity to work as " - "{\\jobandpronoun} with your company. I think my {\\skilltypes} knowledge " - "of {\\myskills} can contribute a lot to your team.\n\n" + "{\\job_and_pronoun} with your company. I think my {\\skill_types} knowledge " + "of {\\my_skills} can contribute a lot to your team.\n\n" "I am passionate about what I do, and I think we would work well together.\n\n" @@ -73,7 +74,7 @@ def index_get(): @writing_blueprint.route('/dbtest', methods=['GET']) -def dbtest_get(): +def db_test_get(): response = make_response(db.get_user_letters(1)[0].contents, 200) response.mimetype = "text/plain" return response @@ -105,10 +106,10 @@ def index_post(): data = CLData( username=form.username.data, company=form.company.data, - jobandpronoun=form.jobandpronoun.data, - skilltypes=form.skilltypes.data, - myskills=form.myskills.data, - closingtext=form.closingtext.data, + job_and_pronoun=form.job_and_pronoun.data, + skill_types=form.skill_types.data, + my_skills=form.my_skills.data, + closing_text=form.closing_text.data, body=form.body.data, ) diff --git a/writing_templates/base.tex b/writing_templates/base.tex index 35537cf..32b2a33 100644 --- a/writing_templates/base.tex +++ b/writing_templates/base.tex @@ -9,7 +9,7 @@ \body -\closing{\closingtext,} +\closing{\closing\_text,} \end{letter} \end{document} diff --git a/writing_templates/default.tex b/writing_templates/default.tex index 00cdea2..ea22814 100644 --- a/writing_templates/default.tex +++ b/writing_templates/default.tex @@ -1,15 +1,15 @@ \def \thecompany {BananCorp} -\def \jobandpronoun {PusherBoy } -\def \skilltypes {broad, practical } -\def \myskills {software design principles} +\def \job\_and\_pronoun {PusherBoy } +\def \skill\_types {broad, practical } +\def \my\_skills {software design principles} % CoverLetter.tex - Create a cover letter using an included vars.tex % \def \username {Sage Vaillancourt} % \def \thecompany {Travelers} -% \def \jobandpronoun {a Software Engineer } -% \def \skilltypes {broad, practical } -% \def \myskills {computer systems} +% \def \job\_and\_pronoun {a Software Engineer } +% \def \skill\_types {broad, practical } +% \def \my\_skills {computer systems} \include{vars} @@ -23,8 +23,8 @@ \opening{Dear \thecompany,} My name is Sage Vaillancourt. I'm excited for the opportunity to work as -\jobandpronoun with your company. It's clear that you're looking for a hard worker who -has a \skilltypes knowledge of \myskills, so I'm certain that I'd be a +\job\_and\_pronoun with your company. It's clear that you're looking for a hard worker who +has a \skill\_types knowledge of \my\_skills, so I'm certain that I'd be a perfect fit to work with you. I am someone who has been passionate about computers my whole life, and I have