Skip to content
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
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ Change Log

Unreleased

[2.3.20] - 2026-01-29
---------------------
* feat: translate skills, jobs and industries

[2.3.19] - 2025-11-26
---------------------
* chore: upgrade python requirements


[2.3.18] - 2025-10-30
---------------------
* fix: pin `pip<25.3` to resolve make upgrade build failure
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pii_check: ## check for PII annotations on all Django models

requirements: ## install development environment requirements
pip install -qr requirements/pip.txt
pip install -q -r requirements/pip_tools.txt -c requirements/constraints.txt
pip install -q -r requirements/pip-tools.txt -c requirements/constraints.txt
pip-sync requirements/dev.txt

test: clean ## run tests in the current virtualenv
Expand Down
2 changes: 1 addition & 1 deletion taxonomy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# 2. MINOR version when you add functionality in a backwards compatible manner, and
# 3. PATCH version when you make backwards compatible bug fixes.
# More details can be found at https://semver.org/
__version__ = '2.3.19'
__version__ = '2.3.20'
121 changes: 121 additions & 0 deletions taxonomy/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.contrib import admin, messages
from django.http import HttpResponseRedirect
from django.urls import re_path, reverse
from django.utils.html import format_html

from taxonomy.constants import JOB_SKILLS_URL_NAME
from taxonomy.models import (
Expand All @@ -30,6 +31,7 @@
SkillsQuiz,
SkillSubCategory,
SkillValidationConfiguration,
TaxonomyTranslation,
Translation,
XBlockSkillData,
XBlockSkills,
Expand Down Expand Up @@ -301,3 +303,122 @@ class SkillValidationConfiguratonAdmin(admin.ModelAdmin):
"""
Admin view for SkillValidationConfiguration model.
"""


@admin.register(TaxonomyTranslation)
class TaxonomyTranslationAdmin(admin.ModelAdmin):
"""
Admin view for TaxonomyTranslation model.

Displays translations for jobs, skills, and industries across different languages.
"""

list_display = (
'id',
'content_type',
'external_id',
'language_code',
'title_preview',
'view_source_object',
)

list_filter = (
'content_type',
'language_code',
)

search_fields = (
'external_id',
'title',
'description',
)

readonly_fields = (
'created',
'modified',
'source_hash',
'source_object_link',
)

fieldsets = (
('Entity Information', {
'fields': ('content_type', 'external_id', 'language_code', 'source_object_link'),
}),
('Translation', {
'fields': ('title', 'description'),
}),
('Metadata', {
'fields': ('source_hash', 'created', 'modified'),
'classes': ('collapse',),
}),
)

ordering = ('-modified',)

@admin.display(description='Title')
def title_preview(self, obj):
"""
Display truncated title for readability.
"""
return obj.title[:75] + '...' if len(obj.title) > 75 else obj.title

@admin.display(description='Source Object')
def view_source_object(self, obj):
"""
Display a link to view the source object (Job, Skill, or Industry).
"""
try:
if obj.content_type == 'job':
job = Job.objects.get(external_id=obj.external_id)
url = reverse('admin:taxonomy_job_change', args=[job.pk])
return format_html('<a href="{}" target="_blank">View Job</a>', url)
elif obj.content_type == 'skill':
skill = Skill.objects.get(external_id=obj.external_id)
url = reverse('admin:taxonomy_skill_change', args=[skill.pk])
return format_html('<a href="{}" target="_blank">View Skill</a>', url)
elif obj.content_type == 'industry':
industry = Industry.objects.get(code=obj.external_id)
url = reverse('admin:taxonomy_industry_change', args=[industry.pk])
return format_html('<a href="{}" target="_blank">View Industry</a>', url)
except (Job.DoesNotExist, Skill.DoesNotExist, Industry.DoesNotExist):
return '-'

return '-'

@admin.display(description='Source Object Details')
def source_object_link(self, obj):
"""
Display detailed link to source object in the detail view.
"""
try:
if obj.content_type == 'job':
job = Job.objects.get(external_id=obj.external_id)
url = reverse('admin:taxonomy_job_change', args=[job.pk])
return format_html(
'<a href="{}" target="_blank" style="font-size: 14px; font-weight: bold;">'
'Open Job: {} (ID: {})</a>',
url, job.name, job.external_id
)
elif obj.content_type == 'skill':
skill = Skill.objects.get(external_id=obj.external_id)
url = reverse('admin:taxonomy_skill_change', args=[skill.pk])
return format_html(
'<a href="{}" target="_blank" style="font-size: 14px; font-weight: bold;">'
'Open Skill: {} (ID: {})</a>',
url, skill.name, skill.external_id
)
elif obj.content_type == 'industry':
industry = Industry.objects.get(code=obj.external_id)
url = reverse('admin:taxonomy_industry_change', args=[industry.pk])
return format_html(
'<a href="{}" target="_blank" style="font-size: 14px; font-weight: bold;">'
'Open Industry: {} (Code: {})</a>',
url, industry.name, industry.code
)
except (Job.DoesNotExist, Skill.DoesNotExist, Industry.DoesNotExist):
return format_html(
'<span style="color: #999;">Source object not found (external_id: {})</span>',
obj.external_id
)

return '-'
Loading