mirror of
https://github.com/nikdoof/ohayodash.git
synced 2025-12-17 20:09:28 +00:00
Add a subtext to the greeting
This commit is contained in:
@@ -77,7 +77,7 @@ def get_bookmarks() -> list:
|
|||||||
return bookmarks
|
return bookmarks
|
||||||
|
|
||||||
|
|
||||||
def get_greeting():
|
def get_greeting() -> tuple:
|
||||||
"""Generate the greeting string based on the defined timezone."""
|
"""Generate the greeting string based on the defined timezone."""
|
||||||
try:
|
try:
|
||||||
tz = zoneinfo.ZoneInfo(os.environ.get('TZ', 'UTC'))
|
tz = zoneinfo.ZoneInfo(os.environ.get('TZ', 'UTC'))
|
||||||
@@ -88,10 +88,10 @@ def get_greeting():
|
|||||||
current_time = datetime.datetime.now(tz)
|
current_time = datetime.datetime.now(tz)
|
||||||
|
|
||||||
if 0 < current_time.hour < 12:
|
if 0 < current_time.hour < 12:
|
||||||
return 'おはようございます!'
|
return 'おはようございます!', "Thats 'Good morning' in Japanese"
|
||||||
elif current_time.hour >= 19:
|
elif current_time.hour >= 19:
|
||||||
return 'こんばんは'
|
return 'こんばんは', "Thats 'Good evening' in Japanese"
|
||||||
return 'こんにちは'
|
return 'こんにちは', "Thats 'Good day' in Japanese"
|
||||||
|
|
||||||
|
|
||||||
@base.app_template_filter()
|
@base.app_template_filter()
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="header">
|
<section id="header">
|
||||||
<h1>{{ greeting | default("Welcome")}}</h1>
|
<h1><span title="{{ greeting[1] }}">{{ greeting[0] | default("Welcome")}}</span></h1>
|
||||||
<h2>{{ now | format_datetime }}</h2>
|
<h2>{{ now | format_datetime }}</h2>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user