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
deef2625
Commit
deef2625
authored
Oct 09, 2018
by
PJ Janse van Rensburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate 'search' substring from rest of placeholder text.
parent
95d4d102
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
view.py
flask_admin/contrib/sqla/view.py
+3
-3
base.py
flask_admin/model/base.py
+2
-2
layout.html
flask_admin/templates/bootstrap2/admin/model/layout.html
+2
-2
layout.html
flask_admin/templates/bootstrap3/admin/model/layout.html
+3
-3
No files found.
flask_admin/contrib/sqla/view.py
View file @
deef2625
...
...
@@ -592,10 +592,10 @@ class ModelView(BaseModelView):
column_labels = dict(name='Name', last_name='Last Name')
column_searchable_list = ('name', 'last_name')
placeholder is: "
Search:
Name, Last Name"
placeholder is: "Name, Last Name"
"""
if
not
self
.
column_searchable_list
:
return
'Search'
return
None
placeholders
=
[]
...
...
@@ -607,7 +607,7 @@ class ModelView(BaseModelView):
placeholders
.
append
(
self
.
column_labels
.
get
(
searchable
,
searchable
))
return
'Search:
%
s'
%
u', '
.
join
(
placeholders
)
return
u', '
.
join
(
placeholders
)
def
scaffold_filters
(
self
,
name
):
"""
...
...
flask_admin/model/base.py
View file @
deef2625
...
...
@@ -1109,9 +1109,9 @@ class BaseModelView(BaseView, ActionsMixin):
def
search_placeholder
(
self
):
"""
Return search placeholder.
Return search placeholder
text
.
"""
return
'Search'
return
None
# Filter helpers
def
scaffold_filters
(
self
,
name
):
...
...
flask_admin/templates/bootstrap2/admin/model/layout.html
View file @
deef2625
...
...
@@ -74,14 +74,14 @@
{% endif %}
{% if search %}
<div
class=
"input-append"
>
<input
type=
"text"
name=
"search"
value=
"{{ search }}"
class=
"{{ input_class }}"
placeholder=
"{{ _gettext('
%(placeholder)s', placeholder=search_placeholder) }
}"
>
<input
type=
"text"
name=
"search"
value=
"{{ search }}"
class=
"{{ input_class }}"
placeholder=
"{{ _gettext('
Search') }}{% if search_placeholder %}: {{ search_placeholder }}{% endif %
}"
>
<a
href=
"{{ clear_search_url }}"
class=
"clear add-on"
>
<i
class=
"fa fa-times icon-remove"
></i>
</a>
</div>
{% else %}
<div>
<input
type=
"text"
name=
"search"
value=
""
class=
"{{ input_class }}"
placeholder=
"{{ _gettext('
%(placeholder)s', placeholder=search_placeholder) }
}"
>
<input
type=
"text"
name=
"search"
value=
""
class=
"{{ input_class }}"
placeholder=
"{{ _gettext('
Search') }}{% if search_placeholder %}: {{ search_placeholder }}{% endif %
}"
>
</div>
{% endif %}
</form>
...
...
flask_admin/templates/bootstrap3/admin/model/layout.html
View file @
deef2625
...
...
@@ -58,7 +58,7 @@
<div
class=
"clearfix"
></div>
{% endmacro %}
{% macro search_form(input_class="col-md-
2
") %}
{% macro search_form(input_class="col-md-
5
") %}
<form
method=
"GET"
action=
"{{ return_url }}"
class=
"navbar-form navbar-left"
role=
"search"
>
{% for flt_name, flt_value in filter_args.items() %}
<input
type=
"hidden"
name=
"{{ flt_name }}"
value=
"{{ flt_value }}"
>
...
...
@@ -74,12 +74,12 @@
{% endif %}
{% if search %}
<div
class=
"input-group"
>
<input
type=
"text"
name=
"search"
value=
"{{ search }}"
class=
"{{ input_class }} form-control"
placeholder=
"{{ _gettext('
%(placeholder)s', placeholder=search_placeholder) }
}"
>
<input
type=
"text"
name=
"search"
value=
"{{ search }}"
class=
"{{ input_class }} form-control"
placeholder=
"{{ _gettext('
Search') }}{% if search_placeholder %}: {{ search_placeholder }}{% endif %
}"
>
<a
href=
"{{ clear_search_url }}"
class=
"input-group-addon clear"
><span
class=
"fa fa-times glyphicon glyphicon-remove"
></span></a>
</div>
{% else %}
<div
class=
"form-group"
>
<input
type=
"text"
name=
"search"
value=
""
class=
"{{ input_class }} form-control"
placeholder=
"{{ _gettext('
%(placeholder)s', placeholder=search_placeholder) }
}"
>
<input
type=
"text"
name=
"search"
value=
""
class=
"{{ input_class }} form-control"
placeholder=
"{{ _gettext('
Search') }}{% if search_placeholder %}: {{ search_placeholder }}{% endif %
}"
>
</div>
{% endif %}
</form>
...
...
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