diff --git a/.gitignore b/.gitignore index d01d47c..4348a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ __pycache__/ .python-version htdocs/ +.idea/ +.venv/ diff --git a/lidiabrowser/lidia/admin.py b/lidiabrowser/lidia/admin.py index d1cc8df..fab8f6c 100644 --- a/lidiabrowser/lidia/admin.py +++ b/lidiabrowser/lidia/admin.py @@ -31,9 +31,11 @@ class TermGroupInline(admin.TabularInline): class AnnotationAdmin(admin.ModelAdmin): - list_display = ["parent_attachment_display", "argname_display", "description", "arglang", "page_range_complete", "summary_of_term_groups", "relation_display"] + list_display = ["parent_attachment_display", "argname_display", "description", "arglang", "page_range_complete", + "summary_of_term_groups", "relation_display"] list_display_links = ["argname_display"] - list_filter = ["parent_attachment", "arglang", "termgroups__articleterm__term", "termgroups__lidiaterm__term", "termgroups__category__category"] + list_filter = ["parent_attachment", "arglang", "termgroups__articleterm__term", "termgroups__lidiaterm__term", + "termgroups__category__category"] ordering = ("parent_attachment", "sort_index") inlines = [ ContinuationInline, @@ -134,6 +136,7 @@ def get_inlines(self, request: HttpRequest, obj=None): inlines.append(ContinuationInline) return inlines + class PublicationAdmin(admin.ModelAdmin): list_display = ["zotero_publication", "attachment_id", "title"] change_form_template = "lidia/change_form_publication.html" @@ -142,6 +145,11 @@ class PublicationAdmin(admin.ModelAdmin): class LidiaTermAdmin(admin.ModelAdmin): list_display = ["term", "vocab"] list_filter = ["vocab"] + change_form_template = "lidia/change_form_lidiaterm.html" + + +class ArticleTermAdmin(admin.ModelAdmin): + change_form_template = "lidia/change_form_articleterm.html" class LanguageAdmin(admin.ModelAdmin): @@ -153,4 +161,4 @@ class LanguageAdmin(admin.ModelAdmin): admin.site.register(Language, LanguageAdmin) admin.site.register(Category) admin.site.register(LidiaTerm, LidiaTermAdmin) -admin.site.register(ArticleTerm) +admin.site.register(ArticleTerm, ArticleTermAdmin) diff --git a/lidiabrowser/lidia/templates/lidia/change_form_articleterm.html b/lidiabrowser/lidia/templates/lidia/change_form_articleterm.html new file mode 100644 index 0000000..e2ee2fe --- /dev/null +++ b/lidiabrowser/lidia/templates/lidia/change_form_articleterm.html @@ -0,0 +1,8 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} +{% block object-tools-items %} +{{ block.super }} +
  • + {% translate "Show related annotations" %} +
  • +{% endblock %} diff --git a/lidiabrowser/lidia/templates/lidia/change_form_lidiaterm.html b/lidiabrowser/lidia/templates/lidia/change_form_lidiaterm.html new file mode 100644 index 0000000..7e2b91d --- /dev/null +++ b/lidiabrowser/lidia/templates/lidia/change_form_lidiaterm.html @@ -0,0 +1,8 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} +{% block object-tools-items %} +{{ block.super }} +
  • + {% translate "Show related annotations" %} +
  • +{% endblock %}