layout.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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="{{ routePath "/manifest.json" }}" crossorigin="use-credentials">
  16. <link rel="apple-touch-icon" href="{{ iconPath "icon-180.png" }}">
  17. <link rel="icon" href="{{ iconPath "icon.svg" }}">
  18. {{ $cspNonce := nonce }}
  19. {{ csp .user $cspNonce | safeHTML }}
  20. <link rel="stylesheet" nonce="{{ $cspNonce }}" type="text/css" href="{{ routePath "/stylesheets/%s/%s.css" .theme_checksum .theme }}">
  21. <script nonce="{{ $cspNonce }}" src="{{ routePath "/js/%s/%s.js" .app_js_checksum "app" }}" type="module"></script>
  22. {{ if .user -}}
  23. {{ if .user.Stylesheet -}}
  24. <style nonce="{{ $cspNonce }}">{{ .user.Stylesheet | safeCSS }}</style>
  25. {{ end -}}
  26. {{ if .user.CustomJS -}}
  27. <script type="module" nonce="{{ $cspNonce }}">{{ .user.CustomJS | safeJS }}</script>
  28. {{ end -}}
  29. {{ end -}}
  30. </head>
  31. <body
  32. data-service-worker-url="{{ routePath "/js/%s/%s.js" .sw_js_checksum "service-worker" }}"
  33. {{ if .csrf }}data-csrf-token="{{ .csrf }}"{{ end }}
  34. data-add-subscription-url="{{ routePath "/subscribe" }}"
  35. data-entries-status-url="{{ routePath "/entry/status" }}"
  36. data-refresh-all-feeds-url="{{ routePath "/feeds/refresh" }}"
  37. {{ if .webAuthnEnabled }}
  38. data-webauthn-register-begin-url="{{ routePath "/webauthn/register/begin" }}"
  39. data-webauthn-register-finish-url="{{ routePath "/webauthn/register/finish" }}"
  40. data-webauthn-login-begin-url="{{ routePath "/webauthn/login/begin" }}"
  41. data-webauthn-login-finish-url="{{ routePath "/webauthn/login/finish" }}"
  42. data-webauthn-delete-all-url="{{ routePath "/webauthn/deleteall" }}"
  43. {{ end }}
  44. {{ if .user }}
  45. {{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}
  46. data-mark-as-read-on-view="{{ if .user.MarkReadOnView }}true{{ else }}false{{ end }}"
  47. {{ end }}>
  48. {{ if .user }}
  49. <a class="skip-to-content-link" href="#main">{{ t "skip_to_content" }}</a>
  50. <header class="header">
  51. <nav>
  52. <div class="logo" data-toggle-button-label="{{ t "menu.title" }}">
  53. <a aria-label="{{ t "menu.home_page" }}" href="{{ routePath (printf "/%s" .user.DefaultHomePage) }}">
  54. Mini<span>flux</span>
  55. </a>
  56. {{ icon "chevron-down"}}
  57. </div>
  58. <ul id="header-menu">
  59. <li {{ if eq .menu "unread" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g u" }}">
  60. <a href="{{ routePath "/unread" }}"
  61. data-page="unread"
  62. {{ if gt .countUnread 0 }}
  63. aria-label="{{ t "menu.unread" }}, {{ plural "page.unread_entry_count" .countUnread .countUnread }}"
  64. {{ end }}
  65. >
  66. {{ icon "entries" }}{{ t "menu.unread" }}
  67. {{ if gt .countUnread 0 }}
  68. <span class="unread-counter-wrapper" aria-hidden="true">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  69. {{ end }}
  70. </a>
  71. </li>
  72. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  73. <a href="{{ routePath "/starred" }}" data-page="starred">{{ icon "star" }}{{ t "menu.starred" }}</a>
  74. </li>
  75. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  76. <a href="{{ routePath "/history" }}" data-page="history">{{ icon "history" }}{{ t "menu.history" }}</a>
  77. </li>
  78. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  79. <a href="{{ routePath "/feeds" }}" data-page="feeds">{{ icon "feeds" }}{{ t "menu.feeds" }}
  80. {{ if gt .countErrorFeeds 0 }}
  81. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  82. {{ end }}
  83. </a>
  84. <a href="{{ routePath "/subscribe" }}" title="{{ t "tooltip.keyboard_shortcuts" "+" }}" aria-label="{{ t "menu.add_feed" }}">
  85. (+)
  86. </a>
  87. </li>
  88. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  89. <a href="{{ routePath "/categories" }}" data-page="categories">{{ icon "categories" }}{{ t "menu.categories" }}</a>
  90. </li>
  91. <li {{ if eq .menu "search" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "/" }}">
  92. <a href="{{ routePath "/search" }}" data-page="search">{{ icon "search" }}{{ t "menu.search" }}</a>
  93. </li>
  94. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  95. <a href="{{ routePath "/settings" }}" data-page="settings">{{ icon "settings" }}{{ t "menu.settings" }}</a>
  96. </li>
  97. {{ if not hasAuthProxy }}
  98. <li>
  99. <form action="{{ routePath "/logout" }}" method="post" class="logout-form">
  100. <input type="hidden" name="csrf" value="{{ .csrf }}">
  101. <button type="submit" class="logout-button" title="{{ t "tooltip.logged_user" .user.Username }}">{{ icon "logout" }}{{ t "menu.logout" }}</button>
  102. </form>
  103. </li>
  104. {{ end }}
  105. </ul>
  106. </nav>
  107. </header>
  108. {{ end }}
  109. {{ if .flashSuccessMessage }}
  110. <div role="alert" class="flash-message alert alert-success">{{ .flashSuccessMessage }}</div>
  111. {{ end }}
  112. {{ if .flashErrorMessage }}
  113. <div role="alert" class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  114. {{ end }}
  115. {{template "page_header" .}}
  116. <main id="main">
  117. {{template "content" .}}
  118. </main>
  119. <dialog id="keyboard-shortcuts-modal" closedby="any">
  120. <form method="dialog">
  121. <button class="btn-close-modal" aria-label="Close" autofocus>x</button>
  122. </form>
  123. <h3 tabindex="-1" id="dialog-title">{{ t "page.keyboard_shortcuts.title" }}</h3>
  124. <div class="keyboard-shortcuts">
  125. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  126. <ul>
  127. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  128. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  129. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  130. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  131. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  132. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  133. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  134. <li>{{ t "menu.add_feed" }} = <strong>+</strong></li>
  135. </ul>
  136. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  137. <ul>
  138. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>&#x23F4;</strong></li>
  139. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>&#x23F5;</strong></li>
  140. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>F</strong></li>
  141. <li>{{ t "page.keyboard_shortcuts.go_to_top_item" }} = <strong>g + g</strong></li>
  142. <li>{{ t "page.keyboard_shortcuts.go_to_bottom_item" }} = <strong>G</strong></li>
  143. </ul>
  144. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  145. <ul>
  146. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  147. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  148. </ul>
  149. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  150. <ul>
  151. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong>, <strong>Enter</strong></li>
  152. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  153. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  154. <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li>
  155. <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li>
  156. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_next" }} = <strong>m</strong></li>
  157. <li>{{ t "page.keyboard_shortcuts.toggle_read_status_prev" }} = <strong>M</strong></li>
  158. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  159. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  160. <li>{{ t "page.keyboard_shortcuts.toggle_star_status" }} = <strong>f</strong></li>
  161. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  162. <li>{{ t "page.keyboard_shortcuts.toggle_entry_attachments" }} = <strong>a</strong></li>
  163. <li>{{ t "page.keyboard_shortcuts.scroll_item_to_top" }} = <strong>z + t</strong></li>
  164. <li>{{ t "page.keyboard_shortcuts.refresh_all_feeds" }} = <strong>R</strong></li>
  165. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  166. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  167. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  168. </ul>
  169. </div>
  170. </dialog>
  171. <template id="icon-read">{{ icon "read" }}</template>
  172. <template id="icon-unread">{{ icon "unread" }}</template>
  173. <template id="icon-star">{{ icon "star" }}</template>
  174. <template id="icon-unstar">{{ icon "unstar" }}</template>
  175. <template id="icon-save">{{ icon "save" }}</template>
  176. </body>
  177. </html>
  178. {{ end }}