-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for bootstrap4 and Django 2.2
- Loading branch information
Grzegorz Tężycki
committed
Jan 24, 2020
1 parent
f144e7a
commit 12d92f5
Showing
32 changed files
with
839 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
|
||
# Require | ||
'bootstrap3', | ||
'bootstrap4', | ||
'crispy_forms', | ||
|
||
# Added extra | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends "base.html" %} | ||
{% load bootstrap3 %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block css %} | ||
{% bootstrap_css %} | ||
{% endblock css %} | ||
|
||
{% block content %} | ||
|
||
<h1> Demo - django-popup-view-field using bootstrap 3 </h1> | ||
|
||
<div> | ||
<ul class="nav nav-tabs" role="tablist" id="tabs" data-toggle="tab"> | ||
<li role="presentation" class="active"> | ||
<a href="#bootstrap" aria-controls="bootstrap" role="tab" data-toggle="tab"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using django-bootstrap3 | ||
</a> | ||
</li> | ||
|
||
<li role="presentation"> | ||
<a href="#crispy" aria-controls="crispy" role="tab" data-toggle="tab"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using Crispy forms + helper | ||
</a> | ||
</li> | ||
|
||
<li role="presentation"> | ||
<a href="#crispy-helper" aria-controls="crispy-helper" role="tab" data-toggle="tab"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using Crispy forms without helper | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
{# ------------------------------- #} | ||
<div class="tab-content"> | ||
|
||
<div class="tab-pane fade in active" id="bootstrap"> | ||
<h4> Render with django-bootstrap3 </h4> | ||
<form action="." method="post" class="form"> | ||
{% csrf_token %} | ||
{% bootstrap_form form_1 %} | ||
{% buttons %} | ||
<button type="submit" class="btn btn-primary"> | ||
{% bootstrap_icon "star" %} Submit | ||
</button> | ||
{% endbuttons %} | ||
</form> | ||
</div> | ||
|
||
<div role="tabpanel" class="tab-pane fade" id="crispy"> | ||
<h4> Crispy + helper </h4> | ||
{% crispy form_2 form_2.helper %} | ||
</div> | ||
|
||
<div role="tabpanel" class="tab-pane fade" id="crispy-helper"> | ||
<h4> Crispy without helper </h4> | ||
{% crispy form_3 %} | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
{% endblock content %} | ||
|
||
{% block javascript %} | ||
<script type="text/javascript" src="{% bootstrap_jquery_url %}"></script> | ||
{% bootstrap_javascript %} | ||
{% endblock javascript %} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{% extends "base.html" %} | ||
{% load bootstrap4 %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block css %} | ||
{% bootstrap_css %} | ||
{% endblock css %} | ||
|
||
{% block content %} | ||
<h1> Demo - django-popup-view-field using bootstrap 4 </h1> | ||
|
||
<div> | ||
|
||
<ul class="nav nav-tabs" id="tabs" role="tablist"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" id="tab-bootstrap" data-toggle="tab" href="#bootstrap" role="tab" aria-controls="home" aria-selected="true"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using django-bootstrap4 | ||
</a> | ||
</li> | ||
|
||
<li class="nav-item"> | ||
<a class="nav-link" id="tab-crispy" data-toggle="tab" href="#crispy"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using Crispy forms + helper | ||
</a> | ||
</li> | ||
|
||
<li class="nav-item"> | ||
<a class="nav-link" id="tab-crispy-helper" data-toggle="tab" href="#crispy-helper"> | ||
<span class="glyphicon glyphicon-star"></span> | ||
Form using Crispy forms without helper | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
{# ------------------------------- #} | ||
<div class="tab-content"> | ||
|
||
<div class="tab-pane fade show active" id="bootstrap" role="tabpanel" aria-labelledby="home-tab"> | ||
<h4> Render with django-bootstrap4 </h4> | ||
<form action="." method="post" class="form"> | ||
{% csrf_token %} | ||
{% bootstrap_form form_1 %} | ||
{% buttons %} | ||
<button type="submit" class="btn btn-primary"> | ||
Submit | ||
</button> | ||
{% endbuttons %} | ||
</form> | ||
</div> | ||
|
||
<div role="tabpanel" class="tab-pane fade" id="crispy"> | ||
<h4> Crispy + helper </h4> | ||
{% crispy form_2 form_2.helper %} | ||
</div> | ||
|
||
<div role="tabpanel" class="tab-pane fade" id="crispy-helper"> | ||
<h4> Crispy without helper </h4> | ||
{% crispy form_3 %} | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
{% endblock content %} | ||
|
||
{% block javascript %} | ||
{% bootstrap_javascript jquery='full'%} | ||
{% endblock javascript %} | ||
|
||
|
Oops, something went wrong.