Skip to content

Commit e94011e

Browse files
authored
Merge pull request #4972 from tomchristie/use-items-template-tag
Use 'items' templatetag throughout.
2 parents df2adbb + 0173e9b commit e94011e

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

rest_framework/templates/rest_framework/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h1>{{ name }}</h1>
150150
</div>
151151

152152
<div class="response-info">
153-
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% autoescape off %}{% for key, val in response_headers.items %}
153+
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% autoescape off %}{% for key, val in response_headers|items %}
154154
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>{% endfor %}
155155

156156
</span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %}

rest_framework/templates/rest_framework/docs/document.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ <h1>{{ document.title }}</h1>
1414
</div>
1515
</div>
1616

17-
{% for section_key, section in document.data.items %}
17+
{% for section_key, section in document.data|items %}
1818
{% if section_key %}
1919
<h2 id="{{ section_key }}" class="coredocs-section-title">{{ section_key }} <a href="#{{ section_key }}"><i class="fa fa-link" aria-hidden="true"></i>
2020
</a></h2>
2121
{% endif %}
2222

23-
{% for link_key, link in section.links.items %}
23+
{% for link_key, link in section.links|items %}
2424
{% include "rest_framework/docs/link.html" %}
2525
{% endfor %}
2626
{% endfor %}
2727

28-
{% for link_key, link in document.links.items %}
28+
{% for link_key, link in document.links|items %}
2929
{% include "rest_framework/docs/link.html" %}
3030
{% endfor %}

rest_framework/templates/rest_framework/docs/sidebar.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
{% load rest_framework %}
12
<div class="sidebar">
23
<h3 class="brand"><a href="#">{{ document.title }}</a></h3>
34

45
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
56
<div class="menu-list">
67
<ul id="menu-content" class="menu-content collapse out">
7-
{% for section_key, section in document.data.items %}
8+
{% for section_key, section in document.data|items %}
89
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
910
<a><i class="fa fa-dot-circle-o fa-lg"></i> {% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
1011
</li>
1112
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
12-
{% for link_key, link in section.links.items %}
13+
{% for link_key, link in section.links|items %}
1314
<li><a href="#{{ section_key }}-{{ link_key }}">{{ link.title|default:link_key }}</a></li>
1415
{% endfor %}
1516
</ul>

rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
<div class="col-sm-10">
1111
{% if style.inline %}
12-
{% for key, text in field.choices.items %}
12+
{% for key, text in field.choices|items %}
1313
<label class="checkbox-inline">
1414
<input type="checkbox" name="{{ field.name }}" value="{{ key }}" {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}>
1515
{{ text }}
1616
</label>
1717
{% endfor %}
1818
{% else %}
19-
{% for key, text in field.choices.items %}
19+
{% for key, text in field.choices|items %}
2020
<div class="checkbox">
2121
<label>
2222
<input type="checkbox" name="{{ field.name }}" value="{{ key }}" {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}>

rest_framework/templates/rest_framework/horizontal/radio.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</label>
2020
{% endif %}
2121

22-
{% for key, text in field.choices.items %}
22+
{% for key, text in field.choices|items %}
2323
<label class="radio-inline">
2424
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key|as_string == field.value|as_string %}checked{% endif %} />
2525
{{ text }}
@@ -34,7 +34,7 @@
3434
</label>
3535
</div>
3636
{% endif %}
37-
{% for key, text in field.choices.items %}
37+
{% for key, text in field.choices|items %}
3838
<div class="radio">
3939
<label>
4040
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key|as_string == field.value|as_string %}checked{% endif %} />

rest_framework/templates/rest_framework/inline/checkbox_multiple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<label class="sr-only">{{ field.label }}</label>
66
{% endif %}
77

8-
{% for key, text in field.choices.items %}
8+
{% for key, text in field.choices|items %}
99
<div class="checkbox">
1010
<label>
1111
<input type="checkbox" name="{{ field.name }}" value="{{ key }}" {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}>

rest_framework/templates/rest_framework/inline/radio.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919
{% endif %}
2020

21-
{% for key, text in field.choices.items %}
21+
{% for key, text in field.choices|items %}
2222
<div class="radio">
2323
<label>
2424
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key|as_string == field.value|as_string %}checked{% endif %}>

rest_framework/templates/rest_framework/vertical/checkbox_multiple.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
{% if style.inline %}
99
<div>
10-
{% for key, text in field.choices.items %}
10+
{% for key, text in field.choices|items %}
1111
<label class="checkbox-inline">
1212
<input type="checkbox" name="{{ field.name }}" value="{{ key }}" {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}>
1313
{{ text }}
1414
</label>
1515
{% endfor %}
1616
</div>
1717
{% else %}
18-
{% for key, text in field.choices.items %}
18+
{% for key, text in field.choices|items %}
1919
<div class="checkbox">
2020
<label>
2121
<input type="checkbox" name="{{ field.name }}" value="{{ key }}" {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}>

rest_framework/templates/rest_framework/vertical/radio.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</label>
1919
{% endif %}
2020

21-
{% for key, text in field.choices.items %}
21+
{% for key, text in field.choices|items %}
2222
<label class="radio-inline">
2323
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key|as_string == field.value|as_string %}checked{% endif %}>
2424
{{ text }}
@@ -35,7 +35,7 @@
3535
</div>
3636
{% endif %}
3737

38-
{% for key, text in field.choices.items %}
38+
{% for key, text in field.choices|items %}
3939
<div class="radio">
4040
<label>
4141
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key|as_string == field.value|as_string %}checked{% endif %}>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy