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
f545ca70
Commit
f545ca70
authored
Feb 21, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed autofocus logic
parent
1ae3aad3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
lib.html
flask_admin/templates/admin/lib.html
+4
-5
inline_form.html
flask_admin/templates/admin/model/inline_form.html
+1
-1
No files found.
flask_admin/templates/admin/lib.html
View file @
f545ca70
...
...
@@ -73,7 +73,7 @@
{% endif %}
{%- endmacro %}
{% macro render_field(form, field,
focus_set
=False) %}
{% macro render_field(form, field,
set_focus
=False) %}
<div
class=
"control-group{{ ' error' if field.errors }}"
>
<div
class=
"control-label"
>
{{ field.label.text }}
...
...
@@ -85,9 +85,8 @@
</div>
<div
class=
"controls"
>
<div>
{% if
not focus_set
%}
{% if
set_focus
%}
{{ field(autofocus='autofocus')|safe }}
{% set focus_set = True %}
{% else %}
{{ field()|safe }}
{% endif %}
...
...
@@ -106,11 +105,11 @@
</div>
{% endmacro %}
{% macro render_form_fields(form,
focus_set=Fals
e) %}
{% macro render_form_fields(form,
set_focus=Tru
e) %}
{{ form.hidden_tag() if form.hidden_tag is defined }}
{% for f in form if f.type != 'HiddenField' and f.type != 'CSRFTokenField' %}
{{ render_field(form, f,
focus_set
) }}
{{ render_field(form, f,
not loop.index0 and set_focus
) }}
{% endfor %}
{% endmacro %}
...
...
flask_admin/templates/admin/model/inline_form.html
View file @
f545ca70
{% import 'admin/lib.html' as lib with context %}
{{ lib.render_form_fields(field,
Tru
e) }}
{{ lib.render_form_fields(field,
Fals
e) }}
<hr/>
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