layout.html 11 KB

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