moved persona template stuff to use template_hooks
This commit is contained in:
committed by
Christopher Allan Webber
parent
4f8f0a4e1f
commit
e39b9cc60f
@@ -120,4 +120,6 @@ hooks = {
|
||||
'auth_no_pass_redirect': no_pass_redirect,
|
||||
('mediagoblin.auth.register',
|
||||
'mediagoblin/auth/register.html'): add_to_form_context,
|
||||
('mediagoblin.auth.login',
|
||||
'mediagoblin/auth/login.html'): add_to_form_context
|
||||
}
|
||||
|
||||
@@ -44,13 +44,7 @@
|
||||
{% trans %}Log in to create an account!{% endtrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if persona is defined %}
|
||||
<p>
|
||||
<a href="javascript:;" id="persona_login">
|
||||
{% trans %}Or login with Persona!{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% template_hook('login_link') %}
|
||||
{% if pass_auth is defined %}
|
||||
<p>
|
||||
<a href="{{ request.urlgen('mediagoblin.auth.login') }}?{{ request.query_string }}">
|
||||
|
||||
@@ -17,9 +17,11 @@
|
||||
#}
|
||||
|
||||
{% block openid_login_link %}
|
||||
{% if openid_link is defined %}
|
||||
<p>
|
||||
<a href="{{ request.urlgen('mediagoblin.plugins.openid.login') }}?{{ request.query_string }}">
|
||||
{%- trans %}Or login with OpenID!{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -49,7 +49,10 @@ def setup_plugin():
|
||||
pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates'))
|
||||
pluginapi.register_template_hooks(
|
||||
{'persona_head': 'mediagoblin/plugins/persona/persona_js_head.html',
|
||||
'persona_form': 'mediagoblin/plugins/persona/persona.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 create_user(register_form):
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{#
|
||||
# GNU MediaGoblin -- federated, autonomous media hosting
|
||||
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
|
||||
{% block persona_edit_link %}
|
||||
<p>
|
||||
<a href="{{ request.urlgen('mediagoblin.plugins.persona.edit') }}">
|
||||
{% trans %}Edit your Persona email addresses{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{#
|
||||
# GNU MediaGoblin -- federated, autonomous media hosting
|
||||
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
|
||||
{% block person_login_link %}
|
||||
<p>
|
||||
<a href="javascript:;" id="persona_login">
|
||||
{% trans %}Or login with Persona!{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{#
|
||||
# GNU MediaGoblin -- federated, autonomous media hosting
|
||||
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
|
||||
{% block persona_register_link %}
|
||||
<p>
|
||||
<a href="javascript:;" id="persona_login">
|
||||
{% trans %}Or register with Persona!{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user