Use add_class widget to prevent overwrites of existing classes.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-16 14:01:13 -04:00
parent 70df49c892
commit 72818c5ec4
7 changed files with 21 additions and 15 deletions

View File

@ -8,11 +8,11 @@
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
crossorigin="anonymous">
crossorigin="anonymous" />
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous">
crossorigin="anonymous" />
</head>
<body style="padding-top: 5rem;">
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
@ -52,7 +52,13 @@
</nav>
<div id="view-{{ request.resolver_match.view_name }}" class="container-fluid">
{% block content %}{% endblock %}
<div class="row justify-content-md-center">
<div class="col-lg-8">
{% block content %}{% endblock %}
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</body>
</html>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>

View File

@ -21,9 +21,9 @@
<div class="form-group">
<label for="id_{{ field.name }}">{{ field.label }}</label>
{% if field.errors %}
{{ field|attr:"class:form-control is-invalid" }}
{{ field|add_class:"form-control is-invalid" }}
{% else %}
{{ field|attr:"class:form-control" }}
{{ field|add_class:"form-control" }}
{% endif %}
{% if field.help_text %}
<p class="help-block"><small>{{ field.help_text }}</small></p>