Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename meta terms to tags #4341

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/references/wagtail-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The WagTail Admin is your "back office" for setting up form applications and pub
- Category Questions: Application questions with multiple options for users to select.
- Screening Statuses: For metadata related to the initial screening stage.
- Reviewer Roles: Adding reviewer roles.
- Meta Terms: For metadata, such as tags, thumbnail image and ... “and” - The results must match all terms (default for database search).
- Tags: For metadata, such as tags, thumbnail image and ... “and” - The results must match all terms (default for database search).
- Manage

### Wagtail default settings
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/administrators/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Should staff admins be able to export submissions.

Columns to exclude from the submission tables.

Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, meta_terms, organization_name
Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, tags, organization_name

SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', [])

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.18 on 2025-01-31 07:38

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("categories", "0006_use_category_options_as_submission_filter"),
]

operations = [
migrations.AlterModelOptions(
name="metaterm",
options={"verbose_name": "Tag", "verbose_name_plural": "Tags"},
),
]
4 changes: 2 additions & 2 deletions hypha/apply/categories/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def __str__(self):
return self.name

class Meta:
verbose_name = _("Meta Term")
verbose_name_plural = _("Meta Terms")
verbose_name = _("Tag")
verbose_name_plural = _("Tags")


class MetaTermChoiceField(forms.ModelChoiceField):
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/funds/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ class UpdateMetaTermsForm(ApplicationSubmissionModelForm):
widget=MetaTermWidget(
attrs={"data-placeholder": "Select...", "data-js-choices": ""}
),
label=_("Meta terms"),
label=_("Tags"),
choices_groupby="get_parent",
required=False,
help_text=_("Meta terms are hierarchical in nature."),
help_text=_("Tags are hierarchical in nature."),
)

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class SubmissionFilter(filters.FilterSet):
category_options = MultipleChoiceFilter(
choices=[], label=_("Category"), method="filter_category_options"
)
meta_terms = ModelMultipleChoiceFilter(queryset=get_meta_terms, label=_("Terms"))
meta_terms = ModelMultipleChoiceFilter(queryset=get_meta_terms, label=_("Tags"))

class Meta:
model = ApplicationSubmission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h5>{% trans "Actions to take" %}</h5>
class="button button--white button--full-width button--bottom-space"
hx-get="{% url 'funds:submissions:metaterms_update' pk=object.pk %}"
hx-target="#htmx-modal"
>{% trans "Meta Terms" %}</button>
>{% trans "Tags" %}</button>

<button
class="button button--white button--full-width button--bottom-space"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
class="{{ s.phase.bg_color }} hover:opacity-70 transition-opacity rounded-full whitespace-nowrap inline-block ms-1 px-2 pt-0.5 pb-1 text-xs font-medium text-gray-800"
>{{ s.phase.display_name }}</a>

{% if "meta_terms" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
{% if "tags" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
{% for meta_term in s.get_assigned_meta_terms %}
<a
href="{% url "apply:submissions:list" %}{% modify_query "only_query_string" "page" meta_terms=meta_term.id %}"
hx-get="{% url "apply:submissions:list" %}{% modify_query "only_query_string" "page" meta_terms=meta_term.id %}"
hx-target="#main"
hx-push-url="true"
hx-swap="outerHTML"
data-tippy-content="Meta Term: {{meta_term.name}}"
data-tippy-content="Tags: {{meta_term.name}}"
data-tippy-placement="top"
class="inline-block px-2 pt-0.5 pb-1 text-xs font-medium whitespace-nowrap rounded-full transition-opacity hover:opacity-70 ms-1 text-slate-900 bg-slate-200"
>{{meta_term.name}}</a>
Expand Down
8 changes: 4 additions & 4 deletions hypha/apply/funds/templates/submissions/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@
{% endfor %}
{% for s in selected_meta_terms %}
<span class="inline-flex items-center py-1 px-2 text-xs font-medium text-blue-800 bg-blue-100 rounded select-none me-2">
{% trans "Meta Term:" %} {{ s|get_meta_term_from_id }}
{% trans "Tag:" %} {{ s|get_meta_term_from_id }}
<a href="{% remove_from_query meta_terms=s %}" role="button" class="inline-flex items-center p-0.5 text-xs text-blue-400 bg-transparent rounded-sm hover:text-blue-900 hover:bg-blue-200 ms-1 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove">
{% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %}
<span class="sr-only">{% trans "Remove meta term filter" %}</span>
<span class="sr-only">{% trans "Remove tag filter" %}</span>
</a>
</span>
{% endfor %}
Expand Down Expand Up @@ -451,8 +451,8 @@
{% enddropdown_menu %}
{% endif %}

{% if "meta_terms" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
{% dropdown_menu title="Terms" heading="Filter by Terms" enable_search=True position="right" %}
{% if "tags" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
{% dropdown_menu title="Tags" heading="Filter by tags" enable_search=True position="right" %}
{% slot "url" %}{% url "apply:submissions:submenu-meta-terms" %}{% remove_from_query "only_query_string" "page" %}{% endslot %}
{% enddropdown_menu %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{% load i18n heroicons %}

<div class="flex gap-4 justify-between pb-4">
<h5 class="m-0">{% trans "Meta Terms" %}</h5>
<h5 class="m-0">{% trans "Tags" %}</h5>
<button
class="flex items-center py-1 px-2 font-bold rounded transition-colors hover:bg-gray-100 text-dark-blue -me-2"
hx-get="{% url 'funds:submissions:metaterms_update' pk=submission.pk %}"
hx-target="#htmx-modal"
role="button"
{% if meta_terms %}
aria-label="{% trans "Update Meta Terms" %}"
title="{% trans "Update Meta Terms" %}"
aria-label="{% trans "Update tags" %}"
title="{% trans "Update tags" %}"
{% else %}
aria-label="{% trans "Add Meta Terms" %}"
aria-label="{% trans "Add tags" %}"
{% endif %}
>
{% if meta_terms %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" "meta_terms" %}"
hx-push-url="true"
class="flex px-3 py-2 text-gray-600 items-center hover:bg-gray-100 focus:bg-gray-100{% if s.selected %}bg-gray-100{% endif %}">
{% trans "All Meta Terms" %}
{% trans "All tags" %}
</a>
</li>
{% endif %}
Expand Down Expand Up @@ -39,8 +39,8 @@
</li>
{% empty %}
<li class="py-2 max-w-xs text-gray-600 ps-4 pe-3">
{% trans "No meta terms found." %}
{% trans "No tags found." %}
</li>
{% endfor %}
</ul>
<p class="py-2 px-3 m-0 text-fg-muted" data-filter-empty-state hidden>{% trans "No meta terms found. Sorry about that." %}</p>
<p class="py-2 px-3 m-0 text-fg-muted" data-filter-empty-state hidden>{% trans "No tags found. Sorry about that." %}</p>
Loading