header.twig 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link href="css/freepost.css" rel="stylesheet">
  7. <title>{{ title is defined ? title ~ ' - ' }}freepost</title>
  8. </head>
  9. <body>
  10. <div class="container">
  11. <div class="header">
  12. <div class="flex-container">
  13. <div class="flex-item">
  14. <a href="{{ ''|docroot }}" class="logo">
  15. free
  16. {# &nbsp; is an extra space because "post" is displayed attached to the picture (not sure why) #}
  17. <img alt="🐵&nbsp;" title="freepost" src="images/freepost.png" />
  18. post
  19. </a>
  20. </div>
  21. <div class="flex-item">
  22. <form action="{{ 'search'|docroot }}">
  23. <input type="text" name="q" value="{{ query }}" placeholder="Search posts" />
  24. </form>
  25. </div>
  26. </div>
  27. <div class="menu">
  28. <a href="{{ ''|docroot }}" class="flex-item">Hot</a>
  29. <a href="{{ 'new'|docroot }}" class="flex-item">New</a>
  30. {% if user %}
  31. {% set unread_messages = new_messages() %}
  32. <a href="{{ 'submit'|docroot }}" class="flex-item">Submit</a>
  33. {% if unread_messages %}
  34. <a href="{{ 'user_activity/replies'|docroot }}" class="new_messages flex-item">
  35. {{ user.name }} ({{ unread_messages }})
  36. </a>
  37. {% else %}
  38. <a href="{{ 'user'|docroot }}" class="flex-item">
  39. {{ user.name }}
  40. </a>
  41. {% endif %}
  42. <a href="{{ 'about'|docroot }}" class="flex-item">About</a>
  43. <a href="{{ 'logout'|docroot }}" class="flex-item">Log out</a>
  44. {% else %}
  45. <a href="{{ 'login'|docroot }}" class="flex-item">Log in</a>
  46. {% endif %}
  47. </div>
  48. </div>
  49. <div class="content">