login.html.twig 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends "FOSUserBundle::layout.html.twig" %}
  2. {% trans_default_domain 'FOSUserBundle' %}
  3. {% block fos_user_header %}
  4. {% endblock %}
  5. {% block fos_user_content %}
  6. {# HWIOAuthBundle uses the same template for the login and the connect functionality currently
  7. so we need to check if the user is already authenticated. #}
  8. {% if not app.user %}
  9. <div class="col-xs-12">
  10. <h2 class="title">
  11. Sign in
  12. </h2>
  13. </div>
  14. <div class="col-md-6">
  15. {% if error is defined and error is not empty %}
  16. <div class="alert alert-warning">
  17. {{ error }}
  18. </div>
  19. {% endif %}
  20. <form action="{{ path('login_check') }}" method="POST">
  21. <div class="form-group clearfix">
  22. <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
  23. <div class="input-group clearfix">
  24. <input class="form-control" type="text" id="username" name="_username">
  25. <span class="input-group-addon"><span class="icon-user"></span></span>
  26. </div>
  27. </div>
  28. <div class="form-group clearfix">
  29. <label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
  30. <div class="input-group clearfix">
  31. <input class="form-control" type="password" id="password" name="_password">
  32. <span class="input-group-addon"><span class="icon-lock"></span></span>
  33. </div>
  34. </div>
  35. <div class="checkbox">
  36. <a class="pull-right" href="{{ path('fos_user_resetting_request') }}">Forgot password?</a>
  37. <label for="remember_me">
  38. <input type="checkbox" id="remember_me" name="_remember_me" value="on" checked="checked" />
  39. {{- 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
  40. </label>
  41. </div>
  42. {% if packagist_host and packagist_host in app.request.headers.get('Referer') %}
  43. <input type="hidden" name="_target_path" value="{{ app.request.headers.get('Referer') }}" />
  44. {% endif %}
  45. <input class="btn btn-block btn-success btn-lg" type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
  46. </form>
  47. <hr>
  48. </div>
  49. {% endif %}
  50. {% for owner in hwi_oauth_resource_owners() %}
  51. {% if not app.user %}
  52. <div class="clearfix"></div>
  53. {% endif %}
  54. <div class="col-md-6">
  55. <a class="btn btn-block btn-{{ owner }} btn-primary btn-lg" href="{{ hwi_oauth_login_url(owner) }}"><span class="icon-{{ owner }}"></span>Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a>{% if not loop.last %}<br />{% endif %}
  56. </div>
  57. {% endfor %}
  58. {% endblock %}