from django.forms.models import ModelForm

from wagtail.contrib.modeladmin.options import (
    ModelAdmin, ModelAdminGroup, modeladmin_register
)
from wagtail.contrib.modeladmin.views import CreateView, EditView, InspectView

from tinymce.widgets import TinyMCE

from jobmanager.models import ApplicantType, Grade, JobCategory, JobRegion


class ApplicantTypeModelAdmin(ModelAdmin):
    model = ApplicantType
    menu_label = 'Applicant types'
    menu_icon = 'snippet'


class JobGradeModelAdmin(ModelAdmin):
    model = Grade
    menu_label = 'Grades'
    menu_icon = 'snippet'
    list_display = ('grade', 'salary_min', 'salary_max')


class JobCategoryForm(ModelForm):
    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {
            'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15}),
        }


class JobCategoryModelFormMixin(object):
    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = ('abbreviation', 'name')


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (
        ApplicantTypeModelAdmin,
        JobCategoryModelAdmin,
        JobGradeModelAdmin,
        JobRegionModelAdmin,
    )

c0a97c53c358cfe557adaba8765413e70239ff25
<mask token>


class JobCategoryForm(ModelForm):


    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15})}


class JobCategoryModelFormMixin(object):

    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = 'abbreviation', 'name'


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (ApplicantTypeModelAdmin, JobCategoryModelAdmin,
        JobGradeModelAdmin, JobRegionModelAdmin)

<mask token>


class JobGradeModelAdmin(ModelAdmin):
    <mask token>
    <mask token>
    <mask token>
    <mask token>


class JobCategoryForm(ModelForm):


    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15})}


class JobCategoryModelFormMixin(object):

    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = 'abbreviation', 'name'


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (ApplicantTypeModelAdmin, JobCategoryModelAdmin,
        JobGradeModelAdmin, JobRegionModelAdmin)

<mask token>


class JobGradeModelAdmin(ModelAdmin):
    model = Grade
    menu_label = 'Grades'
    menu_icon = 'snippet'
    list_display = 'grade', 'salary_min', 'salary_max'


class JobCategoryForm(ModelForm):


    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15})}


class JobCategoryModelFormMixin(object):

    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = 'abbreviation', 'name'


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (ApplicantTypeModelAdmin, JobCategoryModelAdmin,
        JobGradeModelAdmin, JobRegionModelAdmin)

from django.forms.models import ModelForm
from wagtail.contrib.modeladmin.options import ModelAdmin, ModelAdminGroup, modeladmin_register
from wagtail.contrib.modeladmin.views import CreateView, EditView, InspectView
from tinymce.widgets import TinyMCE
from jobmanager.models import ApplicantType, Grade, JobCategory, JobRegion


class ApplicantTypeModelAdmin(ModelAdmin):
    model = ApplicantType
    menu_label = 'Applicant types'
    menu_icon = 'snippet'


class JobGradeModelAdmin(ModelAdmin):
    model = Grade
    menu_label = 'Grades'
    menu_icon = 'snippet'
    list_display = 'grade', 'salary_min', 'salary_max'


class JobCategoryForm(ModelForm):


    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15})}


class JobCategoryModelFormMixin(object):

    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = 'abbreviation', 'name'


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (ApplicantTypeModelAdmin, JobCategoryModelAdmin,
        JobGradeModelAdmin, JobRegionModelAdmin)

from django.forms.models import ModelForm

from wagtail.contrib.modeladmin.options import (
    ModelAdmin, ModelAdminGroup, modeladmin_register
)
from wagtail.contrib.modeladmin.views import CreateView, EditView, InspectView

from tinymce.widgets import TinyMCE

from jobmanager.models import ApplicantType, Grade, JobCategory, JobRegion


class ApplicantTypeModelAdmin(ModelAdmin):
    model = ApplicantType
    menu_label = 'Applicant types'
    menu_icon = 'snippet'


class JobGradeModelAdmin(ModelAdmin):
    model = Grade
    menu_label = 'Grades'
    menu_icon = 'snippet'
    list_display = ('grade', 'salary_min', 'salary_max')


class JobCategoryForm(ModelForm):
    class Meta:
        fields = '__all__'
        model = JobCategory
        widgets = {
            'blurb': TinyMCE(attrs={'cols': 80, 'rows': 15}),
        }


class JobCategoryModelFormMixin(object):
    def get_form_class(self):
        return JobCategoryForm


class JobCategoryCreateView(JobCategoryModelFormMixin, CreateView):
    pass


class JobCategoryEditView(JobCategoryModelFormMixin, EditView):
    pass


class JobCategoryInspectView(JobCategoryModelFormMixin, InspectView):
    pass


class JobCategoryModelAdmin(ModelAdmin):
    model = JobCategory
    menu_label = 'Divisions'
    menu_icon = 'snippet'
    create_view_class = JobCategoryCreateView
    edit_view_class = JobCategoryEditView
    inspect_view_class = JobCategoryInspectView


class JobRegionModelAdmin(ModelAdmin):
    model = JobRegion
    menu_label = 'Regions'
    menu_icon = 'site'
    list_display = ('abbreviation', 'name')


@modeladmin_register
class MyModelAdminGroup(ModelAdminGroup):
    menu_label = 'Job listings'
    menu_icon = 'folder-open-inverse'
    items = (
        ApplicantTypeModelAdmin,
        JobCategoryModelAdmin,
        JobGradeModelAdmin,
        JobRegionModelAdmin,
    )
