diff --git a/rog/admin.py b/rog/admin.py index 8e1e5d7..4033716 100644 --- a/rog/admin.py +++ b/rog/admin.py @@ -35,6 +35,9 @@ from .services.csv_processor import EntryCSVProcessor class EntryAdmin(admin.ModelAdmin): list_display = ['team', 'event', 'category', 'date', 'is_active'] + # change_list_templateの追加 + change_list_template = 'admin/entry/change_list.html' # この行を追加 + def get_urls(self): from django.urls import path urls = super().get_urls() diff --git a/rog/templates/admin/entry/change_list.html b/rog/templates/admin/entry/change_list.html new file mode 100644 index 0000000..2235ec8 --- /dev/null +++ b/rog/templates/admin/entry/change_list.html @@ -0,0 +1,11 @@ +{% extends "admin/change_list.html" %} +{% load i18n %} + +{% block object-tools-items %} + {{ block.super }} +
  • + + {% translate "Upload CSV" %} + +
  • +{% endblock %} \ No newline at end of file diff --git a/rog/templates/admin/entry/upload_csv.html b/rog/templates/admin/entry/upload_csv.html new file mode 100644 index 0000000..5116817 --- /dev/null +++ b/rog/templates/admin/entry/upload_csv.html @@ -0,0 +1,17 @@ +{% extends "admin/base_site.html" %} +{% load i18n static %} + +{% block content %} +
    +
    + {% csrf_token %} +
    + + +
    +
    + +
    +
    +
    +{% endblock %} \ No newline at end of file