From 3226e8c6d8c7b451ce9d4623ace572d95f8da75f Mon Sep 17 00:00:00 2001 From: rasarkar <105652044+rasarkar@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:36:46 -0400 Subject: [PATCH 01/13] CONCD-877 Add padding between topic description and progress bar (#2467) --- concordia/templates/transcriptions/topic_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordia/templates/transcriptions/topic_detail.html b/concordia/templates/transcriptions/topic_detail.html index cd230eb5e..3e8abecf5 100644 --- a/concordia/templates/transcriptions/topic_detail.html +++ b/concordia/templates/transcriptions/topic_detail.html @@ -19,7 +19,7 @@ {% block main_content %}
-
+

{{ topic.title }}

{{ topic.description|safe }}
From 220da6c2811df030f74dcb035cf6083d7a42843d Mon Sep 17 00:00:00 2001 From: Josh Stegmaier <104993387+joshuastegmaier@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:07:45 -0400 Subject: [PATCH 02/13] Added topic filter to resource admin, and removed 'title' filter (#2469) --- concordia/admin/__init__.py | 3 ++- concordia/admin/filters.py | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/concordia/admin/__init__.py b/concordia/admin/__init__.py index a4521121c..6889704ab 100644 --- a/concordia/admin/__init__.py +++ b/concordia/admin/__init__.py @@ -80,6 +80,7 @@ SubmittedFilter, TagCampaignListFilter, TagCampaignStatusListFilter, + TopicListFilter, TranscriptionCampaignListFilter, TranscriptionCampaignStatusListFilter, TranscriptionProjectListFilter, @@ -360,8 +361,8 @@ class ResourceAdmin(admin.ModelAdmin, CustomListDisplayFieldsMixin): list_filter = ( "resource_type", ResourceCampaignStatusListFilter, + TopicListFilter, ResourceCampaignListFilter, - "title", ) def formfield_for_foreignkey(self, db_field, request, **kwargs): diff --git a/concordia/admin/filters.py b/concordia/admin/filters.py index 236c31337..4148a0d5b 100644 --- a/concordia/admin/filters.py +++ b/concordia/admin/filters.py @@ -1,7 +1,7 @@ from django.contrib import admin from django.utils.translation import gettext_lazy as _ -from ..models import Campaign, Project +from ..models import Campaign, Project, Topic class NullableTimestampFilter(admin.SimpleListFilter): @@ -92,6 +92,25 @@ def queryset(self, request, queryset): return queryset +class TopicListFilter(admin.SimpleListFilter): + """ + Base class for admin topic filters + """ + + title = "Topic" + template = "admin/long_name_filter.html" + parameter_name = "topic__id__exact" + + def lookups(self, request, model_admin): + queryset = Topic.objects.all() + return queryset.values_list("id", "title").order_by("title") + + def queryset(self, request, queryset): + if self.value(): + return queryset.filter(**{self.parameter_name: self.value()}) + return queryset + + class ProjectCampaignListFilter(CampaignListFilter): parameter_name = "campaign__id__exact" status_filter_parameter = "campaign__status" From 08ee3bb98f9ffe1e07f8b90186a1ed99dcc74f2e Mon Sep 17 00:00:00 2001 From: Josh Stegmaier <104993387+joshuastegmaier@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:14:07 -0400 Subject: [PATCH 03/13] Renamed 'Quick Tips' to 'Campaign Tips' on places that face the user. Left 'quick tips' as an identifier in the code (analytics, element ids, etc.) (#2470) --- concordia/templates/transcriptions/asset_detail.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/concordia/templates/transcriptions/asset_detail.html b/concordia/templates/transcriptions/asset_detail.html index 5ed967fbf..ff8d17ac8 100644 --- a/concordia/templates/transcriptions/asset_detail.html +++ b/concordia/templates/transcriptions/asset_detail.html @@ -425,7 +425,7 @@

@@ -761,7 +761,7 @@