Skip to content

Commit

Permalink
very minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asuworks authored and alee committed Aug 30, 2024
1 parent 4eaa1f6 commit b5cd979
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion django/core/jinja2/common.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<span class="badge bg-gray ms-1">{{ term }}</span>
{% endfor %}
<a class="text-warn ms-1" href="{{ url(url_name) }}">
<i class="fas fa-times"></i> clear
<i class="fas fa-times"></i> clear filters
</a>
{% endif %}
</p>
Expand Down
4 changes: 4 additions & 0 deletions django/library/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ def filter_queryset(self, request, queryset, view):
criteria.update(id__in=filtered_codebase_ids)
if ordering:
criteria.update(ordering=ordering)
else:
if qs:
# set default ordering for search when ordering is not specified
criteria.update(ordering="relevance")

return get_search_queryset(qs, queryset, tags=tags, criteria=criteria)

Expand Down
8 changes: 3 additions & 5 deletions frontend/src/components/CodebaseListSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
</div>
</div>

<div class="mb-3">
<label v-if="parsedLanguageFacets.length > 0" class="form-label fw-bold">
Programming Languages
</label>
<div class="mb-3" v-if="parsedLanguageFacets.length > 0">
<label class="form-label fw-bold"> Programming Languages </label>
<div class="row">
<div v-for="lang in parsedLanguageFacets" :key="lang.value" class="col-12 col-md-12">
<div class="form-check">
Expand Down Expand Up @@ -134,7 +132,7 @@ onMounted(() => {
const initializeFilterValues = () => {
const urlParams = new URLSearchParams(window.location.search);
values.peerReviewStatus = urlParams.get("peerReviewStatus") || "";
values.programmingLanguages = urlParams.getAll("programmingLanguages") || [];
values.programmingLanguages = urlParams.getAll("programmingLanguages").sort() || [];
values.tags = urlParams.getAll("tags").map(tag => ({ name: tag })) || [];
values.startDate = urlParams.get("publishedAfter")
? new Date(urlParams.get("publishedAfter")!)
Expand Down

0 comments on commit b5cd979

Please sign in to comment.