mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-13 16:22:42 +02:00
feat: replace action row with a FAB
This commit is contained in:
@@ -44,14 +44,16 @@
|
|||||||
</div>
|
</div>
|
||||||
{# Action buttons#}
|
{# Action buttons#}
|
||||||
<div class="col-12 col-xl-8">
|
<div class="col-12 col-xl-8">
|
||||||
<c-ui.quick-transactions-buttons
|
{# <c-ui.quick-transactions-buttons#}
|
||||||
:year="year"
|
{# :year="year"#}
|
||||||
:month="month"
|
{# :month="month"#}
|
||||||
></c-ui.quick-transactions-buttons>
|
{# ></c-ui.quick-transactions-buttons>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="show-loading" hx-get="{% url 'calendar_list' month=month year=year %}" hx-trigger="load, updated from:window, selective_update from:window"></div>
|
<div class="show-loading" hx-get="{% url 'calendar_list' month=month year=year %}"
|
||||||
|
hx-trigger="load, updated from:window, selective_update from:window"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c-ui.transactions_fab></c-ui.transactions_fab>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<div class="tw-min-h-16">
|
||||||
|
<div
|
||||||
|
id="fab-wrapper"
|
||||||
|
class="tw-fixed tw-bottom-5 tw-right-5 tw-ml-auto tw-w-max tw-flex tw-flex-col tw-items-end mt-5">
|
||||||
|
<div
|
||||||
|
id="menu"
|
||||||
|
class="tw-flex tw-flex-col tw-items-end tw-space-y-6 tw-transition-all tw-duration-300 tw-ease-in-out tw-opacity-0 tw-invisible tw-hidden tw-mb-2">
|
||||||
|
|
||||||
|
{{ slot }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn-primary rounded-circle p-0 tw-w-12 tw-h-12 tw-flex tw-items-center tw-justify-center tw-shadow-lg hover:tw-shadow-xl focus:tw-shadow-xl tw-transition-all tw-duration-300 tw-ease-in-out"
|
||||||
|
_="
|
||||||
|
on click or focusout
|
||||||
|
if #menu matches .tw-invisible and event.type === 'click'
|
||||||
|
add .tw-rotate-45 to #fab-icon
|
||||||
|
remove .tw-invisible from #menu
|
||||||
|
remove .tw-hidden from #menu
|
||||||
|
remove .tw-opacity-0 from #menu
|
||||||
|
else
|
||||||
|
wait 0.2s
|
||||||
|
remove .tw-rotate-45 from #fab-icon
|
||||||
|
add .tw-invisible to #menu
|
||||||
|
add .tw-hidden to #menu
|
||||||
|
add .tw-opacity-0 to #menu
|
||||||
|
end
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<i id="fab-icon" class="fa-solid fa-plus tw-text-3xl tw-transition-transform tw-duration-300 tw-ease-in-out"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
<div class="tw-relative fab-item">
|
||||||
|
<button class="btn btn-sm btn-{{ color }}"
|
||||||
|
hx-get="{{ url }}"
|
||||||
|
hx-trigger="{{ hx_trigger }}"
|
||||||
|
hx-target="{{ hx_target }}"
|
||||||
|
hx-vals='{{ hx_vals }}'>
|
||||||
|
<i class="{{ icon }} me-2"></i>
|
||||||
|
{{ title }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
<c-components.fab>
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="success"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, add_income from:window"
|
||||||
|
hx_vals='{"year": {{ year }}, {% if month %}"month": {{ month }},{% endif %} "type": "IN"}'
|
||||||
|
url="{% url 'transaction_add' %}"
|
||||||
|
icon="fa-solid fa-arrow-right-to-bracket"
|
||||||
|
title="{% translate "Income" %}"></c-components.fab_menu_button>
|
||||||
|
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="danger"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, add_income from:window"
|
||||||
|
hx_vals='{"year": {{ year }}, {% if month %}"month": {{ month }},{% endif %} "type": "EX"}'
|
||||||
|
url="{% url 'transaction_add' %}"
|
||||||
|
icon="fa-solid fa-arrow-right-from-bracket"
|
||||||
|
title="{% translate "Expense" %}"></c-components.fab_menu_button>
|
||||||
|
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="warning"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, installment from:window"
|
||||||
|
url="{% url 'installment_plan_add' %}"
|
||||||
|
icon="fa-solid fa-divide"
|
||||||
|
title="{% translate "Installment" %}"></c-components.fab_menu_button>
|
||||||
|
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="warning"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, recurring from:window"
|
||||||
|
url="{% url 'recurring_transaction_add' %}"
|
||||||
|
icon="fa-solid fa-repeat"
|
||||||
|
title="{% translate "Recurring" %}"></c-components.fab_menu_button>
|
||||||
|
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="info"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, transfer from:window"
|
||||||
|
hx_vals='{"year": {{ year }} {% if month %}, "month": {{ month }}{% endif %}}'
|
||||||
|
url="{% url 'transactions_transfer' %}"
|
||||||
|
icon="fa-solid fa-money-bill-transfer"
|
||||||
|
title="{% translate "Transfer" %}"></c-components.fab_menu_button>
|
||||||
|
|
||||||
|
<c-components.fab_menu_button
|
||||||
|
color="info"
|
||||||
|
hx_target="#generic-offcanvas"
|
||||||
|
hx_trigger="click, balance from:window"
|
||||||
|
url="{% url 'account_reconciliation' %}"
|
||||||
|
icon="fa-solid fa-scale-balanced"
|
||||||
|
title="{% translate "Balance" %}"></c-components.fab_menu_button>
|
||||||
|
</c-components.fab>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<div id="toasts">
|
<div id="toasts">
|
||||||
<div class="toast-container position-fixed bottom-0 end-0 p-3" hx-trigger="load, updated from:window, toasts from:window" hx-get="{% url 'toasts' %}" hx-swap="beforeend">
|
<div class="toast-container position-fixed bottom-0 start-50 translate-middle-x p-3" hx-trigger="load, updated from:window, toasts from:window" hx-get="{% url 'toasts' %}" hx-swap="beforeend">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{# Action buttons#}
|
{# Action buttons#}
|
||||||
<div class="col-12 col-xl-8">
|
{# <div class="col-12 col-xl-8">#}
|
||||||
<c-ui.quick-transactions-buttons
|
{# <c-ui.quick-transactions-buttons#}
|
||||||
:year="year"
|
{# :year="year"#}
|
||||||
:month="month"
|
{# :month="month"#}
|
||||||
></c-ui.quick-transactions-buttons>
|
{# ></c-ui.quick-transactions-buttons>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
</div>
|
||||||
{# Monthly summary#}
|
{# Monthly summary#}
|
||||||
<div class="row gx-xl-4 gy-3">
|
<div class="row gx-xl-4 gy-3">
|
||||||
@@ -174,7 +174,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="search" class="my-3">
|
<div id="search" class="my-3">
|
||||||
<label class="w-100">
|
<label class="w-100">
|
||||||
<input type="search" class="form-control" placeholder="{% translate 'Search' %}" hx-preserve id="quick-search"
|
<input type="search" class="form-control" placeholder="{% translate 'Search' %}" hx-preserve
|
||||||
|
id="quick-search"
|
||||||
_="on input or search or htmx:afterSwap from window
|
_="on input or search or htmx:afterSwap from window
|
||||||
if my value is empty
|
if my value is empty
|
||||||
trigger toggle on <.transactions-divider-collapse/>
|
trigger toggle on <.transactions-divider-collapse/>
|
||||||
@@ -195,4 +196,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<c-ui.transactions_fab></c-ui.transactions_fab>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -39,15 +39,16 @@
|
|||||||
</div>
|
</div>
|
||||||
{# Action buttons#}
|
{# Action buttons#}
|
||||||
<div class="col-12 col-xl-10">
|
<div class="col-12 col-xl-10">
|
||||||
<c-ui.quick-transactions-buttons
|
{# <c-ui.quick-transactions-buttons#}
|
||||||
:year="year"
|
{# :year="year"#}
|
||||||
:month="month"
|
{# :month="month"#}
|
||||||
></c-ui.quick-transactions-buttons>
|
{# ></c-ui.quick-transactions-buttons>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-2">
|
<div class="col-lg-2">
|
||||||
<div class="nav flex-column nav-pills" id="month-pills" role="tablist" aria-orientation="vertical" hx-indicator="#data-content">
|
<div class="nav flex-column nav-pills" id="month-pills" role="tablist" aria-orientation="vertical"
|
||||||
|
hx-indicator="#data-content">
|
||||||
<input type="hidden" name="month" value="">
|
<input type="hidden" name="month" value="">
|
||||||
<button class="nav-link active"
|
<button class="nav-link active"
|
||||||
role="tab"
|
role="tab"
|
||||||
@@ -78,7 +79,8 @@
|
|||||||
|
|
||||||
<hr class="my-4 d-block d-lg-none">
|
<hr class="my-4 d-block d-lg-none">
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
<div class="nav flex-column nav-pills" id="currency-pills" role="tablist" aria-orientation="vertical" hx-indicator="#data-content">
|
<div class="nav flex-column nav-pills" id="currency-pills" role="tablist" aria-orientation="vertical"
|
||||||
|
hx-indicator="#data-content">
|
||||||
<input type="hidden" name="account" value="">
|
<input type="hidden" name="account" value="">
|
||||||
<button class="nav-link active"
|
<button class="nav-link active"
|
||||||
role="tab"
|
role="tab"
|
||||||
@@ -118,4 +120,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c-ui.transactions_fab></c-ui.transactions_fab>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -41,15 +41,16 @@
|
|||||||
</div>
|
</div>
|
||||||
{# Action buttons#}
|
{# Action buttons#}
|
||||||
<div class="col-12 col-xl-10">
|
<div class="col-12 col-xl-10">
|
||||||
<c-ui.quick-transactions-buttons
|
{# <c-ui.quick-transactions-buttons#}
|
||||||
:year="year"
|
{# :year="year"#}
|
||||||
:month="month"
|
{# :month="month"#}
|
||||||
></c-ui.quick-transactions-buttons>
|
{# ></c-ui.quick-transactions-buttons>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-2">
|
<div class="col-lg-2">
|
||||||
<div class="nav flex-column nav-pills" id="month-pills" role="tablist" aria-orientation="vertical" hx-indicator="#data-content">
|
<div class="nav flex-column nav-pills" id="month-pills" role="tablist" aria-orientation="vertical"
|
||||||
|
hx-indicator="#data-content">
|
||||||
<input type="hidden" name="month" value="">
|
<input type="hidden" name="month" value="">
|
||||||
<button class="nav-link active"
|
<button class="nav-link active"
|
||||||
role="tab"
|
role="tab"
|
||||||
@@ -80,7 +81,8 @@
|
|||||||
|
|
||||||
<hr class="my-4 d-block d-lg-none">
|
<hr class="my-4 d-block d-lg-none">
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
<div class="nav flex-column nav-pills" id="currency-pills" role="tablist" aria-orientation="vertical" hx-indicator="#data-content">
|
<div class="nav flex-column nav-pills" id="currency-pills" role="tablist" aria-orientation="vertical"
|
||||||
|
hx-indicator="#data-content">
|
||||||
<input type="hidden" name="currency" value="">
|
<input type="hidden" name="currency" value="">
|
||||||
<button class="nav-link active"
|
<button class="nav-link active"
|
||||||
role="tab"
|
role="tab"
|
||||||
@@ -120,4 +122,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c-ui.transactions_fab></c-ui.transactions_fab>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user