Compare commits
6 Commits
2f2e543a79
..
V0.6.5
| Author | SHA1 | Date | |
|---|---|---|---|
| ce7a371caf | |||
| 25459216bc | |||
| e7a22ec27d | |||
| f44b7bf465 | |||
| 4233175067 | |||
| f8f3641811 |
@@ -351,13 +351,18 @@ Der ausgegebene `VAPID_PRIVATE_KEY` ist bereits `.env`-freundlich mit escaped Ne
|
|||||||
- Quick-Wins als gemeinsames Team-Feature ausgebaut
|
- Quick-Wins als gemeinsames Team-Feature ausgebaut
|
||||||
- neuer Optionen-Tab zum Anlegen und Verwalten gemeinsamer Quick-Wins
|
- neuer Optionen-Tab zum Anlegen und Verwalten gemeinsamer Quick-Wins
|
||||||
- bestehende Quick-Wins in den Optionen direkt bearbeitbar gemacht
|
- bestehende Quick-Wins in den Optionen direkt bearbeitbar gemacht
|
||||||
|
- Quick-Win-Reihenfolge per Drag & Drop ergänzt und Speichern der Sortierung in den Optionen stabilisiert
|
||||||
- Plus-Dialog von Einzelkarten auf kompakte auswählbare Quick-Win-Chips umgestellt
|
- Plus-Dialog von Einzelkarten auf kompakte auswählbare Quick-Win-Chips umgestellt
|
||||||
- mehrere Quick-Wins lassen sich gesammelt als erledigt speichern
|
- mehrere Quick-Wins lassen sich gesammelt als erledigt speichern
|
||||||
- „Sonstiges“ blendet Titel und Aufwand jetzt nur bei Auswahl ein
|
- „Sonstiges“ blendet Titel und Aufwand jetzt nur bei Auswahl ein
|
||||||
- neue Aufwand-Stufe `super aufwendig`
|
- neue Aufwand-Stufe `super aufwendig`
|
||||||
- Quick-Win-Popup visuell mit übernommenem Sparkles-Icon aus `heinz.marketing` aufgewertet
|
- Quick-Win-Popup visuell mit übernommenem Sparkles-Icon aus `heinz.marketing` aufgewertet
|
||||||
|
- gemeinsame Aufgaben für zwei Personen mit halbierten Punkten pro Person ergänzt
|
||||||
|
- Aufgabenstatus in `morgen fällig`, `übermorgen fällig` und `bald fällig` feiner aufgeteilt
|
||||||
|
- Aufgaben können jetzt von allen Nutzern direkt gelöscht werden
|
||||||
- Kalenderdarstellung für lange deutsche Begriffe und Namen bei der Worttrennung nachgeschärft
|
- Kalenderdarstellung für lange deutsche Begriffe und Namen bei der Worttrennung nachgeschärft
|
||||||
- deutsche Silbentrennung serverseitig vorbereitet, mit optionalem `pyphen`-Fallback ohne Startfehler im lokalen Dev-Setup
|
- deutsche Silbentrennung serverseitig vorbereitet, mit optionalem `pyphen`-Fallback ohne Startfehler im lokalen Dev-Setup
|
||||||
|
- mobile Layouts für Aufgabenkarten, Bearbeiten-Ansicht und Quick-Win-Verwaltung weiter verdichtet und ausgerichtet
|
||||||
- Footer auf Versionslink, Herkunftshinweis und `hnz.io`-Verweis umgebaut
|
- Footer auf Versionslink, Herkunftshinweis und `hnz.io`-Verweis umgebaut
|
||||||
- Cloudron-Version auf `0.6.5` angehoben
|
- Cloudron-Version auf `0.6.5` angehoben
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ def create_app(config_class: type[Config] = Config) -> Flask:
|
|||||||
(key, values["label"])
|
(key, values["label"])
|
||||||
for key, values in quick_task_config.items()
|
for key, values in quick_task_config.items()
|
||||||
]
|
]
|
||||||
quick_wins = QuickWin.query.filter_by(active=True).order_by(QuickWin.id.asc()).all()
|
quick_wins = QuickWin.query.filter_by(active=True).order_by(QuickWin.sort_order.asc(), QuickWin.id.asc()).all()
|
||||||
def asset_version(filename: str) -> int:
|
def asset_version(filename: str) -> int:
|
||||||
path = Path(app.static_folder) / filename
|
path = Path(app.static_folder) / filename
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class TaskForm(FlaskForm):
|
|||||||
description = TextAreaField("Beschreibung", validators=[Optional(), Length(max=2000)])
|
description = TextAreaField("Beschreibung", validators=[Optional(), Length(max=2000)])
|
||||||
default_points = IntegerField("Punkte", validators=[DataRequired(), NumberRange(min=1, max=500)], default=10)
|
default_points = IntegerField("Punkte", validators=[DataRequired(), NumberRange(min=1, max=500)], default=10)
|
||||||
assigned_user_id = SelectField("Zugewiesen an", coerce=int, validators=[DataRequired()])
|
assigned_user_id = SelectField("Zugewiesen an", coerce=int, validators=[DataRequired()])
|
||||||
|
assigned_user_secondary_id = SelectField("Zweite Person", coerce=int, validators=[Optional()], default=0)
|
||||||
due_date = DateField("Fälligkeitsdatum", format="%Y-%m-%d", validators=[DataRequired()])
|
due_date = DateField("Fälligkeitsdatum", format="%Y-%m-%d", validators=[DataRequired()])
|
||||||
recurrence_interval_value = IntegerField(
|
recurrence_interval_value = IntegerField(
|
||||||
"Intervallwert",
|
"Intervallwert",
|
||||||
@@ -74,6 +75,9 @@ class TaskForm(FlaskForm):
|
|||||||
if self.recurrence_interval_unit.data != "none" and not self.recurrence_interval_value.data:
|
if self.recurrence_interval_unit.data != "none" and not self.recurrence_interval_value.data:
|
||||||
self.recurrence_interval_value.errors.append("Bitte gib einen Intervallwert an.")
|
self.recurrence_interval_value.errors.append("Bitte gib einen Intervallwert an.")
|
||||||
return False
|
return False
|
||||||
|
if self.assigned_user_secondary_id.data and self.assigned_user_secondary_id.data == self.assigned_user_id.data:
|
||||||
|
self.assigned_user_secondary_id.errors.append("Bitte wähle hier eine andere Person oder keine zweite Person.")
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+47
-3
@@ -35,12 +35,24 @@ class User(UserMixin, TimestampMixin, db.Model):
|
|||||||
backref="default_assigned_user",
|
backref="default_assigned_user",
|
||||||
lazy=True,
|
lazy=True,
|
||||||
)
|
)
|
||||||
|
secondary_assigned_task_templates = db.relationship(
|
||||||
|
"TaskTemplate",
|
||||||
|
foreign_keys="TaskTemplate.default_assigned_user_secondary_id",
|
||||||
|
backref="default_assigned_user_secondary",
|
||||||
|
lazy=True,
|
||||||
|
)
|
||||||
assigned_tasks = db.relationship(
|
assigned_tasks = db.relationship(
|
||||||
"TaskInstance",
|
"TaskInstance",
|
||||||
foreign_keys="TaskInstance.assigned_user_id",
|
foreign_keys="TaskInstance.assigned_user_id",
|
||||||
backref="assigned_user",
|
backref="assigned_user",
|
||||||
lazy=True,
|
lazy=True,
|
||||||
)
|
)
|
||||||
|
secondary_assigned_tasks = db.relationship(
|
||||||
|
"TaskInstance",
|
||||||
|
foreign_keys="TaskInstance.assigned_user_secondary_id",
|
||||||
|
backref="assigned_user_secondary",
|
||||||
|
lazy=True,
|
||||||
|
)
|
||||||
completed_tasks = db.relationship(
|
completed_tasks = db.relationship(
|
||||||
"TaskInstance",
|
"TaskInstance",
|
||||||
foreign_keys="TaskInstance.completed_by_user_id",
|
foreign_keys="TaskInstance.completed_by_user_id",
|
||||||
@@ -87,6 +99,7 @@ class TaskTemplate(TimestampMixin, db.Model):
|
|||||||
description = db.Column(db.Text, nullable=True)
|
description = db.Column(db.Text, nullable=True)
|
||||||
default_points = db.Column(db.Integer, nullable=False, default=10)
|
default_points = db.Column(db.Integer, nullable=False, default=10)
|
||||||
default_assigned_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True)
|
default_assigned_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True)
|
||||||
|
default_assigned_user_secondary_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True)
|
||||||
recurrence_interval_value = db.Column(db.Integer, nullable=True)
|
recurrence_interval_value = db.Column(db.Integer, nullable=True)
|
||||||
recurrence_interval_unit = db.Column(db.String(20), nullable=False, default="none")
|
recurrence_interval_unit = db.Column(db.String(20), nullable=False, default="none")
|
||||||
active = db.Column(db.Boolean, nullable=False, default=True)
|
active = db.Column(db.Boolean, nullable=False, default=True)
|
||||||
@@ -113,6 +126,7 @@ class QuickWin(TimestampMixin, db.Model):
|
|||||||
effort = db.Column(db.String(40), nullable=False, index=True)
|
effort = db.Column(db.String(40), nullable=False, index=True)
|
||||||
active = db.Column(db.Boolean, nullable=False, default=True)
|
active = db.Column(db.Boolean, nullable=False, default=True)
|
||||||
created_by_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False, index=True)
|
created_by_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False, index=True)
|
||||||
|
sort_order = db.Column(db.Integer, nullable=False, default=0, index=True)
|
||||||
|
|
||||||
|
|
||||||
class TaskInstance(TimestampMixin, db.Model):
|
class TaskInstance(TimestampMixin, db.Model):
|
||||||
@@ -121,6 +135,7 @@ class TaskInstance(TimestampMixin, db.Model):
|
|||||||
title = db.Column(db.String(160), nullable=False)
|
title = db.Column(db.String(160), nullable=False)
|
||||||
description = db.Column(db.Text, nullable=True)
|
description = db.Column(db.Text, nullable=True)
|
||||||
assigned_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True, index=True)
|
assigned_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True, index=True)
|
||||||
|
assigned_user_secondary_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True, index=True)
|
||||||
due_date = db.Column(db.Date, nullable=False, index=True)
|
due_date = db.Column(db.Date, nullable=False, index=True)
|
||||||
status = db.Column(db.String(20), nullable=False, default="open", index=True)
|
status = db.Column(db.String(20), nullable=False, default="open", index=True)
|
||||||
completed_at = db.Column(db.DateTime, nullable=True, index=True)
|
completed_at = db.Column(db.DateTime, nullable=True, index=True)
|
||||||
@@ -131,21 +146,50 @@ class TaskInstance(TimestampMixin, db.Model):
|
|||||||
def is_completed(self) -> bool:
|
def is_completed(self) -> bool:
|
||||||
return self.completed_at is not None
|
return self.completed_at is not None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def assigned_users(self) -> list[User]:
|
||||||
|
users: list[User] = []
|
||||||
|
if self.assigned_user:
|
||||||
|
users.append(self.assigned_user)
|
||||||
|
if self.assigned_user_secondary and self.assigned_user_secondary.id not in {user.id for user in users}:
|
||||||
|
users.append(self.assigned_user_secondary)
|
||||||
|
return users
|
||||||
|
|
||||||
|
@property
|
||||||
|
def assigned_user_ids(self) -> list[int]:
|
||||||
|
return [user.id for user in self.assigned_users]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_shared_assignment(self) -> bool:
|
||||||
|
return self.assigned_user_id is not None and self.assigned_user_secondary_id is not None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def assignee_label(self) -> str:
|
||||||
|
if not self.assigned_users:
|
||||||
|
return "Ohne Person"
|
||||||
|
return " & ".join(user.name for user in self.assigned_users)
|
||||||
|
|
||||||
def compute_status(self, reference_date: date | None = None) -> str:
|
def compute_status(self, reference_date: date | None = None) -> str:
|
||||||
reference_date = reference_date or date.today()
|
reference_date = reference_date or date.today()
|
||||||
if self.completed_at:
|
if self.completed_at:
|
||||||
return "completed"
|
return "completed"
|
||||||
if self.due_date < reference_date:
|
if self.due_date < reference_date:
|
||||||
return "overdue"
|
return "overdue"
|
||||||
if self.due_date <= reference_date + timedelta(days=2):
|
if self.due_date == reference_date:
|
||||||
return "soon"
|
return "due_today"
|
||||||
|
if self.due_date == reference_date + timedelta(days=1):
|
||||||
|
return "due_tomorrow"
|
||||||
|
if self.due_date == reference_date + timedelta(days=2):
|
||||||
|
return "due_day_after_tomorrow"
|
||||||
return "open"
|
return "open"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status_label(self) -> str:
|
def status_label(self) -> str:
|
||||||
labels = {
|
labels = {
|
||||||
"open": "Offen",
|
"open": "Offen",
|
||||||
"soon": "Bald fällig",
|
"due_today": "Bald fällig",
|
||||||
|
"due_tomorrow": "Morgen fällig",
|
||||||
|
"due_day_after_tomorrow": "Übermorgen fällig",
|
||||||
"overdue": "Überfällig",
|
"overdue": "Überfällig",
|
||||||
"completed": "Erledigt",
|
"completed": "Erledigt",
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-1
@@ -5,6 +5,7 @@ from uuid import uuid4
|
|||||||
|
|
||||||
from flask import Blueprint, current_app, flash, jsonify, redirect, render_template, request, url_for
|
from flask import Blueprint, current_app, flash, jsonify, redirect, render_template, request, url_for
|
||||||
from flask_login import current_user, login_required
|
from flask_login import current_user, login_required
|
||||||
|
from sqlalchemy import func
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
from ..extensions import csrf, db
|
from ..extensions import csrf, db
|
||||||
@@ -109,6 +110,7 @@ def quick_wins():
|
|||||||
effort=quick_win_form.effort.data,
|
effort=quick_win_form.effort.data,
|
||||||
active=True,
|
active=True,
|
||||||
created_by_user_id=current_user.id,
|
created_by_user_id=current_user.id,
|
||||||
|
sort_order=(db.session.query(func.max(QuickWin.sort_order)).scalar() or -1) + 1,
|
||||||
)
|
)
|
||||||
db.session.add(quick_win)
|
db.session.add(quick_win)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
@@ -120,7 +122,7 @@ def quick_wins():
|
|||||||
quick_win_form=quick_win_form,
|
quick_win_form=quick_win_form,
|
||||||
quick_task_config_form=quick_task_config_form,
|
quick_task_config_form=quick_task_config_form,
|
||||||
quick_task_config=quick_task_config,
|
quick_task_config=quick_task_config,
|
||||||
quick_wins=QuickWin.query.filter_by(active=True).order_by(QuickWin.id.asc()).all(),
|
quick_wins=QuickWin.query.filter_by(active=True).order_by(QuickWin.sort_order.asc(), QuickWin.id.asc()).all(),
|
||||||
settings_tabs=_settings_tabs(),
|
settings_tabs=_settings_tabs(),
|
||||||
active_settings_tab="settings.quick_wins",
|
active_settings_tab="settings.quick_wins",
|
||||||
)
|
)
|
||||||
@@ -268,6 +270,38 @@ def update_quick_win(quick_win_id: int):
|
|||||||
return redirect(url_for("settings.quick_wins"))
|
return redirect(url_for("settings.quick_wins"))
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/quick-wins/reorder", methods=["POST"])
|
||||||
|
@login_required
|
||||||
|
@csrf.exempt
|
||||||
|
def reorder_quick_wins():
|
||||||
|
payload = request.get_json(silent=True)
|
||||||
|
if payload is not None:
|
||||||
|
raw_ids = payload.get("ids", [])
|
||||||
|
else:
|
||||||
|
raw_ids = request.form.get("ids", "").split(",")
|
||||||
|
ordered_ids = [int(item) for item in raw_ids if str(item).isdigit()]
|
||||||
|
|
||||||
|
quick_wins = QuickWin.query.filter_by(active=True).all()
|
||||||
|
quick_wins_by_id = {quick_win.id: quick_win for quick_win in quick_wins}
|
||||||
|
|
||||||
|
for position, quick_win_id in enumerate(ordered_ids):
|
||||||
|
quick_win = quick_wins_by_id.get(quick_win_id)
|
||||||
|
if quick_win:
|
||||||
|
quick_win.sort_order = position
|
||||||
|
|
||||||
|
used_ids = set(ordered_ids)
|
||||||
|
remaining = [quick_win for quick_win in quick_wins if quick_win.id not in used_ids]
|
||||||
|
for offset, quick_win in enumerate(sorted(remaining, key=lambda item: (item.sort_order, item.id)), start=len(ordered_ids)):
|
||||||
|
quick_win.sort_order = offset
|
||||||
|
|
||||||
|
db.session.commit()
|
||||||
|
if payload is not None:
|
||||||
|
return jsonify({"ok": True})
|
||||||
|
|
||||||
|
flash("Die Quick-Win-Reihenfolge wurde gespeichert.", "success")
|
||||||
|
return redirect(url_for("settings.quick_wins"))
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/users/<int:user_id>/toggle-admin", methods=["POST"])
|
@bp.route("/users/<int:user_id>/toggle-admin", methods=["POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def toggle_admin(user_id: int):
|
def toggle_admin(user_id: int):
|
||||||
@@ -308,7 +342,9 @@ def delete_user(user_id: int):
|
|||||||
return redirect(url_for("settings.index"))
|
return redirect(url_for("settings.index"))
|
||||||
|
|
||||||
TaskTemplate.query.filter_by(default_assigned_user_id=user.id).update({"default_assigned_user_id": None})
|
TaskTemplate.query.filter_by(default_assigned_user_id=user.id).update({"default_assigned_user_id": None})
|
||||||
|
TaskTemplate.query.filter_by(default_assigned_user_secondary_id=user.id).update({"default_assigned_user_secondary_id": None})
|
||||||
TaskInstance.query.filter_by(assigned_user_id=user.id).update({"assigned_user_id": None})
|
TaskInstance.query.filter_by(assigned_user_id=user.id).update({"assigned_user_id": None})
|
||||||
|
TaskInstance.query.filter_by(assigned_user_secondary_id=user.id).update({"assigned_user_secondary_id": None})
|
||||||
TaskInstance.query.filter_by(completed_by_user_id=user.id).update({"completed_by_user_id": None})
|
TaskInstance.query.filter_by(completed_by_user_id=user.id).update({"completed_by_user_id": None})
|
||||||
MonthlyScoreSnapshot.query.filter_by(user_id=user.id).delete()
|
MonthlyScoreSnapshot.query.filter_by(user_id=user.id).delete()
|
||||||
NotificationLog.query.filter_by(user_id=user.id).delete()
|
NotificationLog.query.filter_by(user_id=user.id).delete()
|
||||||
|
|||||||
+81
-14
@@ -6,6 +6,7 @@ from datetime import date
|
|||||||
|
|
||||||
from flask import Blueprint, flash, redirect, render_template, request, url_for
|
from flask import Blueprint, flash, redirect, render_template, request, url_for
|
||||||
from flask_login import current_user, login_required
|
from flask_login import current_user, login_required
|
||||||
|
from sqlalchemy import or_
|
||||||
|
|
||||||
from ..forms import QuickTaskForm, TaskForm
|
from ..forms import QuickTaskForm, TaskForm
|
||||||
from ..models import QuickWin, TaskInstance, User
|
from ..models import QuickWin, TaskInstance, User
|
||||||
@@ -15,6 +16,7 @@ from ..services.tasks import (
|
|||||||
complete_task,
|
complete_task,
|
||||||
create_quick_task,
|
create_quick_task,
|
||||||
create_task_template_and_instance,
|
create_task_template_and_instance,
|
||||||
|
delete_task_instance,
|
||||||
refresh_task_statuses,
|
refresh_task_statuses,
|
||||||
update_template_and_instance,
|
update_template_and_instance,
|
||||||
)
|
)
|
||||||
@@ -27,22 +29,44 @@ def _user_choices() -> list[tuple[int, str]]:
|
|||||||
return [(user.id, user.name) for user in User.query.order_by(User.name.asc()).all()]
|
return [(user.id, user.name) for user in User.query.order_by(User.name.asc()).all()]
|
||||||
|
|
||||||
|
|
||||||
|
def _secondary_user_choices() -> list[tuple[int, str]]:
|
||||||
|
return [(0, "Keine zweite Person")] + _user_choices()
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/my-tasks")
|
@bp.route("/my-tasks")
|
||||||
@login_required
|
@login_required
|
||||||
def my_tasks():
|
def my_tasks():
|
||||||
tasks = (
|
tasks = (
|
||||||
TaskInstance.query.filter_by(assigned_user_id=current_user.id)
|
TaskInstance.query.filter(
|
||||||
|
or_(
|
||||||
|
TaskInstance.assigned_user_id == current_user.id,
|
||||||
|
TaskInstance.assigned_user_secondary_id == current_user.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
.order_by(TaskInstance.completed_at.is_(None).desc(), TaskInstance.due_date.asc())
|
.order_by(TaskInstance.completed_at.is_(None).desc(), TaskInstance.due_date.asc())
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
refresh_task_statuses(tasks)
|
refresh_task_statuses(tasks)
|
||||||
|
|
||||||
sections = {"open": [], "soon": [], "overdue": [], "completed": []}
|
sections = {
|
||||||
|
"open": [],
|
||||||
|
"due_today": [],
|
||||||
|
"due_tomorrow": [],
|
||||||
|
"due_day_after_tomorrow": [],
|
||||||
|
"overdue": [],
|
||||||
|
"completed": [],
|
||||||
|
}
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
sections[task.status].append(task)
|
sections[task.status].append(task)
|
||||||
|
|
||||||
completed_count = len(sections["completed"])
|
completed_count = len(sections["completed"])
|
||||||
active_count = len(sections["open"]) + len(sections["soon"]) + len(sections["overdue"])
|
active_count = (
|
||||||
|
len(sections["open"])
|
||||||
|
+ len(sections["due_today"])
|
||||||
|
+ len(sections["due_tomorrow"])
|
||||||
|
+ len(sections["due_day_after_tomorrow"])
|
||||||
|
+ len(sections["overdue"])
|
||||||
|
)
|
||||||
completion_ratio = 0 if completed_count + active_count == 0 else round(completed_count / (completed_count + active_count) * 100)
|
completion_ratio = 0 if completed_count + active_count == 0 else round(completed_count / (completed_count + active_count) * 100)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
@@ -63,9 +87,19 @@ def all_tasks():
|
|||||||
sort = request.args.get("sort", "due")
|
sort = request.args.get("sort", "due")
|
||||||
|
|
||||||
if mine == "1":
|
if mine == "1":
|
||||||
query = query.filter(TaskInstance.assigned_user_id == current_user.id)
|
query = query.filter(
|
||||||
|
or_(
|
||||||
|
TaskInstance.assigned_user_id == current_user.id,
|
||||||
|
TaskInstance.assigned_user_secondary_id == current_user.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
elif user_filter:
|
elif user_filter:
|
||||||
query = query.filter(TaskInstance.assigned_user_id == user_filter)
|
query = query.filter(
|
||||||
|
or_(
|
||||||
|
TaskInstance.assigned_user_id == user_filter,
|
||||||
|
TaskInstance.assigned_user_secondary_id == user_filter,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if sort == "points":
|
if sort == "points":
|
||||||
query = query.order_by(TaskInstance.points_awarded.desc(), TaskInstance.due_date.asc())
|
query = query.order_by(TaskInstance.points_awarded.desc(), TaskInstance.due_date.asc())
|
||||||
@@ -78,10 +112,20 @@ def all_tasks():
|
|||||||
refresh_task_statuses(tasks)
|
refresh_task_statuses(tasks)
|
||||||
|
|
||||||
if status != "all":
|
if status != "all":
|
||||||
status_map = {"completed": "completed", "overdue": "overdue", "open": "open", "soon": "soon"}
|
if status == "soon":
|
||||||
selected = status_map.get(status)
|
tasks = [task for task in tasks if task.status in {"due_today", "due_tomorrow", "due_day_after_tomorrow"}]
|
||||||
if selected:
|
else:
|
||||||
tasks = [task for task in tasks if task.status == selected]
|
status_map = {
|
||||||
|
"completed": "completed",
|
||||||
|
"overdue": "overdue",
|
||||||
|
"open": "open",
|
||||||
|
"today": "due_today",
|
||||||
|
"tomorrow": "due_tomorrow",
|
||||||
|
"day_after_tomorrow": "due_day_after_tomorrow",
|
||||||
|
}
|
||||||
|
selected = status_map.get(status)
|
||||||
|
if selected:
|
||||||
|
tasks = [task for task in tasks if task.status == selected]
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"tasks/all_tasks.html",
|
"tasks/all_tasks.html",
|
||||||
@@ -96,6 +140,7 @@ def all_tasks():
|
|||||||
def create():
|
def create():
|
||||||
form = TaskForm()
|
form = TaskForm()
|
||||||
form.assigned_user_id.choices = _user_choices()
|
form.assigned_user_id.choices = _user_choices()
|
||||||
|
form.assigned_user_secondary_id.choices = _secondary_user_choices()
|
||||||
if request.method == "GET" and not form.due_date.data:
|
if request.method == "GET" and not form.due_date.data:
|
||||||
form.due_date.data = today_local()
|
form.due_date.data = today_local()
|
||||||
|
|
||||||
@@ -157,12 +202,15 @@ def edit(task_id: int):
|
|||||||
task = TaskInstance.query.get_or_404(task_id)
|
task = TaskInstance.query.get_or_404(task_id)
|
||||||
form = TaskForm(obj=task.task_template)
|
form = TaskForm(obj=task.task_template)
|
||||||
form.assigned_user_id.choices = _user_choices()
|
form.assigned_user_id.choices = _user_choices()
|
||||||
|
form.assigned_user_secondary_id.choices = _secondary_user_choices()
|
||||||
|
next_url = request.args.get("next") or request.form.get("next") or request.referrer or url_for("tasks.all_tasks")
|
||||||
|
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
form.title.data = task.title
|
form.title.data = task.title
|
||||||
form.description.data = task.description
|
form.description.data = task.description
|
||||||
form.default_points.data = task.points_awarded
|
form.default_points.data = task.task_template.default_points
|
||||||
form.assigned_user_id.data = task.assigned_user_id or _user_choices()[0][0]
|
form.assigned_user_id.data = task.assigned_user_id or _user_choices()[0][0]
|
||||||
|
form.assigned_user_secondary_id.data = task.assigned_user_secondary_id or 0
|
||||||
form.due_date.data = task.due_date
|
form.due_date.data = task.due_date
|
||||||
form.recurrence_interval_value.data = task.task_template.recurrence_interval_value or 1
|
form.recurrence_interval_value.data = task.task_template.recurrence_interval_value or 1
|
||||||
form.recurrence_interval_unit.data = task.task_template.recurrence_interval_unit
|
form.recurrence_interval_unit.data = task.task_template.recurrence_interval_unit
|
||||||
@@ -171,9 +219,21 @@ def edit(task_id: int):
|
|||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
update_template_and_instance(task, form)
|
update_template_and_instance(task, form)
|
||||||
flash("Aufgabe und Vorlage wurden aktualisiert.", "success")
|
flash("Aufgabe und Vorlage wurden aktualisiert.", "success")
|
||||||
return redirect(url_for("tasks.all_tasks"))
|
return redirect(next_url)
|
||||||
|
|
||||||
return render_template("tasks/task_form.html", form=form, mode="edit", task=task)
|
return render_template("tasks/task_form.html", form=form, mode="edit", task=task, next_url=next_url)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/tasks/<int:task_id>/delete", methods=["POST"])
|
||||||
|
@login_required
|
||||||
|
def delete(task_id: int):
|
||||||
|
task = TaskInstance.query.get_or_404(task_id)
|
||||||
|
title = task.title
|
||||||
|
next_url = request.form.get("next") or url_for("tasks.all_tasks")
|
||||||
|
|
||||||
|
delete_task_instance(task)
|
||||||
|
flash(f"Aufgabe „{title}“ wurde gelöscht.", "success")
|
||||||
|
return redirect(next_url)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/tasks/<int:task_id>/complete", methods=["POST"])
|
@bp.route("/tasks/<int:task_id>/complete", methods=["POST"])
|
||||||
@@ -186,8 +246,15 @@ def complete(task_id: int):
|
|||||||
return redirect(request.referrer or url_for("tasks.my_tasks"))
|
return redirect(request.referrer or url_for("tasks.my_tasks"))
|
||||||
|
|
||||||
completed_by_id = current_user.id
|
completed_by_id = current_user.id
|
||||||
if task.assigned_user_id and task.assigned_user_id != current_user.id and choice == "assigned":
|
allowed_ids = {current_user.id}
|
||||||
completed_by_id = task.assigned_user_id
|
if task.assigned_user_id:
|
||||||
|
allowed_ids.add(task.assigned_user_id)
|
||||||
|
if task.assigned_user_secondary_id:
|
||||||
|
allowed_ids.add(task.assigned_user_secondary_id)
|
||||||
|
if choice != "me":
|
||||||
|
selected_user_id = request.form.get("completed_for", type=int)
|
||||||
|
if selected_user_id in allowed_ids:
|
||||||
|
completed_by_id = selected_user_id
|
||||||
|
|
||||||
complete_task(task, completed_by_id)
|
complete_task(task, completed_by_id)
|
||||||
flash("Punkte verbucht. Gute Arbeit.", "success")
|
flash("Punkte verbucht. Gute Arbeit.", "success")
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import json
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import date, datetime, time, timedelta
|
from datetime import date, datetime, time, timedelta
|
||||||
|
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_, or_
|
||||||
|
|
||||||
from ..extensions import db
|
from ..extensions import db
|
||||||
from ..models import BadgeDefinition, MonthlyScoreSnapshot, TaskInstance, User, UserBadge
|
from ..models import BadgeDefinition, MonthlyScoreSnapshot, TaskInstance, User, UserBadge
|
||||||
@@ -92,7 +92,7 @@ def _completion_metrics(user: User) -> dict[str, int]:
|
|||||||
metrics["on_time_tasks_completed"] += 1
|
metrics["on_time_tasks_completed"] += 1
|
||||||
if completion_day <= task.due_date - timedelta(days=1):
|
if completion_day <= task.due_date - timedelta(days=1):
|
||||||
metrics["early_tasks_completed"] += 1
|
metrics["early_tasks_completed"] += 1
|
||||||
if task.assigned_user_id and task.assigned_user_id != user.id:
|
if task.assigned_user_ids and user.id not in task.assigned_user_ids:
|
||||||
metrics["foreign_tasks_completed"] += 1
|
metrics["foreign_tasks_completed"] += 1
|
||||||
max_points = max(max_points, task.points_awarded)
|
max_points = max(max_points, task.points_awarded)
|
||||||
|
|
||||||
@@ -127,7 +127,10 @@ def _user_had_clean_month(user_id: int, year: int, month: int) -> bool:
|
|||||||
start_date = date(year, month, 1)
|
start_date = date(year, month, 1)
|
||||||
end_date = (month_bounds(year, month)[1] - timedelta(days=1)).date()
|
end_date = (month_bounds(year, month)[1] - timedelta(days=1)).date()
|
||||||
tasks = TaskInstance.query.filter(
|
tasks = TaskInstance.query.filter(
|
||||||
TaskInstance.assigned_user_id == user_id,
|
or_(
|
||||||
|
TaskInstance.assigned_user_id == user_id,
|
||||||
|
TaskInstance.assigned_user_secondary_id == user_id,
|
||||||
|
),
|
||||||
TaskInstance.due_date >= start_date,
|
TaskInstance.due_date >= start_date,
|
||||||
TaskInstance.due_date <= end_date,
|
TaskInstance.due_date <= end_date,
|
||||||
).all()
|
).all()
|
||||||
|
|||||||
@@ -21,6 +21,21 @@ def ensure_schema_and_admins() -> None:
|
|||||||
db.session.execute(text("ALTER TABLE user ADD COLUMN calendar_feed_token VARCHAR(255)"))
|
db.session.execute(text("ALTER TABLE user ADD COLUMN calendar_feed_token VARCHAR(255)"))
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
task_template_columns = {column["name"] for column in inspector.get_columns("task_template")}
|
||||||
|
if "default_assigned_user_secondary_id" not in task_template_columns:
|
||||||
|
db.session.execute(text("ALTER TABLE task_template ADD COLUMN default_assigned_user_secondary_id INTEGER"))
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
task_instance_columns = {column["name"] for column in inspector.get_columns("task_instance")}
|
||||||
|
if "assigned_user_secondary_id" not in task_instance_columns:
|
||||||
|
db.session.execute(text("ALTER TABLE task_instance ADD COLUMN assigned_user_secondary_id INTEGER"))
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
quick_win_columns = {column["name"] for column in inspector.get_columns("quick_win")}
|
||||||
|
if "sort_order" not in quick_win_columns:
|
||||||
|
db.session.execute(text("ALTER TABLE quick_win ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0"))
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
ensure_app_settings()
|
ensure_app_settings()
|
||||||
|
|
||||||
users_without_feed = User.query.filter(User.calendar_feed_token.is_(None)).all()
|
users_without_feed = User.query.filter(User.calendar_feed_token.is_(None)).all()
|
||||||
@@ -46,6 +61,7 @@ def ensure_schema_and_admins() -> None:
|
|||||||
default_quick_win_user = first_user
|
default_quick_win_user = first_user
|
||||||
|
|
||||||
_ensure_default_quick_wins(default_quick_win_user or User.query.order_by(User.id.asc()).first())
|
_ensure_default_quick_wins(default_quick_win_user or User.query.order_by(User.id.asc()).first())
|
||||||
|
_ensure_quick_win_ordering()
|
||||||
|
|
||||||
|
|
||||||
def _ensure_default_quick_wins(default_user: User | None) -> None:
|
def _ensure_default_quick_wins(default_user: User | None) -> None:
|
||||||
@@ -62,6 +78,7 @@ def _ensure_default_quick_wins(default_user: User | None) -> None:
|
|||||||
|
|
||||||
existing_titles = {quick_win.title for quick_win in QuickWin.query.all()}
|
existing_titles = {quick_win.title for quick_win in QuickWin.query.all()}
|
||||||
created = False
|
created = False
|
||||||
|
next_sort_order = QuickWin.query.count()
|
||||||
for title, effort in defaults:
|
for title, effort in defaults:
|
||||||
if title not in existing_titles:
|
if title not in existing_titles:
|
||||||
db.session.add(
|
db.session.add(
|
||||||
@@ -70,8 +87,21 @@ def _ensure_default_quick_wins(default_user: User | None) -> None:
|
|||||||
effort=effort,
|
effort=effort,
|
||||||
active=True,
|
active=True,
|
||||||
created_by_user_id=default_user.id,
|
created_by_user_id=default_user.id,
|
||||||
|
sort_order=next_sort_order,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
next_sort_order += 1
|
||||||
created = True
|
created = True
|
||||||
if created:
|
if created:
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
def _ensure_quick_win_ordering() -> None:
|
||||||
|
quick_wins = QuickWin.query.order_by(QuickWin.sort_order.asc(), QuickWin.id.asc()).all()
|
||||||
|
dirty = False
|
||||||
|
for index, quick_win in enumerate(quick_wins):
|
||||||
|
if quick_win.sort_order != index:
|
||||||
|
quick_win.sort_order = index
|
||||||
|
dirty = True
|
||||||
|
if dirty:
|
||||||
|
db.session.commit()
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from datetime import UTC, datetime, time, timedelta
|
from datetime import UTC, datetime, time, timedelta
|
||||||
|
|
||||||
|
from sqlalchemy import or_
|
||||||
|
|
||||||
from ..models import TaskInstance, User
|
from ..models import TaskInstance, User
|
||||||
|
|
||||||
|
|
||||||
@@ -23,7 +25,12 @@ def _format_timestamp(value: datetime | None) -> str:
|
|||||||
|
|
||||||
def build_calendar_feed(user: User, base_url: str) -> str:
|
def build_calendar_feed(user: User, base_url: str) -> str:
|
||||||
tasks = (
|
tasks = (
|
||||||
TaskInstance.query.filter_by(assigned_user_id=user.id)
|
TaskInstance.query.filter(
|
||||||
|
or_(
|
||||||
|
TaskInstance.assigned_user_id == user.id,
|
||||||
|
TaskInstance.assigned_user_secondary_id == user.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
.order_by(TaskInstance.due_date.asc(), TaskInstance.id.asc())
|
.order_by(TaskInstance.due_date.asc(), TaskInstance.id.asc())
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
|||||||
+32
-3
@@ -25,12 +25,19 @@ def refresh_task_statuses(tasks: list[TaskInstance]) -> None:
|
|||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
def effective_points(base_points: int, assigned_user_secondary_id: int | None) -> int:
|
||||||
|
if assigned_user_secondary_id:
|
||||||
|
return max(1, base_points // 2)
|
||||||
|
return base_points
|
||||||
|
|
||||||
|
|
||||||
def create_task_template_and_instance(form) -> TaskInstance:
|
def create_task_template_and_instance(form) -> TaskInstance:
|
||||||
template = TaskTemplate(
|
template = TaskTemplate(
|
||||||
title=form.title.data.strip(),
|
title=form.title.data.strip(),
|
||||||
description=(form.description.data or "").strip(),
|
description=(form.description.data or "").strip(),
|
||||||
default_points=form.default_points.data,
|
default_points=form.default_points.data,
|
||||||
default_assigned_user_id=form.assigned_user_id.data,
|
default_assigned_user_id=form.assigned_user_id.data,
|
||||||
|
default_assigned_user_secondary_id=form.assigned_user_secondary_id.data or None,
|
||||||
recurrence_interval_value=form.recurrence_interval_value.data if form.recurrence_interval_unit.data != "none" else None,
|
recurrence_interval_value=form.recurrence_interval_value.data if form.recurrence_interval_unit.data != "none" else None,
|
||||||
recurrence_interval_unit=form.recurrence_interval_unit.data,
|
recurrence_interval_unit=form.recurrence_interval_unit.data,
|
||||||
active=form.active.data,
|
active=form.active.data,
|
||||||
@@ -43,8 +50,9 @@ def create_task_template_and_instance(form) -> TaskInstance:
|
|||||||
title=template.title,
|
title=template.title,
|
||||||
description=template.description,
|
description=template.description,
|
||||||
assigned_user_id=template.default_assigned_user_id,
|
assigned_user_id=template.default_assigned_user_id,
|
||||||
|
assigned_user_secondary_id=template.default_assigned_user_secondary_id,
|
||||||
due_date=form.due_date.data,
|
due_date=form.due_date.data,
|
||||||
points_awarded=template.default_points,
|
points_awarded=effective_points(template.default_points, template.default_assigned_user_secondary_id),
|
||||||
status="open",
|
status="open",
|
||||||
)
|
)
|
||||||
refresh_task_status(task, form.due_date.data)
|
refresh_task_status(task, form.due_date.data)
|
||||||
@@ -59,6 +67,7 @@ def update_template_and_instance(task: TaskInstance, form) -> TaskInstance:
|
|||||||
template.description = (form.description.data or "").strip()
|
template.description = (form.description.data or "").strip()
|
||||||
template.default_points = form.default_points.data
|
template.default_points = form.default_points.data
|
||||||
template.default_assigned_user_id = form.assigned_user_id.data
|
template.default_assigned_user_id = form.assigned_user_id.data
|
||||||
|
template.default_assigned_user_secondary_id = form.assigned_user_secondary_id.data or None
|
||||||
template.recurrence_interval_unit = form.recurrence_interval_unit.data
|
template.recurrence_interval_unit = form.recurrence_interval_unit.data
|
||||||
template.recurrence_interval_value = (
|
template.recurrence_interval_value = (
|
||||||
form.recurrence_interval_value.data if form.recurrence_interval_unit.data != "none" else None
|
form.recurrence_interval_value.data if form.recurrence_interval_unit.data != "none" else None
|
||||||
@@ -68,7 +77,8 @@ def update_template_and_instance(task: TaskInstance, form) -> TaskInstance:
|
|||||||
task.title = template.title
|
task.title = template.title
|
||||||
task.description = template.description
|
task.description = template.description
|
||||||
task.assigned_user_id = template.default_assigned_user_id
|
task.assigned_user_id = template.default_assigned_user_id
|
||||||
task.points_awarded = template.default_points
|
task.assigned_user_secondary_id = template.default_assigned_user_secondary_id
|
||||||
|
task.points_awarded = effective_points(template.default_points, template.default_assigned_user_secondary_id)
|
||||||
task.due_date = form.due_date.data
|
task.due_date = form.due_date.data
|
||||||
refresh_task_status(task, form.due_date.data)
|
refresh_task_status(task, form.due_date.data)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
@@ -108,8 +118,12 @@ def ensure_next_recurring_task(task: TaskInstance) -> TaskInstance | None:
|
|||||||
title=task.task_template.title,
|
title=task.task_template.title,
|
||||||
description=task.task_template.description,
|
description=task.task_template.description,
|
||||||
assigned_user_id=task.task_template.default_assigned_user_id,
|
assigned_user_id=task.task_template.default_assigned_user_id,
|
||||||
|
assigned_user_secondary_id=task.task_template.default_assigned_user_secondary_id,
|
||||||
due_date=next_due,
|
due_date=next_due,
|
||||||
points_awarded=task.task_template.default_points,
|
points_awarded=effective_points(
|
||||||
|
task.task_template.default_points,
|
||||||
|
task.task_template.default_assigned_user_secondary_id,
|
||||||
|
),
|
||||||
status="open",
|
status="open",
|
||||||
)
|
)
|
||||||
refresh_task_status(next_task, today_local())
|
refresh_task_status(next_task, today_local())
|
||||||
@@ -149,6 +163,7 @@ def create_quick_task(title: str, effort: str, creator: User, description: str =
|
|||||||
title=template.title,
|
title=template.title,
|
||||||
description=description,
|
description=description,
|
||||||
assigned_user_id=creator.id,
|
assigned_user_id=creator.id,
|
||||||
|
assigned_user_secondary_id=None,
|
||||||
due_date=today_local(),
|
due_date=today_local(),
|
||||||
points_awarded=template.default_points,
|
points_awarded=template.default_points,
|
||||||
status="open",
|
status="open",
|
||||||
@@ -157,3 +172,17 @@ def create_quick_task(title: str, effort: str, creator: User, description: str =
|
|||||||
db.session.add(task)
|
db.session.add(task)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return task
|
return task
|
||||||
|
|
||||||
|
|
||||||
|
def delete_task_instance(task: TaskInstance) -> None:
|
||||||
|
template = task.task_template
|
||||||
|
db.session.delete(task)
|
||||||
|
db.session.flush()
|
||||||
|
|
||||||
|
remaining_instance = db.session.scalar(
|
||||||
|
select(TaskInstance.id).where(TaskInstance.task_template_id == template.id).limit(1)
|
||||||
|
)
|
||||||
|
if remaining_instance is None:
|
||||||
|
db.session.delete(template)
|
||||||
|
|
||||||
|
db.session.commit()
|
||||||
|
|||||||
+174
-9
@@ -161,8 +161,15 @@ p {
|
|||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.topbar > div {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.topbar h1 {
|
.topbar h1 {
|
||||||
font-size: clamp(1.9rem, 4vw, 2.9rem);
|
font-size: clamp(1.9rem, 4vw, 2.9rem);
|
||||||
|
min-width: 0;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
hyphens: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar-user {
|
.topbar-user {
|
||||||
@@ -387,6 +394,9 @@ p {
|
|||||||
.section-heading h2,
|
.section-heading h2,
|
||||||
.panel h2 {
|
.panel h2 {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
hyphens: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-heading__count,
|
.section-heading__count,
|
||||||
@@ -423,8 +433,37 @@ p {
|
|||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.task-card__top {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__title-block {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__top > div:first-child,
|
||||||
|
.task-card__title-block {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__title-block .chip-row {
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__top .icon-button {
|
||||||
|
align-self: flex-start;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.task-card h3 {
|
.task-card h3 {
|
||||||
font-size: 1.35rem;
|
font-size: 1.35rem;
|
||||||
|
line-height: 1.08;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
hyphens: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-card--compact {
|
.task-card--compact {
|
||||||
@@ -473,6 +512,9 @@ p {
|
|||||||
color: #1d4ed8;
|
color: #1d4ed8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-badge--due_today,
|
||||||
|
.status-badge--due_tomorrow,
|
||||||
|
.status-badge--due_day_after_tomorrow,
|
||||||
.status-badge--soon {
|
.status-badge--soon {
|
||||||
background: #fff3d6;
|
background: #fff3d6;
|
||||||
color: #b45309;
|
color: #b45309;
|
||||||
@@ -514,6 +556,16 @@ p {
|
|||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.task-assignee__avatars {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-assignee__avatars .avatar + .avatar {
|
||||||
|
margin-left: -10px;
|
||||||
|
border: 2px solid var(--surface-strong);
|
||||||
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 34px;
|
width: 34px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
@@ -578,6 +630,11 @@ p {
|
|||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button--danger {
|
||||||
|
border-color: rgba(225, 29, 72, 0.3);
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
.button--wide {
|
.button--wide {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -898,6 +955,9 @@ p {
|
|||||||
border-left: 4px solid #2563eb;
|
border-left: 4px solid #2563eb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar-task--due_today,
|
||||||
|
.calendar-task--due_tomorrow,
|
||||||
|
.calendar-task--due_day_after_tomorrow,
|
||||||
.calendar-task--soon {
|
.calendar-task--soon {
|
||||||
border-left: 4px solid #f59e0b;
|
border-left: 4px solid #f59e0b;
|
||||||
}
|
}
|
||||||
@@ -1050,6 +1110,12 @@ p {
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quick-win-list__toolbar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.quick-win-manage-card {
|
.quick-win-manage-card {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
@@ -1061,11 +1127,40 @@ p {
|
|||||||
|
|
||||||
.quick-win-manage-card {
|
.quick-win-manage-card {
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-manage-card.is-dragging {
|
||||||
|
opacity: 0.72;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-manage-form {
|
.quick-win-manage-form {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-manage-form[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-manage-card__summary {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-manage-card__title strong {
|
||||||
|
display: block;
|
||||||
|
font-size: 1.12rem;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-manage-card__drag {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-manage-card__actions {
|
.quick-win-manage-card__actions {
|
||||||
@@ -1112,6 +1207,9 @@ p {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-tag {
|
.quick-win-tag {
|
||||||
@@ -1134,15 +1232,15 @@ p {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: 10px 16px;
|
padding: 8px 13px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid rgba(132, 152, 190, 0.22);
|
border: 1px solid rgba(132, 152, 190, 0.22);
|
||||||
background: var(--surface-soft);
|
background: var(--surface-soft);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 0.97rem;
|
font-size: 0.9rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 1.2;
|
line-height: 1.1;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
|
transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -1183,34 +1281,94 @@ p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
.task-card {
|
||||||
|
gap: 14px;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__top {
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__title-block {
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__title-block .chip-row {
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card__top .icon-button {
|
||||||
|
width: 44px;
|
||||||
|
min-width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
border-radius: 14px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card h3 {
|
||||||
|
font-size: 1.15rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-panel h2 {
|
||||||
|
font-size: 1.85rem;
|
||||||
|
line-height: 1.08;
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-dialog__surface {
|
||||||
|
width: min(100vw - 16px, 410px);
|
||||||
|
max-width: calc(100vw - 16px);
|
||||||
|
padding: 18px 16px;
|
||||||
|
gap: 14px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.quick-win-dialog-header {
|
.quick-win-dialog-header {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-dialog-header__badge {
|
.quick-win-dialog-header__badge {
|
||||||
width: 48px;
|
width: 42px;
|
||||||
height: 48px;
|
height: 42px;
|
||||||
|
border-radius: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-dialog-header__badge svg {
|
||||||
|
width: 19px;
|
||||||
|
height: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-tag-grid {
|
.quick-win-tag-grid {
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-tag {
|
.quick-win-tag {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
flex: 0 1 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-tag span {
|
.quick-win-tag span {
|
||||||
width: auto;
|
width: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
white-space: normal;
|
padding: 6px 11px;
|
||||||
text-align: left;
|
font-size: 0.84rem;
|
||||||
justify-content: flex-start;
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-win-tag--custom span {
|
.quick-win-tag--custom span {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quick-win-list__toolbar {
|
||||||
|
justify-content: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-win-list__toolbar .button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.push-box__state {
|
.push-box__state {
|
||||||
@@ -1318,6 +1476,10 @@ p {
|
|||||||
|
|
||||||
.complete-dialog__surface--task {
|
.complete-dialog__surface--task {
|
||||||
width: min(520px, calc(100vw - 24px));
|
width: min(520px, calc(100vw - 24px));
|
||||||
|
max-width: calc(100vw - 24px);
|
||||||
|
overflow-x: hidden;
|
||||||
|
overscroll-behavior-x: contain;
|
||||||
|
touch-action: pan-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
.choice-grid {
|
.choice-grid {
|
||||||
@@ -1422,6 +1584,9 @@ p {
|
|||||||
color: #8db7ff;
|
color: #8db7ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-badge--due_today,
|
||||||
|
.status-badge--due_tomorrow,
|
||||||
|
.status-badge--due_day_after_tomorrow,
|
||||||
.status-badge--soon {
|
.status-badge--soon {
|
||||||
background: rgba(245, 158, 11, 0.18);
|
background: rgba(245, 158, 11, 0.18);
|
||||||
color: #ffd38a;
|
color: #ffd38a;
|
||||||
|
|||||||
+131
-9
@@ -3,6 +3,7 @@
|
|||||||
const dialogForm = document.getElementById("completeDialogForm");
|
const dialogForm = document.getElementById("completeDialogForm");
|
||||||
const dialogChoice = document.getElementById("completeDialogChoice");
|
const dialogChoice = document.getElementById("completeDialogChoice");
|
||||||
const dialogText = document.getElementById("completeDialogText");
|
const dialogText = document.getElementById("completeDialogText");
|
||||||
|
const dialogChoices = document.getElementById("completeDialogChoices");
|
||||||
const closeButton = document.getElementById("completeDialogClose");
|
const closeButton = document.getElementById("completeDialogClose");
|
||||||
const quickTaskDialog = document.getElementById("quickTaskDialog");
|
const quickTaskDialog = document.getElementById("quickTaskDialog");
|
||||||
const quickTaskOpen = document.getElementById("quickTaskOpen");
|
const quickTaskOpen = document.getElementById("quickTaskOpen");
|
||||||
@@ -13,23 +14,58 @@
|
|||||||
const quickWinCustomFields = document.getElementById("quickWinCustomFields");
|
const quickWinCustomFields = document.getElementById("quickWinCustomFields");
|
||||||
const quickWinTitle = document.getElementById("quick-title");
|
const quickWinTitle = document.getElementById("quick-title");
|
||||||
const quickWinEffort = document.getElementById("quick-effort");
|
const quickWinEffort = document.getElementById("quick-effort");
|
||||||
|
const currentUserId = document.body.dataset.currentUserId;
|
||||||
|
const currentUserName = document.body.dataset.currentUserName;
|
||||||
|
const quickWinSortList = document.querySelector("[data-quick-win-sort-list]");
|
||||||
|
const quickWinSortIds = document.getElementById("quickWinSortIds");
|
||||||
|
const quickWinSortSave = document.getElementById("quickWinSortSave");
|
||||||
|
const quickWinToggleButtons = document.querySelectorAll("[data-quick-win-toggle]");
|
||||||
|
let draggedQuickWin = null;
|
||||||
|
let quickWinSortDirty = false;
|
||||||
|
|
||||||
|
function buildCompletionOptions(button) {
|
||||||
|
const options = [];
|
||||||
|
const assignedPairs = [
|
||||||
|
[button.dataset.assignedPrimaryId, button.dataset.assignedPrimaryName],
|
||||||
|
[button.dataset.assignedSecondaryId, button.dataset.assignedSecondaryName],
|
||||||
|
];
|
||||||
|
|
||||||
|
assignedPairs.forEach(([id, label]) => {
|
||||||
|
if (id && label && !options.some((option) => option.value === id)) {
|
||||||
|
options.push({ value: id, label });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (currentUserId && currentUserName && !options.some((option) => option.value === currentUserId)) {
|
||||||
|
options.push({ value: currentUserId, label: "Ich" });
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelectorAll("[data-complete-action]").forEach((button) => {
|
document.querySelectorAll("[data-complete-action]").forEach((button) => {
|
||||||
button.addEventListener("click", () => {
|
button.addEventListener("click", () => {
|
||||||
if (!dialog || !dialogForm || !dialogChoice || !dialogText) {
|
if (!dialog || !dialogForm || !dialogChoice || !dialogText || !dialogChoices) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialogForm.action = button.dataset.completeAction;
|
dialogForm.action = button.dataset.completeAction;
|
||||||
dialogText.textContent = `Die Aufgabe "${button.dataset.completeTitle}" war ${button.dataset.completeAssigned} zugewiesen. Wer hat sie erledigt?`;
|
dialogText.textContent = `Die Aufgabe "${button.dataset.completeTitle}" war ${button.dataset.completeAssigned} zugewiesen. Wer hat sie erledigt?`;
|
||||||
dialog.showModal();
|
dialogChoices.innerHTML = "";
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
document.querySelectorAll("[data-complete-choice]").forEach((button) => {
|
buildCompletionOptions(button).forEach((option, index) => {
|
||||||
button.addEventListener("click", () => {
|
const choiceButton = document.createElement("button");
|
||||||
dialogChoice.value = button.dataset.completeChoice || "me";
|
choiceButton.type = "button";
|
||||||
dialog.close();
|
choiceButton.className = index === 0 ? "button button--secondary" : "button";
|
||||||
dialogForm.submit();
|
choiceButton.dataset.completeChoice = option.value;
|
||||||
|
choiceButton.textContent = option.label;
|
||||||
|
choiceButton.addEventListener("click", () => {
|
||||||
|
dialogChoice.value = option.value;
|
||||||
|
dialog.close();
|
||||||
|
dialogForm.submit();
|
||||||
|
});
|
||||||
|
dialogChoices.appendChild(choiceButton);
|
||||||
|
});
|
||||||
|
dialog.showModal();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -87,6 +123,92 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function syncQuickWinSortIds() {
|
||||||
|
if (!quickWinSortList || !quickWinSortIds) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ids = [...quickWinSortList.querySelectorAll("[data-quick-win-sort-item]")]
|
||||||
|
.map((item) => item.dataset.quickWinSortItem)
|
||||||
|
.filter(Boolean);
|
||||||
|
quickWinSortIds.value = ids.join(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
function setQuickWinSortDirty(isDirty) {
|
||||||
|
quickWinSortDirty = isDirty;
|
||||||
|
if (quickWinSortSave) {
|
||||||
|
quickWinSortSave.disabled = !isDirty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quickWinSortList) {
|
||||||
|
syncQuickWinSortIds();
|
||||||
|
setQuickWinSortDirty(false);
|
||||||
|
|
||||||
|
quickWinSortList.querySelectorAll("[data-quick-win-sort-item]").forEach((item) => {
|
||||||
|
item.addEventListener("dragstart", () => {
|
||||||
|
draggedQuickWin = item;
|
||||||
|
item.classList.add("is-dragging");
|
||||||
|
});
|
||||||
|
|
||||||
|
item.addEventListener("dragend", () => {
|
||||||
|
item.classList.remove("is-dragging");
|
||||||
|
draggedQuickWin = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
item.addEventListener("dragover", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
item.addEventListener("drop", async (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
if (!draggedQuickWin || draggedQuickWin === item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = [...quickWinSortList.querySelectorAll("[data-quick-win-sort-item]")];
|
||||||
|
const draggedIndex = items.indexOf(draggedQuickWin);
|
||||||
|
const targetIndex = items.indexOf(item);
|
||||||
|
if (draggedIndex < targetIndex) {
|
||||||
|
item.after(draggedQuickWin);
|
||||||
|
} else {
|
||||||
|
item.before(draggedQuickWin);
|
||||||
|
}
|
||||||
|
syncQuickWinSortIds();
|
||||||
|
setQuickWinSortDirty(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
quickWinToggleButtons.forEach((button) => {
|
||||||
|
button.addEventListener("click", () => {
|
||||||
|
const targetId = button.dataset.target;
|
||||||
|
if (!targetId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const target = document.getElementById(targetId);
|
||||||
|
if (!target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const willOpen = target.hidden;
|
||||||
|
|
||||||
|
document.querySelectorAll("[data-quick-win-edit]").forEach((editForm) => {
|
||||||
|
editForm.hidden = true;
|
||||||
|
});
|
||||||
|
quickWinToggleButtons.forEach((toggle) => {
|
||||||
|
toggle.setAttribute("aria-expanded", "false");
|
||||||
|
toggle.textContent = "Bearbeiten";
|
||||||
|
});
|
||||||
|
|
||||||
|
if (willOpen) {
|
||||||
|
target.hidden = false;
|
||||||
|
button.setAttribute("aria-expanded", "true");
|
||||||
|
button.textContent = "Schließen";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const pushButton = document.getElementById("pushToggle");
|
const pushButton = document.getElementById("pushToggle");
|
||||||
const pushHint = document.getElementById("pushHint");
|
const pushHint = document.getElementById("pushHint");
|
||||||
const vapidKey = document.body.dataset.pushKey;
|
const vapidKey = document.body.dataset.pushKey;
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
<link rel="apple-touch-icon" href="{{ url_for('static', filename='images/apple-touch-icon.png') }}">
|
<link rel="apple-touch-icon" href="{{ url_for('static', filename='images/apple-touch-icon.png') }}">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css', v=asset_version('css/style.css')) }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css', v=asset_version('css/style.css')) }}">
|
||||||
</head>
|
</head>
|
||||||
<body data-push-key="{{ config['VAPID_PUBLIC_KEY'] if current_user.is_authenticated else '' }}">
|
<body
|
||||||
|
data-push-key="{{ config['VAPID_PUBLIC_KEY'] if current_user.is_authenticated else '' }}"
|
||||||
|
data-current-user-id="{{ current_user.id if current_user.is_authenticated else '' }}"
|
||||||
|
data-current-user-name="{{ current_user.name if current_user.is_authenticated else '' }}"
|
||||||
|
>
|
||||||
{% from "partials/macros.html" import nav_icon %}
|
{% from "partials/macros.html" import nav_icon %}
|
||||||
<div class="app-shell {% if not current_user.is_authenticated %}app-shell--auth{% endif %}">
|
<div class="app-shell {% if not current_user.is_authenticated %}app-shell--auth{% endif %}">
|
||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
@@ -119,10 +123,7 @@
|
|||||||
<p class="eyebrow">Punkte fair verbuchen</p>
|
<p class="eyebrow">Punkte fair verbuchen</p>
|
||||||
<h2>Wer hat diese Aufgabe erledigt?</h2>
|
<h2>Wer hat diese Aufgabe erledigt?</h2>
|
||||||
<p id="completeDialogText">Bitte wähle aus, wem die Punkte gutgeschrieben werden sollen.</p>
|
<p id="completeDialogText">Bitte wähle aus, wem die Punkte gutgeschrieben werden sollen.</p>
|
||||||
<div class="choice-grid">
|
<div class="choice-grid" id="completeDialogChoices"></div>
|
||||||
<button type="button" class="button button--secondary" data-complete-choice="assigned">Zugewiesene Person</button>
|
|
||||||
<button type="button" class="button" data-complete-choice="me">Ich</button>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="button button--ghost" id="completeDialogClose">Abbrechen</button>
|
<button type="button" class="button button--ghost" id="completeDialogClose">Abbrechen</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|||||||
@@ -45,10 +45,10 @@
|
|||||||
{% macro task_card(task, current_user, compact=false) -%}
|
{% macro task_card(task, current_user, compact=false) -%}
|
||||||
<article class="task-card {% if compact %}task-card--compact{% endif %}">
|
<article class="task-card {% if compact %}task-card--compact{% endif %}">
|
||||||
<div class="task-card__top">
|
<div class="task-card__top">
|
||||||
<div>
|
<div class="task-card__title-block">
|
||||||
<div class="chip-row">
|
<div class="chip-row">
|
||||||
{{ status_badge(task) }}
|
{{ status_badge(task) }}
|
||||||
<span class="point-pill">{{ task.points_awarded }} Punkte</span>
|
<span class="point-pill">{{ task.points_awarded }} Punkte{% if task.is_shared_assignment %} / Person{% endif %}</span>
|
||||||
</div>
|
</div>
|
||||||
<h3>{{ task.title }}</h3>
|
<h3>{{ task.title }}</h3>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dt>Zuständig</dt>
|
<dt>Zuständig</dt>
|
||||||
<dd>{{ task.assigned_user.name if task.assigned_user else 'Unverteilt' }}</dd>
|
<dd>{{ task.assignee_label }}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dt>Rhythmus</dt>
|
<dt>Rhythmus</dt>
|
||||||
@@ -84,18 +84,26 @@
|
|||||||
|
|
||||||
<div class="task-card__footer">
|
<div class="task-card__footer">
|
||||||
<div class="task-assignee">
|
<div class="task-assignee">
|
||||||
{{ avatar(task.assigned_user) }}
|
<span class="task-assignee__avatars">
|
||||||
<span>{{ task.assigned_user.name if task.assigned_user else 'Ohne Person' }}</span>
|
{% for assigned_user in task.assigned_users %}
|
||||||
|
{{ avatar(assigned_user) }}
|
||||||
|
{% endfor %}
|
||||||
|
</span>
|
||||||
|
<span>{{ task.assignee_label }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if not task.completed_at %}
|
{% if not task.completed_at %}
|
||||||
{% if task.assigned_user_id and task.assigned_user_id != current_user.id %}
|
{% if task.assigned_users and current_user.id not in task.assigned_user_ids %}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="button"
|
class="button"
|
||||||
data-complete-action="{{ url_for('tasks.complete', task_id=task.id) }}"
|
data-complete-action="{{ url_for('tasks.complete', task_id=task.id) }}"
|
||||||
data-complete-title="{{ task.title }}"
|
data-complete-title="{{ task.title }}"
|
||||||
data-complete-assigned="{{ task.assigned_user.name if task.assigned_user else 'Zugewiesene Person' }}"
|
data-complete-assigned="{{ task.assignee_label }}"
|
||||||
|
data-assigned-primary-id="{{ task.assigned_user.id if task.assigned_user else '' }}"
|
||||||
|
data-assigned-primary-name="{{ task.assigned_user.name if task.assigned_user else '' }}"
|
||||||
|
data-assigned-secondary-id="{{ task.assigned_user_secondary.id if task.assigned_user_secondary else '' }}"
|
||||||
|
data-assigned-secondary-name="{{ task.assigned_user_secondary.name if task.assigned_user_secondary else '' }}"
|
||||||
>
|
>
|
||||||
{{ nav_icon('check') }}
|
{{ nav_icon('check') }}
|
||||||
<span>Erledigen</span>
|
<span>Erledigen</span>
|
||||||
|
|||||||
@@ -36,10 +36,46 @@
|
|||||||
<article class="panel">
|
<article class="panel">
|
||||||
<p class="eyebrow">Direkt sichtbar</p>
|
<p class="eyebrow">Direkt sichtbar</p>
|
||||||
<h2>Aktive Quick-Wins bearbeiten</h2>
|
<h2>Aktive Quick-Wins bearbeiten</h2>
|
||||||
<div class="quick-win-list">
|
<p class="muted">Per Drag & Drop kannst du die Reihenfolge festlegen, die später auch bei den Quick-Win-Chips erscheint.</p>
|
||||||
|
<form method="post" action="{{ url_for('settings.reorder_quick_wins') }}" id="quickWinSortForm">
|
||||||
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
|
<input type="hidden" name="ids" id="quickWinSortIds" value="{{ quick_wins|map(attribute='id')|join(',') }}">
|
||||||
|
</form>
|
||||||
|
<div class="quick-win-list__toolbar">
|
||||||
|
<button type="submit" class="button button--secondary" id="quickWinSortSave" form="quickWinSortForm" disabled>Reihenfolge speichern</button>
|
||||||
|
</div>
|
||||||
|
<div class="quick-win-list" data-quick-win-sort-list>
|
||||||
{% for quick_win in quick_wins %}
|
{% for quick_win in quick_wins %}
|
||||||
<article class="quick-win-manage-card">
|
<article class="quick-win-manage-card" draggable="true" data-quick-win-sort-item="{{ quick_win.id }}">
|
||||||
<form method="post" action="{{ url_for('settings.update_quick_win', quick_win_id=quick_win.id) }}" class="quick-win-manage-form">
|
<div class="quick-win-manage-card__summary">
|
||||||
|
<div class="quick-win-manage-card__drag">
|
||||||
|
{{ nav_icon('list') }}
|
||||||
|
<span>Ziehen zum Sortieren</span>
|
||||||
|
</div>
|
||||||
|
<div class="quick-win-manage-card__title">
|
||||||
|
<strong>{{ quick_win.title }}</strong>
|
||||||
|
</div>
|
||||||
|
<div class="quick-win-manage-card__actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="button button--ghost"
|
||||||
|
data-quick-win-toggle
|
||||||
|
data-target="quick-win-edit-{{ quick_win.id }}"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="quick-win-edit-{{ quick_win.id }}"
|
||||||
|
>
|
||||||
|
Bearbeiten
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<form
|
||||||
|
method="post"
|
||||||
|
action="{{ url_for('settings.update_quick_win', quick_win_id=quick_win.id) }}"
|
||||||
|
class="quick-win-manage-form"
|
||||||
|
id="quick-win-edit-{{ quick_win.id }}"
|
||||||
|
data-quick-win-edit
|
||||||
|
hidden
|
||||||
|
>
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="quick-win-title-{{ quick_win.id }}">Titel</label>
|
<label for="quick-win-title-{{ quick_win.id }}">Titel</label>
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
<option value="all" {% if filters.status == 'all' %}selected{% endif %}>Alle</option>
|
<option value="all" {% if filters.status == 'all' %}selected{% endif %}>Alle</option>
|
||||||
<option value="open" {% if filters.status == 'open' %}selected{% endif %}>Offen</option>
|
<option value="open" {% if filters.status == 'open' %}selected{% endif %}>Offen</option>
|
||||||
<option value="soon" {% if filters.status == 'soon' %}selected{% endif %}>Bald fällig</option>
|
<option value="soon" {% if filters.status == 'soon' %}selected{% endif %}>Bald fällig</option>
|
||||||
|
<option value="today" {% if filters.status == 'today' %}selected{% endif %}>Heute fällig</option>
|
||||||
|
<option value="tomorrow" {% if filters.status == 'tomorrow' %}selected{% endif %}>Morgen fällig</option>
|
||||||
|
<option value="day_after_tomorrow" {% if filters.status == 'day_after_tomorrow' %}selected{% endif %}>Übermorgen fällig</option>
|
||||||
<option value="overdue" {% if filters.status == 'overdue' %}selected{% endif %}>Überfällig</option>
|
<option value="overdue" {% if filters.status == 'overdue' %}selected{% endif %}>Überfällig</option>
|
||||||
<option value="completed" {% if filters.status == 'completed' %}selected{% endif %}>Erledigt</option>
|
<option value="completed" {% if filters.status == 'completed' %}selected{% endif %}>Erledigt</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -48,4 +51,3 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,8 @@
|
|||||||
<small class="calendar-task__person" lang="de">
|
<small class="calendar-task__person" lang="de">
|
||||||
{% if task.completed_by_user %}
|
{% if task.completed_by_user %}
|
||||||
{{ task.completed_by_user.name|hyphenate_de }}
|
{{ task.completed_by_user.name|hyphenate_de }}
|
||||||
{% elif task.assigned_user %}
|
{% elif task.assigned_users %}
|
||||||
{{ task.assigned_user.name|hyphenate_de }}
|
{{ task.assignee_label|hyphenate_de }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ 'Ohne Zuweisung'|hyphenate_de }}
|
{{ 'Ohne Zuweisung'|hyphenate_de }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -108,8 +108,8 @@
|
|||||||
<small class="calendar-task__person" lang="de">
|
<small class="calendar-task__person" lang="de">
|
||||||
{% if task.completed_by_user %}
|
{% if task.completed_by_user %}
|
||||||
{{ task.completed_by_user.name|hyphenate_de }}
|
{{ task.completed_by_user.name|hyphenate_de }}
|
||||||
{% elif task.assigned_user %}
|
{% elif task.assigned_users %}
|
||||||
{{ task.assigned_user.name|hyphenate_de }}
|
{{ task.assignee_label|hyphenate_de }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ 'Ohne Zuweisung'|hyphenate_de }}
|
{{ 'Ohne Zuweisung'|hyphenate_de }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -46,13 +46,41 @@
|
|||||||
<section class="stack">
|
<section class="stack">
|
||||||
<div class="section-heading">
|
<div class="section-heading">
|
||||||
<h2>Bald fällig</h2>
|
<h2>Bald fällig</h2>
|
||||||
<span class="section-heading__count">{{ sections.soon|length }}</span>
|
<span class="section-heading__count">{{ sections.due_today|length }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="task-grid">
|
<div class="task-grid">
|
||||||
{% for task in sections.soon %}
|
{% for task in sections.due_today %}
|
||||||
{{ task_card(task, current_user) }}
|
{{ task_card(task, current_user) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="empty-state">Gerade nichts, was in den nächsten Tagen drängt.</div>
|
<div class="empty-state">Heute ist gerade nichts mehr auf Kante.</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="stack">
|
||||||
|
<div class="section-heading">
|
||||||
|
<h2>Morgen fällig</h2>
|
||||||
|
<span class="section-heading__count">{{ sections.due_tomorrow|length }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="task-grid">
|
||||||
|
{% for task in sections.due_tomorrow %}
|
||||||
|
{{ task_card(task, current_user) }}
|
||||||
|
{% else %}
|
||||||
|
<div class="empty-state">Für morgen sieht es gerade entspannt aus.</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="stack">
|
||||||
|
<div class="section-heading">
|
||||||
|
<h2>Übermorgen fällig</h2>
|
||||||
|
<span class="section-heading__count">{{ sections.due_day_after_tomorrow|length }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="task-grid">
|
||||||
|
{% for task in sections.due_day_after_tomorrow %}
|
||||||
|
{{ task_card(task, current_user) }}
|
||||||
|
{% else %}
|
||||||
|
<div class="empty-state">Auch übermorgen ist noch nichts Drängendes drin.</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -85,4 +113,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<h2>{% if mode == 'edit' %}Änderungen für {{ task.title }}{% else %}Neue Aufgabe anlegen{% endif %}</h2>
|
<h2>{% if mode == 'edit' %}Änderungen für {{ task.title }}{% else %}Neue Aufgabe anlegen{% endif %}</h2>
|
||||||
<form method="post" class="form-grid form-grid--two">
|
<form method="post" class="form-grid form-grid--two">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
|
{% if mode == 'edit' %}
|
||||||
|
<input type="hidden" name="next" value="{{ next_url }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="field field--full">
|
<div class="field field--full">
|
||||||
{{ form.title.label }}
|
{{ form.title.label }}
|
||||||
@@ -32,6 +35,13 @@
|
|||||||
{% for error in form.assigned_user_id.errors %}<small class="error">{{ error }}</small>{% endfor %}
|
{% for error in form.assigned_user_id.errors %}<small class="error">{{ error }}</small>{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
{{ form.assigned_user_secondary_id.label }}
|
||||||
|
{{ form.assigned_user_secondary_id() }}
|
||||||
|
<small class="muted">Wenn du hier noch jemanden auswählst, zählen die Punkte pro Person halbiert.</small>
|
||||||
|
{% for error in form.assigned_user_secondary_id.errors %}<small class="error">{{ error }}</small>{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
{{ form.due_date.label }}
|
{{ form.due_date.label }}
|
||||||
{{ form.due_date() }}
|
{{ form.due_date() }}
|
||||||
@@ -57,8 +67,18 @@
|
|||||||
<div class="form-actions field--full">
|
<div class="form-actions field--full">
|
||||||
{{ form.submit(class_='button') }}
|
{{ form.submit(class_='button') }}
|
||||||
<a class="button button--ghost" href="{{ url_for('tasks.all_tasks') }}">Abbrechen</a>
|
<a class="button button--ghost" href="{{ url_for('tasks.all_tasks') }}">Abbrechen</a>
|
||||||
|
{% if mode == 'edit' %}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="button button--ghost button--danger"
|
||||||
|
formmethod="post"
|
||||||
|
formaction="{{ url_for('tasks.delete', task_id=task.id) }}"
|
||||||
|
onclick="return confirm('Diese Aufgabe wirklich löschen?');"
|
||||||
|
>
|
||||||
|
Aufgabe löschen
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user