File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
qgis-app/plugins/templates/plugins Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 88 < option value ="name " {% if request.GET.sort == 'name ' %}selected{% endif %} > {% trans "Name" %}</ option >
99 < option value ="downloads " {% if request.GET.sort == 'downloads ' %}selected{% endif %} > {% trans "Downloads" %}</ option >
1010 < option value ="author " {% if request.GET.sort == 'author ' %}selected{% endif %} > {% trans "Author" %}</ option >
11+ < option value ="created_on " {% if request.GET.sort == 'created_on ' %}selected{% endif %} > {% trans "Created On" %}</ option >
1112 < option value ="latest_version_date " {% if request.GET.sort == 'latest_version_date ' %}selected{% endif %} > {% trans "Latest Version" %}</ option >
1213 < option value ="weighted_rating " {% if request.GET.sort == 'weighted_rating ' %}selected{% endif %} > {% trans "Stars" %}</ option >
1314 </ select >
3536
3637 // Preserve the other sorting option (sort/order)
3738 if ( key === 'sort' && ! params . has ( 'order' ) ) {
38- params . set ( 'order' , 'asc' ) ; // Default to ascending if no order is selected
39+ if ( value === 'name' || value === 'author' ) {
40+ params . set ( 'order' , 'asc' ) ; // Default to descending if sorting by weighted rating
41+ } else {
42+ params . set ( 'order' , 'desc' ) ; // Default to ascending if no order is selected
43+ }
3944 } else if ( key === 'order' && ! params . has ( 'sort' ) ) {
4045 params . set ( 'sort' , 'name' ) ; // Default to sorting by name if no sort field is selected
4146 }
You can’t perform that action at this time.
0 commit comments