From 3ae948f1e2bcd932dee8b7ade9c1d151a617d776 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Gertz?= <git@rapsys.eu>
Date: Thu, 13 Oct 2022 15:18:04 +0200
Subject: [PATCH] New header layout New user layout Cleanup

---
 Resources/views/user/index.html.twig | 47 +++++++++++-----------------
 1 file changed, 19 insertions(+), 28 deletions(-)

diff --git a/Resources/views/user/index.html.twig b/Resources/views/user/index.html.twig
index 58417a7..ab1bcba 100644
--- a/Resources/views/user/index.html.twig
+++ b/Resources/views/user/index.html.twig
@@ -1,50 +1,41 @@
 {% extends '@RapsysAir/body.html.twig' %}
 {% block content %}
-	<article id="dashboard">
+	<article>
 		<header>
-			<h2><a href="{{ path('rapsys_air_user') }}">{{ section }}</a></h2>
-			<p>{{ description }}</p>
+			<h2>{{ description }}</h2>
 		</header>
 		<div class="panel">
 			{% if groups is defined and groups %}
-				<div class="grid three">
+				<div class="grid{% if groups|length > 2 %} three{% elseif groups|length > 1 %} two{% endif %}">
 					{% for group, users in groups %}
 						<article class="cell">
-							<h3>{{ group }}</h3>
+							<header>
+								<h3>{{ group }}</h3>
+							</header>
 							<ul>
 								{% for id, user in users %}
-									<li><a href="{{ path('rapsys_air_user_view', {'id': id}) }}">{{ user.pseudonym }}</a><a href="{{ path('rapsys_user_edit', {'mail': user.mail|short, 'hash': user.mail|short|hash}) }}">{% trans %}Modify{% endtrans %}</a></li>
+									<li><a href="{{ user.link }}" title="{% if user.forename %}{{ user.forename }} {% endif %}{% if user.surname %}{{ user.surname }} {% endif %}{% if user.pseudonym %}({{ user.pseudonym }}) {% endif %}&lt;{{ user.mail }}&gt;">{{ user.mail }}</a><a href="{{ user.edit }}">{% trans %}Modify{% endtrans %}</a></li>
 								{% endfor %}
 						</article>
 					{% endfor %}
 				</div>
 			{% elseif users is defined and users %}
-				<div class="grid four">
+				<div class="grid{% if users|length > 3 %} four{% elseif users|length > 2 %} three{% elseif users|length > 1 %} two{% endif %}">
 					{% for id, user in users %}
 						<article class="cell">
-							<h3><a href="{{ path('rapsys_air_user_view', {'id': id}) }}">{{ user.pseudonym }}</a></h3>
-						</article>
-					{% endfor %}
-					{#{% for date, day in organizers %}
-						<article class="{{ ['cell', 'seventh']|merge(day.class)|join(' ') }}">
-							<h3>{{ day.title }}</h3>
-							{% if day.sessions is not empty %}
-								<ul>
-									{% for session in day.sessions %}
-										<li class="{{ ['session']|merge(session.class)|join(' ') }}">
-											<a href="{{ path('rapsys_air_session_view', {'id': session.id}) }}" title="{{ session.applications|join('\n') }}">{{ session.title }}</a>
-											<span>
-												{% if session.weather is defined and session.weather %}<span title="{{ session.weathertitle }}">{{ session.weather }}</span>{% endif %}
-												<span title="{{ session.slottitle }}">{{ session.slot }}</span>
-											</span>
-										</li>
+							<header>
+								<h3><a href="{{ user.link }}" title="{{ '%pseudonym% calendar'|trans({'%pseudonym%': user.pseudonym}) }}">{{ user.pseudonym }}</a></h3>
+							</header>
+							{% for dname, dinfos in user.dances %}
+								<dl>
+									<dt><a href="{{ dinfos.link }}">{{ dname }}</a></dt>
+									{% for dtype, dlink in dinfos.types %}
+										<dd><a href="{{ dlink }}">{{ dtype }}</a><dd>
 									{% endfor %}
-								</ul>
-							{% else %}
-								&nbsp;
-							{% endif %}
+								</dl>
+							{% endfor %}
 						</article>
-					{% endfor %}#}
+					{% endfor %}
 				</div>
 			{% endif %}
 			{{ include('@RapsysAir/form/_toolbox.html.twig') }}
-- 
2.41.1