layout.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. {{ $cspNonce := nonce }}
  25. {{ csp .user $cspNonce | safeHTML }}
  26. <link rel="stylesheet" nonce="{{ $cspNonce }}" type="text/css" href="{{ route "stylesheet" "name" .theme "checksum" .theme_checksum }}">
  27. <script nonce="{{ $cspNonce }}" src="{{ route "javascript" "name" "app" "checksum" .app_js_checksum }}" type="module"></script>
  28. {{ if .user -}}
  29. {{ if .user.Stylesheet -}}
  30. <style nonce="{{ $cspNonce }}">{{ .user.Stylesheet | safeCSS }}</style>
  31. {{ end -}}
  32. {{ if .user.CustomJS -}}
  33. <script type="module" nonce="{{ $cspNonce }}">{{ .user.CustomJS | safeJS }}</script>
  34. {{ end -}}
  35. {{ end -}}
  36. </head>
  37. <body
  38. data-service-worker-url="{{ route "javascript" "name" "service-worker" "checksum" .sw_js_checksum }}"
  39. {{ if .csrf }}data-csrf-token="{{ .csrf }}"{{ end }}
  40. data-add-subscription-url="{{ route "addSubscription" }}"
  41. data-entries-status-url="{{ route "updateEntriesStatus" }}"
  42. data-refresh-all-feeds-url="{{ route "refreshAllFeeds" }}"
  43. {{ if .webAuthnEnabled }}
  44. data-webauthn-register-begin-url="{{ route "webauthnRegisterBegin" }}"
  45. data-webauthn-register-finish-url="{{ route "webauthnRegisterFinish" }}"
  46. data-webauthn-login-begin-url="{{ route "webauthnLoginBegin" }}"
  47. data-webauthn-login-finish-url="{{ route "webauthnLoginFinish" }}"
  48. data-webauthn-delete-all-url="{{ route "webauthnDeleteAll" }}"
  49. {{ end }}
  50. {{ if .user }}
  51. {{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}
  52. data-mark-as-read-on-view="{{ if .user.MarkReadOnView }}true{{ else }}false{{ end }}"
  53. {{ end }}>
  54. {{ if .user }}
  55. <a class="skip-to-content-link" href="#main">{{ t "skip_to_content" }}</a>
  56. <header class="header">
  57. <nav>
  58. <div class="logo" data-toggle-button-label="{{ t "menu.title" }}">
  59. <a aria-label="{{ t "menu.home_page" }}" href="{{ route .user.DefaultHomePage }}">
  60. Mini<span>flux</span>
  61. </a>
  62. {{ icon "chevron-down"}}
  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. {{ icon "entries" }}{{ 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">{{ icon "star" }}{{ 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">{{ icon "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">{{ icon "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">{{ icon "categories" }}{{ t "menu.categories" }}</a>
  96. </li>
  97. <li {{ if eq .menu "search" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "/" }}">
  98. <a href="{{ route "search" }}" data-page="search">{{ icon "search" }}{{ t "menu.search" }}</a>
  99. </li>
  100. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  101. <a href="{{ route "settings" }}" data-page="settings">{{ icon "settings" }}{{ t "menu.settings" }}</a>
  102. </li>
  103. {{ if not hasAuthProxy }}
  104. <li>
  105. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ icon "logout" }}{{ t "menu.logout" }}</a>
  106. </li>
  107. {{ end }}
  108. </ul>
  109. </nav>
  110. </header>
  111. {{ end }}
  112. {{ if .flashMessage }}
  113. <div role="alert" class="flash-message alert alert-success">{{ .flashMessage }}</div>
  114. {{ end }}
  115. {{ if .flashErrorMessage }}
  116. <div role="alert" class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  117. {{ end }}
  118. {{template "page_header" .}}
  119. <main id="main">
  120. {{template "content" .}}
  121. </main>
  122. <template id="keyboard-shortcuts">
  123. <div id="modal-left">
  124. <button class="btn-close-modal" aria-label="Close">x</button>
  125. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  126. <div class="keyboard-shortcuts">
  127. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  128. <ul>
  129. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  130. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  131. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  132. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  133. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  134. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  135. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  136. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  137. </ul>
  138. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  139. <ul>
  140. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  141. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  142. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  143. <li>{{ t "page.keyboard_shortcuts.go_to_top_item" }} = <strong>g + g</strong></li>
  144. <li>{{ t "page.keyboard_shortcuts.go_to_bottom_item" }} = <strong>G</strong></li>
  145. </ul>
  146. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  147. <ul>
  148. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  149. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  150. </ul>
  151. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  152. <ul>
  153. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong>, <strong>Enter</strong></li>
  154. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  155. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  156. <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li>
  157. <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li>
  158. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_next" }} = <strong>m</strong></li>
  159. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_prev" }} = <strong>M</strong></li>
  160. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  161. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  162. <li>{{ t "page.keyboard_shortcuts.toggle_star_status" }} = <strong>f</strong></li>
  163. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  164. <li>{{ t "page.keyboard_shortcuts.toggle_entry_attachments" }} = <strong>a</strong></li>
  165. <li>{{ t "page.keyboard_shortcuts.scroll_item_to_top" }} = <strong>z + t</strong></li>
  166. <li>{{ t "page.keyboard_shortcuts.refresh_all_feeds" }} = <strong>R</strong></li>
  167. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  168. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  169. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  170. </ul>
  171. </div>
  172. </div>
  173. </template>
  174. <template id="icon-read">{{ icon "read" }}</template>
  175. <template id="icon-unread">{{ icon "unread" }}</template>
  176. <template id="icon-star">{{ icon "star" }}</template>
  177. <template id="icon-unstar">{{ icon "unstar" }}</template>
  178. <template id="icon-save">{{ icon "save" }}</template>
  179. </body>
  180. </html>
  181. {{ end }}