diff --git a/django/core/jinja2/base.jinja b/django/core/jinja2/base.jinja
index 054aa9fa1..299f80e9d 100644
--- a/django/core/jinja2/base.jinja
+++ b/django/core/jinja2/base.jinja
@@ -354,7 +354,7 @@
{% if not is_production() %}
-
+
You are currently accessing a test version of the comses.net website . Information that you
view or store here will not be preserved and may not be consistent.
diff --git a/django/core/jinja2/common.jinja b/django/core/jinja2/common.jinja
index d7b2cff91..b0fc5347e 100644
--- a/django/core/jinja2/common.jinja
+++ b/django/core/jinja2/common.jinja
@@ -109,8 +109,9 @@
{% endmacro %}
-{% macro build_paginator_url_params(page_number, query_params) %}{%- if query_params %}{{ query_params }}&{%endif
--%}page={{page_number}}{% endmacro %}
+{% macro build_paginator_url_params(page_number, query_params) %}
+{%- if query_params %}{{ query_params }}&{%endif-%}page={{page_number}}
+{% endmacro %}
{% macro page_nav(url_name, list_state) %}
@@ -127,7 +128,7 @@
1
- {% for page in list_state.range -%}
+ {% for page in list_state.range -%}
{% if loop.first and page > 2 %}
…
@@ -137,42 +138,46 @@
{{ page }}
- {% if loop.last and page < list_state.num_pages - 1 -%}
+ {% if loop.last and page < list_state.num_pages - 1 -%}
+
…
- {% endif %}
- {% endfor %}
- {% if list_state.num_pages > 1 -%}
-
- {{ list_state.num_pages }}
-
- {% endif %}
-
-
- »
- Next
-
-
+ {% endif %}
+ {% endfor %}
+ {% if list_state.num_pages > 1 -%}
+
+ {{ list_state.num_pages }}
+
+ {% endif %}
+
+
+ »
+ Next
+
+
{% endmacro %}
{% macro paginator(url_name, list_state) %}
-
Displaying {{ list_state.num_results }} of {{ list_state.count }} results
- {% if list_state.query %}
- for '{{ list_state.query }}'
- {% endif %}
- {% if list_state.filter_display_terms %}
- {% for term in list_state.filter_display_terms %}
- {{ term }}
- {% endfor %}
-
- clear filters
-
+
Displaying {{ list_state.num_results }} of {{ list_state.count }} results
+ {% if list_state.query or list_state.filter_display_terms %}
+ {% if list_state.query %}
+ for "{{ list_state.query }}"
+ {% endif %}
+ {% if list_state.filter_display_terms %}
+ {% for term in list_state.filter_display_terms %}
+ {{ term }}
+ {% endfor %}
+ {% endif %}
+
+ clear search
+
{% endif %}
+
{% if list_state.count %}
diff --git a/django/core/pagination.py b/django/core/pagination.py
index db6fdcd14..344676764 100644
--- a/django/core/pagination.py
+++ b/django/core/pagination.py
@@ -12,9 +12,9 @@
SORT_BY_FILTERS = defaultdict(
lambda: "Sort by: Relevance", # default sort by relevance
{
- "-first_published_at": "Sort by: Publish date: newest",
- "first_published_at": "Sort by: Publish date: oldest",
- "-last_modified": "Sort by: Recently Modified",
+ "-first_published_at": "Sort by: Recently published",
+ "first_published_at": "Sort by: Earliest published",
+ "-last_modified": "Sort by: Recently modified",
},
)
diff --git a/django/requirements.txt b/django/requirements.txt
index a26f31403..3ec7ca983 100644
--- a/django/requirements.txt
+++ b/django/requirements.txt
@@ -30,6 +30,7 @@ html2text>=2016.9.19
jinja2==3.1.4
jsonschema==4.19.0
markdown==3.6
+MarkupSafe<3.0.0 # FIXME: remove after regression in 3.0.x is patched https://github.com/comses/planning/issues/277
nltk>=3.8.1,<4.0.0
numpy==1.26.4
pandas==2.2.2
diff --git a/frontend/src/components/CodebaseListSidebar.vue b/frontend/src/components/CodebaseListSidebar.vue
index 8a0063db6..4e8a82e9f 100644
--- a/frontend/src/components/CodebaseListSidebar.vue
+++ b/frontend/src/components/CodebaseListSidebar.vue
@@ -141,7 +141,8 @@ const initializeFilterValues = () => {
values.endDate = urlParams.get("publishedBefore")
? new Date(urlParams.get("publishedBefore")!)
: null;
- values.ordering = urlParams.get("ordering") || "-first_published_at";
+ values.ordering =
+ urlParams.get("ordering") || (urlParams.get("query") ? "relevance" : "-first_published_at");
initialFilterValues.value = { ...values };
};