mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 20:13:28 +00:00
Add oauth& provider forms
This commit is contained in:
@@ -31,19 +31,18 @@
|
||||
<div class="span12">
|
||||
{{ auth_macro.flashes() }}
|
||||
<form
|
||||
ng-controller="LoginFormController"
|
||||
novalidate
|
||||
name="loginForm"
|
||||
ng-submit="submit();"
|
||||
method="POST"
|
||||
action="{{ path("login_authenticate") }}"
|
||||
check-form-submission
|
||||
>
|
||||
{% if form.vars.errors|length > 0 %}
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ form_errors(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ auth_macro.fieldInput(form.email, "loginForm", 'icon-envelope') }}
|
||||
@@ -122,3 +121,8 @@
|
||||
{% block footer_scaffholding %}
|
||||
{# empty footer #}
|
||||
{% endblock footer_scaffholding %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript" src="/scripts/apps/login/home/oauthLogin.js"></script>
|
||||
{% endblock %}
|
||||
|
@@ -37,19 +37,18 @@
|
||||
<div class="span12">
|
||||
{{ auth_macro.flashes() }}
|
||||
<form
|
||||
ng-controller="LoginFormController"
|
||||
novalidate
|
||||
name="loginForm"
|
||||
ng-submit="submit();"
|
||||
action="{{ path('login_authentication_provider_do_bind', { 'providerId' : provider.getId() }) }}"
|
||||
method="POST"
|
||||
check-form-submission
|
||||
>
|
||||
{% if form.vars.errors|length > 0 %}
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ form_errors(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ auth_macro.fieldInput(form.login, "loginForm", 'icon-envelope') }}
|
||||
@@ -86,3 +85,8 @@
|
||||
</div>
|
||||
{% include "login/include/register-link-block.html.twig" with {"login" : login, "last_item" : app['registration.enabled']} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript" src="/scripts/apps/login/home/bind.js"></script>
|
||||
{% endblock %}
|
||||
|
@@ -55,19 +55,18 @@
|
||||
<div class="span12">
|
||||
{{ auth_macro.flashes() }}
|
||||
<form
|
||||
ng-controller="LoginFormController"
|
||||
novalidate
|
||||
name="loginForm"
|
||||
ng-submit="submit();"
|
||||
action="{{ path('login_authentication_provider_do_mapping', { 'providerId' : provider.getId() }) }}"
|
||||
method="POST"
|
||||
check-form-submission
|
||||
>
|
||||
{% if form.vars.errors|length > 0 %}
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ form_errors(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row-fluid hidden">
|
||||
<div class="span12">
|
||||
{{ auth_macro.fieldInput(form.login, "loginForm", 'icon-envelope', {'value' : 'nard', 'autocomplete' : 'off' }) }}
|
||||
@@ -118,3 +117,8 @@
|
||||
</div>
|
||||
{% include "login/include/register-link-block.html.twig" with {"login" : login, "last_item" : app['registration.enabled']} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript" src="/scripts/apps/login/home/mapping.js"></script>
|
||||
{% endblock %}
|
||||
|
34
www/scripts/apps/login/home/bind.js
Normal file
34
www/scripts/apps/login/home/bind.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
require([
|
||||
"jquery",
|
||||
"i18n",
|
||||
"apps/login/home/common",
|
||||
"apps/login/home/views/form"
|
||||
], function($, i18n, Common, LoginForm) {
|
||||
Common.initialize();
|
||||
|
||||
i18n.init({
|
||||
resGetPath: Common.languagePath
|
||||
}, function() {
|
||||
new LoginForm({
|
||||
el : $("form[name=loginForm]"),
|
||||
rules: [{
|
||||
name: "login",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
},{
|
||||
name: "password",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
}]
|
||||
});
|
||||
});
|
||||
});
|
34
www/scripts/apps/login/home/mapping.js
Normal file
34
www/scripts/apps/login/home/mapping.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
require([
|
||||
"jquery",
|
||||
"i18n",
|
||||
"apps/login/home/common",
|
||||
"apps/login/home/views/form"
|
||||
], function($, i18n, Common, LoginForm) {
|
||||
Common.initialize();
|
||||
|
||||
i18n.init({
|
||||
resGetPath: Common.languagePath
|
||||
}, function() {
|
||||
new LoginForm({
|
||||
el : $("form[name=loginForm]"),
|
||||
rules: [{
|
||||
name: "login",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
},{
|
||||
name: "password",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
}]
|
||||
});
|
||||
});
|
||||
});
|
34
www/scripts/apps/login/home/oauthLogin.js
Normal file
34
www/scripts/apps/login/home/oauthLogin.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
require([
|
||||
"jquery",
|
||||
"i18n",
|
||||
"apps/login/home/common",
|
||||
"apps/login/home/views/form"
|
||||
], function($, i18n, Common, LoginForm) {
|
||||
Common.initialize();
|
||||
|
||||
i18n.init({
|
||||
resGetPath: Common.languagePath
|
||||
}, function() {
|
||||
new LoginForm({
|
||||
el : $("form[name=loginForm]"),
|
||||
rules: [{
|
||||
name: "login",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
},{
|
||||
name: "password",
|
||||
rules: "required",
|
||||
message: i18n.t("validation_blank")
|
||||
}]
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user