예제 #1
0
def includeme(config):

    config.add_static_view('static-kotti_image_gallery', 'kotti_image_gallery:static')
    config.scan("kotti_image_gallery")
    config.add_view(AddImageFormView,
                    name=Image.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt',)
    config.add_view(EditImageFormView,
                    context=Image,
                    name='edit',
                    permission='edit',
                    renderer='kotti:templates/edit/node.pt', )

    config.add_view(make_generic_edit(GallerySchema()),
                    context=Gallery,
                    name='edit',
                    permission='edit',
                    renderer='kotti:templates/edit/node.pt', )

    config.add_view(make_generic_add(GallerySchema(), Gallery),
                    name=Gallery.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
예제 #2
0
def includeme(config):

    config.add_static_view('static-kotti_media', 'kotti_media:static')
    config.scan("kotti_media")

    # Video add/edit
    config.add_view(make_generic_add(DocumentSchema(), Video),
                                     name=Video.type_info.add_view,
                                     permission='add',
                                     renderer='kotti:templates/edit/node.pt', )
    config.add_view(make_generic_edit(DocumentSchema()),
                    context=Video,
                    name='edit',
                    permission='edit',
                    renderer='kotti:templates/edit/node.pt', )

    # Audio add/edit
    config.add_view(make_generic_add(DocumentSchema(), Audio),
                                     name=Audio.type_info.add_view,
                                     permission='add',
                                     renderer='kotti:templates/edit/node.pt', )
    config.add_view(make_generic_edit(DocumentSchema()),
                    context=Audio,
                    name='edit',
                    permission='edit',
                    renderer='kotti:templates/edit/node.pt', )

    # File types edit
    for file_type in (M4aFile, Mp3File, OgaFile, WavFile, Mp4File, OgvFile, WebmFile, SubtitlesFile, ChaptersFile):
        config.add_view(EditFileFormView,
                        context=file_type,
                        name='edit',
                        permission='edit',
                        renderer='kotti:templates/edit/node.pt', )
    # M4aFile add
    config.add_view(AddM4aFileFormView,
                    name=M4aFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # Mp3File add
    config.add_view(AddMp3FileFormView,
                    name=Mp3File.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # OgaFile add
    config.add_view(AddOgaFileFormView,
                    name=OgaFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # WavFile add
    config.add_view(AddWavFileFormView,
                    name=WavFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # Mp4File add
    config.add_view(AddMp4FileFormView,
                    name=Mp4File.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # OgvFile add
    config.add_view(AddOgvFileFormView,
                    name=OgvFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # WebmFile add
    config.add_view(AddWebmFileFormView,
                    name=WebmFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # SubtitlesFile add
    config.add_view(AddSubtitlesFileFormView,
                    name=SubtitlesFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )
    # ChaptersFile add
    config.add_view(AddChaptersFileFormView,
                    name=ChaptersFile.type_info.add_view,
                    permission='add',
                    renderer='kotti:templates/edit/node.pt', )