-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
174 additions
and
23 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
21 changes: 21 additions & 0 deletions
21
examples/fieldsets/templates/fieldsets/bootstrap5_view.html
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,21 @@ | ||
{% load tapeforms %}<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Simple Bootstrap v5</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
</head> | ||
|
||
<body> | ||
<div class="p-4"> | ||
<form action="." method="post" novalidate> | ||
{% csrf_token %} | ||
{% for fieldset in form.get_fieldsets %} | ||
{% form fieldset %} | ||
{% endfor %} | ||
<button type="submit">Submit</button> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
from django.urls import path | ||
|
||
from .views import ManualFieldsetsView, PropertyFieldsetsView | ||
from .views import BootstrapFieldsetsView, ManualFieldsetsView, PropertyFieldsetsView | ||
|
||
urlpatterns = [ | ||
path("manual/", ManualFieldsetsView.as_view()), | ||
path("property/", PropertyFieldsetsView.as_view()), | ||
path("bootstrap/", BootstrapFieldsetsView.as_view()), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
LAYOUT_DEFAULT_TEMPLATE = "tapeforms/layouts/default.html" | ||
FIELDSET_DEFAULT_TEMPLATE = "tapeforms/fieldsets/default.html" | ||
FIELD_DEFAULT_TEMPLATE = "tapeforms/fields/default.html" |
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,27 @@ | ||
{% extends 'tapeforms/layouts/bootstrap.html' %} | ||
{% load tapeforms %} | ||
|
||
|
||
{% block fields %} | ||
<div class="card mb-3"> | ||
{% if form.fieldset_title %} | ||
<div class="card-header">{{ form.fieldset_title }}</div> | ||
{% endif %} | ||
|
||
<div class="card-body"> | ||
{{ block.super }} | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block visible_fields %} | ||
{% for field_row in visible_fields %} | ||
<div class="{{ form.extra.row_css_class|default:'row' }}"> | ||
{% for field in field_row %} | ||
<div class="{{ form.extra.col_css_class|default:'col' }}"> | ||
{% formfield field %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |
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,23 @@ | ||
{% extends 'tapeforms/layouts/default.html' %} | ||
{% load tapeforms %} | ||
|
||
|
||
{% block fields %} | ||
{% if form.fieldset_title %} | ||
<h3>{{ form.fieldset_title }}</h3> | ||
{% endif %} | ||
|
||
{{ block.super }} | ||
{% endblock %} | ||
|
||
{% block visible_fields %} | ||
{% for field_row in visible_fields %} | ||
<div class="field-row"> | ||
{% for field in field_row %} | ||
<div class="field-col"> | ||
{% formfield field %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |
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