Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
f34777a2
Commit
f34777a2
authored
Aug 28, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translations for HTML filters
parent
0b77e733
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
8 deletions
+14
-8
rest_framework/filters.py
+2
-1
rest_framework/templates/rest_framework/admin.html
+1
-1
rest_framework/templates/rest_framework/base.html
+2
-1
rest_framework/templates/rest_framework/filters/django_filter.html
+3
-2
rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html
+2
-1
rest_framework/templates/rest_framework/filters/ordering.html
+2
-1
rest_framework/templates/rest_framework/filters/search.html
+2
-1
No files found.
rest_framework/filters.py
View file @
f34777a2
...
...
@@ -12,6 +12,7 @@ from django.core.exceptions import ImproperlyConfigured
from
django.db
import
models
from
django.template
import
Context
,
loader
from
django.utils
import
six
from
django.utils.translation
import
ugettext_lazy
as
_
from
rest_framework.compat
import
(
crispy_forms
,
distinct
,
django_filters
,
get_model_name
,
guardian
...
...
@@ -31,7 +32,7 @@ if 'crispy_forms' in settings.INSTALLED_APPS and crispy_forms and django_filters
field
.
help_text
=
None
layout_components
=
list
(
self
.
form
.
fields
.
keys
())
+
[
Submit
(
''
,
'Submit'
,
css_class
=
'btn-default'
),
Submit
(
''
,
_
(
'Submit'
)
,
css_class
=
'btn-default'
),
]
helper
=
FormHelper
()
...
...
rest_framework/templates/rest_framework/admin.html
View file @
f34777a2
...
...
@@ -116,7 +116,7 @@
{% if filter_form %}
<button
style=
"float: right; margin-right: 10px"
data-toggle=
"modal"
data-target=
"#filtersModal"
class=
"btn btn-default"
>
<span
class=
"glyphicon glyphicon-wrench"
aria-hidden=
"true"
></span>
Filters
{% trans "Filters" %}
</button>
{% endif %}
...
...
rest_framework/templates/rest_framework/base.html
View file @
f34777a2
{% load staticfiles %}
{% load rest_framework %}
{% load i18n %}
<!DOCTYPE html>
<html>
<head>
...
...
@@ -112,7 +113,7 @@
{% if filter_form %}
<button
style=
"float: right; margin-right: 10px"
data-toggle=
"modal"
data-target=
"#filtersModal"
class=
"btn btn-default"
>
<span
class=
"glyphicon glyphicon-wrench"
aria-hidden=
"true"
></span>
Filters
{% trans "Filters" %}
</button>
{% endif %}
...
...
rest_framework/templates/rest_framework/filters/django_filter.html
View file @
f34777a2
<h2>
Field filters
</h2>
{% load i18n %}
<h2>
{% trans "Field filters" %}
</h2>
<form
class=
"form"
action=
""
method=
"get"
>
{{ filter.form.as_p }}
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
{% trans "Submit" %}
</button>
</form>
rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html
View file @
f34777a2
{% load crispy_forms_tags %}
{% load i18n %}
<h2>
Field filters
</h2>
<h2>
{% trans "Field filters" %}
</h2>
{% crispy filter.form %}
rest_framework/templates/rest_framework/filters/ordering.html
View file @
f34777a2
{% load rest_framework %}
<h2>
Ordering
</h2>
{% load i18n %}
<h2>
{% trans "Ordering" %}
</h2>
<div
class=
"list-group"
>
{% for key, label in options %}
{% if key == current %}
...
...
rest_framework/templates/rest_framework/filters/search.html
View file @
f34777a2
<h2>
Search
</h2>
{% load i18n %}
<h2>
{% trans "Search" %}
</h2>
<form
class=
"form-inline"
>
<div
class=
"form-group"
>
<div
class=
"input-group"
>
...
...
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