show.html.twig 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends "FOSUserBundle::layout.html.twig" %}
  2. {% import "PackagistWebBundle::macros.html.twig" as macros %}
  3. {% block fos_user_content %}
  4. <section class="col-md-9">
  5. {%- if app.user.apiToken %}
  6. <h3 class="font-normal profile-title">{{ 'profile.your_api_token'|trans }}</h3>
  7. <div class="input-group api-token-group clearfix">
  8. <input id="api-token" type="text" class="form-control" value="" data-api-token="{{ app.user.apiToken }}" readonly="readonly">
  9. <span class="input-group-btn">
  10. <button class="btn btn-success btn-show-api-token" type="button">{{ 'profile.show_api_token'|trans }}</button>
  11. </span>
  12. </div>
  13. <p>{{ 'profile.api_token_explain'|trans({ '%path_about%':path('about') })|raw }}</p>
  14. <hr>
  15. {%- endif %}
  16. {% if githubSync is not null and githubSync.createdAt|date('YmdHis') > '-2 days'|date('YmdHis') %}
  17. <h3 class="font-normal">GitHub Hook Sync</h3>
  18. {% if githubSync.completedAt is null %}
  19. <p>Still running... <a href="{{ path('fos_user_profile_show') }}">Refresh</a></p>
  20. {% elseif githubSync.status == 'errored' %}
  21. <p>An unexpected error occurred during sync.</p>
  22. {% else %}
  23. <p>Completed at {{ githubSync.completedAt|date('Y-m-d H:i:s') }} UTC, <a href="{{ path('user_github_sync') }}">retry hook sync</a>.</p>
  24. {% if githubSync.result.results is defined %}
  25. <h4>{{ githubSync.result.results.hooks_setup }} hooks setup/updated</h4>
  26. <h4>{{ githubSync.result.results.hooks_ok_unchanged }} hooks already setup and left unchanged</h4>
  27. {% if githubSync.result.results.hooks_failed|length > 0 %}
  28. <h4>Hooks setup failures</h4>
  29. {% for fail in githubSync.result.results.hooks_failed %}
  30. <p><a href="{{ path('view_package', {name: fail.package}) }}">{{ fail.package }}</a> {{ fail.reason|raw }}</p>
  31. {% endfor %}
  32. {% endif %}
  33. {% endif %}
  34. {% endif %}
  35. {% endif %}
  36. {% embed "PackagistWebBundle:web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: true} %}
  37. {% block content_title %}
  38. <h3 class="font-normal">{{ 'packages.yours'|trans }}</h3>
  39. {% endblock %}
  40. {% endembed %}
  41. {%- if deleteForm is defined %}
  42. <form class="delete action" action="{{ path('user_delete', {name: user.username}) }}" method="POST">
  43. {{ form_widget(deleteForm._token) }}
  44. <input class="btn btn-danger" type="submit" value="Delete Account Permanently" onclick="return confirm('Are you sure? There is no way back..');" />
  45. </form>
  46. {%- endif %}
  47. </section>
  48. {% endblock %}