Einleitung and Geltungsbereich now draggable
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django.contrib import admin
|
||||
from django import forms
|
||||
from django.utils.safestring import mark_safe
|
||||
from adminsortable2.admin import SortableInlineAdminMixin, SortableAdminBase
|
||||
|
||||
from mptt.forms import TreeNodeMultipleChoiceField
|
||||
from nested_admin import NestedStackedInline, NestedModelAdmin, NestedTabularInline
|
||||
from .models import *
|
||||
@@ -65,7 +65,6 @@ class GeltungsbereichInline(NestedStackedInline):
|
||||
extra=0
|
||||
sortable_field_name = "order"
|
||||
show_change_link=True
|
||||
classes = ['collapse']
|
||||
verbose_name_plural = "Geltungsbereich-Abschnitte"
|
||||
fieldsets = (
|
||||
(None, {
|
||||
@@ -79,7 +78,6 @@ class EinleitungInline(NestedStackedInline):
|
||||
extra = 0
|
||||
sortable_field_name = "order"
|
||||
show_change_link = True
|
||||
classes = ['collapse']
|
||||
verbose_name_plural = "Einleitungs-Abschnitte"
|
||||
fieldsets = (
|
||||
(None, {
|
||||
@@ -102,7 +100,7 @@ class VorgabeForm(forms.ModelForm):
|
||||
raise forms.ValidationError('Thema ist ein Pflichtfeld. Bitte wählen Sie ein Thema aus.')
|
||||
return thema
|
||||
|
||||
class VorgabeInline(SortableInlineAdminMixin, NestedStackedInline):
|
||||
class VorgabeInline(NestedStackedInline):
|
||||
model = Vorgabe
|
||||
form = VorgabeForm
|
||||
extra = 0
|
||||
@@ -200,7 +198,7 @@ class PersonAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
@admin.register(Dokument)
|
||||
class DokumentAdmin(SortableAdminBase, NestedModelAdmin):
|
||||
class DokumentAdmin(NestedModelAdmin):
|
||||
actions_on_top=True
|
||||
inlines = [EinleitungInline, GeltungsbereichInline, VorgabeInline]
|
||||
filter_horizontal=['autoren','pruefende']
|
||||
|
||||
Reference in New Issue
Block a user