2012-02-27 11:44:01 +01:00
|
|
|
from django.contrib import admin
|
2012-03-01 10:51:43 +01:00
|
|
|
from trans.models import Project, SubProject, Translation, Unit, Suggestion
|
2012-02-27 11:44:01 +01:00
|
|
|
|
|
|
|
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']
|
|
|
|
|
2012-02-27 11:47:04 +01:00
|
|
|
admin.site.register(Unit, UnitAdmin)
|
2012-02-27 11:44:01 +01:00
|
|
|
|
2012-03-01 10:51:43 +01:00
|
|
|
class SuggestionAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ['checksum', 'target']
|
|
|
|
search_fields = ['checksum', 'target']
|
|
|
|
|
|
|
|
admin.site.register(Suggestion, SuggestionAdmin)
|
|
|
|
|