2021-05-17 16:27:27 -04:00
|
|
|
{% extends 'base/layout.html' %}
|
2021-12-15 16:57:30 -05:00
|
|
|
{% load helpers %}
|
2016-11-02 16:43:24 -04:00
|
|
|
{% load form_helpers %}
|
2021-12-13 15:36:51 -05:00
|
|
|
{% load render_table from django_tables2 %}
|
2023-07-29 03:30:25 +07:00
|
|
|
{% load i18n %}
|
2016-11-02 16:43:24 -04:00
|
|
|
|
2023-08-02 14:53:32 -04:00
|
|
|
{% block title %}
|
|
|
|
{% trans "Add" %} {{ model_name|title }}
|
|
|
|
{% endblock %}
|
2021-03-13 02:19:42 -07:00
|
|
|
|
2021-12-15 16:57:30 -05:00
|
|
|
{% block tabs %}
|
|
|
|
<ul class="nav nav-tabs px-3">
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button class="nav-link active" id="component-form-tab" data-bs-toggle="tab" data-bs-target="#component-form" type="button" role="tab" aria-controls="component-form" aria-selected="true">
|
2023-07-29 03:30:25 +07:00
|
|
|
{% trans "Bulk Creation" %}
|
2021-12-15 16:57:30 -05:00
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button class="nav-link" id="object-list-tab" data-bs-toggle="tab" data-bs-target="#object-list" type="button" role="tab" aria-controls="object-list" aria-selected="false">
|
2023-07-29 03:30:25 +07:00
|
|
|
{% trans "Selected Objects" %}
|
2021-12-15 16:57:30 -05:00
|
|
|
{% badge table.rows|length %}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content-wrapper %}
|
|
|
|
<div class="tab-content">
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
{# Component creation form #}
|
|
|
|
<div class="tab-pane show active" id="component-form" role="tabpanel" aria-labelledby="component-form-tab">
|
|
|
|
<form action="" method="post" class="form form-horizontal">
|
|
|
|
|
|
|
|
{% csrf_token %}
|
|
|
|
{% if request.POST.return_url %}
|
|
|
|
<input type="hidden" name="return_url" value="{{ request.POST.return_url }}" />
|
|
|
|
{% endif %}
|
|
|
|
{% for field in form.hidden_fields %}
|
|
|
|
{{ field }}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col col-md-12 col-lg-10 offset-lg-1">
|
|
|
|
<div class="card">
|
2023-07-29 03:30:25 +07:00
|
|
|
<h5 class="card-header">{{ model_name|title }} {% trans "to Add" %}</h5>
|
2021-12-15 16:57:30 -05:00
|
|
|
<div class="card-body">
|
|
|
|
{% for field in form.visible_fields %}
|
|
|
|
{% render_field field %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group text-end">
|
|
|
|
<div class="col col-md-12">
|
2023-07-29 03:30:25 +07:00
|
|
|
<a href="{{ return_url }}" class="btn btn-outline-danger">{% trans "Cancel" %}</a>
|
|
|
|
<button type="submit" name="_create" class="btn btn-primary">{% trans "Create" %}</button>
|
2021-12-15 16:57:30 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-11-02 16:43:24 -04:00
|
|
|
</div>
|
2021-12-15 16:57:30 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{# Selected objects list #}
|
|
|
|
<div class="tab-pane" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body table-responsive">
|
|
|
|
{% render_table table 'inc/table.html' %}
|
|
|
|
</div>
|
2016-11-02 16:43:24 -04:00
|
|
|
</div>
|
2021-12-15 16:57:30 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|