File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,14 @@ def project_versions(request, project_slug):
287
287
only_active = False ,
288
288
)
289
289
active_versions = versions .filter (active = True )
290
+
291
+ # Limit inactive versions in case a project has a large number of branches or tags
292
+ # Filter inactive versions based on the query string
290
293
inactive_versions = versions .filter (active = False )
294
+ version_filter = request .GET .get ('version_filter' , '' )
295
+ if version_filter :
296
+ inactive_versions = inactive_versions .filter (verbose_name__icontains = version_filter )
297
+ inactive_versions = inactive_versions [:100 ]
291
298
292
299
# If there's a wiped query string, check the string against the versions
293
300
# list and display a success message. Deleting directories doesn't know how
Original file line number Diff line number Diff line change @@ -78,7 +78,22 @@ <h1>{% trans "Active Versions" %}</h1>
78
78
79
79
{% if inactive_versions %}
80
80
< div class ="module-header ">
81
- < h1 > {% trans "Inactive Versions" %}</ h1 >
81
+ < h1 > {% trans "Activate a version" %}</ h1 >
82
+ < p > {% trans "Active versions are built whenever new code is pushed to that branch or tag." %}</ p >
83
+ </ div >
84
+
85
+ {# Version search #}
86
+ < div class ="wide-search-bar ">
87
+ < div class ="wide-search-bar-wrapper clearfix ">
88
+ < form action =". " method ="GET ">
89
+ < div class ="text-input-wrapper ">
90
+ < input type ="text " name ="version_filter " value ="{{ request.GET.version_filter }} " placeholder ="1.0, 2.0, devel ">
91
+ </ div >
92
+ < div class ="submit-input-wrapper ">
93
+ < input type ="submit " value ="{% trans 'Filter Inactive Versions' %} ">
94
+ </ div >
95
+ </ form >
96
+ </ div >
82
97
</ div >
83
98
84
99
< div class ="module-list ">
@@ -104,7 +119,7 @@ <h1>{% trans "Inactive Versions" %}</h1>
104
119
105
120
{% if request.user|is_admin:project %}
106
121
< ul class ="module-item-menu ">
107
- < li > < a href ="{% url "project_version_detail " project.slug version.slug %}"> {% trans "Edit" %}</ a > </ li >
122
+ < li > < a href ="{% url "project_version_detail " project.slug version.slug %}"> {% trans "Edit & Activate " %}</ a > </ li >
108
123
</ ul >
109
124
{% endif %}
110
125
You can’t perform that action at this time.
0 commit comments