layout.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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="apple-mobile-web-app-title" content="Miniflux">
  8. <meta name="googlebot" content="notranslate">
  9. <meta name="mobile-web-app-capable" content="yes">
  10. <meta name="referrer" content="no-referrer">
  11. <meta name="robots" content="noindex,nofollow">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
  13. <meta name="theme-color" content="{{ theme_color .theme "light" }}" media="(prefers-color-scheme: light)">
  14. <meta name="theme-color" content="{{ theme_color .theme "dark" }}" media="(prefers-color-scheme: dark)">
  15. <link rel="manifest" href="{{ route "webManifest" }}" crossorigin="use-credentials">
  16. <link rel="icon" type="image/png" sizes="16x16" href="{{ route "appIcon" "filename" "icon-16.png" }}">
  17. <link rel="icon" type="image/png" sizes="32x32" href="{{ route "appIcon" "filename" "icon-32.png" }}">
  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. <link rel="apple-touch-icon" sizes="120x120" href="{{ route "appIcon" "filename" "icon-120.png" }}">
  21. <link rel="apple-touch-icon" sizes="152x152" href="{{ route "appIcon" "filename" "icon-152.png" }}">
  22. <link rel="apple-touch-icon" sizes="167x167" href="{{ route "appIcon" "filename" "icon-167.png" }}">
  23. <link rel="apple-touch-icon" sizes="180x180" href="{{ route "appIcon" "filename" "icon-180.png" }}">
  24. <link rel="stylesheet" type="text/css" href="{{ route "stylesheet" "name" .theme "checksum" .theme_checksum }}">
  25. {{ if .user }}
  26. {{ $cspNonce := nonce }}
  27. <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 html url;">
  28. {{ if .user.Stylesheet -}}
  29. <style nonce="{{ $cspNonce }}">{{ .user.Stylesheet | safeCSS }}</style>
  30. {{ end -}}
  31. {{ if .user.CustomJS -}}
  32. <script type="module" nonce="{{ $cspNonce }}">{{ .user.CustomJS | safeJS }}</script>
  33. {{ end -}}
  34. {{ else -}}
  35. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * data:; media-src *; frame-src *; require-trusted-types-for 'script'; trusted-types html url;">
  36. {{ end -}}
  37. <script src="{{ route "javascript" "name" "app" "checksum" .app_js_checksum }}" type="module"></script>
  38. </head>
  39. <body
  40. data-service-worker-url="{{ route "javascript" "name" "service-worker" "checksum" .sw_js_checksum }}"
  41. {{ if .csrf }}data-csrf-token="{{ .csrf }}"{{ end }}
  42. data-add-subscription-url="{{ route "addSubscription" }}"
  43. data-entries-status-url="{{ route "updateEntriesStatus" }}"
  44. data-refresh-all-feeds-url="{{ route "refreshAllFeeds" }}"
  45. {{ if .webAuthnEnabled }}
  46. data-webauthn-register-begin-url="{{ route "webauthnRegisterBegin" }}"
  47. data-webauthn-register-finish-url="{{ route "webauthnRegisterFinish" }}"
  48. data-webauthn-login-begin-url="{{ route "webauthnLoginBegin" }}"
  49. data-webauthn-login-finish-url="{{ route "webauthnLoginFinish" }}"
  50. data-webauthn-delete-all-url="{{ route "webauthnDeleteAll" }}"
  51. {{ end }}
  52. {{ if .user }}
  53. {{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}
  54. data-mark-as-read-on-view="{{ if .user.MarkReadOnView }}true{{ else }}false{{ end }}"
  55. {{ 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. {{ icon "chevron-down"}}
  65. </div>
  66. <ul id="header-menu">
  67. <li {{ if eq .menu "unread" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g u" }}">
  68. <a href="{{ route "unread" }}"
  69. data-page="unread"
  70. {{ if gt .countUnread 0 }}
  71. aria-label="{{ t "menu.unread" }}, {{ plural "page.unread_entry_count" .countUnread .countUnread }}"
  72. {{ end }}
  73. >
  74. {{ icon "entries" }}{{ t "menu.unread" }}
  75. {{ if gt .countUnread 0 }}
  76. <span class="unread-counter-wrapper" aria-hidden="true">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  77. {{ end }}
  78. </a>
  79. </li>
  80. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  81. <a href="{{ route "starred" }}" data-page="starred">{{ icon "star" }}{{ t "menu.starred" }}</a>
  82. </li>
  83. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  84. <a href="{{ route "history" }}" data-page="history">{{ icon "history" }}{{ t "menu.history" }}</a>
  85. </li>
  86. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  87. <a href="{{ route "feeds" }}" data-page="feeds">{{ icon "feeds" }}{{ t "menu.feeds" }}
  88. {{ if gt .countErrorFeeds 0 }}
  89. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  90. {{ end }}
  91. </a>
  92. <a href="{{ route "addSubscription" }}" title="{{ t "tooltip.keyboard_shortcuts" "+" }}" aria-label="{{ t "menu.add_feed" }}">
  93. (+)
  94. </a>
  95. </li>
  96. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  97. <a href="{{ route "categories" }}" data-page="categories">{{ icon "categories" }}{{ t "menu.categories" }}</a>
  98. </li>
  99. <li {{ if eq .menu "search" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "/" }}">
  100. <a href="{{ route "search" }}" data-page="search">{{ icon "search" }}{{ t "menu.search" }}</a>
  101. </li>
  102. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  103. <a href="{{ route "settings" }}" data-page="settings">{{ icon "settings" }}{{ t "menu.settings" }}</a>
  104. </li>
  105. {{ if not hasAuthProxy }}
  106. <li>
  107. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ icon "logout" }}{{ t "menu.logout" }}</a>
  108. </li>
  109. {{ end }}
  110. </ul>
  111. </nav>
  112. </header>
  113. {{ end }}
  114. {{ if .flashMessage }}
  115. <div role="alert" class="flash-message alert alert-success">{{ .flashMessage }}</div>
  116. {{ end }}
  117. {{ if .flashErrorMessage }}
  118. <div role="alert" class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  119. {{ end }}
  120. {{template "page_header" .}}
  121. <main id="main">
  122. {{template "content" .}}
  123. </main>
  124. <template id="keyboard-shortcuts">
  125. <div id="modal-left">
  126. <button class="btn-close-modal" aria-label="Close">x</button>
  127. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  128. <div class="keyboard-shortcuts">
  129. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  130. <ul>
  131. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  132. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  133. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  134. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  135. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  136. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  137. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  138. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  139. </ul>
  140. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  141. <ul>
  142. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  143. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  144. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  145. <li>{{ t "page.keyboard_shortcuts.go_to_top_item" }} = <strong>g + g</strong></li>
  146. <li>{{ t "page.keyboard_shortcuts.go_to_bottom_item" }} = <strong>G</strong></li>
  147. </ul>
  148. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  149. <ul>
  150. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  151. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  152. </ul>
  153. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  154. <ul>
  155. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong>, <strong>Enter</strong></li>
  156. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  157. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  158. <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li>
  159. <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li>
  160. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_next" }} = <strong>m</strong></li>
  161. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_prev" }} = <strong>M</strong></li>
  162. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  163. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  164. <li>{{ t "page.keyboard_shortcuts.toggle_star_status" }} = <strong>f</strong></li>
  165. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  166. <li>{{ t "page.keyboard_shortcuts.toggle_entry_attachments" }} = <strong>a</strong></li>
  167. <li>{{ t "page.keyboard_shortcuts.scroll_item_to_top" }} = <strong>z + t</strong></li>
  168. <li>{{ t "page.keyboard_shortcuts.refresh_all_feeds" }} = <strong>R</strong></li>
  169. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  170. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  171. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  172. </ul>
  173. </div>
  174. </div>
  175. </template>
  176. <template id="icon-read">{{ icon "read" }}</template>
  177. <template id="icon-unread">{{ icon "unread" }}</template>
  178. <template id="icon-star">{{ icon "star" }}</template>
  179. <template id="icon-unstar">{{ icon "unstar" }}</template>
  180. <template id="icon-save">{{ icon "save" }}</template>
  181. </body>
  182. </html>
  183. {{ end }}