add confirmation disable billing and update other style (#2)

This commit is contained in:
Muhammad Irfan 2023-06-07 14:19:37 +07:00 committed by GitHub
parent 15a794fe97
commit ea4d6da2cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 45 deletions

View file

@ -16,14 +16,24 @@
<div class="row">
<div class="col-sm-12">
{% if setting.billing_enabled %}
<h1>Billing Enabled</h1> <br/>
<a href="{% url 'horizon:admin:billing_setting:disable_billing' %}" class="btn btn-primary">Disable Billing</a>
<div class="panel panel-success">
<div class="panel-heading">Status: Billing Enabled</div>
<div class="panel-body">
<button class="btn btn-danger" data-toggle="modal" data-target="#modal_disable_billing">Disable Billing</button>
</div>
</div>
{% else %}
<h1>Billing Disabled</h1> <br/>
<p>Please make sure all price is already configured before enable billing</p>
<a href="{% url 'horizon:admin:billing_setting:enable_billing' %}" class="btn btn-primary {% if missing_price.has_missing or missing_setting.has_missing %} disabled {% endif %}">Enable</a>
<a href="{% url 'horizon:admin:billing_setting:reset_billing' %}" class="btn btn-danger">Reset Billing Data</a>
<div class="panel panel-danger">
<div class="panel-heading">Status: Billing Disabled</div>
<div class="panel-body">
<p>Please make sure all price is already configured before enable billing</p>
<a href="{% url 'horizon:admin:billing_setting:enable_billing' %}" class="btn btn-primary {% if missing_price.has_missing or missing_setting.has_missing %} disabled {% endif %}">Enable</a>
<a href="{% url 'horizon:admin:billing_setting:reset_billing' %}" class="btn btn-danger">Reset Billing Data</a>
</div>
</div>
{% endif %}
</div>
</div>
{% include "admin/billing_setting/modal_disable_billing.html" with modal_backdrop='static' hide=True %}
{% endblock %}

View file

@ -0,0 +1,15 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% block modal_id %}modal_disable_billing{% endblock %}
{% block modal_backdrop %}static{% endblock %}
{% block modal-header %}{% trans "Confirmation" %}{% endblock %}
{% block modal-body %}
<p>{% trans "Are you sure to disable billing?" %}</p>
{% endblock %}
{% block modal-footer %}
<a href='#' class='btn btn-danger cancel' data-dismiss='modal'>{% trans "No" %}</a>
<a href="{% url 'horizon:admin:billing_setting:disable_billing' %}" class="btn btn-primary">{% trans "Yes" %}</a>
{% endblock %}

View file

@ -6,34 +6,30 @@
<div class="row">
<div class="col-sm-6">
<dl class="dl-horizontal">
<dt>Project: </dt>
<dd>
<select id="selection" onchange="onSelection(this.value)">
<option value='null'
{% if not current_tenant_id %}selected {% endif %}
>All</option>
<b>Project: </b>
<select id="selection" onchange="onSelection(this.value)">
<option value='null'
{% if not current_tenant_id %}selected {% endif %}
>All</option>
<option
value='{"tenant_id": "0"}'
{% if "0" == current_tenant_id %}selected {% endif %}
>General Notification
</option>
<option
value='{"tenant_id": "0"}'
{% if "0" == current_tenant_id %}selected {% endif %}
>General Notification
</option>
{% for i in select_list %}
<option
value='{"tenant_id": "{{ i.id }}"}'
{% if i.id == current_tenant_id %}selected {% endif %}
>{{ i.name }}
</option>
{% endfor %}
</select>
</dd>
</dl>
{% for i in select_list %}
<option
value='{"tenant_id": "{{ i.id }}"}'
{% if i.id == current_tenant_id %}selected {% endif %}
>{{ i.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-sm-6 text-right">
<a href="{% url 'horizon:admin:notification_center:read_all' current_tenant_id %}"
class="btn btn-primary" style="margin-bottom: 8px">Mark to Read All</a>
<div class="col-sm-6">
<a href="{% url 'horizon:admin:notification_center:read_all' current_tenant_id %}"
class="btn btn-primary pull-right" style="margin-bottom: 8px">Mark to Read All</a>
</div>
</div>
<div class="row">

View file

@ -1,21 +1,22 @@
{% extends 'base.html' %}
{% block title %}{{ page_title }}{% endblock %}
{% block main %}
<div>
<dl class="dl-horizontal">
<dt>Project: </dt>
<dd>
<select id="project_select" onchange="onProjectSelect(this.value)">
{% for i in project_list %}
<option
value='{"project_id": "{{ i.id }}", "project_name": "{{ i.name }}"}'
{% if i.id == current_project_id %}selected {% endif %}
>{{ i.name }}</option>
{% endfor %}
</select>
</dd>
</dl>
<div class="row" style="margin-bottom: 15px;">
<div class="col-md-6">
<b>Invoice Month</b>
<select id="project_select" onchange="onProjectSelect(this.value)">
{% for i in project_list %}
<option
value='{"project_id": "{{ i.id }}", "project_name": "{{ i.name }}"}'
{% if i.id == current_project_id %}selected {% endif %}
>{{ i.name }}</option>
{% endfor %}
</select>
</div>
</div>
{{ table.render }}
{% endblock %}
{% block js %}