From 2ed17923502a517bb6511b85764aeea230cfbffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 27 Feb 2012 11:44:01 +0100 Subject: [PATCH] Add admin interface --- trans/admin.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 trans/admin.py diff --git a/trans/admin.py b/trans/admin.py new file mode 100644 index 000000000..8c2d4220d --- /dev/null +++ b/trans/admin.py @@ -0,0 +1,29 @@ +from django.contrib import admin +from trans.models import Project, SubProject, Translation, Unit + +class ProjectAdmin(admin.ModelAdmin): + list_display = ['name', 'slug', 'web'] + prepopulated_fields = {'slug': ('name',)} + search_fields = ['name', 'slug', 'web'] + +admin.site.register(Project, ProjectAdmin) + +class SubProjectAdmin(admin.ModelAdmin): + list_display = ['name', 'slug', 'project', 'repo', 'branch'] + prepopulated_fields = {'slug': ('name',)} + search_fields = ['name', 'slug', 'repo', 'branch'] + +admin.site.register(SubProject, SubProjectAdmin) + +class TranslationAdmin(admin.ModelAdmin): + list_display = ['subproject', 'language', 'translated', 'fuzzy', 'revision', 'filename'] + search_fields = ['subproject__slug', 'language__code', 'translated', 'fuzzy', 'revision', 'filename'] + +admin.site.register(Translation, TranslationAdmin) + +class UnitAdmin(admin.ModelAdmin): + list_display = ['source', 'target'] + search_fields = ['source', 'target'] + +admin.site.register(Unit,Unit Admin) +