From 3a4258fdc60619d1bcf16f27484a60d9320d4de6 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Tue, 19 Dec 2017 09:51:26 +0000
Subject: [PATCH] Add the model admin for fund

---
 opentech/apply/admin.py         | 19 +++++++++++++++++--
 opentech/apply/wagtail_hooks.py |  7 +++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 opentech/apply/wagtail_hooks.py

diff --git a/opentech/apply/admin.py b/opentech/apply/admin.py
index 4185d360e..7e15ae656 100644
--- a/opentech/apply/admin.py
+++ b/opentech/apply/admin.py
@@ -1,3 +1,18 @@
-# from django.contrib import admin
+from wagtail.contrib.modeladmin.options import ModelAdmin, ModelAdminGroup
 
-# Register your models here.
+from .models import Fund
+
+
+class FundModelAdmin(ModelAdmin):
+    model = Fund
+    menu_icon = 'site'
+    list_display = ('name',)
+    list_filter = ('name',)
+    search_fields = ('name',)
+
+
+class ApplyAdminGroup(ModelAdminGroup):
+    menu_label = 'Apply'
+    menu_icon = 'folder-open-inverse'
+    menu_order = 200
+    items = (FundModelAdmin,)
diff --git a/opentech/apply/wagtail_hooks.py b/opentech/apply/wagtail_hooks.py
new file mode 100644
index 000000000..c9b8729c7
--- /dev/null
+++ b/opentech/apply/wagtail_hooks.py
@@ -0,0 +1,7 @@
+from wagtail.contrib.modeladmin.options import modeladmin_register
+
+from .admin import ApplyAdminGroup
+
+
+modeladmin_register(ApplyAdminGroup)
+
-- 
GitLab