Skip to content

Commit

Permalink
show team information instead of toggle for users with only one team
Browse files Browse the repository at this point in the history
  • Loading branch information
KaydenLiss committed Dec 12, 2023
1 parent f383876 commit 00a82bb
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions templates/base/__teamToggle.html.twig
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{% set teams = adminArea is defined and adminArea ? app.user.adminRoles : app.user.teams %}

{% if teams|length > 1 and currentTeam is defined and currentTeam %}
{% if currentTeam is defined and currentTeam %}
<div class="flex flex-row justify-end items-center relative">
<button data-type="dropdown" data-target="#teamtoggle-menu" class="relative !inline-flex !items-center justify-center h-10 gap-x-2 p-3 rounded-[6.25rem] text-sm tracking-[.00714em] text-center font-medium hover:bg-surface-300 focus:bg-surface-400">
<span class="material-symbols-outlined">group</span>
{{ currentTeam.name }}
</button>
<ul id="teamtoggle-menu" role="dropdownmenu" class="dropdown hidden top-10">
{% for team in teams %}
{% if team != currentTeam %}
<li class="relative">
<a href="{{ path('team_switch',{'team':team.id}) }}">{{ team.name }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% if teams|length > 1 %}
<button data-type="dropdown" data-target="#teamtoggle-menu" class="relative !inline-flex !items-center justify-center h-10 gap-x-2 p-3 rounded-[6.25rem] text-sm tracking-[.00714em] text-center font-medium hover:bg-surface-300 focus:bg-surface-400">
<span class="material-symbols-outlined">group</span>
{{ currentTeam.name }}
</button>
<ul id="teamtoggle-menu" role="dropdownmenu" class="dropdown hidden top-10">
{% for team in teams %}
{% if team != currentTeam %}
<li class="relative">
<a href="{{ path('team_switch',{'team':team.id}) }}">{{ team.name }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<div class="!inline-flex !items-center justify-center gap-x-2 p-3 text-sm font-medium">
<span class="material-symbols-outlined">group</span>
{{ currentTeam.name }}
</div>
{% endif %}
</div>
{% endif %}
{% endif %}

0 comments on commit 00a82bb

Please sign in to comment.