Skip to content

Commit

Permalink
Update hello_there.html
Browse files Browse the repository at this point in the history
Added in logic so that "Name" is not required.  If name is not supplied then a message is displayed.
  • Loading branch information
TimPreble authored Dec 29, 2018
1 parent 3546f38 commit 459347a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hello_app/templates/hello_there.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<title>Hello, Flask</title>
</head>
<body>
<span class="message">Hello there, {{ name }}!</span> It's {{ date.strftime("%A, %d %B, %Y at %X") }}.
{%if name %}
<span class="message">Hello there, {{ name }}!</span> It's {{ date.strftime("%A, %d %B, %Y at %X") }}.
{% else %}
<span class="message">You must provide a name.</span>
{% endif %}
</body>
</html>
<!-- The above syntax makes use of jinja and it's documentation can be found over here http://jinja.pocoo.org/docs/2.10/templates/ -->

0 comments on commit 459347a

Please sign in to comment.