def setup_plugin():
    """Setup plugin by adding routes and templates to mediagoblin"""

    _log.info('Setting up routes and templates')
    config = pluginapi.get_config('indexedsearch')

    if config.get('USERS_ONLY'):
        view = 'user_search_results_view'
    else:
        view = 'search_results_view'

    routes = [
        ('indexedsearch',
         '/search/',
         'mediagoblin.plugins.indexedsearch.views:' + view)]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    search_link_style = config.get('SEARCH_LINK_STYLE')
    _log.debug("Search link style was specified as: %r", search_link_style)

    if search_link_style in ['button', 'link', 'none', 'form']:
        header_template = ('indexedsearch/search_link_%s.html' %
                           search_link_style)
    else:
        header_template = 'indexedsearch/search_link_form.html'

    pluginapi.register_template_hooks(
        {'header_extra': header_template})
Beispiel #2
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.persona')

    routes = [
        ('mediagoblin.plugins.persona.login',
         '/auth/persona/login/',
         'mediagoblin.plugins.persona.views:login'),
        ('mediagoblin.plugins.persona.register',
         '/auth/persona/register/',
         'mediagoblin.plugins.persona.views:register'),
        ('mediagoblin.plugins.persona.edit',
         '/edit/persona/',
         'mediagoblin.plugins.persona.views:edit'),
        ('mediagoblin.plugins.persona.add',
         '/edit/persona/add/',
         'mediagoblin.plugins.persona.views:add')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
        {'persona_end': 'mediagoblin/plugins/persona/persona_js_end.html',
         'persona_form': 'mediagoblin/plugins/persona/persona.html',
         'edit_link': 'mediagoblin/plugins/persona/edit_link.html',
         'login_link': 'mediagoblin/plugins/persona/login_link.html',
         'register_link': 'mediagoblin/plugins/persona/register_link.html'})
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.oauth')

    _log.info('Setting up OAuth...')
    _log.debug('OAuth config: {0}'.format(config))

    routes = [
        ('mediagoblin.plugins.oauth.authorize', '/oauth-2/authorize',
         'mediagoblin.plugins.oauth.views:authorize'),
        ('mediagoblin.plugins.oauth.authorize_client',
         '/oauth-2/client/authorize',
         'mediagoblin.plugins.oauth.views:authorize_client'),
        ('mediagoblin.plugins.oauth.access_token', '/oauth-2/access_token',
         'mediagoblin.plugins.oauth.views:access_token'),
        ('mediagoblin.plugins.oauth.list_connections',
         '/oauth-2/client/connections',
         'mediagoblin.plugins.oauth.views:list_connections'),
        ('mediagoblin.plugins.oauth.register_client',
         '/oauth-2/client/register',
         'mediagoblin.plugins.oauth.views:register_client'),
        ('mediagoblin.plugins.oauth.list_clients', '/oauth-2/client/list',
         'mediagoblin.plugins.oauth.views:list_clients')
    ]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
Beispiel #4
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.openid')

    routes = [
        ('mediagoblin.plugins.openid.register',
         '/auth/openid/register/',
         'mediagoblin.plugins.openid.views:register'),
        ('mediagoblin.plugins.openid.login',
         '/auth/openid/login/',
         'mediagoblin.plugins.openid.views:login'),
        ('mediagoblin.plugins.openid.finish_login',
         '/auth/openid/login/finish/',
         'mediagoblin.plugins.openid.views:finish_login'),
        ('mediagoblin.plugins.openid.edit',
         '/edit/openid/',
         'mediagoblin.plugins.openid.views:start_edit'),
        ('mediagoblin.plugins.openid.finish_edit',
         '/edit/openid/finish/',
         'mediagoblin.plugins.openid.views:finish_edit'),
        ('mediagoblin.plugins.openid.delete',
         '/edit/openid/delete/',
         'mediagoblin.plugins.openid.views:delete_openid'),
        ('mediagoblin.plugins.openid.finish_delete',
         '/edit/openid/delete/finish/',
         'mediagoblin.plugins.openid.views:finish_delete')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {'register_link': 'mediagoblin/plugins/openid/register_link.html',
         'login_link': 'mediagoblin/plugins/openid/login_link.html',
         'edit_link': 'mediagoblin/plugins/openid/edit_link.html'})
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.persona')

    routes = [
        ('mediagoblin.plugins.persona.login', '/auth/persona/login/',
         'mediagoblin.plugins.persona.views:login'),
        ('mediagoblin.plugins.persona.register', '/auth/persona/register/',
         'mediagoblin.plugins.persona.views:register'),
        ('mediagoblin.plugins.persona.edit', '/edit/persona/',
         'mediagoblin.plugins.persona.views:edit'),
        ('mediagoblin.plugins.persona.add', '/edit/persona/add/',
         'mediagoblin.plugins.persona.views:add')
    ]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks({
        'persona_end':
        'mediagoblin/plugins/persona/persona_js_end.html',
        'persona_form':
        'mediagoblin/plugins/persona/persona.html',
        'edit_link':
        'mediagoblin/plugins/persona/edit_link.html',
        'login_link':
        'mediagoblin/plugins/persona/login_link.html',
        'register_link':
        'mediagoblin/plugins/persona/register_link.html'
    })
