mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-10 14:52:42 +02:00
feat: first batch of work
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{% load i18n %}
|
||||
<div class="tw:container tw:px-md-3 tw:py-3 tw:column-gap-5">
|
||||
<div class="tw:text-3xl tw:font-bold tw:font-mono tw:w-full tw:mb-3">
|
||||
<div class="container px-md-3 py-3 column-gap-5">
|
||||
<div class="text-3xl font-bold font-mono w-full mb-3">
|
||||
{% spaceless %}
|
||||
<div>{% translate 'Rules' %}<span>
|
||||
<a class="tw:no-underline tw:text-2xl tw:p-1 category-action"
|
||||
<a class="no-underline text-2xl p-1 category-action"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Add" %}"
|
||||
@@ -14,32 +14,32 @@
|
||||
{% endspaceless %}
|
||||
</div>
|
||||
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl">
|
||||
<div class="tw:card-body tw:overflow-x-auto">
|
||||
<div class="card bg-base-100 shadow-xl">
|
||||
<div class="card-body overflow-x-auto">
|
||||
{% if transaction_rules %}
|
||||
<c-config.search></c-config.search>
|
||||
<table class="tw:table tw:table-hover">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="tw:w-auto"></th>
|
||||
<th scope="col" class="tw:w-auto"></th>
|
||||
<th scope="col" class="tw:w-auto">{% translate 'Order' %}</th>
|
||||
<th scope="col" class="w-auto"></th>
|
||||
<th scope="col" class="w-auto"></th>
|
||||
<th scope="col" class="w-auto">{% translate 'Order' %}</th>
|
||||
<th scope="col">{% translate 'Name' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rule in transaction_rules %}
|
||||
<tr class="transaction_rule">
|
||||
<td class="tw:w-auto">
|
||||
<div class="tw:join" role="group" aria-label="{% translate 'Actions' %}">
|
||||
<a class="tw:btn tw:btn-secondary tw:btn-sm tw:join-item"
|
||||
<td class="w-auto">
|
||||
<div class="join" role="group" aria-label="{% translate 'Actions' %}">
|
||||
<a class="btn btn-secondary btn-sm join-item"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "View" %}"
|
||||
hx-get="{% url 'transaction_rule_view' transaction_rule_id=rule.id %}"
|
||||
hx-target="#persistent-generic-offcanvas-left">
|
||||
<i class="fa-solid fa-eye fa-fw"></i></a>
|
||||
<a class="tw:btn tw:btn-secondary tw:btn-sm tw:join-item tw:text-error"
|
||||
<a class="btn btn-secondary btn-sm join-item text-error"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Delete" %}"
|
||||
@@ -51,7 +51,7 @@
|
||||
data-confirm-text="{% translate "Yes, delete it!" %}"
|
||||
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
||||
{% if not rule.owner %}
|
||||
<a class="tw:btn tw:btn-secondary tw:btn-sm tw:join-item tw:text-warning"
|
||||
<a class="btn btn-secondary btn-sm join-item text-warning"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Take ownership" %}"
|
||||
@@ -59,7 +59,7 @@
|
||||
<i class="fa-solid fa-crown fa-fw"></i></a>
|
||||
{% endif %}
|
||||
{% if user == rule.owner %}
|
||||
<a class="tw:btn tw:btn-secondary tw:btn-sm tw:join-item tw:text-primary"
|
||||
<a class="btn btn-secondary btn-sm join-item text-primary"
|
||||
role="button"
|
||||
hx-target="#generic-offcanvas"
|
||||
hx-swap="innerHTML"
|
||||
@@ -70,23 +70,23 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="tw:w-auto">
|
||||
<a class="tw:no-underline"
|
||||
<td class="w-auto">
|
||||
<a class="no-underline"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="
|
||||
{% if rule.active %}{% translate "Deactivate" %}{% else %}{% translate "Activate" %}{% endif %}"
|
||||
hx-get="{% url 'transaction_rule_toggle_activity' transaction_rule_id=rule.id %}">
|
||||
{% if rule.active %}<i class="fa-solid fa-toggle-on tw:text-green-400"></i>{% else %}
|
||||
<i class="fa-solid fa-toggle-off tw:text-red-400"></i>{% endif %}
|
||||
{% if rule.active %}<i class="fa-solid fa-toggle-on text-green-400"></i>{% else %}
|
||||
<i class="fa-solid fa-toggle-off text-red-400"></i>{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
<td class="tw:text-center">
|
||||
<td class="text-center">
|
||||
<div>{{ rule.order }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ rule.name }}</div>
|
||||
<div class="tw:text-gray-400">{{ rule.description }}</div>
|
||||
<div class="text-gray-400">{{ rule.description }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{% load i18n %}
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl tw:max-h-full tw:overflow-auto tw:overflow-x-auto">
|
||||
<div class="tw:card-header tw:bg-base-200 tw:p-4">
|
||||
<div role="tablist" class="tw:tabs tw:tabs-lifted">
|
||||
<button class="tw:tab tw:tab-active" id="visual-tab" data-bs-toggle="tab" data-bs-target="#visual-tab-pane"
|
||||
<div class="card bg-base-100 shadow-xl max-h-full overflow-auto overflow-x-auto">
|
||||
<div class="card-header bg-base-200 p-4">
|
||||
<div role="tablist" class="tabs tabs-lifted">
|
||||
<button class="tab tab-active" id="visual-tab" data-bs-toggle="tab" data-bs-target="#visual-tab-pane"
|
||||
type="button" role="tab" aria-controls="visual-tab-pane"
|
||||
aria-selected="true">{% translate 'Visual' %}</button>
|
||||
<button class="tw:tab" id="logs-tab" data-bs-toggle="tab" data-bs-target="#logs-tab-pane" type="button"
|
||||
<button class="tab" id="logs-tab" data-bs-toggle="tab" data-bs-target="#logs-tab-pane" type="button"
|
||||
role="tab" aria-controls="logs-tab-pane" aria-selected="false">{% translate 'Logs' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw:card-body">
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="visual-tab-pane" role="tabpanel" aria-labelledby="home-tab"
|
||||
tabindex="0">
|
||||
@@ -19,9 +19,9 @@
|
||||
{% for result in results %}
|
||||
|
||||
{% if result.type == 'header' %}
|
||||
<div class="tw:my-3">
|
||||
<h6 class="tw:text-center tw:mb-3">
|
||||
<span class="tw:badge tw:badge-secondary">
|
||||
<div class="my-3">
|
||||
<h6 class="text-center mb-3">
|
||||
<span class="badge badge-secondary">
|
||||
{% if result.header_type == "edit_transaction" %}
|
||||
{% translate 'Edit transaction' %}
|
||||
{% elif result.header_type == "update_or_create_transaction" %}
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
|
||||
{% if result.type == 'triggering_transaction' %}
|
||||
<div class="tw:mt-4">
|
||||
<h6 class="tw:text-center tw:mb-3"><span class="tw:badge tw:badge-secondary">{% translate 'Start' %}</span></h6>
|
||||
<div class="mt-4">
|
||||
<h6 class="text-center mb-3"><span class="badge badge-secondary">{% translate 'Start' %}</span></h6>
|
||||
<c-transaction.item :transaction="result.transaction" :dummy="True"
|
||||
:disable-selection="True"></c-transaction.item>
|
||||
</div>
|
||||
@@ -45,8 +45,8 @@
|
||||
<div>
|
||||
<div>
|
||||
{% translate 'Set' %} <span
|
||||
class="tw:badge tw:badge-secondary">{{ result.field }}</span> {% translate 'to' %}
|
||||
<span class="tw:badge tw:badge-secondary">{{ result.new_value }}</span>
|
||||
class="badge badge-secondary">{{ result.field }}</span> {% translate 'to' %}
|
||||
<span class="badge badge-secondary">{{ result.new_value }}</span>
|
||||
</div>
|
||||
<c-transaction.item :transaction="result.transaction" :dummy="True"
|
||||
:disable-selection="True"></c-transaction.item>
|
||||
@@ -55,18 +55,18 @@
|
||||
|
||||
{% if result.type == 'update_or_create_transaction' %}
|
||||
<div>
|
||||
<div class="tw:alert tw:alert-info" role="alert">
|
||||
<div class="alert alert-info" role="alert">
|
||||
{% translate 'Search' %}: {{ result.query }}
|
||||
</div>
|
||||
{% if result.start_transaction %}
|
||||
<c-transaction.item :transaction="result.start_transaction" :dummy="True"
|
||||
:disable-selection="True"></c-transaction.item>
|
||||
{% else %}
|
||||
<div class="tw:alert tw:alert-error" role="alert">
|
||||
<div class="alert alert-error" role="alert">
|
||||
{% translate 'No transaction found, a new one will be created' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="tw:text-center tw:text-3xl tw:my-2"><i class="fa-solid fa-arrow-down"></i></div>
|
||||
<div class="text-center text-3xl my-2"><i class="fa-solid fa-arrow-down"></i></div>
|
||||
<c-transaction.item :transaction="result.end_transaction" :dummy="True"
|
||||
:disable-selection="True"></c-transaction.item>
|
||||
</div>
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
{% if result.type == 'error' %}
|
||||
<div>
|
||||
<div class="tw:alert tw:alert-{% if result.level == 'error' %}error{% elif result.level == 'warning' %}warning{% else %}info{% endif %}" role="alert">
|
||||
<div class="alert alert-{% if result.level == 'error' %}error{% elif result.level == 'warning' %}warning{% else %}info{% endif %}" role="alert">
|
||||
{{ result.error }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
{% block body %}
|
||||
<div hx-get="{% url 'transaction_rule_view' transaction_rule_id=transaction_rule.id %}"
|
||||
hx-trigger="updated from:window" hx-target="closest .offcanvas" class="show-loading">
|
||||
<div class="tw:text-2xl">{{ transaction_rule.name }}</div>
|
||||
<div class="tw:text-base tw:text-gray-400">{{ transaction_rule.description }}</div>
|
||||
<div class="text-2xl">{{ transaction_rule.name }}</div>
|
||||
<div class="text-base text-gray-400">{{ transaction_rule.description }}</div>
|
||||
<hr>
|
||||
<div class="tw:my-3">
|
||||
<div class="tw:text-xl tw:mb-2">{% translate 'If transaction...' %}</div>
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl">
|
||||
<div class="tw:card-body">
|
||||
<div class="my-3">
|
||||
<div class="text-xl mb-2">{% translate 'If transaction...' %}</div>
|
||||
<div class="card bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
{{ transaction_rule.trigger }}
|
||||
</div>
|
||||
<div class="tw:card-footer tw:text-end">
|
||||
<a class="tw:no-underline tw:text-gray-400 tw:p-1"
|
||||
<div class="card-footer text-end">
|
||||
<a class="no-underline text-gray-400 p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Edit" %}"
|
||||
@@ -28,26 +28,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tw:my-3">
|
||||
<div class="tw:text-xl tw:mb-2">{% translate 'Then...' %}</div>
|
||||
<div class="my-3">
|
||||
<div class="text-xl mb-2">{% translate 'Then...' %}</div>
|
||||
{% for action in all_actions %}
|
||||
{% if action.action_type == "edit_transaction" %}
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl tw:mb-3">
|
||||
<div class="tw:card-header tw:bg-base-200 tw:p-4">
|
||||
<div class="card bg-base-100 shadow-xl mb-3">
|
||||
<div class="card-header bg-base-200 p-4">
|
||||
<div>
|
||||
{% if action.order != 0 %}<span class="tw:badge tw:badge-secondary">{{ action.order }}</span>{% endif %}
|
||||
<span class="tw:badge tw:badge-primary">{% trans 'Edit transaction' %}</span>
|
||||
{% if action.order != 0 %}<span class="badge badge-secondary">{{ action.order }}</span>{% endif %}
|
||||
<span class="badge badge-primary">{% trans 'Edit transaction' %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw:card-body">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
{% translate 'Set' %} <span
|
||||
class="tw:badge tw:badge-secondary">{{ action.get_field_display }}</span> {% translate 'to' %}
|
||||
class="badge badge-secondary">{{ action.get_field_display }}</span> {% translate 'to' %}
|
||||
</div>
|
||||
<div class="tw:bg-base-200 tw:rounded-3xl tw:mt-3 tw:p-2">{{ action.value }}</div>
|
||||
<div class="bg-base-200 rounded-3xl mt-3 p-2">{{ action.value }}</div>
|
||||
</div>
|
||||
<div class="tw:card-footer tw:text-end">
|
||||
<a class="tw:no-underline tw:text-gray-400 tw:p-1"
|
||||
<div class="card-footer text-end">
|
||||
<a class="no-underline text-gray-400 p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate 'Edit' %}"
|
||||
@@ -55,7 +55,7 @@
|
||||
hx-target="#generic-offcanvas">
|
||||
<i class="fa-solid fa-pencil fa-fw"></i>
|
||||
</a>
|
||||
<a class="tw:text-error tw:no-underline tw:p-1"
|
||||
<a class="text-error no-underline p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate 'Delete' %}"
|
||||
@@ -71,18 +71,18 @@
|
||||
</div>
|
||||
</div>
|
||||
{% elif action.action_type == "update_or_create_transaction" %}
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl tw:mb-3">
|
||||
<div class="tw:card-header tw:bg-base-200 tw:p-4">
|
||||
<div class="card bg-base-100 shadow-xl mb-3">
|
||||
<div class="card-header bg-base-200 p-4">
|
||||
<div>
|
||||
{% if action.order != 0 %}<span class="tw:badge tw:badge-secondary">{{ action.order }}</span>{% endif %}
|
||||
<span class="tw:badge tw:badge-primary">{% trans 'Update or create transaction' %}</span>
|
||||
{% if action.order != 0 %}<span class="badge badge-secondary">{{ action.order }}</span>{% endif %}
|
||||
<span class="badge badge-primary">{% trans 'Update or create transaction' %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw:card-body">
|
||||
<div class="card-body">
|
||||
<div>{% trans 'Edit to view' %}</div>
|
||||
</div>
|
||||
<div class="tw:card-footer tw:text-end">
|
||||
<a class="tw:no-underline tw:text-gray-400 tw:p-1"
|
||||
<div class="card-footer text-end">
|
||||
<a class="no-underline text-gray-400 p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate 'Edit' %}"
|
||||
@@ -90,7 +90,7 @@
|
||||
hx-target="#generic-offcanvas">
|
||||
<i class="fa-solid fa-pencil fa-fw"></i>
|
||||
</a>
|
||||
<a class="tw:text-error tw:no-underline tw:p-1"
|
||||
<a class="text-error no-underline p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate 'Delete' %}"
|
||||
@@ -107,20 +107,20 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% empty %}
|
||||
<div class="tw:card tw:bg-base-100 tw:shadow-xl">
|
||||
<div class="tw:card-body">
|
||||
<div class="card bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
{% translate 'This rule has no actions' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<hr>
|
||||
<div class="tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-2">
|
||||
<div class="tw:dropdown">
|
||||
<button class="tw:btn tw:btn-outline tw:btn-primary tw:no-underline tw:w-full" type="button" data-bs-toggle="dropdown"
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-2">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline btn-primary no-underline w-full" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="fa-solid fa-flask-vial tw:me-2"></i>{% translate 'Test' %}
|
||||
<i class="fa-solid fa-flask-vial me-2"></i>{% translate 'Test' %}
|
||||
</button>
|
||||
<ul class="tw:dropdown-content tw:menu tw:bg-base-100 tw:rounded-box tw:z-[1] tw:w-52 tw:p-2 tw:shadow">
|
||||
<ul class="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow">
|
||||
{% if transaction_rule.on_create %}
|
||||
<li><a role="link" href="#"
|
||||
hx-get="{% url 'transaction_rule_dry_run_created' pk=transaction_rule.id %}"
|
||||
@@ -138,12 +138,12 @@
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tw:dropdown">
|
||||
<button class="tw:btn tw:btn-outline tw:btn-primary tw:no-underline tw:w-full" type="button" data-bs-toggle="dropdown"
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline btn-primary no-underline w-full" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="fa-solid fa-circle-plus tw:me-2"></i>{% translate 'Add new' %}
|
||||
<i class="fa-solid fa-circle-plus me-2"></i>{% translate 'Add new' %}
|
||||
</button>
|
||||
<ul class="tw:dropdown-content tw:menu tw:bg-base-100 tw:rounded-box tw:z-[1] tw:w-52 tw:p-2 tw:shadow">
|
||||
<ul class="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow">
|
||||
<li><a role="link" href="#"
|
||||
hx-get="{% url 'transaction_rule_action_add' transaction_rule_id=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'Edit Transaction' %}</a></li>
|
||||
|
||||
Reference in New Issue
Block a user