layout.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. {{ define "base" }}
  2. <!DOCTYPE html>
  3. <html lang="{{ replace .language "_" "-"}}">
  4. <head>
  5. <meta charset="utf-8">
  6. <title>{{template "title" .}} - Miniflux</title>
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <meta name="mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-title" content="Miniflux">
  11. <link rel="manifest" href="{{ route "webManifest" }}" crossorigin="use-credentials">
  12. <meta name="robots" content="noindex,nofollow">
  13. <meta name="referrer" content="no-referrer">
  14. <meta name="google" content="notranslate">
  15. <!-- Favicons -->
  16. <link rel="icon" type="image/png" sizes="16x16" href="{{ route "appIcon" "filename" "favicon-16.png" }}">
  17. <link rel="icon" type="image/png" sizes="32x32" href="{{ route "appIcon" "filename" "favicon-32.png" }}">
  18. <!-- Android icons -->
  19. <link rel="icon" type="image/png" sizes="128x128" href="{{ route "appIcon" "filename" "icon-128.png" }}">
  20. <link rel="icon" type="image/png" sizes="192x192" href="{{ route "appIcon" "filename" "icon-192.png" }}">
  21. <!-- iOS icons -->
  22. <link rel="apple-touch-icon" sizes="120x120" href="{{ route "appIcon" "filename" "icon-120.png" }}">
  23. <link rel="apple-touch-icon" sizes="152x152" href="{{ route "appIcon" "filename" "icon-152.png" }}">
  24. <link rel="apple-touch-icon" sizes="167x167" href="{{ route "appIcon" "filename" "icon-167.png" }}">
  25. <link rel="apple-touch-icon" sizes="180x180" href="{{ route "appIcon" "filename" "icon-180.png" }}">
  26. <meta name="theme-color" content="{{ theme_color .theme "light" }}" media="(prefers-color-scheme: light)">
  27. <meta name="theme-color" content="{{ theme_color .theme "dark" }}" media="(prefers-color-scheme: dark)">
  28. <link rel="stylesheet" type="text/css" href="{{ route "stylesheet" "name" .theme "checksum" .theme_checksum }}">
  29. {{ if and .user .user.Stylesheet }}
  30. {{ $stylesheetNonce := nonce }}
  31. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * data:; media-src *; frame-src *; style-src 'self' 'nonce-{{ $stylesheetNonce }}'">
  32. <style nonce="{{ $stylesheetNonce }}">{{ .user.Stylesheet | safeCSS }}</style>
  33. {{ else }}
  34. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * data:; media-src *; frame-src *">
  35. {{ end }}
  36. <script src="{{ route "javascript" "name" "app" "checksum" .app_js_checksum }}" defer></script>
  37. <script src="{{ route "javascript" "name" "service-worker" "checksum" .sw_js_checksum }}" defer id="service-worker-script"></script>
  38. </head>
  39. <body
  40. {{ if .csrf }}data-csrf-token="{{ .csrf }}"{{ end }}
  41. data-add-subscription-url="{{ route "addSubscription" }}"
  42. data-entries-status-url="{{ route "updateEntriesStatus" }}"
  43. data-refresh-all-feeds-url="{{ route "refreshAllFeeds" }}"
  44. {{ if .webAuthnEnabled }}
  45. data-webauthn-register-begin-url="{{ route "webauthnRegisterBegin" }}"
  46. data-webauthn-register-finish-url="{{ route "webauthnRegisterFinish" }}"
  47. data-webauthn-login-begin-url="{{ route "webauthnLoginBegin" }}"
  48. data-webauthn-login-finish-url="{{ route "webauthnLoginFinish" }}"
  49. data-webauthn-delete-all-url="{{ route "webauthnDeleteAll" }}"
  50. {{ end }}
  51. {{ if .user }}{{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}{{ end }}>
  52. {{ if .user }}
  53. <a class="skip-to-content-link" href="#main">
  54. Skip to content
  55. </a>
  56. <div class="header">
  57. <nav>
  58. <div class="logo">
  59. <a aria-label="{{ t "menu.home_page" }}" href="{{ route .user.DefaultHomePage }}">
  60. Mini<span>flux</span>
  61. </a>
  62. <button aria-controls="header-menu" aria-expanded="false" aria-label="{{ t "menu.title" }}">
  63. <svg aria-label="{{ t "menu.title" }}" xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
  64. <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"/>
  65. </svg>
  66. </button>
  67. </div>
  68. <ul id="header-menu">
  69. <li {{ if eq .menu "unread" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g u" }}">
  70. <a href="{{ route "unread" }}" data-page="unread">{{ t "menu.unread" }}
  71. {{ if gt .countUnread 0 }}
  72. <span class="unread-counter-wrapper">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  73. {{ end }}
  74. </a>
  75. </li>
  76. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  77. <a href="{{ route "starred" }}" data-page="starred">{{ t "menu.starred" }}</a>
  78. </li>
  79. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  80. <a href="{{ route "history" }}" data-page="history">{{ t "menu.history" }}</a>
  81. </li>
  82. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  83. <a href="{{ route "feeds" }}" data-page="feeds">{{ t "menu.feeds" }}
  84. {{ if gt .countErrorFeeds 0 }}
  85. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  86. {{ end }}
  87. </a>
  88. <a href="{{ route "addSubscription" }}" title="{{ t "tooltip.keyboard_shortcuts" "+" }}">
  89. (+)
  90. </a>
  91. </li>
  92. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  93. <a href="{{ route "categories" }}" data-page="categories">{{ t "menu.categories" }}</a>
  94. </li>
  95. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  96. <a href="{{ route "settings" }}" data-page="settings">{{ t "menu.settings" }}</a>
  97. </li>
  98. {{ if not hasAuthProxy }}
  99. <li>
  100. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
  101. </li>
  102. {{ end }}
  103. </ul>
  104. </nav>
  105. <search role="search" class="search">
  106. <details {{ if $.searchQuery }}open{{ end }}>
  107. <summary>
  108. <span>{{ t "search.label" }}</span>
  109. </summary>
  110. <form action="{{ route "searchEntries" }}" aria-labelledby="search-input-label">
  111. <input type="search" name="q" aria-label="{{ t "search.label" }}" {{ if $.searchQuery }}value="{{ .searchQuery }}"{{ end }} required>
  112. <button type="submit">{{ t "search.submit" }}</button>
  113. </form>
  114. </details>
  115. </search>
  116. </div>
  117. {{ end }}
  118. {{ if .flashMessage }}
  119. <div class="flash-message alert alert-success">{{ .flashMessage }}</div>
  120. {{ end }}
  121. {{ if .flashErrorMessage }}
  122. <div class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  123. {{ end }}
  124. {{template "header" .}}
  125. <main id="main">
  126. {{template "content" .}}
  127. </main>
  128. <template id="keyboard-shortcuts">
  129. <div id="modal-left">
  130. <button class="btn-close-modal" aria-label="Close">x</button>
  131. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  132. <div class="keyboard-shortcuts">
  133. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  134. <ul>
  135. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  136. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  137. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  138. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  139. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  140. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  141. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  142. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  143. </ul>
  144. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  145. <ul>
  146. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  147. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  148. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  149. </ul>
  150. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  151. <ul>
  152. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  153. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  154. </ul>
  155. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  156. <ul>
  157. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong></li>
  158. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  159. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  160. <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li>
  161. <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li>
  162. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_next" }} = <strong>m</strong></li>
  163. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_prev" }} = <strong>M</strong></li>
  164. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  165. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  166. <li>{{ t "page.keyboard_shortcuts.toggle_bookmark_status" }} = <strong>f</strong></li>
  167. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  168. <li>{{ t "page.keyboard_shortcuts.toggle_entry_attachments" }} = <strong>a</strong></li>
  169. <li>{{ t "page.keyboard_shortcuts.scroll_item_to_top" }} = <strong>z + t</strong></li>
  170. <li>{{ t "page.keyboard_shortcuts.refresh_all_feeds" }} = <strong>R</strong></li>
  171. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  172. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  173. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  174. </ul>
  175. </div>
  176. </div>
  177. </template>
  178. <template id="icon-read">{{ icon "read" }}</template>
  179. <template id="icon-unread">{{ icon "unread" }}</template>
  180. <template id="icon-star">{{ icon "star" }}</template>
  181. <template id="icon-unstar">{{ icon "unstar" }}</template>
  182. <template id="icon-save">{{ icon "save" }}</template>
  183. <div id="toast-wrapper" role="alert" aria-live="assertive" aria-atomic="true">
  184. <span id="toast-msg"></span>
  185. </div>
  186. </body>
  187. </html>
  188. {{ end }}