Tweak form widths

This commit is contained in:
jeremystretch 2021-07-20 13:21:09 -04:00
parent b59c1c693d
commit ba3552b697
3 changed files with 41 additions and 44 deletions

View File

@ -5,25 +5,25 @@
{% render_errors form %}
{% block content %}
{% if perms.extras.add_journalentry %}
{% if perms.extras.add_journalentry %}
<form action="{% url 'extras:journalentry_add' %}" method="post" enctype="multipart/form-data">
<div class="col col-md-9">
<div class="field-group">
<h4>New Journal Entry</h4>
{% csrf_token %}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
{% render_field form.kind %}
{% render_field form.comments %}
</div>
<div class="col col-md-12 text-end my-3">
<a href="{{ object.get_absolute_url }}" class="btn btn-outline-danger">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
<div class="container">
<div class="field-group">
<h4>New Journal Entry</h4>
{% csrf_token %}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
{% render_field form.kind %}
{% render_field form.comments %}
</div>
<div class="col col-md-12 text-end my-3">
<a href="{{ object.get_absolute_url }}" class="btn btn-outline-danger">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
</form>
{% endif %}
{% render_table table 'inc/table.html' %}
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
{% endif %}
{% render_table table 'inc/table.html' %}
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
{% endblock %}

View File

@ -6,7 +6,7 @@
{% block content %}
<div class="row">
<div class="col col-md-12 col-xl-8 offset-xl-2">
<div class="col col-md-12 col-lg-10 offset-lg-1">
<ul class="nav nav-tabs mb-3" role="tablist">
<li class="nav-item" role="presentation">
<a href="#csv" class="nav-link active" role="tab" data-bs-toggle="tab">CSV</a>

View File

@ -18,37 +18,34 @@
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
<div class="row">
<div class="col col-md-8 offset-md-2 col-lg-6 offset-lg-3">
<div class="col col-md-12 col-lg-10 offset-lg-1">
{% block tabs %}{% endblock %}
{% block form %}
{% if form.Meta.fieldsets %}
{# Render grouped fields according to Form #}
{% for group, fields in form.Meta.fieldsets %}
<div class="field-group">
{# Render grouped fields according to Form #}
{% for group, fields in form.Meta.fieldsets %}
<div class="field-group">
<h4>{{ group }}</h4>
{% for name in fields %}
{% render_field form|getfield:name %}
{% endfor %}
</div>
{% endfor %}
<h4>{{ group }}</h4>
{% if form.custom_fields %}
<div class="field-group">
<h4>Custom Fields</h4>
{% render_custom_fields form %}
</div>
{% endif %}
{% for name in fields %}
{% render_field form|getfield:name %}
{% endfor %}
</div>
{% endfor %}
{% if form.custom_fields %}
<div class="field-group">
<h4>Custom Fields</h4>
{% render_custom_fields form %}
</div>
{% endif %}
{% if form.comments %}
<div class="field-group">
<h4>Comments</h4>
{% render_field form.comments %}
</div>
{% endif %}
{% if form.comments %}
<div class="field-group">
<h4>Comments</h4>
{% render_field form.comments %}
</div>
{% endif %}
{% else %}
{# Render all fields in a single group #}