add basic design to userbundle && refactor
This commit is contained in:
@@ -3,59 +3,77 @@
|
||||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
{% block fos_user_content %}
|
||||
<script>
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : '320599508311862',
|
||||
xfbml : true,
|
||||
version : 'v2.8'
|
||||
});
|
||||
};
|
||||
|
||||
(function(d, s, id){
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) {return;}
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
|
||||
function fb_login() {
|
||||
FB.getLoginStatus(function(response) {
|
||||
if (response.status === 'connected') {
|
||||
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
|
||||
} else {
|
||||
FB.login(function(response) {
|
||||
if (response.authResponse) {
|
||||
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
|
||||
}
|
||||
}, {scope: 'email'});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<a href="#" onclick="fb_login();">Facebook Connect Button (Dialog)</a>
|
||||
|
||||
{% if error %}
|
||||
{{ error.messageKey|trans(error.messageData, 'security') }}
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ path("fos_user_security_check") }}" method="post">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>
|
||||
<div class="login">
|
||||
<h1>
|
||||
Sign in
|
||||
</h1>
|
||||
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}"
|
||||
placeholder="{{ 'security.login.username'|trans }}"
|
||||
autofocus/>
|
||||
<div class="form">
|
||||
<form action="{{ path("fos_user_security_check") }}" method="post">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>
|
||||
|
||||
<input type="password" id="password" name="_password"
|
||||
placeholder="{{ 'security.login.password'|trans }}"
|
||||
/>
|
||||
<div class="input input--kozakura">
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}"
|
||||
class="input__field input__field--kozakura" autofocus/>
|
||||
<label class="input__label input__label--kozakura" for="fos_user_registration_form_email">
|
||||
<span class="input__label-content input__label-content--kozakura"
|
||||
data-content="Username or Email">Username or Email</span>
|
||||
</label>
|
||||
<svg class="graphic graphic--kozakura" width="300%" height="100%" viewBox="0 0 1200 60"
|
||||
preserveAspectRatio="none">
|
||||
<path d="M1200,9c0,0-305.005,0-401.001,0C733,9,675.327,4.969,598,4.969C514.994,4.969,449.336,9,400.333,9C299.666,9,0,9,0,9v43c0,0,299.666,0,400.333,0c49.002,0,114.66,3.484,197.667,3.484c77.327,0,135-3.484,200.999-3.484C894.995,52,1200,52,1200,52V9z"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" id="remember_me" name="_remember_me" value="on"/>
|
||||
<label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>
|
||||
<div class="input input--kozakura">
|
||||
<input type="password" id="password" name="_password"
|
||||
class="input__field input__field--kozakura"/>
|
||||
<label class="input__label input__label--kozakura" for="fos_user_registration_form_email">
|
||||
<span class="input__label-content input__label-content--kozakura" data-content="Password">Password</span>
|
||||
</label>
|
||||
<svg class="graphic graphic--kozakura" width="300%" height="100%" viewBox="0 0 1200 60"
|
||||
preserveAspectRatio="none">
|
||||
<path d="M1200,9c0,0-305.005,0-401.001,0C733,9,675.327,4.969,598,4.969C514.994,4.969,449.336,9,400.333,9C299.666,9,0,9,0,9v43c0,0,299.666,0,400.333,0c49.002,0,114.66,3.484,197.667,3.484c77.327,0,135-3.484,200.999-3.484C894.995,52,1200,52,1200,52V9z"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<input type="submit" id="_submit" name="_submit"
|
||||
value="{{ 'security.login.submit'|trans }}"/>
|
||||
</form>
|
||||
<div class="checkbox text-center">
|
||||
<label for="remember_me">
|
||||
<input type="checkbox" id="remember_me" name="_remember_me" value="on"/>
|
||||
{{ 'security.login.remember_me'|trans }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="input-submit">
|
||||
<input class="submit" type="submit" id="_submit" name="_submit"
|
||||
value="{{ 'security.login.submit'|trans }}"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% include('@JotunheimrUser/Social/facebook.html.twig') %}
|
||||
</div>
|
||||
{% endblock fos_user_content %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
{% javascripts
|
||||
'@JotunheimrUserBundle/Resources/public/js/register.js' %}
|
||||
<script type="text/javascript" src="{{ asset_url }}"></script>
|
||||
{% endjavascripts %}
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
|
||||
{% stylesheets filter='cssrewrite'
|
||||
'@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css'
|
||||
'@JotunheimrUserBundle/Resources/public/css/login.css' %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
|
||||
{% endstylesheets %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user