-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved team/user selection dropdown to top left rather than in dropdown
Signed-off-by: Trey <73353716+TreyWW@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
70 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
frontend/templates/base/topbar/team_selector/selector.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="dropdown" data-hx-container="team_selector"> | ||
<label tabindex="0" | ||
class="flex flex-row justify-between items-center w-48 border h-8 rounded cursor-pointer pe-4"> | ||
<div class="flex flex-row"> | ||
{% if request.actor.is_org or not request.user.user_profile.profile_picture %} | ||
<img class="p-1 ms-2 h-6 w-6 object-contain" | ||
src="https://raw.githubusercontent.com/TreyWW/MyFinances/main/frontend/static/img/logo_single.png" | ||
alt="Logo" /> | ||
<div class="font-bold ms-2">{{ request.actor.name }}</div> | ||
{% else %} | ||
<img class="p-1 ms-2 h-6 w-6 object-contain" | ||
src="{{ request.user.user_profile.profile_picture.url }}" | ||
alt="Logo" /> | ||
<div class="font-bold ms-2">{{ request.user.name }}</div> | ||
{% endif %} | ||
</div> | ||
<div class="fa-layers fa-fw fa-xs"> | ||
<span class="fas fa-chevron-up" data-fa-transform="up-6"></span> | ||
<span class="fas fa-chevron-down" data-fa-transform="down-6"></span> | ||
</div> | ||
</label> | ||
<ul tabindex="0" | ||
class="dropdown-content menu p-2 border shadow bg-base-100 !w-full !rounded mt-2" | ||
data-hx-container="dropdown_items"> | ||
<div class="font-bold p-2">Personal Account</div> | ||
<button class="font-semibold flex flex-row hover:bg-base-100 rounded items-center py-1 pe-4 justify-between {% if not request.actor.is_org %}bg-base-100{% endif %}" | ||
hx-post="{% url 'api:teams:switch_team' team_id=0 %}" | ||
hx-swap="none"> | ||
<div class="items-center flex flex-row"> | ||
{% component "profile_picture" image_type="small" extra_classes="p-1 h-6 w-6 object-contain" url=request.user.user_profile.profile_picture_url %} | ||
<a>{{ request.user.first_name|default_if_none:"You" }}</a> | ||
</div> | ||
{% if not request.actor.is_org %}<i class="fa fa-check"></i>{% endif %} | ||
</button> | ||
<div class="font-bold mt-2 p-2">Teams</div> | ||
{% for team in request.user.teams_apart_of %} | ||
<button class="flex flex-row hover:bg-base-100 rounded items-center py-1 pe-4 justify-between {% if request.actor.is_org and team.id == request.actor.id %}bg-base-100{% endif %}" | ||
hx-post="{% url 'api:teams:switch_team' team_id=team.id %}" | ||
hx-swap="none"> | ||
<div class="items-center flex flex-row"> | ||
<img class="p-1 h-6 w-6 object-contain" | ||
src="https://raw.githubusercontent.com/TreyWW/MyFinances/main/frontend/static/img/logo_single.png" | ||
alt="Logo" /> | ||
<p>{{ team.name }}</p> | ||
</div> | ||
{% if request.actor.is_org and team.id == request.actor.id %}<i class="fa fa-check"></i>{% endif %} | ||
</button> | ||
{% endfor %} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
<div hx-swap-oob='innerHTML:[data-htmx-swap="logged_in_for"]'> | ||
{% if request.user.logged_in_as_team %} | ||
<h2 class="text-xl mb-1">Organization</h2> | ||
<h2 class="text-md"> | ||
Logged in for <strong>{{ request.user.logged_in_as_team.name }}</strong> | ||
</h2> | ||
{% else %} | ||
<h2 class="text-xl mb-1">Personal</h2> | ||
<h2 class="text-md"> | ||
Logged in as <strong>{{ request.user.first_name | default_if_none:"You" }}</strong> | ||
</h2> | ||
{% endif %} | ||
</div> | ||