navigation.html.twig 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {% block feeds %}
  2. {% from 'cards/macros/widgets.html.twig' import section, details %}
  3. {% set prepend %}
  4. <h2 class="section-title">Account</h2>
  5. {% endset %}
  6. {% set main %}
  7. {% set classes = {'details': 'section-details-title', 'summary': 'details-summary-title'} %}
  8. {% set summary %}
  9. <span>{% trans %}Feeds{% endtrans %}</span>
  10. {% if app.user %}
  11. {# User custom feeds #}
  12. <a class="edit-feed-link" href="{{ path('edit_feeds') }}">{{ icon('edit', 'icon icon-edit-feed') | raw }}</a>
  13. {% endif %}
  14. {% endset %}
  15. {% set expanded %}
  16. <nav class="frame-section-padding" tabindex="0" title="{% trans %}Navigate through each feed{% endtrans %}">
  17. {% if not app.user %} {# Default feeds #}
  18. <ul>
  19. <li>
  20. <a href="{{ path('feed_public') }}" class='hover-effect {{ active('feed_public') }}'>
  21. {% trans %}Feed{% endtrans %}
  22. </a>
  23. </li>
  24. </ul>
  25. {% else %}
  26. <ul>
  27. {% for link in get_feeds(current_actor) %}
  28. <li>
  29. <a href="{{ link.getUrl() }}" class='{{ active(link.getRoute()) }}'>{{ link.getTitle() }}</a>
  30. </li>
  31. {% endfor %}
  32. {% for link in handle_event('AddMainNavigationItem', {'nickname': current_actor.getNickname()}) %}
  33. <li>
  34. <a href="{{ link['path'] }}" class='{{ active(link['path_id']) }}'>
  35. {{ link['title'] }}
  36. </a>
  37. </li>
  38. {% endfor %}
  39. </ul>
  40. {% endif %}
  41. </nav>
  42. {% endset %}
  43. {% set blocks = {'summary': { summary }, 'main': { expanded }} %}
  44. {{ details(blocks, classes) }}
  45. {% endset %}
  46. {% set classes = {'section': 'frame-section'} %}
  47. {% set title = 'Navigate through feeds' %}
  48. {% set blocks = {'prepend': {}, 'main': { main }, 'append': {}} %}
  49. {{ section(title, blocks, classes) }}
  50. {% endblock feeds %}
  51. {% block profile_current_actor %}
  52. <nav tabindex="0" class="profile-navigation" title="{% trans %}Navigate through account related pages{% endtrans %}">
  53. <a title="{% trans %}Access your account settings{% endtrans %}" href="{{ path('person_actor_settings', {id: app.user.getId()}) }}" class='{{ active('settings') }}'>
  54. {% trans %}Settings{% endtrans %}
  55. </a>
  56. <a title="{% trans %}Logout from your account{% endtrans %}" href='{{ path('security_logout') }}'>
  57. {% trans %}Logout{% endtrans %}
  58. </a>
  59. </nav>
  60. {% endblock profile_current_actor %}
  61. {% block profile_security %}
  62. {% from 'cards/macros/widgets.html.twig' import section, nav_a %}
  63. {% set prepend %}
  64. <h2 class="section-title">Account</h2>
  65. {% endset %}
  66. {% set main %}
  67. {% set nav = {'classes': 'profile-navigation', 'title': 'Navigate through account related pages', 'tabindex': '0'} %}
  68. {% set items = [
  69. {'route': 'security_login', 'classes': active('security_login'), 'title': 'Login with your existing account', 'name': 'Login' },
  70. {'route': 'security_register', 'classes': active('security_register'), 'title': 'Register a new account!', 'name': 'Register' }
  71. ]%}
  72. {{ nav_a(nav, items) }}
  73. {% endset %}
  74. {% set classes = {'section': 'frame-section frame-section-padding'} %}
  75. {% set title = 'Profile information' %}
  76. {% set blocks = {'prepend': { prepend }, 'main': { main }, 'append': {}} %}
  77. {{ section(title, blocks, classes) }}
  78. {% endblock profile_security %}
  79. {% block footer %}
  80. {% from 'cards/macros/widgets.html.twig' import nav_ul_li_a %}
  81. {% set nav = {'classes': 'footer', 'title': 'Footer conatining instance FAQ, TOS, and additional info'} %}
  82. {% set items = [
  83. {'route': 'doc_faq', 'classes': active('doc_faq'), 'title': 'FAQ', 'name': 'FAQ'},
  84. {'route': 'doc_tos', 'classes': active('doc_tos'), 'title': 'TOS', 'name': 'TOS'},
  85. {'route': 'doc_privacy', 'classes': active('doc_privacy'), 'title': 'Privacy', 'name': 'Privacy'},
  86. {'route': 'doc_source', 'classes': active('doc_source'), 'title': 'Source', 'name': 'Source'},
  87. {'route': 'doc_version', 'classes': active('doc_version'), 'title': 'Version', 'name': 'Version'}
  88. ]%}
  89. {{ nav_ul_li_a(nav, items) }}
  90. {% endblock footer %}