allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 08/14: [#8354] remove iteritems() usage in templates; assuming none of these are such huge lists that py2-non-iter will matter
Date Tue, 10 Mar 2020 16:12:00 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8354
in repository https://gitbox.apache.org/repos/asf/allura.git

commit fa63fe6057c222028705dcbdb23b30ff2b69e335
Author: Dave Brondsema <dave@brondsema.net>
AuthorDate: Fri Mar 6 17:15:08 2020 -0500

    [#8354] remove iteritems() usage in templates; assuming none of these are such huge lists
that py2-non-iter will matter
---
 Allura/allura/ext/admin/templates/project_trove.html                  | 2 +-
 Allura/allura/templates/browse_trove_categories.html                  | 4 ++--
 Allura/allura/templates/reconfirm_auth.html                           | 2 +-
 Allura/allura/templates/repo/merge_request_changed.html               | 2 +-
 Allura/allura/templates/widgets/forge_form.html                       | 2 +-
 Allura/allura/templates/widgets/page_size.html                        | 2 +-
 Allura/allura/templates/widgets/search_help.html                      | 2 +-
 Allura/allura/templates/widgets/state_field.html                      | 2 +-
 Allura/allura/templates_responsive/widgets/forge_form.html            | 2 +-
 ForgeImporters/forgeimporters/templates/project_base.html             | 4 ++--
 ForgeTracker/forgetracker/templates/tracker/admin_fields.html         | 2 +-
 .../templates/tracker_widgets/custom_field_admin_detail.html          | 2 +-
 12 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Allura/allura/ext/admin/templates/project_trove.html b/Allura/allura/ext/admin/templates/project_trove.html
index 23af654..e93aac4 100644
--- a/Allura/allura/ext/admin/templates/project_trove.html
+++ b/Allura/allura/ext/admin/templates/project_trove.html
@@ -50,7 +50,7 @@
   <div class="grid-19 trove_add_container">
     {% if trove_recommendations[base.shortname] %}
         Recommended to choose from:
-            {% for trove_id, label in trove_recommendations[base.shortname].iteritems() %}
+            {% for trove_id, label in trove_recommendations[base.shortname].items() %}
                 <a href="#" data-id="{{ trove_id }}" data-trove="{{ base.shortname }}"
class="recommended_trove"><i class="fa fa-plus-circle"></i> {{ label }}</a>
             {% endfor %}
         <br>
diff --git a/Allura/allura/templates/browse_trove_categories.html b/Allura/allura/templates/browse_trove_categories.html
index 9e2ab07..cbf8c82 100644
--- a/Allura/allura/templates/browse_trove_categories.html
+++ b/Allura/allura/templates/browse_trove_categories.html
@@ -25,10 +25,10 @@
     <h3><a href="/categories">(back)</a></h3>
     <h3>Trove Categories</h3>
     <ul>
-        {% for key, value in tree.iteritems() recursive %}
+        {% for key, value in tree.items() recursive %}
             <li>{{ key }}</li>
             {% if value %}
-                <ul>{{ loop(value.iteritems()) }}</ul>
+                <ul>{{ loop(value.items()) }}</ul>
             {% endif %}
         {% endfor %}
     </ul>
diff --git a/Allura/allura/templates/reconfirm_auth.html b/Allura/allura/templates/reconfirm_auth.html
index 26d6fd2..a3ea322 100644
--- a/Allura/allura/templates/reconfirm_auth.html
+++ b/Allura/allura/templates/reconfirm_auth.html
@@ -35,7 +35,7 @@
     <input type="submit" value="Submit">
 
     {# include any post params again, so that their original form submit can go through successfully
#}
-    {% for key, val in request.POST.iteritems() %}
+    {% for key, val in request.POST.items() %}
         {% if key != 'password' %}
             <input type="hidden" name="{{ key }}" value="{{ val }}">
         {% endif %}
diff --git a/Allura/allura/templates/repo/merge_request_changed.html b/Allura/allura/templates/repo/merge_request_changed.html
index dd4059c..479bab3 100644
--- a/Allura/allura/templates/repo/merge_request_changed.html
+++ b/Allura/allura/templates/repo/merge_request_changed.html
@@ -16,7 +16,7 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-{% for field, values in changes.iteritems() %}
+{% for field, values in changes.items() %}
 {% if field == 'Description': %}
 - **{{ field }}**:
 
diff --git a/Allura/allura/templates/widgets/forge_form.html b/Allura/allura/templates/widgets/forge_form.html
index 1ff6702..4f182d1 100644
--- a/Allura/allura/templates/widgets/forge_form.html
+++ b/Allura/allura/templates/widgets/forge_form.html
@@ -25,7 +25,7 @@
   {% if style == 'wide' %}
     {% set extra_width = 4 %}
   {% endif %}
-  {% if errors and not errors.iteritems and show_errors %}
+  {% if errors and not errors.items and show_errors %}
   <div class="grid-{{19 + extra_width}}"><span {{widget.j2_attrs({'class':error_class})}}>{{errors|nl2br}}</span></div>
   {% endif %}
   {% for field in widget.fields %}
diff --git a/Allura/allura/templates/widgets/page_size.html b/Allura/allura/templates/widgets/page_size.html
index baed90a..623a087 100644
--- a/Allura/allura/templates/widgets/page_size.html
+++ b/Allura/allura/templates/widgets/page_size.html
@@ -17,7 +17,7 @@
        under the License.
 -#}
 <form method="get">
-  {% for k,v in widget.url_params.iteritems() %}
+  {% for k,v in widget.url_params.items() %}
     <input type="hidden" name="{{k}}" value="{{v}}"/>
   {% endfor %}
   {% if limit %}
diff --git a/Allura/allura/templates/widgets/search_help.html b/Allura/allura/templates/widgets/search_help.html
index a936e4c..23a85c1 100644
--- a/Allura/allura/templates/widgets/search_help.html
+++ b/Allura/allura/templates/widgets/search_help.html
@@ -24,7 +24,7 @@
 {% if fields %}
     <p>To search on specific fields, use these field names instead of a general text
search.  You can group with <code>AND</code> or <code>OR</code>.</p>
     <ul>
-    {% for fld, descr in fields.iteritems() %}
+    {% for fld, descr in fields.items() %}
         <li><b>{{ fld }}:</b>{{ descr }}</li>
     {% endfor %}
     </ul>
diff --git a/Allura/allura/templates/widgets/state_field.html b/Allura/allura/templates/widgets/state_field.html
index 59f6843..3dca679 100644
--- a/Allura/allura/templates/widgets/state_field.html
+++ b/Allura/allura/templates/widgets/state_field.html
@@ -25,7 +25,7 @@
       <span class="{{ error_class }}">{{ ctx.errors }}</span><br/>
     {% endif %}
     {{ selector.display(css_class=selector_cls, **ctx) }}
-    {% for name, field in states.iteritems() %}
+    {% for name, field in states.items() %}
         {% set ctx = widget.context_for(field) %}
         <div class="{{ field_cls }}" data-name="{{ name }}">
             {% if field.show_label %}<label for="{{ ctx.name }}">{{ field.label }}</label><br/>{%
endif %}
diff --git a/Allura/allura/templates_responsive/widgets/forge_form.html b/Allura/allura/templates_responsive/widgets/forge_form.html
index 43b72e7..1678a12 100644
--- a/Allura/allura/templates_responsive/widgets/forge_form.html
+++ b/Allura/allura/templates_responsive/widgets/forge_form.html
@@ -29,7 +29,7 @@
       {% if enctype %}enctype="{{enctype}}"{% endif %}
       {% if target %}target="{{target}}"{% endif %}
       action="{{action}}">
-  {% if errors and not errors.iteritems and show_errors %}
+  {% if errors and not errors.items and show_errors %}
   <div class=""><span {{widget.j2_attrs({'class':error_class})}}>{{errors|nl2br}}</span></div>
   {% endif %}
   {% for field in widget.fields %}
diff --git a/ForgeImporters/forgeimporters/templates/project_base.html b/ForgeImporters/forgeimporters/templates/project_base.html
index 09b3d80..65b33b8 100644
--- a/ForgeImporters/forgeimporters/templates/project_base.html
+++ b/ForgeImporters/forgeimporters/templates/project_base.html
@@ -113,14 +113,14 @@
         {% if c.form_errors['tools'] %}
         <div class="error">{{c.form_errors['tools']}}</div>
         {% endif %}
-        {% for name, tool_importer in importer.tool_importers.iteritems() %}
+        {% for name, tool_importer in importer.tool_importers.items() %}
         <div class="tool">
             <img src="{{ tool_importer.tool_icon(g.theme, 48) }}" alt="{{ tool_importer.tool_label
}} icon">
             <label>
                 <input name="tools" value="{{name}}" type="checkbox"{% if not c.form_errors
or name in c.form_values['tools'] %} checked="checked"{% endif %}/>
                 {{tool_importer.tool_label}}
             </label>
-            {% for option_name, option_label in tool_importer.tool_option.iteritems() %}
+            {% for option_name, option_label in tool_importer.tool_option.items() %}
               <label>
                 <input name="tool_option" value="{{option_name}}" type="checkbox"{% if
not c.form_errors or name in c.form_values['tool_option'] %} checked="checked"{% endif %}/>
                 {{option_label}}
diff --git a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
index 33f05a7..751bb85 100644
--- a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
+++ b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
@@ -37,7 +37,7 @@
             <th>Show in list views (e.g. search results, milestone views)</th>
         </tr>
         </thead>
-        {%for column, full_name in columns.iteritems() %}
+        {%for column, full_name in columns.items() %}
         <tr>
             <td>{{full_name}}</td> <td><input type="checkbox" name="{{column}}"
{%if globals.show_in_search[column]%}checked {%endif%}></td>
         </tr>
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/custom_field_admin_detail.html
b/ForgeTracker/forgetracker/templates/tracker_widgets/custom_field_admin_detail.html
index 4dab13d..ef6e5d0 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/custom_field_admin_detail.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/custom_field_admin_detail.html
@@ -19,7 +19,7 @@
 <div class="{{container_cls}}">
   {% set ctx=widget.context_for(selector) %}
   {{selector.display(css_class=selector_cls, **ctx)}}
-  {% for name, field in states.iteritems() %}
+  {% for name, field in states.items() %}
     {% set ctx=widget.context_for(field) %}
     <div class="{{field_cls}}" data-name="{{name}}">
       {{field.display(**ctx)}}


Mime
View raw message