From 87096a3da411fb6224105bc7270d9f62b6bd0fa0 Mon Sep 17 00:00:00 2001 From: Akira Date: Wed, 22 Jan 2025 19:39:16 +0900 Subject: [PATCH] Try to fix issue 4 --- rog/admin.py | 3 +++ rog/templates/admin/entry/change_list.html | 11 +++++++++++ rog/templates/admin/entry/upload_csv.html | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 rog/templates/admin/entry/change_list.html create mode 100644 rog/templates/admin/entry/upload_csv.html 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