Beispiel #6
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.subtitles')

    routes = [('mediagoblin.plugins.subtitles.customize',
               '/u/<string:user>/m/<int:media_id>/customize/<int:id>',
               'mediagoblin.plugins.subtitles.views:custom_subtitles'),
              ('mediagoblin.plugins.subtitles.subtitles',
               '/u/<string:user>/m/<int:media_id>/subtitles/',
               'mediagoblin.plugins.subtitles.views:edit_subtitles'),
              ('mediagoblin.plugins.subtitles.delete_subtitles',
               '/u/<string:user>/m/<int:media_id>/delete/<int:id>',
               'mediagoblin.plugins.subtitles.views:delete_subtitles')]

    pluginapi.register_routes(routes)

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks({
        "customize_subtitles":
        "mediagoblin/plugins/subtitles/custom_subtitles.html",
        "add_subtitles":
        "mediagoblin/plugins/subtitles/subtitles.html",
        "subtitle_sidebar":
        "mediagoblin/plugins/subtitles/subtitle_media_block.html"
    })
Beispiel #7
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.oauth')

    _log.info('Setting up OAuth...')
    _log.debug('OAuth config: {0}'.format(config))

    routes = [
       ('mediagoblin.plugins.oauth.authorize',
            '/oauth/authorize',
            'mediagoblin.plugins.oauth.views:authorize'),
        ('mediagoblin.plugins.oauth.authorize_client',
            '/oauth/client/authorize',
            'mediagoblin.plugins.oauth.views:authorize_client'),
        ('mediagoblin.plugins.oauth.access_token',
            '/oauth/access_token',
            'mediagoblin.plugins.oauth.views:access_token'),
        ('mediagoblin.plugins.oauth.list_connections',
            '/oauth/client/connections',
            'mediagoblin.plugins.oauth.views:list_connections'),
        ('mediagoblin.plugins.oauth.register_client',
            '/oauth/client/register',
            'mediagoblin.plugins.oauth.views:register_client'),
        ('mediagoblin.plugins.oauth.list_clients',
            '/oauth/client/list',
            'mediagoblin.plugins.oauth.views:list_clients')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
Beispiel #8
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.basic_auth')

    routes = [('mediagoblin.plugins.basic_auth.edit.pass', '/edit/password/',
               'mediagoblin.plugins.basic_auth.views:change_pass'),
              ('mediagoblin.plugins.basic_auth.forgot_password',
               '/auth/forgot_password/',
               'mediagoblin.plugins.basic_auth.views:forgot_password'),
              ('mediagoblin.plugins.basic_auth.verify_forgot_password',
               '/auth/forgot_password/verify/',
               'mediagoblin.plugins.basic_auth.views:verify_forgot_password')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks({
        'edit_link':
        'mediagoblin/plugins/basic_auth/edit_link.html',
        'fp_link':
        'mediagoblin/plugins/basic_auth/fp_link.html',
        'fp_head':
        'mediagoblin/plugins/basic_auth/fp_head.html',
        'create_account':
        'mediagoblin/plugins/basic_auth/create_account_link.html'
    })
def setup_plugin():
    """Setup plugin by adding routes and templates to mediagoblin"""

    _log.info('Setting up routes and templates')
    config = pluginapi.get_config('indexedsearch')

    if config.get('USERS_ONLY'):
        view = 'user_search_results_view'
    else:
        view = 'search_results_view'

    routes = [
        ('indexedsearch',
         '/search/',
         'indexedsearch.views:' + view)]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    search_link_style = config.get('SEARCH_LINK_STYLE')
    _log.debug("Search link style was specified as: %r", search_link_style)

    if search_link_style in ['button', 'link', 'none', 'form']:
        header_template = ('indexedsearch/search_link_%s.html' %
                           search_link_style)
    else:
        header_template = 'indexedsearch/search_link_form.html'

    pluginapi.register_template_hooks(
        {'header_extra': header_template})
Beispiel #10
0
def setup_plugin():
    _log.info("Plugin loading")
    config = get_config('uploadurl')
    if config:
        _log.info('%r' % config)
    else:
        _log.info("no config found continuing")

    register_routes(('upload', '/upload', 'uploadurl.views:upload_handler'))
Beispiel #11
0
def setup_plugin():
	_log.info("Plugin loading")
	config = get_config('uploadurl')
	if config:
		_log.info('%r' % config)
	else:
		_log.info("no config found continuing")

	register_routes(('upload', '/upload', 'uploadurl.views:upload_handler'))
Beispiel #12
0
def setup_plugin():
    routes = [('modify_context.specific_page', '/modify_context/specific/',
               'mediagoblin.tests.testplugins.modify_context.views:specific'),
              ('modify_context.general_page', '/modify_context/',
               'mediagoblin.tests.testplugins.modify_context.views:general')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(
        pkg_resources.resource_filename(
            'mediagoblin.tests.testplugins.modify_context', 'templates'))
Beispiel #13
0
def setup_plugin():
    _log.info('Setting up piwigo...')

    routes = [
            ('mediagoblin.plugins.piwigo.wsphp',
             '/api/piwigo/ws.php',
             'mediagoblin.plugins.piwigo.views:ws_php'),
        ]

    pluginapi.register_routes(routes)
Beispiel #14
0
def setup_plugin():
    config = pluginapi.get_config(MEDIA_TYPE)
    _log.info("setting up blog media type plugin.")

    routes = [
        #blog_create
        ('mediagoblin.media_types.blog.create', '/u/<string:user>/b/create/',
         'mediagoblin.media_types.blog.views:blog_edit'),
        #blog_edit
        ('mediagoblin.media_types.blog.edit',
         '/u/<string:user>/b/<string:blog_slug>/edit/',
         'mediagoblin.media_types.blog.views:blog_edit'),
        #blog post create
        ('mediagoblin.media_types.blog.blogpost.create',
         '/u/<string:user>/b/<string:blog_slug>/p/create/',
         'mediagoblin.media_types.blog.views:blogpost_create'),
        #blog post edit
        ('mediagoblin.media_types.blog.blogpost.edit',
         '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/edit/',
         'mediagoblin.media_types.blog.views:blogpost_edit'),
        #blog collection dashboard in case of multiple blogs
        ('mediagoblin.media_types.blog.blog_admin_dashboard',
         '/u/<string:user>/b/dashboard/',
         'mediagoblin.media_types.blog.views:blog_dashboard'),
        #blog dashboard
        ('mediagoblin.media_types.blog.blog-dashboard',
         '/u/<string:user>/b/<string:blog_slug>/dashboard/',
         'mediagoblin.media_types.blog.views:blog_dashboard'),
        #blog post listing view
        ('mediagoblin.media_types.blog.blog_post_listing',
         '/u/<string:user>/b/<string:blog_slug>/',
         'mediagoblin.media_types.blog.views:blog_post_listing'),
        #blog post draft view
        ('mediagoblin.media_types.blog.blogpost_draft_view',
         '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/draft/',
         'mediagoblin.media_types.blog.views:draft_view'),
        #blog delete view
        ('mediagoblin.media_types.blog.blog_delete',
         '/u/<string:user>/b/<string:blog_slug>/delete/',
         'mediagoblin.media_types.blog.views:blog_delete'),
        # blog about view
        ('mediagoblin.media_types.blog.blog_about',
         '/u/<string:user>/b/<string:blog_slug>/about/',
         'mediagoblin.media_types.blog.views:blog_about_view')
    ]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks({
        "user_profile":
        "mediagoblin/blog/url_to_blogs_dashboard.html",
        "blog_dashboard_home":
        "mediagoblin/blog/url_to_dashboard.html",
    })
Beispiel #15
0
def setup_plugin():
    _log.info('Setting up piwigo...')

    routes = [
        ('mediagoblin.plugins.piwigo.wsphp', '/api/piwigo/ws.php',
         'mediagoblin.plugins.piwigo.views:ws_php'),
    ]

    pluginapi.register_routes(routes)

    PWGSession.session_manager = SessionManager("pwg_id", "plugins.piwigo")
Beispiel #16
0
def setup_plugin():
    _log.info('Setting up piwigo...')

    routes = [
            ('mediagoblin.plugins.piwigo.wsphp',
             '/api/piwigo/ws.php',
             'mediagoblin.plugins.piwigo.views:ws_php'),
        ]

    pluginapi.register_routes(routes)

    PWGSession.session_manager = SessionManager("pwg_id", "plugins.piwigo")
Beispiel #17
0
def setup_plugin():
    routes = [
        ('modify_context.specific_page',
         '/modify_context/specific/',
         'mediagoblin.tests.testplugins.modify_context.views:specific'),
        ('modify_context.general_page',
         '/modify_context/',
         'mediagoblin.tests.testplugins.modify_context.views:general')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(
        pkg_resources.resource_filename(
            'mediagoblin.tests.testplugins.modify_context', 'templates'))
def setup_plugin():
    _log.info('Setting up Search...')

    config = pluginapi.get_config(__name__)

    _log.debug('Search config: {0}'.format(config))

    routes = [
        ('mediagoblin.plugins.search.search', '/search',
         'mediagoblin.plugins.search.views:search'),
    ]

    pluginapi.register_routes(routes)
def setup_plugin():
	_log.info("Starting podcaster")
	config = get_config('podcast')
	if config:
		_log.info("CONFIG FOUND")
	else:
		_log.info("CONFIG NOT FOUND")

	register_routes([('makeapodcast','/makeapodcast.html','podcast.views:register_podcast'),
		('podcast.rssfeed', '/u/<string:user>/podcast', 'podcast.views:get_podcasts'),
		('podcast.createpodcast','/podcast/create','podcast.views:create_podcast'),
		('podcast.listpodcast', '/u/<string:user>/listpodcast', 'podcast.views:list_podcast')])
	register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
def setup_plugin():
    _log.info('Setting up Search...')

    config = pluginapi.get_config(__name__)

    _log.debug('Search config: {0}'.format(config))

    routes = [
        ('mediagoblin.plugins.search.search',
            '/search',
            'mediagoblin.plugins.search.views:search'),
    ]

    pluginapi.register_routes(routes)
Beispiel #21
0
def setup_plugin():
    _log.info('Setting up API...')

    _log.debug('API config: {0}'.format(config))

    routes = [
        Route('mediagoblin.plugins.api.test', '/api/test',
            controller='mediagoblin.plugins.api.views:api_test'),
        Route('mediagoblin.plugins.api.entries', '/api/entries',
            controller='mediagoblin.plugins.api.views:get_entries'),
        Route('mediagoblin.plugins.api.post_entry', '/api/submit',
            controller='mediagoblin.plugins.api.views:post_entry')]

    pluginapi.register_routes(routes)
def setup_plugin():
    config = pluginapi.get_config('mediagoblin_picscout')

    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
        {"image_sideinfo": "mediagoblin/plugins/picscout/sideinfo.html"})

    routes = [
        ('mediagoblin_picscout.api',
         '/api/picscout/picscout_lookup',
         'mediagoblin_picscout.api:picscout_lookup')
    ]

    pluginapi.register_routes(routes)
Beispiel #23
0
def setup_plugin():
    # config = pluginapi.get_config('oembed')

    routes = [
        ('oembed',
         '/oembed',
         'oembed.views:oembed')]

    pluginapi.register_routes(routes)

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {"media_head": "oembed/oembed.html"})
Beispiel #24
0
def setup_plugin():
    _log.info("Setting up Blogging plugin")
    config = pluginapi.get_config('mediagoblin.plugins.blog')
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    routes = [
        ('mediagoblin.plugins.blog.blogpost.edit',
            '/u/<string:user>/b/post/edit/',
            'mediagoblin.plugins.blog.views:edit_blog_post'),
        ('mediagoblin.plugins.blog.blog.view',
            '/u/<string:user>/b/blog-name/',
            'mediagoblin.plugins.blog.views:view_blog')
    ]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
def setup_plugin():
    _log.info('Setting up API...')

    config = pluginapi.get_config(__name__)

    _log.debug('API config: {0}'.format(config))

    routes = [('mediagoblin.plugins.api.test', '/api/test',
               'mediagoblin.plugins.api.views:api_test'),
              ('mediagoblin.plugins.api.entries', '/api/entries',
               'mediagoblin.plugins.api.views:get_entries'),
              ('mediagoblin.plugins.api.post_entry', '/api/submit',
               'mediagoblin.plugins.api.views:post_entry')]

    pluginapi.register_routes(routes)
Beispiel #26
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.ldap')

    routes = [('mediagoblin.plugins.ldap.register', '/auth/ldap/register/',
               'mediagoblin.plugins.ldap.views:register'),
              ('mediagoblin.plugins.ldap.login', '/auth/ldap/login/',
               'mediagoblin.plugins.ldap.views:login')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks({
        'create_account':
        'mediagoblin/plugins/ldap/create_account_link.html'
    })
Beispiel #27
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.ldap')

    routes = [
        ('mediagoblin.plugins.ldap.register',
         '/auth/ldap/register/',
         'mediagoblin.plugins.ldap.views:register'),
        ('mediagoblin.plugins.ldap.login',
         '/auth/ldap/login/',
         'mediagoblin.plugins.ldap.views:login')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {'create_account': 'mediagoblin/plugins/ldap/create_account_link.html'})
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.html5-multi-upload')

    _log.info('Setting up html5-multi-upload....')

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pages = config.items()

    routes = [
        ('mediagoblin.plugins.html5-multi-upload.multi_submit_start',
         '/html5-multi-upload/',
         'mediagoblin.plugins.html5-multi-upload.views:multi_submit_start')
    ]

    pluginapi.register_routes(routes)
    _log.info('Done setting up html5-multi-upload!')
Beispiel #29
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.flatpagesfile')

    _log.info('Setting up flatpagesfile....')

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pages = config.items()

    routes = []
    for name, (url, template) in pages:
        name = 'flatpagesfile.%s' % name.strip()
        controller = flatpage_handler_builder(template)
        routes.append((name, url, controller))

    pluginapi.register_routes(routes)
    _log.info('Done setting up flatpagesfile!')
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.html5-multi-upload')

    _log.info('Setting up html5-multi-upload....')

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pages = config.items()

    routes = [
         ('mediagoblin.plugins.html5-multi-upload.multi_submit_start',
          '/html5-multi-upload/', 
          'mediagoblin.plugins.html5-multi-upload.views:multi_submit_start')
      ]

    pluginapi.register_routes(routes)
    _log.info('Done setting up html5-multi-upload!')
Beispiel #31
0
def setup_plugin():
    config = pluginapi.get_config(MEDIA_TYPE)
    _log.info("setting up blog media type plugin.")
    
    routes = [  
        #blog_create
        ('mediagoblin.media_types.blog.create',                         
        '/u/<string:user>/b/create/',
        'mediagoblin.media_types.blog.views:blog_edit'
        ), 
         #blog_edit        
        ('mediagoblin.media_types.blog.edit',                          
        '/u/<string:user>/b/<string:blog_slug>/edit/',          
        'mediagoblin.media_types.blog.views:blog_edit'
        ),
        #blog post create
        ('mediagoblin.media_types.blog.blogpost.create',                
        '/u/<string:user>/b/<string:blog_slug>/p/create/',
        'mediagoblin.media_types.blog.views:blogpost_create'
        ),
        #blog post edit
        ('mediagoblin.media_types.blog.blogpost.edit',                  
        '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/edit/',
        'mediagoblin.media_types.blog.views:blogpost_edit'
        ),
        #blog admin dashboard
        ('mediagoblin.media_types.blog.blog-dashboard',
        '/u/<string:user>/b/<string:blog_slug>/blog_dashboard/',
        'mediagoblin.media_types.blog.views:blog_dashboard'
        ),
        #blog post listing view
        ('mediagoblin.media_types.blog.blog_post_listing',
        '/u/<string:user>/b/<string:blog_slug>/',
        'mediagoblin.media_types.blog.views:blog_post_listing'
        ),
        #blog post draft view
        ('mediagoblin.media_types.blog.blogpost_draft_view', 
        '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/draft/',
        'mediagoblin.media_types.blog.views:draft_view')
        ]
            
            
    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
Beispiel #32
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.flatpagesfile')

    _log.info('Setting up flatpagesfile....')

    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pages = config.items()

    routes = []
    for name, (url, template) in pages:
        name = 'flatpagesfile.%s' % name.strip()
        controller = flatpage_handler_builder(template)
        routes.append(
            (name, url, controller))

    pluginapi.register_routes(routes)
    _log.info('Done setting up flatpagesfile!')
def setup_plugin():
    _log.info('Setting up recaptcha...')
    config = pluginapi.get_config('mediagoblin.plugins.recaptcha')
    if config:
        if config.get('RECAPTCHA_USE_SSL') == True:
            _log.info('reCAPTCHA is configured to use SSL.')
        else:
            _log.info('reCAPTCHA is NOT configured to use SSL.')

        if config.get('RECAPTCHA_PUBLIC_KEY') == 'domainpublickey':
            _log.warn('reCAPTCHA public key was not specified.')
        if config.get('RECAPTCHA_PRIVATE_KEY') == 'domainprivatekey':
            _log.warn('reCAPTCHA private key was not specified.')

    routes = [
        ('mediagoblin.plugins.recaptcha.register',
         '/auth/recaptcha/register/',
         'mediagoblin.plugins.recaptcha.views:register'),
        ('mediagoblin.plugins.recaptcha.login',
         '/auth/recaptcha/login/',
         'mediagoblin.plugins.recaptcha.views:login'),
        ('mediagoblin.plugins.recaptcha.edit.pass',
         '/edit/password/',
         'mediagoblin.plugins.recaptcha.views:change_pass'),
        ('mediagoblin.plugins.recaptcha.forgot_password',
         '/auth/forgot_password/',
         'mediagoblin.plugins.recaptcha.views:forgot_password'),
        ('mediagoblin.plugins.recaptcha.verify_forgot_password',
         '/auth/forgot_password/verify/',
         'mediagoblin.plugins.recaptcha.views:verify_forgot_password')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {'edit_link': 'mediagoblin/plugins/recaptcha/edit_link.html',
         'fp_link': 'mediagoblin/plugins/recaptcha/fp_link.html',
         'fp_head': 'mediagoblin/plugins/recaptcha/fp_head.html',
         'create_account':
            'mediagoblin/plugins/recaptcha/create_account_link.html'})

    _log.info('Done setting up recaptcha!')
Beispiel #34
0
def setup_plugin():
    _log.info('Setting up basic search...')
    config = pluginapi.get_config('mediagoblin.plugins.basicsearch')

    routes = [('mediagoblin.plugins.basicsearch', '/search/',
               'mediagoblin.plugins.basicsearch.views:search_results_view')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    search_link_style = config.get('SEARCH_LINK_STYLE')
    _log.debug("Search link style was specified as: %r", search_link_style)
    if search_link_style == 'button':
        header_template = '/mediagoblin/plugins/basicsearch/search_link_button.html'
    elif search_link_style == 'none':
        header_template = '/mediagoblin/plugins/basicsearch/search_link_none.html'
    else:
        header_template = '/mediagoblin/plugins/basicsearch/search_link_default.html'

    pluginapi.register_template_hooks({'header_extra': header_template})
Beispiel #35
0
def setup_plugin():
    global _setup_plugin_called

    my_plugin_dir = os.path.dirname(__file__)
    template_dir = os.path.join(my_plugin_dir, 'templates')
    register_template_path(template_dir)
    register_routes([
        ('manage-featured-media', '/mod/feature-media/',
        'mediagoblin.plugins.archivalook.views:featured_media_panel'),
        ('gallery-recent-media', '/recent/',
        'mediagoblin.plugins.archivalook.views:recent_media_gallery_view'),
        ('mediagoblin.user_pages.media_feature',
          '/u/<string:user>/m/<string:media>/feature/',
          'mediagoblin.plugins.archivalook.views:feature_media'),
        ('mediagoblin.user_pages.media_unfeature',
          '/u/<string:user>/m/<string:media>/unfeature/',
          'mediagoblin.plugins.archivalook.views:unfeature_media'),
        ('mediagoblin.user_pages.feature_promote',
          '/u/<string:user>/m/<string:media>/promote_feature/',
          'mediagoblin.plugins.archivalook.views:promote_featured_media'),
        ('mediagoblin.user_pages.feature_demote',
          '/u/<string:user>/m/<string:media>/demote_feature/',
          'mediagoblin.plugins.archivalook.views:demote_featured_media')])
    register_template_hooks({
            'media_sideinfo':'archivalook/feature_media_sidebar.html'})
    register_template_hooks({
            'moderation_powers':'archivalook/bits/feature_dropdown.html'})

    # Add template head hooks, if certain media types are enabled
    from mediagoblin import mg_globals
    plugin_section = mg_globals.global_config.get("plugins", {})
    if "mediagoblin.media_types.video" in plugin_section:
        register_template_hooks({
            "archivalook_feature_head": (
                "/archivalook/feature_displays/video_head.html")})
    if "mediagoblin.media_types.audio" in plugin_section:
        register_template_hooks({
            "archivalook_feature_head": (
                "/archivalook/feature_displays/audio_head.html")})
Beispiel #36
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.basic_auth')

    routes = [
        ('mediagoblin.plugins.basic_auth.edit.pass',
         '/edit/password/',
         'mediagoblin.plugins.basic_auth.views:change_pass'),
        ('mediagoblin.plugins.basic_auth.forgot_password',
         '/auth/forgot_password/',
         'mediagoblin.plugins.basic_auth.views:forgot_password'),
        ('mediagoblin.plugins.basic_auth.verify_forgot_password',
         '/auth/forgot_password/verify/',
         'mediagoblin.plugins.basic_auth.views:verify_forgot_password')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {'edit_link': 'mediagoblin/plugins/basic_auth/edit_link.html',
         'fp_link': 'mediagoblin/plugins/basic_auth/fp_link.html',
         'fp_head': 'mediagoblin/plugins/basic_auth/fp_head.html',
         'create_account':
            'mediagoblin/plugins/basic_auth/create_account_link.html'})
def setup_plugin():
    _log.info('Setting up basic search...')
    config = pluginapi.get_config('mediagoblin.plugins.basicsearch')

    routes = [
        ('mediagoblin.plugins.basicsearch',
         '/search/',
         'mediagoblin.plugins.basicsearch.views:search_results_view')]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    search_link_style = config.get('SEARCH_LINK_STYLE')
    _log.debug("Search link style was specified as: %r", search_link_style)
    if search_link_style == 'button':
        header_template = '/mediagoblin/plugins/basicsearch/search_link_button.html'
    elif search_link_style == 'none':
        header_template = '/mediagoblin/plugins/basicsearch/search_link_none.html'
    else:
        header_template = '/mediagoblin/plugins/basicsearch/search_link_default.html'

    pluginapi.register_template_hooks(
        {'header_extra': header_template})
Beispiel #38
0
def setup_plugin():
    config = pluginapi.get_config(MEDIA_TYPE)
    _log.info("setting up blog media type plugin.")

    routes = [
        #blog_create
        ('mediagoblin.media_types.blog.create', '/u/<string:user>/b/create/',
         'mediagoblin.media_types.blog.views:blog_edit'),
        #blog_edit
        ('mediagoblin.media_types.blog.edit',
         '/u/<string:user>/b/<string:blog_slug>/edit/',
         'mediagoblin.media_types.blog.views:blog_edit'),
        #blog post create
        ('mediagoblin.media_types.blog.blogpost.create',
         '/u/<string:user>/b/<string:blog_slug>/p/create/',
         'mediagoblin.media_types.blog.views:blogpost_create'),
        #blog post edit
        ('mediagoblin.media_types.blog.blogpost.edit',
         '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/edit/',
         'mediagoblin.media_types.blog.views:blogpost_edit'),
        #blog admin dashboard
        ('mediagoblin.media_types.blog.blog-dashboard',
         '/u/<string:user>/b/<string:blog_slug>/blog_dashboard/',
         'mediagoblin.media_types.blog.views:blog_dashboard'),
        #blog post listing view
        ('mediagoblin.media_types.blog.blog_post_listing',
         '/u/<string:user>/b/<string:blog_slug>/',
         'mediagoblin.media_types.blog.views:blog_post_listing'),
        #blog post draft view
        ('mediagoblin.media_types.blog.blogpost_draft_view',
         '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/draft/',
         'mediagoblin.media_types.blog.views:draft_view')
    ]

    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
def setup_plugin():
    _log.info('Setting up embedcode plugin...')
    config = pluginapi.get_config('mediagoblin.plugins.embedcode')
    pluginapi.register_routes(routes)
    embedcode_template = '/mediagoblin/plugins/embedcode/embed_code.html'
    pluginapi.register_template_hooks({'media_sideinfo': embedcode_template})
Beispiel #40
0
def setup_plugin():
    routes = [('staticstuff.static_demo', '/staticstuff/',
               'mediagoblin.tests.testplugins.staticstuff.views:static_demo')]

    pluginapi.register_routes(routes)
Beispiel #41
0
def setup_plugin():
    config = pluginapi.get_config(MEDIA_TYPE)
    _log.info("setting up blog media type plugin.")

    routes = [
        #blog_create
        ('mediagoblin.media_types.blog.create',
        '/u/<string:user>/b/create/',
        'mediagoblin.media_types.blog.views:blog_edit'
        ),
         #blog_edit
        ('mediagoblin.media_types.blog.edit',
        '/u/<string:user>/b/<string:blog_slug>/edit/',
        'mediagoblin.media_types.blog.views:blog_edit'
        ),
        #blog post create
        ('mediagoblin.media_types.blog.blogpost.create',
        '/u/<string:user>/b/<string:blog_slug>/p/create/',
        'mediagoblin.media_types.blog.views:blogpost_create'
        ),
        #blog post edit
        ('mediagoblin.media_types.blog.blogpost.edit',
        '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/edit/',
        'mediagoblin.media_types.blog.views:blogpost_edit'
        ),
        #blog collection dashboard in case of multiple blogs
        ('mediagoblin.media_types.blog.blog_admin_dashboard',
        '/u/<string:user>/b/dashboard/',
        'mediagoblin.media_types.blog.views:blog_dashboard'
        ),
        #blog dashboard
        ('mediagoblin.media_types.blog.blog-dashboard',
        '/u/<string:user>/b/<string:blog_slug>/dashboard/',
        'mediagoblin.media_types.blog.views:blog_dashboard'
        ),
        #blog post listing view
        ('mediagoblin.media_types.blog.blog_post_listing',
        '/u/<string:user>/b/<string:blog_slug>/',
        'mediagoblin.media_types.blog.views:blog_post_listing'
        ),
        #blog post draft view
        ('mediagoblin.media_types.blog.blogpost_draft_view',
        '/u/<string:user>/b/<string:blog_slug>/p/<string:blog_post_slug>/draft/',
        'mediagoblin.media_types.blog.views:draft_view'
        ),
        #blog delete view
        ('mediagoblin.media_types.blog.blog_delete',
        '/u/<string:user>/b/<string:blog_slug>/delete/',
        'mediagoblin.media_types.blog.views:blog_delete'
        ),
        # blog about view
        ('mediagoblin.media_types.blog.blog_about',
        '/u/<string:user>/b/<string:blog_slug>/about/',
        'mediagoblin.media_types.blog.views:blog_about_view'
        )]


    pluginapi.register_routes(routes)
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks({"user_profile": "mediagoblin/blog/url_to_blogs_dashboard.html",
                                        "blog_dashboard_home": "mediagoblin/blog/url_to_dashboard.html",
                                    })