Skip to content

Commit

Permalink
djlint
Browse files Browse the repository at this point in the history
Signed-off-by: Trey <[email protected]>
  • Loading branch information
TreyWW committed Aug 22, 2024
1 parent 30a3519 commit f4cf648
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 216 deletions.
34 changes: 15 additions & 19 deletions frontend/templates/modals/generate_api_key.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,22 @@
</label>
</div>
{% if request.user.is_superuser %}
<div class="form-control w-full">
<label class="label">
Administrator Connection?
</label>

<div class="grid grid-cols-8 gap-4 items-center">
<input id="modal_input-administrator"
name="administrator"
type="checkbox"
class="peer checkbox checkbox-block checkbox-bordered">
<select name="administrator_type" class="select select-bordered col-span-7 w-full">
{% for option in APIAuthToken_types %}
<option value="{{ option }}">{{ option.label }}</option>
{% endfor %}
</select>
<div class="form-control w-full">
<label class="label">Administrator Connection?</label>
<div class="grid grid-cols-8 gap-4 items-center">
<input id="modal_input-administrator"
name="administrator"
type="checkbox"
class="peer checkbox checkbox-block checkbox-bordered">
<select name="administrator_type"
class="select select-bordered col-span-7 w-full">
{% for option in APIAuthToken_types %}<option value="{{ option }}">{{ option.label }}</option>{% endfor %}
</select>
</div>
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden">
<span class="label-text-alt text-error">Please enter a valid name for your key</span>
</label>
</div>
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden">
<span class="label-text-alt text-error">Please enter a valid name for your key</span>
</label>
</div>
{% endif %}
<div class="collapse collapse-arrow border select-bordered mt-4">
<input type="checkbox" />
Expand Down
44 changes: 22 additions & 22 deletions frontend/templates/pages/invoices/create/create_recurring.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,29 @@ <h3 class="text-sm text-natural font-semibold hidden lg:block text-end me-6">To<
STEP 3 - SERVICES <span class="required_star">*</span>
</div>
{% component_block "pages:invoices:create:services:services_table" %}
{% endcomponent_block %}
<div class="divider my-4">
STEP 4 - BANK DETAILS
<i class="text-neutral-content">[OPTIONAL]</i>
</div>
<div class="my-4 flex w-full flex-col">
<div class="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 md:gap-2 lg:gap-4">
{% include "pages/invoices/create/bank_details/holder_name.html" %}
{% include "pages/invoices/create/bank_details/account_number.html" %}
{% include "pages/invoices/create/bank_details/sort_code.html" %}
</div>
</div>
<div class="divider my-4">
STEP 5 - CUSTOM DESIGNS
<i class="text-neutral-content">[OPTIONAL]</i>
</div>
{% include "pages/invoices/create/custom_designs/logo.html" %}
{# <div class="divider my-4">STEP 5 - NOTES [OPTIONAL]</div>#}
{# {% include "pages/invoices/create/notes/notes.html" %}#}
<div class="group-invalid:tooltip"
data-tip="Fill out all required details to save the invoice.">
<button class="btn btn-primary group-invalid:btn-disabled btn-block">Create Recurring Profile</button>
{% endcomponent_block %}
<div class="divider my-4">
STEP 4 - BANK DETAILS
<i class="text-neutral-content">[OPTIONAL]</i>
</div>
<div class="my-4 flex w-full flex-col">
<div class="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 md:gap-2 lg:gap-4">
{% include "pages/invoices/create/bank_details/holder_name.html" %}
{% include "pages/invoices/create/bank_details/account_number.html" %}
{% include "pages/invoices/create/bank_details/sort_code.html" %}
</div>
</div>
<div class="divider my-4">
STEP 5 - CUSTOM DESIGNS
<i class="text-neutral-content">[OPTIONAL]</i>
</div>
{% include "pages/invoices/create/custom_designs/logo.html" %}
{# <div class="divider my-4">STEP 5 - NOTES [OPTIONAL]</div>#}
{# {% include "pages/invoices/create/notes/notes.html" %}#}
<div class="group-invalid:tooltip"
data-tip="Fill out all required details to save the invoice.">
<button class="btn btn-primary group-invalid:btn-disabled btn-block">Create Recurring Profile</button>
</div>
</form>
<script>
function validate_sort_code(value) {
Expand Down
238 changes: 119 additions & 119 deletions frontend/templates/pages/invoices/recurring/dashboard/_fetch_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,127 +4,127 @@
{% load common_children_filter from listfilters %}
{% feature_enabled "isInvoiceSchedulingEnabled" as schedule_invoices_enabled %}
<tbody id="table_body">
{% for invoiceProfile in page.object_list %}
<tr class="hover cursor-pointer"
hx-trigger="click"
hx-boost="true"
hx-target='div[data-hx-swap="content"]'
hx-swap="innerHTML"
hx-vals='{"invoice_structure_main": "True"}'
hx-push-url="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}"
hx-get="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">
<td class="link link-primary no-underline">
<a href="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">{{ invoiceProfile.id }}</a>
</td>
<td>{{ invoiceProfile.end_date | date:"d/m/Y" | default:"never" }}</td>
<td>
<div class="flex items-center text-sm">
<div>
{% with cli_name=invoiceProfile.client_to.name|default:invoiceProfile.client_name %}
{% if cli_name %}
<p class="font-semibold">{{ cli_name }}</p>
{% else %}
<p class="font-thin">No Client</p>
{% endif %}
{% endwith %}
{% for invoiceProfile in page.object_list %}
<tr class="hover cursor-pointer"
hx-trigger="click"
hx-boost="true"
hx-target='div[data-hx-swap="content"]'
hx-swap="innerHTML"
hx-vals='{"invoice_structure_main": "True"}'
hx-push-url="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}"
hx-get="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">
<td class="link link-primary no-underline">
<a href="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">{{ invoiceProfile.id }}</a>
</td>
<td>{{ invoiceProfile.end_date | date:"d/m/Y" | default:"never" }}</td>
<td>
<div class="flex items-center text-sm">
<div>
{% with cli_name=invoiceProfile.client_to.name|default:invoiceProfile.client_name %}
{% if cli_name %}
<p class="font-semibold">{{ cli_name }}</p>
{% else %}
<p class="font-thin">No Client</p>
{% endif %}
{% endwith %}
</div>
</div>
</div>
</td>
<td>
{{ invoiceProfile.get_currency_symbol }}{{ invoiceProfile.get_total_price | default_if_none:0 | floatformat:2 | intcomma }}
</td>
<td>
{% include "pages/invoices/recurring/dashboard/_status_badge.html" with status=invoiceProfile.status inv_id=invoiceProfile.id %}
</td>
<td colspan="2"
onclick="const e = arguments[0] || window.event; e.stopPropagation();"
class="cursor-default">
{# The if statement for dropdown top goes as follows #}
{# Use dropdown on top if these: #}
{# - is last item (and not first item) (and more than 4 items) #}
<div class="dropdown dropdown-left {% if forloop.last and invoices.count > 4 %}dropdown-top{% endif %}">
<label tabindex="0" class="btn btn-primary btn-outline btn-sm">
<i class="fa-solid fa-ellipsis-vertical"></i>
</label>
<ul tabindex="0"
class="dropdown-content z-[1] menu wp-2 shadow-2xl bg-base-200 rounded-box w-52">
<li hx-boost="true">
<a href="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">
<i class="fa-solid fa-eye"></i>
Overview
</a>
</li>
{# <li>#}
{# <a href="{% url "invoices:single:preview" invoice_id=invoiceProfile.id %}">#}
{# <i class="fa-solid fa-file-pdf"></i>#}
{# Preview#}
{# </a>#}
{# </li>#}
{# <li>#}
{# <a href="{% url "invoices:single:manage_access" invoice_id=invoiceProfile.id %}">#}
{# <i class="fa-solid fa-key"></i>#}
{# Manage Access#}
{# </a>#}
{# </li>#}
<li>
<a href="{% url "invoices:recurring:edit" invoice_profile_id=invoiceProfile.id %}">
<i class="fa-solid fa-pencil"></i>
Edit
</a>
</li>
<li>
<button hx-delete="{% url 'api:invoices:recurring:delete' %}"
hx-target="closest tr"
hx-confirm="Are you sure you would like to delete invoice recurring profile #{{ invoiceProfile.id }}?"
hx-vals='{"invoice_profile": "{{ invoiceProfile.id }}" }'>
<i class="fa-solid fa-trash"></i>
Delete
</td>
<td>
{{ invoiceProfile.get_currency_symbol }}{{ invoiceProfile.get_total_price | default_if_none:0 | floatformat:2 | intcomma }}
</td>
<td>
{% include "pages/invoices/recurring/dashboard/_status_badge.html" with status=invoiceProfile.status inv_id=invoiceProfile.id %}
</td>
<td colspan="2"
onclick="const e = arguments[0] || window.event; e.stopPropagation();"
class="cursor-default">
{# The if statement for dropdown top goes as follows #}
{# Use dropdown on top if these: #}
{# - is last item (and not first item) (and more than 4 items) #}
<div class="dropdown dropdown-left {% if forloop.last and invoices.count > 4 %}dropdown-top{% endif %}">
<label tabindex="0" class="btn btn-primary btn-outline btn-sm">
<i class="fa-solid fa-ellipsis-vertical"></i>
</label>
<ul tabindex="0"
class="dropdown-content z-[1] menu wp-2 shadow-2xl bg-base-200 rounded-box w-52">
<li hx-boost="true">
<a href="{% url "invoices:recurring:overview" invoice_profile_id=invoiceProfile.id %}">
<i class="fa-solid fa-eye"></i>
Overview
</a>
</li>
{# <li>#}
{# <a href="{% url "invoices:single:preview" invoice_id=invoiceProfile.id %}">#}
{# <i class="fa-solid fa-file-pdf"></i>#}
{# Preview#}
{# </a>#}
{# </li>#}
{# <li>#}
{# <a href="{% url "invoices:single:manage_access" invoice_id=invoiceProfile.id %}">#}
{# <i class="fa-solid fa-key"></i>#}
{# Manage Access#}
{# </a>#}
{# </li>#}
<li>
<a href="{% url "invoices:recurring:edit" invoice_profile_id=invoiceProfile.id %}">
<i class="fa-solid fa-pencil"></i>
Edit
</a>
</li>
<li>
<button hx-delete="{% url 'api:invoices:recurring:delete' %}"
hx-target="closest tr"
hx-confirm="Are you sure you would like to delete invoice recurring profile #{{ invoiceProfile.id }}?"
hx-vals='{"invoice_profile": "{{ invoiceProfile.id }}" }'>
<i class="fa-solid fa-trash"></i>
Delete
</button>
</li>
</ul>
</div>
</td>
</tr>
{% empty %}
<td colspan="100%" class="text-center">No Invoices Found</td>
{% endfor %}
{% if page.has_other_pages %}
<tr>
<td>
<div class="join">
{% if page.has_previous %}
<button class="join-item btn"
hx-swap="outerHTML"
hx-target="#table_body"
hx-indicator=""
hx-include='#filter_list_storage, #sort_direction_storage, [name="sort"]'
hx-get="{% url "api:invoices:recurring:fetch" %}?page={{ page.previous_page_number }}">
«
</button>
</li>
</ul>
</div>
</td>
</tr>
{% empty %}
<td colspan="100%" class="text-center">No Invoices Found</td>
{% endfor %}
{% if page.has_other_pages %}
<tr>
<td>
<div class="join">
{% if page.has_previous %}
<button class="join-item btn"
hx-swap="outerHTML"
hx-target="#table_body"
hx-indicator=""
hx-include='#filter_list_storage, #sort_direction_storage, [name="sort"]'
hx-get="{% url "api:invoices:recurring:fetch" %}?page={{ page.previous_page_number }}">
«
</button>
{% else %}
<button class="join-item btn">
<i class="fa fa-x w-2 h-2"></i>
</button>
{% endif %}
<button class="join-item btn">Page {{ page.number }}</button>
{% if page.has_next %}
<button class="join-item btn"
hx-swap="outerHTML"
hx-target="#table_body"
hx-indicator=""
hx-include='#filter_list_storage, #sort_direction_storage, [name="sort"]'
hx-get="{% url "api:invoices:recurring:fetch" %}?page={{ page.next_page_number }}">
»
</button>
{% else %}
<button class="join-item btn">
<i class="fa fa-x w-2 h-2"></i>
</button>
{% endif %}
</div>
</td>
</tr>
{% endif %}
{% else %}
<button class="join-item btn">
<i class="fa fa-x w-2 h-2"></i>
</button>
{% endif %}
<button class="join-item btn">Page {{ page.number }}</button>
{% if page.has_next %}
<button class="join-item btn"
hx-swap="outerHTML"
hx-target="#table_body"
hx-indicator=""
hx-include='#filter_list_storage, #sort_direction_storage, [name="sort"]'
hx-get="{% url "api:invoices:recurring:fetch" %}?page={{ page.next_page_number }}">
»
</button>
{% else %}
<button class="join-item btn">
<i class="fa fa-x w-2 h-2"></i>
</button>
{% endif %}
</div>
</td>
</tr>
{% endif %}
</tbody>
{% for option in all_sort_options %}
<div hx-swap-oob="innerHTML:li[data-sort='{{ option }}'] button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ <h2 class="menu-title">Sort by</h2>
<button class="dropdown-item"
hx-get="{% url 'api:invoices:recurring:fetch' %}"
name="sort"
value="status">Payment Status
</button>
value="status">Payment Status</button>
</li>
<li data-sort="date_due">
<button class="dropdown-item"
hx-get="{% url 'api:invoices:recurring:fetch' %}"
name="sort"
value="date_due">Date
</button>
value="date_due">Date</button>
</li>
</ul>
</div>
Expand Down Expand Up @@ -143,22 +141,22 @@ <h2 class="text-xl" data-oob="recurring-invoices-title">Recurring Invoices</h2>
<div class="w-full overflow-x-auto">
<table class="table">
<thead>
<tr hx-swap="outerHTML"
hx-target="#table_body"
hx-include="#filter_list_storage">
<th>Profile ID</th>
<th>End Date</th>
<th>Client Name</th>
<th>Amount</th>
<th>Status</th>
<th>Actions</th>
</tr>
<tr hx-swap="outerHTML"
hx-target="#table_body"
hx-include="#filter_list_storage">
<th>Profile ID</th>
<th>End Date</th>
<th>Client Name</th>
<th>Amount</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="table_body"
hx-swap="outerHTML"
hx-trigger="load"
hx-get="{% url 'api:invoices:recurring:fetch' %}?page={{ page.next_page_number }}">
{% include 'components/table/skeleton_rows.html' with rows=3 cols=6 %}
{% include 'components/table/skeleton_rows.html' with rows=3 cols=6 %}
</tbody>
</table>
</div>
Expand Down
Loading

0 comments on commit f4cf648

Please sign in to comment.