layout.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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 name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
  8. <meta name="mobile-web-app-capable" content="yes">
  9. <meta name="apple-mobile-web-app-title" content="Miniflux">
  10. <link rel="manifest" href="{{ route "webManifest" }}" crossorigin="use-credentials">
  11. <meta name="robots" content="noindex,nofollow">
  12. <meta name="referrer" content="no-referrer">
  13. <meta name="google" content="notranslate">
  14. <!-- Favicons -->
  15. <link rel="icon" type="image/png" sizes="16x16" href="{{ route "appIcon" "filename" "favicon-16.png" }}">
  16. <link rel="icon" type="image/png" sizes="32x32" href="{{ route "appIcon" "filename" "favicon-32.png" }}">
  17. <!-- Android icons -->
  18. <link rel="icon" type="image/png" sizes="128x128" href="{{ route "appIcon" "filename" "icon-128.png" }}">
  19. <link rel="icon" type="image/png" sizes="192x192" href="{{ route "appIcon" "filename" "icon-192.png" }}">
  20. <!-- iOS icons -->
  21. <link rel="apple-touch-icon" sizes="120x120" href="{{ route "appIcon" "filename" "icon-120.png" }}">
  22. <link rel="apple-touch-icon" sizes="152x152" href="{{ route "appIcon" "filename" "icon-152.png" }}">
  23. <link rel="apple-touch-icon" sizes="167x167" href="{{ route "appIcon" "filename" "icon-167.png" }}">
  24. <link rel="apple-touch-icon" sizes="180x180" href="{{ route "appIcon" "filename" "icon-180.png" }}">
  25. <meta name="theme-color" content="{{ theme_color .theme "light" }}" media="(prefers-color-scheme: light)">
  26. <meta name="theme-color" content="{{ theme_color .theme "dark" }}" media="(prefers-color-scheme: dark)">
  27. <link rel="stylesheet" type="text/css" href="{{ route "stylesheet" "name" .theme "checksum" .theme_checksum }}">
  28. {{ if .user }}
  29. {{ $cspNonce := nonce }}
  30. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * data:; media-src *; frame-src *; {{ if .user.ExternalFontHosts }}font-src {{ .user.ExternalFontHosts }}; {{ end }}style-src 'self'{{ if .user.Stylesheet }}{{ if .user.ExternalFontHosts }} {{ .user.ExternalFontHosts }}{{ end }} 'nonce-{{ $cspNonce }}'{{ end }}{{ if .user.CustomJS }}; script-src 'self' 'nonce-{{ $cspNonce }}'{{ end }}; require-trusted-types-for 'script'; trusted-types ttpolicy;">
  31. {{ if .user.Stylesheet }}
  32. <style nonce="{{ $cspNonce }}">{{ .user.Stylesheet | safeCSS }}</style>
  33. {{ end }}
  34. {{ if .user.CustomJS }}
  35. <script type="module" nonce="{{ $cspNonce }}">{{ .user.CustomJS | safeJS }}</script>
  36. {{ end }}
  37. {{ else }}
  38. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * data:; media-src *; frame-src *; require-trusted-types-for 'script'; trusted-types ttpolicy;">
  39. {{ end }}
  40. <script src="{{ route "javascript" "name" "app" "checksum" .app_js_checksum }}" defer></script>
  41. <script src="{{ route "javascript" "name" "service-worker" "checksum" .sw_js_checksum }}" defer id="service-worker-script"></script>
  42. </head>
  43. <body
  44. {{ if .csrf }}data-csrf-token="{{ .csrf }}"{{ end }}
  45. data-add-subscription-url="{{ route "addSubscription" }}"
  46. data-entries-status-url="{{ route "updateEntriesStatus" }}"
  47. data-refresh-all-feeds-url="{{ route "refreshAllFeeds" }}"
  48. {{ if .webAuthnEnabled }}
  49. data-webauthn-register-begin-url="{{ route "webauthnRegisterBegin" }}"
  50. data-webauthn-register-finish-url="{{ route "webauthnRegisterFinish" }}"
  51. data-webauthn-login-begin-url="{{ route "webauthnLoginBegin" }}"
  52. data-webauthn-login-finish-url="{{ route "webauthnLoginFinish" }}"
  53. data-webauthn-delete-all-url="{{ route "webauthnDeleteAll" }}"
  54. {{ end }}
  55. {{ if .user }}{{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}{{ end }}>
  56. {{ if .user }}
  57. <a class="skip-to-content-link" href="#main">{{ t "skip_to_content" }}</a>
  58. <header class="header">
  59. <nav>
  60. <div class="logo" data-toggle-button-label="{{ t "menu.title" }}">
  61. <a aria-label="{{ t "menu.home_page" }}" href="{{ route .user.DefaultHomePage }}">
  62. Mini<span>flux</span>
  63. </a>
  64. <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">
  65. <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"/>
  66. </svg>
  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" }}"
  71. data-page="unread"
  72. {{ if gt .countUnread 0 }}
  73. aria-label="{{ t "menu.unread" }}, {{ plural "page.unread_entry_count" .countUnread .countUnread }}"
  74. {{ end }}
  75. >
  76. {{ t "menu.unread" }}
  77. {{ if gt .countUnread 0 }}
  78. <span class="unread-counter-wrapper" aria-hidden="true">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  79. {{ end }}
  80. </a>
  81. </li>
  82. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  83. <a href="{{ route "starred" }}" data-page="starred">{{ t "menu.starred" }}</a>
  84. </li>
  85. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  86. <a href="{{ route "history" }}" data-page="history">{{ t "menu.history" }}</a>
  87. </li>
  88. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  89. <a href="{{ route "feeds" }}" data-page="feeds">{{ t "menu.feeds" }}
  90. {{ if gt .countErrorFeeds 0 }}
  91. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  92. {{ end }}
  93. </a>
  94. <a href="{{ route "addSubscription" }}" title="{{ t "tooltip.keyboard_shortcuts" "+" }}" aria-label="{{ t "menu.add_feed" }}">
  95. (+)
  96. </a>
  97. </li>
  98. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  99. <a href="{{ route "categories" }}" data-page="categories">{{ t "menu.categories" }}</a>
  100. </li>
  101. <li {{ if eq .menu "search" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "/" }}">
  102. <a href="{{ route "search" }}" data-page="search">{{ t "menu.search" }}</a>
  103. </li>
  104. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  105. <a href="{{ route "settings" }}" data-page="settings">{{ t "menu.settings" }}</a>
  106. </li>
  107. {{ if not hasAuthProxy }}
  108. <li>
  109. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
  110. </li>
  111. {{ end }}
  112. </ul>
  113. </nav>
  114. </header>
  115. {{ end }}
  116. {{ if .flashMessage }}
  117. <div role="alert" class="flash-message alert alert-success">{{ .flashMessage }}</div>
  118. {{ end }}
  119. {{ if .flashErrorMessage }}
  120. <div role="alert" class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  121. {{ end }}
  122. {{template "page_header" .}}
  123. <main id="main">
  124. {{template "content" .}}
  125. </main>
  126. <template id="keyboard-shortcuts">
  127. <div id="modal-left">
  128. <button class="btn-close-modal" aria-label="Close">x</button>
  129. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  130. <div class="keyboard-shortcuts">
  131. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  132. <ul>
  133. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  134. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  135. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  136. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  137. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  138. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  139. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  140. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  141. </ul>
  142. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  143. <ul>
  144. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  145. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  146. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  147. <li>{{ t "page.keyboard_shortcuts.go_to_top_item" }} = <strong>g + g</strong></li>
  148. <li>{{ t "page.keyboard_shortcuts.go_to_bottom_item" }} = <strong>G</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>, <strong>Enter</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 }}