Compare commits

...

2 Commits

6 changed files with 29 additions and 26 deletions

7
app.py
View File

@ -135,10 +135,15 @@ def index():
for habit_list in habit_lists: for habit_list in habit_lists:
habit_list.habits = sorted(habit_list.get_habits(), key=lambda habit: (not habit.checked, habit.slot)) habit_list.habits = sorted(habit_list.get_habits(), key=lambda habit: (not habit.checked, habit.slot))
days = {"Monday": "Montag", "Tuesday": "Dienstag", "Wednesday": "Mittwoch", "Thursday": "Donnerstag",
"Friday": "Freitag", "Saturday": "Samstag", "Sunday": "Sonntag"}
date = datetime.datetime.now().strftime("%d.%m.%Y %H:%M ") + days[datetime.datetime.now().strftime("%A")]
return render_template( return render_template(
'index.html', 'index.html',
title=name, title=name,
utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M %A"), utc_dt=date,
habit_lists=habit_lists, habit_lists=habit_lists,
heatmap_values=heatmap_values, heatmap_values=heatmap_values,
errors={}, errors={},

View File

@ -121,7 +121,7 @@
</div> </div>
<!-- Beschreibung --> <!-- Beschreibung -->
<div class="col-md-3 d-none d-md-block text-black text-opacity-50" <div class="col-md-4 d-none d-md-block text-black text-opacity-50"
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis"> style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{{ habit.note }} {{ habit.note }}
</div> </div>
@ -129,7 +129,7 @@
<!-- Streak --> <!-- Streak -->
<div class="col-2" id="streak-{{ habit.id }}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis"> <div class="col-2" id="streak-{{ habit.id }}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{% if not habit.streak == 0 %} {% if not habit.streak == 0 %}
{{ habit.streak }} 🔥 {{ habit.streak }}20 🔥
{% endif %} {% endif %}
</div> </div>
@ -140,7 +140,7 @@
<i class="bi bi-trash3"></i> <i class="bi bi-trash3"></i>
</button> </button>
<!-- --> <!-- Knopf für das Bearbeiten der Gewohnheit -->
<a type="button" class="btn" href="{{ url_for('edit_habit') }}?habit={{ habit.id }}" aria-current="page" <a type="button" class="btn" href="{{ url_for('edit_habit') }}?habit={{ habit.id }}" aria-current="page"
style="width: 40px; height: 40px; min-height: 3em;"> style="width: 40px; height: 40px; min-height: 3em;">

View File

@ -2,7 +2,7 @@
{% block content %} {% block content %}
<div class="card bg-light p-5 mt-5"> <div class="card bg-light p-5 mt-5">
<h1>Habitliste erstellen📋</h1> <h1>Gewohnheitsliste erstellen📋</h1>
<form action="/habit-list" method="POST"> <form action="/habit-list" method="POST">
<div class="mb-3"> <div class="mb-3">

View File

@ -2,7 +2,7 @@
{% block content %} {% block content %}
<div class="card bg-light p-5 mt-5"> <div class="card bg-light p-5 mt-5">
<h1>Habit erstellen📋</h1> <h1>Gewohnheit erstellen📋</h1>
<form action="/habit" method="POST"> <form action="/habit" method="POST">
<div class="mb-3"> <div class="mb-3">

View File

@ -34,11 +34,7 @@
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> <ul class="me-auto"></ul>
<li class="nav-item">
<a class="nav-link text-white {% if title == 'Home' %} active {% endif %}" aria-current="page" href="{{ url_for('index') }}">Home</a>
</li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0"> <ul class="navbar-nav mb-2 mb-lg-0">
{% if not current_user.is_authenticated %} {% if not current_user.is_authenticated %}
<li class="nav-item me-2"> <li class="nav-item me-2">

View File

@ -1,23 +1,25 @@
{% extends 'layouts/main.html' %} {% extends 'layouts/main.html' %}
{% block content %} {% block content %}
<div class="card bg-light mt-4 p-5">
<h1>{{ habit_list.name }}: {{ title }}</h1>
<p>Lade Nutzer per ihrer E-Mail-Adresse ein</p>
<h1>{{ habit_list.name }}: {{ title }}</h1> <form action="/users" method="POST">
<p>Lade Nutzer per ihrer E-Mail-Adresse ein</p> <div class="mb-3">
<label for="email" class="form-label">E-Mail</label>
<form action="/users" method="POST"> <input type="text" placeholder="beispiel@cimeyclust.com"
<div class="mb-3"> class="form-control {% if errors.get('email') %} is-invalid {% endif %}" id="email" name="email"
<label for="email" class="form-label">E-Mail</label> value="{{email}}">
<input type="text" placeholder="beispiel@cimeyclust.com" class="form-control {% if errors.get('email') %} is-invalid {% endif %}" id="email" name="email" value="{{email}}"> <div class="invalid-feedback">
<div class="invalid-feedback"> {{ errors.get('email', '') }}
{{ errors.get('email', '') }} </div>
</div> </div>
</div>
<input hidden="hidden" name="habit_list_id" value="{{ habit_list.id }}"> <input hidden="hidden" name="habit_list_id" value="{{ habit_list.id }}">
<!-- submit button -->
<button type="submit" class="btn btn-primary">Einladen</button>
</form>
<!-- submit button -->
<button type="submit" class="btn btn-primary">Einladen</button>
</form>
</div>
{% endblock %} {% endblock %}