File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,8 @@ def project_versions(request, project_slug):
349
349
350
350
Shows the available versions and lets the user choose which ones to build.
351
351
"""
352
+ max_inactive_versions = 100
353
+
352
354
project = get_object_or_404 (
353
355
Project .objects .protected (request .user ),
354
356
slug = project_slug ,
@@ -367,7 +369,7 @@ def project_versions(request, project_slug):
367
369
version_filter = request .GET .get ('version_filter' , '' )
368
370
if version_filter :
369
371
inactive_versions = inactive_versions .filter (verbose_name__icontains = version_filter )
370
- inactive_versions = inactive_versions [:100 ]
372
+ inactive_versions = inactive_versions [:max_inactive_versions ]
371
373
372
374
# If there's a wiped query string, check the string against the versions
373
375
# list and display a success message. Deleting directories doesn't know how
@@ -387,6 +389,7 @@ def project_versions(request, project_slug):
387
389
'inactive_versions' : inactive_versions ,
388
390
'active_versions' : active_versions ,
389
391
'project' : project ,
392
+ 'max_inactive_versions' : max_inactive_versions ,
390
393
},
391
394
)
392
395
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ <h1>{% trans "Activate a version" %}</h1>
83
83
</ div >
84
84
85
85
{# Version search #}
86
+ < a name ="version-filter "> </ a >
86
87
< div class ="wide-search-bar ">
87
88
< div class ="wide-search-bar-wrapper clearfix ">
88
89
< form action =". " method ="GET ">
@@ -134,8 +135,19 @@ <h1>{% trans "Activate a version" %}</h1>
134
135
</ div >
135
136
{% endif %}
136
137
138
+
139
+
137
140
</ div >
138
141
</ div >
142
+
143
+ {% if inactive_versions|length > = max_inactive_versions %}
144
+ < p >
145
+ {% blocktrans trimmed %}
146
+ Only the first {{ max_inactive_versions }} inactive versions were shown. Please < a href ="#version-filter "> filter the list</ a > .
147
+ {% endblocktrans %}
148
+ </ p >
149
+ {% endif %}
150
+
139
151
{% endif %}
140
152
141
153
</ div >
You can’t perform that action at this time.
0 commit comments