edit_content.html.twig 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {{ form_start(form, { 'action': path('fos_user_profile_edit'), 'attr': { 'class': 'fos_user_profile_edit col-md-6' } }) }}
  2. {{ form_errors(form) }}
  3. <div class="form-group clearfix">
  4. {{ form_label(form.username) }}
  5. <div class="input-group">
  6. {{ form_errors(form.username) }}
  7. {{ form_widget(form.username) }}
  8. <span class="input-group-addon"><span class="icon-user"></span></span>
  9. </div>
  10. </div>
  11. <div class="form-group clearfix">
  12. {{ form_label(form.email) }}
  13. <div class="input-group clearfix">
  14. {{ form_errors(form.email) }}
  15. {{ form_widget(form.email) }}
  16. <span class="input-group-addon"><span class="icon-mail"></span></span>
  17. </div>
  18. </div>
  19. {% if not app.user.githubId %}
  20. <div class="form-group clearfix">
  21. {{ form_label(form.current_password) }}
  22. <div class="input-group">
  23. {{ form_errors(form.current_password) }}
  24. {{ form_widget(form.current_password) }}
  25. <span class="input-group-addon"><span class="icon-lock"></span></span>
  26. </div>
  27. </div>
  28. {% endif %}
  29. <div class="notifications form-group">
  30. {{ form_errors(form.failureNotifications) }}
  31. <label>
  32. {{ form_widget(form.failureNotifications) }}
  33. {{ 'profile.notify_on_failure'|trans }}
  34. </label>
  35. </div>
  36. {{ form_rest(form) }}
  37. <input type="submit" class="btn btn-block btn-success btn-lg" value="{{ 'profile.edit.submit'|trans({}, 'FOSUserBundle') }}" />
  38. <hr>
  39. <h5>Using GitHub:</h5>
  40. <a href="{{ app.user.githubId ? '#' : hwi_oauth_login_url('github') }}" class="btn btn-block btn-github btn-lg {{ app.user.githubId ? 'disabled' : 'btn-primary' }}">
  41. <span class="icon-github"></span>
  42. {% set ghUser = app.user.githubUsername %}
  43. {{ (app.user.githubId ? 'profile.accounts_connected' : 'profile.connect_accounts')|trans({"%user%": ghUser|default('unknown')}) }}
  44. </a>
  45. {% if app.user.githubId %}
  46. {% if ghUser == false %}
  47. <p>Unknown GitHub user, token is missing, logout and login again via GitHub to fix it, or <a href="{{ path('user_github_disconnect', {token: csrf_token('unlink_github')}) }}">disconnect your GitHub account</a> entirely to connect another one.</p>
  48. {% else %}
  49. <p><a href="{{ path('user_github_disconnect', {token: csrf_token('unlink_github')}) }}">Disconnect your GitHub account</a> to connect another one.</p>
  50. {% endif %}
  51. {% endif %}
  52. {{ form_end(form) }}
  53. <div class="col-md-2">
  54. </div>