Skip to content

Commit

Permalink
fix(accounts): logged user required for memberships view + commented …
Browse files Browse the repository at this point in the history
…out useless menu items
  • Loading branch information
thejoeejoee committed Oct 27, 2023
1 parent fea8df4 commit fcb969d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fiesta/apps/accounts/views/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def clean_role(self):
return role


class MyMembershipsView(TemplateView):
class MyMembershipsView(LoginRequiredMixin, TemplateView):
template_name = "accounts/memberships/my_memberships.html"


Expand Down
29 changes: 20 additions & 9 deletions fiesta/templates/fiesta/parts/user_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,30 @@
class="block py-2 px-4 text-sm text-primary hover:underline">New membership</a>
{% endif %}
<ul class="py-1">
<li>
<a href="#"
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
</li>
<li>
<a href="#"
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100">Earnings</a>
</li>
{# <li>#}
{# <a href="#"#}
{# class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100">Settings</a>#}
{# </li>#}
{# <li>#}
{# <a href="#"#}
{# class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100">Earnings</a>#}
{# </li>#}
<li>
<a href="{% url 'account_logout' %}"
hx-post="{% url 'account_logout' %}"
{% if redirect_field_value %}hx-vals='{"{{ redirect_field_name }}": "{{ redirect_field_value }}"}'{% endif %}
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100">Sign out</a>
class="py-2 px-4 text-sm text-gray-700 flex flex-row justify-between items-center hover:bg-gray-100">
Sign out

<svg xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 transform rotate-180"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1">
</path>
</svg>
</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit fcb969d

Please sign in to comment.