layout.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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">{{ t "skip_to_content" }}</a>
  54. <header class="header">
  55. <nav>
  56. <div class="logo" data-toggle-button-label="{{ t "menu.title" }}">
  57. <a aria-label="{{ t "menu.home_page" }}" href="{{ route .user.DefaultHomePage }}">
  58. Mini<span>flux</span>
  59. </a>
  60. <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
  61. <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"/>
  62. </svg>
  63. </div>
  64. <ul id="header-menu">
  65. <li {{ if eq .menu "unread" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g u" }}">
  66. <a href="{{ route "unread" }}"
  67. data-page="unread"
  68. {{ if gt .countUnread 0 }}
  69. aria-label="{{ t "menu.unread" }}, {{ plural "page.unread_entry_count" .countUnread .countUnread }}"
  70. {{ end }}
  71. >
  72. {{ t "menu.unread" }}
  73. {{ if gt .countUnread 0 }}
  74. <span class="unread-counter-wrapper" aria-hidden="true">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  75. {{ end }}
  76. </a>
  77. </li>
  78. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  79. <a href="{{ route "starred" }}" data-page="starred">{{ t "menu.starred" }}</a>
  80. </li>
  81. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  82. <a href="{{ route "history" }}" data-page="history">{{ t "menu.history" }}</a>
  83. </li>
  84. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  85. <a href="{{ route "feeds" }}" data-page="feeds">{{ t "menu.feeds" }}
  86. {{ if gt .countErrorFeeds 0 }}
  87. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  88. {{ end }}
  89. </a>
  90. <a href="{{ route "addSubscription" }}" title="{{ t "tooltip.keyboard_shortcuts" "+" }}" aria-label="{{ t "menu.add_feed" }}">
  91. (+)
  92. </a>
  93. </li>
  94. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  95. <a href="{{ route "categories" }}" data-page="categories">{{ t "menu.categories" }}</a>
  96. </li>
  97. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  98. <a href="{{ route "settings" }}" data-page="settings">{{ t "menu.settings" }}</a>
  99. </li>
  100. {{ if not hasAuthProxy }}
  101. <li>
  102. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
  103. </li>
  104. {{ end }}
  105. </ul>
  106. </nav>
  107. <search role="search" class="search">
  108. <details {{ if $.searchQuery }}open{{ end }}>
  109. <summary>
  110. <span>{{ t "search.label" }}</span>
  111. <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
  112. <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"/>
  113. </svg>
  114. </summary>
  115. <form action="{{ route "searchEntries" }}" aria-labelledby="search-input-label">
  116. <input type="search" name="q" id="search-input" aria-label="{{ t "search.label" }}" placeholder="{{ t "search.placeholder" }}" {{ if $.searchQuery }}value="{{ .searchQuery }}"{{ end }} required>
  117. <button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.loading" }}">{{ t "search.submit" }}</button>
  118. </form>
  119. </details>
  120. </search>
  121. </header>
  122. {{ end }}
  123. {{ if .flashMessage }}
  124. <div role="alert" class="flash-message alert alert-success">{{ .flashMessage }}</div>
  125. {{ end }}
  126. {{ if .flashErrorMessage }}
  127. <div role="alert" class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  128. {{ end }}
  129. {{template "page_header" .}}
  130. <main id="main">
  131. {{template "content" .}}
  132. </main>
  133. <template id="keyboard-shortcuts">
  134. <div id="modal-left">
  135. <button class="btn-close-modal" aria-label="Close">x</button>
  136. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  137. <div class="keyboard-shortcuts">
  138. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  139. <ul>
  140. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  141. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  142. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  143. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  144. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  145. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  146. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  147. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  148. </ul>
  149. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  150. <ul>
  151. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  152. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  153. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  154. </ul>
  155. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  156. <ul>
  157. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  158. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  159. </ul>
  160. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  161. <ul>
  162. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong></li>
  163. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  164. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  165. <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li>
  166. <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li>
  167. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_next" }} = <strong>m</strong></li>
  168. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_prev" }} = <strong>M</strong></li>
  169. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  170. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  171. <li>{{ t "page.keyboard_shortcuts.toggle_bookmark_status" }} = <strong>f</strong></li>
  172. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  173. <li>{{ t "page.keyboard_shortcuts.toggle_entry_attachments" }} = <strong>a</strong></li>
  174. <li>{{ t "page.keyboard_shortcuts.scroll_item_to_top" }} = <strong>z + t</strong></li>
  175. <li>{{ t "page.keyboard_shortcuts.refresh_all_feeds" }} = <strong>R</strong></li>
  176. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  177. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  178. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  179. </ul>
  180. </div>
  181. </div>
  182. </template>
  183. <template id="icon-read">{{ icon "read" }}</template>
  184. <template id="icon-unread">{{ icon "unread" }}</template>
  185. <template id="icon-star">{{ icon "star" }}</template>
  186. <template id="icon-unstar">{{ icon "unstar" }}</template>
  187. <template id="icon-save">{{ icon "save" }}</template>
  188. <div id="toast-wrapper" role="alert" aria-live="assertive" aria-atomic="true">
  189. <span id="toast-msg"></span>
  190. </div>
  191. </body>
  192. </html>
  193. {{ end }}