Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add generic form-view.html and grid-view.html templates
- Loading branch information
1 parent
57fc4ab
commit 1eb8db2
Showing
18 changed files
with
135 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% if is_read_only %} | ||
{% import 'keg-elements/forms/horizontal-static.html' as horizontal %} | ||
{% else %} | ||
{% import 'keg-elements/forms/horizontal-b4.html' as horizontal %} | ||
{% endif %} | ||
|
||
{% set base_template = config.get('BASE_TEMPLATE') or config.get('KEG_BASE_TEMPLATE') %} | ||
{% if base_template %} | ||
{% extends base_template %} | ||
{% endif %} | ||
|
||
{% if use_select2 is not defined %} | ||
{% set use_select2 = config.get('KEG_USE_SELECT2', True) %} | ||
{% endif %} | ||
|
||
{% block scripts %} | ||
{{ super() }} | ||
{% if use_select2 %} | ||
{% include 'keg-elements/forms/select2-scripts.html' %} | ||
{% endif %} | ||
{{ horizontal.custom_js() }} | ||
{% endblock %} | ||
|
||
{% block styles %} | ||
{{ super() }} | ||
{% if use_select2 %} | ||
{% include 'keg-elements/forms/select2-styles.html' %} | ||
{% endif %} | ||
{{ horizontal.custom_css() }} | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
{% block page_content_title %} | ||
<h1>{{ title }}</h1> | ||
{% endblock %} | ||
{% block form %}{% endblock %} | ||
{% endblock %} |
File renamed without changes.
File renamed without changes.
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
6 changes: 6 additions & 0 deletions
6
keg_elements/templates/keg-elements/forms/select2-scripts.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,6 @@ | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js"></script> | ||
<script> | ||
$(document).ready(function() { | ||
$('form select').select2(); | ||
}); | ||
</script> |
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 @@ | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/css/select2.min.css" rel="stylesheet" /> |
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,38 @@ | ||
{% set base_template = config.get('BASE_TEMPLATE') or config.get('KEG_BASE_TEMPLATE') %} | ||
{% if base_template %} | ||
{% extends base_template %} | ||
{% endif %} | ||
|
||
{% macro grid_scripts() %} | ||
<script src="{{ url_for('webgrid.static', filename='webgrid.js') }}"></script> | ||
<script src="{{ url_for('webgrid.static', filename='jquery.multiple.select.js') }}"></script> | ||
{% endmacro %} | ||
|
||
{% block page_content %} | ||
{% block page_content_title %} | ||
<h1>{{ title }}</h1> | ||
{% endblock %} | ||
|
||
{% block pre_grid %}{% endblock %} | ||
|
||
<section id="grid-body"> | ||
<div class="preamble"> | ||
{% block preamble %} | ||
{% endblock %} | ||
</div> | ||
{{ grid.html() | safe}} | ||
</section> | ||
|
||
{% block post_grid %}{% endblock %} | ||
|
||
{% if not base_template %} | ||
{{ grid_scripts() }} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block scripts %} | ||
{% if base_template %} | ||
{{ super() }} | ||
{{ grid_scripts() }} | ||
{% endif %} | ||
{% 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
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
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 was deleted.
Oops, something went wrong.
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