-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
172 additions
and
99 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
from django.contrib import messages | ||
from django.http import HttpRequest | ||
from django.shortcuts import render | ||
from django.shortcuts import render, redirect | ||
|
||
from backend.decorators import * | ||
from backend.models import * | ||
from backend.models import Invoice | ||
from backend.types.htmx import HtmxHttpRequest | ||
|
||
|
||
def invoices_dashboard(request: HtmxHttpRequest): | ||
context = {} | ||
|
||
return render(request, "pages/invoices/dashboard/dashboard.html", context) | ||
return render(request, "pages/invoices/dashboard/dashboard.html") | ||
|
||
|
||
def invoices_dashboard_id(request: HtmxHttpRequest, invoice_id): | ||
context = {} | ||
|
||
if invoice_id == "create": | ||
return redirect("invoices:create") | ||
elif type(invoice_id) != "int": | ||
elif not isinstance(invoice_id, int): | ||
messages.error(request, "Invalid invoice ID") | ||
return redirect("invoices:dashboard") | ||
invoices = Invoice.objects.get(id=invoice_id) | ||
if not invoices: | ||
|
||
try: | ||
Invoice.objects.get(id=invoice_id) | ||
except Invoice.DoesNotExist: | ||
return redirect("invoices:dashboard") | ||
return render( | ||
request, | ||
"pages/invoices/dashboard/dashboard.html", | ||
) | ||
return render(request, "pages/invoices/dashboard/dashboard.html", context) |
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
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
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,10 @@ | ||
<div hx-swap="innerHTML"> | ||
{% block content %} | ||
{% endblock content %} | ||
</div> | ||
{# Profile Picture dropdown item #} | ||
<div hx-swap-oob='outerHTML:div[data-layout="icon_dropdown_items"]'> | ||
{% component "base:topbar:icon_dropdown" %} | ||
</div> | ||
{% include "base/+left_drawer.html" with swap=True %} | ||
{% include "base/breadcrumbs.html" with swap=True %} |
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,28 @@ | ||
<div data-layout="icon_dropdown_items"> | ||
<li hx-boost="true"> | ||
<a {% if request.resolver_match.url_name == "user settings" %}class="active btn-disabled"{% endif %} | ||
href="{% url 'user settings' %}"> | ||
<i class="fa fa-solid fa-cog"></i> | ||
Account Settings | ||
</a> | ||
</li> | ||
<li hx-boost="true"> | ||
<a {% if request.resolver_match.url_name == "user settings teams" %}class="active btn-disabled"{% endif %} | ||
href="{% url "user settings teams" %}"> | ||
<i class="fa fa-solid fa-users"></i> | ||
Manage Team | ||
<span class="badge">New</span> | ||
</a> | ||
</li> | ||
<li> | ||
<label for="logout_modal"> | ||
<i class="fa fa-solid fa-right-from-bracket"></i> | ||
Logout | ||
</label> | ||
</li> | ||
{% if request.user.is_superuser and request.user.is_staff %} | ||
<li> | ||
<a tabindex="-1" class="dropdown-item text text-sm mt-1" href="/admin/">Go to admin dashboard</a> | ||
</li> | ||
{% endif %} | ||
</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
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
Oops, something went wrong.