class ServiceTypeModelAdmin(ModelAdmin):
    model = ServiceType
    menu_label = 'Service Type'
    menu_icon = 'site'


class JobLengthModelAdmin(ModelAdmin):
    model = JobLength
    menu_label = 'Job Length'
    menu_icon = 'site'


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


for _debug_template_name in (
        'job_listing_details',
        'job_listing_list',
        'job_listing_table',
):
    register_template_debug(
        'jobmanager', _debug_template_name,
        f'jobmanager/{_debug_template_name}.html',
        getattr(template_debug, f'{_debug_template_name}_test_cases'))
Exemple #2
0
    # add 'span' to the default feature set
    features.default_features.append('span')


@hooks.register('before_serve_shared_page')
def set_served_by_wagtail_sharing(page, request, args, kwargs):
    setattr(request, 'served_by_wagtail_sharing', True)


@hooks.register('register_permissions')
def add_export_feedback_permission_to_wagtail_admin_group_view():
    return Permission.objects.filter(content_type__app_label='v1',
                                     codename='export_feedback')


register_template_debug('v1',
                        'featured_content',
                        '_includes/organisms/featured-content.html',
                        featured_content_test_cases,
                        extra_js=['featured-content-module.js'])

register_template_debug('v1', 'notification',
                        '_includes/molecules/notification.html',
                        notification_test_cases)

register_template_debug('v1',
                        'video_player',
                        '_includes/organisms/video-player.html',
                        video_player_test_cases,
                        extra_js=['video-player.js'])
    # register a feature 'span'
    # which whitelists the <span> element
    features.register_converter_rule('editorhtml', 'span', [
        WhitelistRule('span', allow_html_class),
    ])

    # add 'span' to the default feature set
    features.default_features.append('span')


@hooks.register('before_serve_shared_page')
def set_served_by_wagtail_sharing(page, request, args, kwargs):
    setattr(request, 'served_by_wagtail_sharing', True)


@hooks.register('register_permissions')
def add_export_feedback_permission_to_wagtail_admin_group_view():
    return Permission.objects.filter(
        content_type__app_label='v1',
        codename='export_feedback'
    )


register_template_debug(
    'v1',
    'notification',
    '_includes/molecules/notification.html',
    notification_test_cases
)