header.twig 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <a href="{{ 'about'|docroot }}" class="flex-item">About</a>
  31. {% if user %}
  32. {% set unread_messages = new_messages() %}
  33. <a href="{{ 'submit'|docroot }}" class="flex-item">Submit</a>
  34. {% if unread_messages %}
  35. <a href="{{ 'user_activity/replies'|docroot }}" class="new_messages flex-item">
  36. {{ user.name }} ({{ unread_messages }})
  37. </a>
  38. {% else %}
  39. <a href="{{ 'user'|docroot }}" class="flex-item">
  40. {{ user.name }}
  41. </a>
  42. {% endif %}
  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">