mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-14 08:42:45 +02:00
feat: multi tenancy support
This commit is contained in:
@@ -17,40 +17,59 @@
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 gy-3 gx-3">
|
||||
{% for strategy in strategies %}
|
||||
<div class="col">
|
||||
<div class="card h-100">
|
||||
<div class="card-header">
|
||||
<span class="badge rounded-pill text-bg-secondary">{{ strategy.payment_currency.name }}</span> x <span class="badge rounded-pill text-bg-secondary">{{ strategy.target_currency.name }}</span>
|
||||
</div>
|
||||
<a href="{% url 'dca_strategy_detail_index' strategy_id=strategy.id %}" hx-boost="true" class="text-decoration-none card-body">
|
||||
<div class="">
|
||||
<div class="card-title tw-text-xl">{{ strategy.name }}</div>
|
||||
<div class="card-text tw-text-gray-400">{{ strategy.notes }}</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="card-footer text-end">
|
||||
<a class="text-decoration-none tw-text-gray-400 p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Edit" %}"
|
||||
hx-get="{% url 'dca_strategy_edit' strategy_id=strategy.id %}"
|
||||
hx-target="#generic-offcanvas">
|
||||
<i class="fa-solid fa-pencil fa-fw"></i>
|
||||
</a>
|
||||
<a class="text-danger text-decoration-none p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Delete" %}"
|
||||
hx-delete="{% url 'dca_strategy_delete' strategy_id=strategy.id %}"
|
||||
hx-trigger='confirmed'
|
||||
data-bypass-on-ctrl="true"
|
||||
data-title="{% translate "Are you sure?" %}"
|
||||
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>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card h-100">
|
||||
<div class="card-header">
|
||||
<span class="badge rounded-pill text-bg-secondary">{{ strategy.payment_currency.name }}</span> x <span
|
||||
class="badge rounded-pill text-bg-secondary">{{ strategy.target_currency.name }}</span>
|
||||
</div>
|
||||
<a href="{% url 'dca_strategy_detail_index' strategy_id=strategy.id %}" hx-boost="true"
|
||||
class="text-decoration-none card-body">
|
||||
<div class="">
|
||||
<div class="card-title tw-text-xl">{{ strategy.name }}</div>
|
||||
<div class="card-text tw-text-gray-400">{{ strategy.notes }}</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="card-footer text-end">
|
||||
<a class="text-decoration-none tw-text-gray-400 p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Edit" %}"
|
||||
hx-get="{% url 'dca_strategy_edit' strategy_id=strategy.id %}"
|
||||
hx-target="#generic-offcanvas">
|
||||
<i class="fa-solid fa-pencil fa-fw"></i>
|
||||
</a>
|
||||
<a class="text-danger text-decoration-none p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Delete" %}"
|
||||
hx-delete="{% url 'dca_strategy_delete' strategy_id=strategy.id %}"
|
||||
hx-trigger='confirmed'
|
||||
data-bypass-on-ctrl="true"
|
||||
data-title="{% translate "Are you sure?" %}"
|
||||
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>
|
||||
</a>
|
||||
{% if not strategy.owner %}
|
||||
<a class="text-primary text-decoration-none p-1"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Take ownership" %}"
|
||||
hx-get="{% url 'dca_strategy_take_ownership' strategy_id=strategy.id %}">
|
||||
<i class="fa-solid fa-crown fa-fw"></i></a>
|
||||
{% endif %}
|
||||
{% if user == strategy.owner %}
|
||||
<a class="text-primary text-decoration-none p-1"
|
||||
role="button"
|
||||
hx-target="#generic-offcanvas"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Share" %}"
|
||||
hx-get="{% url 'dca_strategy_share_settings' pk=strategy.id %}">
|
||||
<i class="fa-solid fa-share fa-fw"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'extends/offcanvas.html' %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Share settings' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url "dca_strategy_share_settings" pk=object.id %}" hx-target="#generic-offcanvas" novalidate>
|
||||
{% crispy form %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user