Skip to content

Commit 7942122

Browse files
committed
made changes to app personality
1 parent 8846816 commit 7942122

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def login():
220220
APP.logger.info("Decrypting password")
221221
if sha256_crypt.verify(password, passdata_block):
222222
session["user_id"] = curr_user.my_id
223+
session["user_name"] = curr_user.username
223224
session["log"] = True
224225
APP.logger.info("Successfully logged in")
225226
return redirect(url_for("closet"))
@@ -260,7 +261,9 @@ def closet(): # LOGIN REQUIRED!
260261
"SELECT closet FROM users_closets WHERE id = %s;", (session["user_id"]),
261262
).fetchone()
262263
user_closet = pickle.loads(str.encode(closet_pickled[0]))
263-
return render_template("my_closet.html", closet=user_closet)
264+
return render_template(
265+
"my_closet.html", closet=user_closet, user=session["user_name"]
266+
)
264267

265268

266269
def get_temp(zipcode):
@@ -313,7 +316,9 @@ def closet_modify():
313316
(pickle.dumps(user_closet, 0), session["user_id"]),
314317
)
315318
APP.logger.info("Successfully modified closet for user %s", (session["user_id"]))
316-
return render_template("my_closet.html", closet=user_closet)
319+
return render_template(
320+
"my_closet.html", closet=user_closet, user=session["user_name"]
321+
)
317322

318323

319324
@APP.route("/try", methods=["GET", "POST"]) # LOGIN REQUIRED!

templates/my_closet.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
{% block page_content %}
1010
<div class="container">
11-
<h1> Welcome to your outdoors closet! </h1>
11+
<h3> Welcome to your outdoors closet, {{ user }}! </h3>
1212
<p> Here, you can add your clothes to get your outfit suggestions using them. We've already added some clothes. Feel free to remove and add as you may.</p>
1313
<form method="POST">
1414
<table class="highlight">
1515
<thead>
1616
<tr>
17-
<th><h2>Name</h2></th>
18-
<th><h2>Warmth</h2></th>
17+
<th>Name</th>
18+
<th>Warmth</th>
1919
</tr>
2020
</thead>
2121
<tbody>

templates/try.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
{% block page_content %}
1111
<div class="container">
1212
<span id="app_info">
13-
<h1> Try the app!</h1>
14-
<p> Enter secret temperature desired as a number.</p>
13+
<h3>Try ToWear!</h3>
14+
{% if temperature %}
15+
<h5>You can check your suggested outfit, below.</h5>
16+
{% endif %}
1517
<p> Note that we will use only the items in your closet; so, go ahead and add or remove items from there in the My Closet page.</p>
1618
</span>
1719
<span id="app_info_loading" style="display:none">
18-
<h1> Trying the app! </h1>
20+
<h3> Trying ToWear! Please wait...</h3>
1921
<p> This could take up to a minute, depending on how many clothes are in your closet.</p>
2022
</span>
2123
<form method="POST">

0 commit comments

Comments
 (0)