mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-26 10:38:36 +02:00
changes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{% extends 'extends/offcanvas.html' %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Edit transaction rule' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url 'transaction_rule_dry_run_created' pk=rule.id %}" hx-target="#generic-offcanvas"
|
||||
hx-indicator="#dry-run-created-result, closest form" class="show-loading" novalidate>
|
||||
{% crispy form %}
|
||||
</form>
|
||||
<hr>
|
||||
<div id="dry-run-created-result" class="show-loading">
|
||||
{% include 'rules/fragments/transaction_rule/dry_run/visual.html' with logs=logs results=results %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% extends 'extends/offcanvas.html' %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Edit transaction rule' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url 'transaction_rule_dry_run_deleted' pk=rule.id %}" hx-target="#generic-offcanvas"
|
||||
hx-indicator="#dry-run-deleted-result, closest form" class="show-loading" novalidate>
|
||||
{% crispy form %}
|
||||
</form>
|
||||
<hr>
|
||||
<div id="dry-run-deleted-result" class="show-loading">
|
||||
{% include 'rules/fragments/transaction_rule/dry_run/visual.html' with logs=logs results=results %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="card tw:max-h-full tw:overflow-auto tw:overflow-x-auto">
|
||||
<div class="card-body">
|
||||
<pre>
|
||||
{{ logs|linebreaks }}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,82 @@
|
||||
{% load i18n %}
|
||||
<div class="card tw:max-h-full tw:overflow-auto tw:overflow-x-auto">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link 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>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" 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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<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">
|
||||
{% if not results %}
|
||||
{% translate 'Run a test to see...' %}
|
||||
{% else %}
|
||||
{% for result in results %}
|
||||
|
||||
{% if result.type == 'triggering_transaction' %}
|
||||
<div class="mt-4">
|
||||
<h6 class="text-center mb-3"><span class="badge text-bg-secondary">{% translate 'Start' %}</span></h6>
|
||||
<c-transaction.item :transaction="result.transaction" :dummy="True"
|
||||
:disable-selection="True"></c-transaction.item>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if result.type == 'edit_transaction' %}
|
||||
<div class="mt-4">
|
||||
<h6 class="text-center mb-3"><span class="badge text-bg-secondary">{% translate 'Edit transaction' %}</span>
|
||||
</h6>
|
||||
<div>
|
||||
{% translate 'Set' %} <span
|
||||
class="badge text-bg-secondary">{{ result.field }}</span> {% translate 'to' %}
|
||||
<span class="badge text-bg-secondary">{{ result.new_value }}</span>
|
||||
</div>
|
||||
<c-transaction.item :transaction="result.transaction" :dummy="True"
|
||||
:disable-selection="True" :overriden_tags="result.tags" :overriden_entities="result.entities"></c-transaction.item>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if result.type == 'update_or_create_transaction' %}
|
||||
<div class="mt-4">
|
||||
<h6 class="text-center mb-3"><span class="badge text-bg-secondary">{% translate 'Update or create transaction' %}</span>
|
||||
</h6>
|
||||
<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="alert alert-danger" role="alert">
|
||||
{% translate 'No transaction found, a new one will be created' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="text-center h3"><i class="fa-solid fa-arrow-down"></i></div>
|
||||
<c-transaction.item :transaction="result.start_transaction" :dummy="True"
|
||||
:disable-selection="True" :overriden_tags="result.tags" :overriden_entities="result.entities"></c-transaction.item>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="tab-pane fade" id="logs-tab-pane" role="tabpanel" aria-labelledby="logs-tab" tabindex="0">
|
||||
{% if not logs %}
|
||||
{% translate 'Run a test to see...' %}
|
||||
{% else %}
|
||||
<pre>
|
||||
{{ logs|linebreaks }}
|
||||
</pre>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
data-text="{% translate "You won't be able to revert this!" %}"
|
||||
data-confirm-text="{% translate 'Yes, delete it!' %}"
|
||||
_="install prompt_swal">
|
||||
<i class="fa-solid fa-trash fa-fw"></i>
|
||||
<i class="fa-solid fa-trash fa-fw"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,33 +101,57 @@
|
||||
data-text="{% translate "You won't be able to revert this!" %}"
|
||||
data-confirm-text="{% translate 'Yes, delete it!' %}"
|
||||
_="install prompt_swal">
|
||||
<i class="fa-solid fa-trash fa-fw"></i>
|
||||
<i class="fa-solid fa-trash fa-fw"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if not all_actions %}
|
||||
{% empty %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{% translate 'This rule has no actions' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-primary text-decoration-none w-100" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="fa-solid fa-circle-plus me-2"></i>{% translate 'Add new' %}
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end w-100">
|
||||
<li><a class="dropdown-item" role="link"
|
||||
hx-get="{% url 'transaction_rule_action_add' transaction_rule_id=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'Edit Transaction' %}</a></li>
|
||||
<li><a class="dropdown-item" role="link"
|
||||
hx-get="{% url 'update_or_create_transaction_rule_action_add' transaction_rule_id=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'Update or Create Transaction' %}</a></li>
|
||||
</ul>
|
||||
<div class="d-grid d-lg-flex gap-2">
|
||||
<div class="dropdown flex-fill">
|
||||
<button class="btn btn-outline-primary text-decoration-none w-100" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="fa-solid fa-flask-vial me-2"></i>{% translate 'Test' %}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{% if transaction_rule.on_create %}
|
||||
<li><a class="dropdown-item" role="link" href="#"
|
||||
hx-get="{% url 'transaction_rule_dry_run_created' pk=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'On creation' %}</a></li>
|
||||
{% endif %}
|
||||
{% if transaction_rule.on_update %}
|
||||
<li><a class="dropdown-item" role="link" href="#"
|
||||
hx-get="{% url 'transaction_rule_dry_run_deleted' pk=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'On update' %}</a></li>
|
||||
{% endif %}
|
||||
{% if transaction_rule.on_delete %}
|
||||
<li><a class="dropdown-item" role="link" href="#"
|
||||
hx-get="{% url 'transaction_rule_dry_run_deleted' pk=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'On delete' %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="dropdown flex-fill">
|
||||
<button class="btn btn-outline-primary text-decoration-none w-100" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="fa-solid fa-circle-plus me-2"></i>{% translate 'Add new' %}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" 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>
|
||||
<li><a class="dropdown-item" role="link" href="#"
|
||||
hx-get="{% url 'update_or_create_transaction_rule_action_add' transaction_rule_id=transaction_rule.id %}"
|
||||
hx-target="#generic-offcanvas">{% trans 'Update or Create Transaction' %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user