Exemplo n.º 1
0
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})
Exemplo n.º 2
0
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})
Exemplo n.º 3
0
def setup_plugin():
    _log.info('Setting up recaptcha...')

    config = pluginapi.get_config('mediagoblin.plugins.recaptcha')
    if config:
        if config.get('RECAPTCHA_SITE_KEY') == 'domainsitekey':
            configuration_error = 'You must configure the recaptcha plugin site key.'
            raise ImproperlyConfigured(configuration_error)
        if config.get('RECAPTCHA_SECRET_KEY') == 'domainsecretkey':
            configuration_error = 'You must configure the recaptcha plugin secret key.'
            raise ImproperlyConfigured(configuration_error)

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

    pluginapi.register_template_hooks({
        'register_captcha':
        'mediagoblin/plugins/recaptcha/captcha_challenge.html'
    })

    # Create dummy request object to find register_form.
    environ = create_environ('/foo', 'http://localhost:8080/')
    request = Request(environ)
    register_form = pluginapi.hook_handle("auth_get_registration_form",
                                          request)
    del request

    # Add plugin-specific fields to register_form class.
    register_form_class = register_form.__class__
    register_form_class.g_recaptcha_response = captcha_forms.RecaptchaHiddenField(
        'reCAPTCHA', id='g-recaptcha-response', name='g-recaptcha-response')
    register_form_class.remote_address = wtforms.HiddenField('')

    _log.info('Done setting up recaptcha!')
Exemplo n.º 4
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():
    _log.info('Setting up lepturecaptcha...')

    config = pluginapi.get_config('mediagoblin.plugins.lepturecaptcha')
    if config:
        if config.get('CAPTCHA_SECRET_PHRASE') == 'changeme':
            configuration_error = 'You must configure the captcha secret phrase.'
            raise ImproperlyConfigured(configuration_error)

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

    pluginapi.register_template_hooks(
        {'register_captcha': 'mediagoblin/plugins/lepturecaptcha/captcha_challenge.html'})

    # Create dummy request object to find register_form.
    environ = create_environ('/foo', 'http://localhost:8080/')
    request = Request(environ)
    register_form = pluginapi.hook_handle("auth_get_registration_form", request)
    del request

    # Add plugin-specific fields to register_form class.
    register_form_class = register_form.__class__
    register_form_class.captcha_response = captcha_forms.CaptchaStringField('CAPTCHA response', id='captcha_response', name='captcha_response')
    register_form_class.captcha_hash = wtforms.HiddenField('')
    register_form_class.remote_address = wtforms.HiddenField('')

    _log.info('Done setting up lepturecaptcha!')
Exemplo n.º 6
0
def setup_plugin():
    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {"media_sideinfo": "mediagoblin/plugins/metadata_display/metadata_table.html",
         "head": "mediagoblin/plugins/metadata_display/bits/metadata_extra_head.html"})
Exemplo n.º 7
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'})
Exemplo n.º 8
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"
    })
Exemplo n.º 9
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'
    })
Exemplo n.º 10
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'})
Exemplo n.º 11
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.geolocation')
    
    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {"image_sideinfo": "mediagoblin/plugins/geolocation/map.html",
         "image_head": "mediagoblin/plugins/geolocation/map_js_head.html"})
Exemplo n.º 12
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin.plugins.geolocation')

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

    pluginapi.register_template_hooks(
        {"location_info": "mediagoblin/plugins/geolocation/map.html",
         "location_head": "mediagoblin/plugins/geolocation/map_js_head.html"})
Exemplo n.º 13
0
def setup_plugin():
    # Register the template path.
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks({
        "media_sideinfo":
        "mediagoblin/plugins/metadata_display/metadata_table.html",
        "head":
        "mediagoblin/plugins/metadata_display/bits/metadata_extra_head.html"
    })
Exemplo n.º 14
0
def setup_plugin():
    _log.info('Setting up embedcode plugin...')
    config = pluginapi.get_config('mediagoblin.plugins.embedcode')

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

    pluginapi.register_template_hooks(
        {'media_sideinfo': 'mediagoblin/plugins/embedcode/embed_code.html'})

    _log.info('Done setting up embedcode!')
Exemplo n.º 15
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",
    })
Exemplo n.º 16
0
def setup_plugin():
    global config 
    config = pluginapi.get_config('advanced-sampleplugin')
    if config:
        _log.info('%r' % config)
    else:
        _log.info('There is no configuration set.')
    
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))

    pluginapi.register_template_hooks(
        {"persona_end": "mediagoblin/advanced-sampleplugin/template.html"})
Exemplo n.º 17
0
def setup_plugin():
    config = pluginapi.get_config("mediagoblin.plugins.geolocation")

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

    pluginapi.register_template_hooks(
        {
            "location_info": "mediagoblin/plugins/geolocation/map.html",
            "location_head": "mediagoblin/plugins/geolocation/map_js_head.html",
        }
    )
Exemplo n.º 18
0
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)
Exemplo n.º 19
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"})
Exemplo n.º 20
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'
    })
Exemplo n.º 21
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():
    _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!')
Exemplo n.º 23
0
def setup_plugin():
    global _setup_plugin_called

    _log.info('Setting up Piwik...')
    config = pluginapi.get_config('mediagoblin.plugins.piwik')
    if config:
        if config.get('PIWIK_DOMAIN') == 'mediagoblin.example.com':
            _log.warn('Piwik domain was not specified.')
        if config.get('PIWIK_LOCATION') == 'example.com/piwik':
            _log.warn('Piwik location was not specified.')

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

    from mediagoblin import mg_globals
    plugin_section = mg_globals.global_config.get("plugins", {})
    pluginapi.register_template_hooks(
         {"head": "mediagoblin/plugins/piwik/bits/piwik_extra_head.html"})

    _log.info('Done setting up Piwik!')
Exemplo n.º 24
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})
Exemplo n.º 25
0
def setup_plugin():
    global _setup_plugin_called

    _log.info('Setting up Piwik...')
    config = pluginapi.get_config('mediagoblin.plugins.piwik')
    if config:
        if config.get('PIWIK_DOMAIN') == 'mediagoblin.example.com':
            _log.warn('Piwik domain was not specified.')
        if config.get('PIWIK_LOCATION') == 'example.com/piwik':
            _log.warn('Piwik location was not specified.')

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

    from mediagoblin import mg_globals
    plugin_section = mg_globals.global_config.get("plugins", {})
    pluginapi.register_template_hooks(
        {"head": "mediagoblin/plugins/piwik/bits/piwik_extra_head.html"})

    _log.info('Done setting up Piwik!')
Exemplo n.º 26
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})
Exemplo n.º 27
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'})
Exemplo n.º 28
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")})
Exemplo n.º 29
0
def setup_plugin():
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
        {'header_left': 'mediagoblin/processing_info/header_left.html'})
    return
Exemplo n.º 30
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin_rdfa')

    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
        {"image_sideinfo": "mediagoblin/plugins/rdfa/metadata.html"})
Exemplo n.º 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 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",
                                    })
Exemplo n.º 32
0
def setup_plugin():
    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
            {'header_left': 'mediagoblin/processing_info/header_left.html'})
    return
Exemplo n.º 33
0
def setup_plugin():
    config = pluginapi.get_config('mediagoblin_rdfa')

    pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
    pluginapi.register_template_hooks(
        {"image_sideinfo": "mediagoblin/plugins/rdfa/metadata.html"})
Exemplo n.º 34
0
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})