Commit 36b788e0 by Chif Gergő

request: Make template look similar to other tables on request page

Added a new panel with the header: Request fields. The field form now in the table last line.
parent 10b9ae7d
Pipeline #678 passed with stage
in 0 seconds
...@@ -3,42 +3,53 @@ ...@@ -3,42 +3,53 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block content %} {% block content %}
<div class="table-responsive"> <div class="row">
<div class="table-container"> <div class="col-md-12">
<table class="table table-bordered table-striped table-hover" > <div class="panel panel-default">
<thead> <div class="panel-heading">
<tr> <h3 class="no-margin"><i class="fa fa-phone"></i> {% trans "Request fields" %}</h3>
<th>{% trans "Fieldname" %}</th> </div>
<th>{% trans "Type" %}</th> <div class="panel-body">
<th>{% trans "Choices" %}</th> <div class="table-responsive">
<th>{% trans "Required" %}</th> <div class="table-container">
<th>{% trans "Delete" %}</th> <table class="text-center table table-bordered table-striped table-hover" >
</tr> <thead class"align-center">
</thead> <tr>
<tbody> <th class="text-center">{% trans "Fieldname" %}</th>
{% for field in object_list %} <th class="text-center">{% trans "Type" %}</th>
<tr> <th class="text-center">{% trans "Choices" %}</th>
<td>{{field.fieldname}}</td> <th class="text-center">{% trans "Required" %}</th>
<td>{{field.type}}</td> <th class="text-center">{% trans "Delete" %}</th>
<td>{{field.choices}}</td> </tr>
<td>{{field.required}}</td> </thead>
<td><a href={% url "request.views.field-delete" pk=field.pk %}> <tbody>
<i class="fa fa-times"></i></a> {% for field in object_list %}
</td> <tr>
</tr> <td>{{field.fieldname}}</td>
{% endfor %} <td>{{field.type}}</td>
<tr> <td>{{field.choices}}</td>
<form action={% url 'request.views.request-field-add' %} method="post"> <td>{{field.required}}</td>
{% csrf_token %} <td><a href={% url "request.views.field-delete" pk=field.pk %}>
{% for field in add_form %} <i class="fa fa-times"></i></a>
<td> {{field}}</td> </td>
{% endfor %} </tr>
<td><button type="submit" class="btn btn-sm btn-success">{% trans "Add" %}</button></td> {% endfor %}
</form> <tr>
</tr> <form action={% url 'request.views.request-field-add' %} method="post">
</tbody> {% csrf_token %}
</table> {% for field in add_form %}
</div> <td> {{field}}</td>
</div> {% endfor %}
<td><button type="submit" class="btn btn-sm btn-success">{% trans "Add" %}</button></td>
</form>
</tr>
</tbody>
</table>
</div>
</div> <!-- .table-responsive -->
</div> <!-- .panel-body -->
</div>
</div>
</div>
{% endblock %} {% endblock %}
...@@ -49,7 +49,6 @@ from django.urls import reverse_lazy ...@@ -49,7 +49,6 @@ from django.urls import reverse_lazy
class RequestFieldFormView(LoginRequiredMixin, CreateView): class RequestFieldFormView(LoginRequiredMixin, CreateView):
template_name = 'request/_request-field-form.html'
model = RequestField model = RequestField
form_class = RequestFieldModelForm form_class = RequestFieldModelForm
success_url = reverse_lazy('request.views.field-list') success_url = reverse_lazy('request.views.field-list')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment