Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
b32808c4
Commit
b32808c4
authored
Dec 28, 2014
by
Paul Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve styling of inline forms
parent
6d2026d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
28 deletions
+45
-28
inline_list_base.html
...in/templates/bootstrap2/admin/model/inline_list_base.html
+19
-12
inline_list_base.html
...in/templates/bootstrap3/admin/model/inline_list_base.html
+26
-16
No files found.
flask_admin/templates/bootstrap2/admin/model/inline_list_base.html
View file @
b32808c4
{% macro render_inline_fields(field, template, render, check=None) %}
{% macro render_inline_fields(field, template, render, check=None) %}
<div
class=
"inline-field"
>
<div
class=
"inline-field"
>
{# existing inline form fields #}
<div
class=
"inline-field-list"
>
<div
class=
"inline-field-list"
>
{% for subfield in field %}
{% for subfield in field %}
<div
id=
"{{ subfield.id }}"
class=
"inline-field"
>
<div
id=
"{{ subfield.id }}"
class=
"inline-field
well well-small
"
>
{%- if not check or check(subfield) %}
{%- if not check or check(subfield) %}
{% if subfield.get_pk and subfield.get_pk() %}
<legend>
<div
class=
"inline-field-control"
>
{{ field.label.text }} #{{ loop.index }}
<div
class=
"pull-right"
>
{% if subfield.get_pk and subfield.get_pk() %}
<input
type=
"checkbox"
name=
"del-{{ subfield.id }}"
id=
"del-{{ subfield.id }}"
/>
<input
type=
"checkbox"
name=
"del-{{ subfield.id }}"
id=
"del-{{ subfield.id }}"
/>
<label
for=
"del-{{ subfield.id }}"
style=
"display: inline"
>
{{ _gettext('Delete?') }}
</label>
<label
for=
"del-{{ subfield.id }}"
style=
"display: inline"
>
{{ _gettext('Delete?') }}
</label>
</div>
{% else %}
{% else %}
<div
class=
"inline-field-control"
>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"icon-remove"
></i></a>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"icon-remove"
></i></a>
{% endif %}
</div>
</div>
{% endif %}
</legend>
{%- endif -%}
{%- endif -%}
{{ render(subfield) }}
{{ render(subfield) }}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{# template for new inline form fields #}
<div
class=
"inline-field-template hide"
>
<div
class=
"inline-field-template hide"
>
{% filter forceescape %}
{% filter forceescape %}
<div
class=
"inline-field"
>
<div
class=
"inline-field well well-small"
>
<div
class=
"inline-field-control"
>
<legend>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"icon-remove"
></i></a>
New {{ field.label.text }}
</div>
<div
class=
"pull-right"
>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"icon-remove"
></i></a>
</div>
</legend>
{{ render(template) }}
{{ render(template) }}
</div>
</div>
{% endfilter %}
{% endfilter %}
</div>
</div>
<a
id=
"{{ field.id }}-button"
href=
"javascript:void(0)"
class=
"btn"
onclick=
"faForm.addInlineField(this, '{{ field.id }}');"
>
{{ _gettext('Add') }} {{ field.label.text }}
</a>
<a
id=
"{{ field.id }}-button"
href=
"javascript:void(0)"
class=
"btn"
onclick=
"faForm.addInlineField(this, '{{ field.id }}');"
>
{{ _gettext('Add') }} {{ field.label.text }}
</a>
</div>
</div>
{% endmacro %}
{% endmacro %}
flask_admin/templates/bootstrap3/admin/model/inline_list_base.html
View file @
b32808c4
{% macro render_inline_fields(field, template, render, check=None) %}
{% macro render_inline_fields(field, template, render, check=None) %}
<div
class=
"inline-field"
>
<div
class=
"inline-field"
>
{# existing inline form fields #}
<div
class=
"inline-field-list"
>
<div
class=
"inline-field-list"
>
{% for subfield in field %}
{% for subfield in field %}
<div
id=
"{{ subfield.id }}"
class=
"inline-field well"
>
<div
id=
"{{ subfield.id }}"
class=
"inline-field well
well-sm
"
>
{%- if not check or check(subfield) %}
{%- if not check or check(subfield) %}
{% if subfield.get_pk and subfield.get_pk() %}
<legend>
<div
class=
"inline-field-control"
>
<small>
<input
type=
"checkbox"
name=
"del-{{ subfield.id }}"
id=
"del-{{ subfield.id }}"
/>
{{ field.label.text }} #{{ loop.index }}
<label
for=
"del-{{ subfield.id }}"
style=
"display: inline"
>
{{ _gettext('Delete?') }}
</label>
<div
class=
"pull-right"
>
</div>
{% if subfield.get_pk and subfield.get_pk() %}
{% else %}
<input
type=
"checkbox"
name=
"del-{{ subfield.id }}"
id=
"del-{{ subfield.id }}"
/>
<div
class=
"inline-field-control"
>
<label
for=
"del-{{ subfield.id }}"
style=
"display: inline"
>
{{ _gettext('Delete?') }}
</label>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"glyphicon glyphicon-remove"
></i></a>
{% else %}
</div>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><i
class=
"glyphicon glyphicon-remove"
></i></a>
{% endif %}
{% endif %}
</div>
</small>
</legend>
<div
class=
'clearfix'
></div>
{%- endif -%}
{%- endif -%}
{{ render(subfield) }}
{{ render(subfield) }}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{# template for new inline form fields #}
<div
class=
"inline-field-template hide"
>
<div
class=
"inline-field-template hide"
>
{% filter forceescape %}
{% filter forceescape %}
<div
class=
"inline-field panel panel-info"
>
<div
class=
"inline-field well well-sm"
>
<div
class=
"inline-field-control"
>
<legend>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><span
class=
"glyphicon glyphicon-remove"
></span></a>
<small>
New {{ field.label.text }}
</small>
</div>
<div
class=
"pull-right"
>
<a
href=
"javascript:void(0)"
class=
"inline-remove-field"
><span
class=
"glyphicon glyphicon-remove"
></span></a>
</div>
</legend>
<div
class=
'clearfix'
></div>
{{ render(template) }}
{{ render(template) }}
</div>
</div>
{% endfilter %}
{% endfilter %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment