Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

132 linhas
6.7 KiB

3 anos atrás
  1. {% from 'bootstrap/nav.html' import render_nav_item %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. {% block head %}
  8. <title>{% block title %}{% endblock %} - Touch</title>
  9. <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
  10. {% block styles %}
  11. <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
  12. <link rel="stylesheet" href="{{ url_for('static', filename='open-iconic/font/css/open-iconic-bootstrap.css') }}">
  13. <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
  14. {% endblock styles %}
  15. {% endblock head %}
  16. </head>
  17. <body>
  18. {% block navbar %}
  19. <nav class="navbar navbar-expand-lg navbar-light bg-light">
  20. <div class="container">
  21. <a class="navbar-brand" href="{{ url_for('main.index') }}">
  22. <img src="{{ url_for('static', filename='favicon.ico') }}" alt="Albumy">
  23. </a>
  24. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01"
  25. aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
  26. <span class="navbar-toggler-icon"></span>
  27. </button>
  28. <div class="collapse navbar-collapse" id="navbarColor01">
  29. <div class="navbar-nav mr-auto">
  30. {{ render_nav_item('main.index', '主页') }}
  31. {{ render_nav_item('main.explore', '探索') }}
  32. <form class="form-inline my-2 my-lg-0" action="{{ url_for('main.search') }}">
  33. <input type="text" name="q" class="form-control mr-sm-1" placeholder="照片, 标签 或 用户"
  34. required>
  35. <button class="btn btn-light my-2 my-sm-0" type="submit">
  36. <span class="oi oi-magnifying-glass"></span>
  37. </button>
  38. </form>
  39. </div>
  40. <div class="navbar-nav ml-auto">
  41. {% if current_user.is_authenticated %}
  42. <a class="nav-item nav-link" href="{{ url_for('main.show_notifications', filter='unread') }}">
  43. <span class="oi oi-bell"></span>
  44. <span id="notification-badge"
  45. class="{% if notification_count == 0 %}hide{% endif %} badge badge-danger badge-notification"
  46. data-href="{{ url_for('ajax.notifications_count') }}">{{ notification_count }}</span>
  47. </a>
  48. <a class="nav-item nav-link" href="{{ url_for('main.upload') }}" title="上传">
  49. <span class="oi oi-cloud-upload"></span>&nbsp;&nbsp;
  50. </a>
  51. <div class="dropdown nav-item">
  52. <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button"
  53. aria-expanded="false">
  54. <img class="avatar-xs"
  55. src="{{ url_for('main.get_avatar', filename=current_user.avatar_s) }}">
  56. <span class="caret"></span>
  57. </a>
  58. <div class="dropdown-menu dropdown-menu-right" role="menu">
  59. <h6 class="dropdown-header">登陆 {{ current_user.username }}</h6>
  60. <a class="dropdown-item" href="{{ url_for('user.index', username=current_user.username) }}">
  61. <span class="oi oi-person"></span> 我的主页
  62. </a>
  63. <div class="dropdown-divider"></div>
  64. <a class="dropdown-item" href="{{ url_for('user.edit_profile') }}">
  65. <span class="oi oi-cog"></span> 设置
  66. </a>
  67. {% if current_user.can('MODERATE') %}
  68. <a class="dropdown-item" href="{{ url_for('admin.index') }}">
  69. <span class="oi oi-dashboard"></span> 控制板
  70. </a>
  71. {% endif %}
  72. <a class="dropdown-item" href="{{ url_for('auth.logout') }}">
  73. <span class="oi oi-power-standby"></span> 注销
  74. </a>
  75. </div>
  76. </div>
  77. {% else %}
  78. <a class="btn btn-outline-primary" href="{{ url_for('auth.login') }}">登陆</a>&nbsp;&nbsp;
  79. <a class="btn btn-primary" href="{{ url_for('auth.register') }}">加入 Touch</a>
  80. {% endif %}
  81. </div>
  82. </div>
  83. </div>
  84. </nav>
  85. {% endblock %}
  86. <main>
  87. <div class="container">
  88. {% for message in get_flashed_messages(with_categories=True) %}
  89. <div class="alert alert-{{ message[0] }}">
  90. <button type="button" class="close" data-dismiss="alert">&times;</button>
  91. {{ message[1] }}
  92. </div>
  93. {% endfor %}
  94. {% block content %}{% endblock %}
  95. {% block footer %}
  96. <footer>
  97. <p class="float-left">
  98. <small>&copy; 2018
  99. <a href="http://greyli.com" title="Written by Grey Li">Grey Li</a> -
  100. <a href="https://github.com/greyli/albumy" title="Fork me on GitHub">GitHub</a> -
  101. <a href="http://helloflask.com" title="A HelloFlask project">HelloFlask</a>
  102. </small>
  103. </p>
  104. <p class="float-right">
  105. <small>Capture and share every wonderful moment.</small>
  106. </p>
  107. </footer>
  108. {% endblock %}
  109. </div>
  110. </main>
  111. <div id="toast"></div>
  112. {% block scripts %}
  113. <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
  114. <script src="{{ url_for('static', filename='js/popper.min.js') }}"></script>
  115. <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
  116. {{ moment.include_moment(local_js=url_for('static', filename='js/moment-with-locales.min.js')) }}
  117. <script src="{{ url_for('static', filename='js/script.js') }}"></script>
  118. <script type="text/javascript">
  119. var csrf_token = "{{ csrf_token() }}";
  120. {% if current_user.is_authenticated %}
  121. var is_authenticated = true;
  122. {% else %}
  123. var is_authenticated = false;
  124. {% endif %}
  125. </script>
  126. {% endblock %}
  127. </body>
  128. </html>