common.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. // Code generated by go generate; DO NOT EDIT.
  2. package template // import "miniflux.app/template"
  3. var templateCommonMap = map[string]string{
  4. "entry_pagination": `{{ define "entry_pagination" }}
  5. <div class="pagination">
  6. <div class="pagination-prev">
  7. {{ if .prevEntry }}
  8. <a href="{{ .prevEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .prevEntry.Title }}" data-page="previous">{{ t "pagination.previous" }}</a>
  9. {{ else }}
  10. {{ t "pagination.previous" }}
  11. {{ end }}
  12. </div>
  13. <div class="pagination-next">
  14. {{ if .nextEntry }}
  15. <a href="{{ .nextEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .nextEntry.Title }}" data-page="next">{{ t "pagination.next" }}</a>
  16. {{ else }}
  17. {{ t "pagination.next" }}
  18. {{ end }}
  19. </div>
  20. </div>
  21. {{ end }}`,
  22. "feed_list": `{{ define "feed_list" }}
  23. <div class="items">
  24. {{ range .feeds }}
  25. <article class="item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ end }}">
  26. <div class="item-header">
  27. <span class="item-title">
  28. {{ if .Icon }}
  29. <img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .Title }}">
  30. {{ end }}
  31. {{ if .Disabled }} 🚫 {{ end }}
  32. <a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
  33. </span>
  34. <span class="feed-entries-counter">
  35. (<span title="{{ t "page.feeds.unread_counter" }}">{{ .UnreadCount }}</span>/<span title="{{ t "page.feeds.read_counter" }}">{{ .ReadCount }}</span>)
  36. </span>
  37. <span class="category">
  38. <a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
  39. </span>
  40. </div>
  41. <div class="item-meta">
  42. <ul>
  43. <li>
  44. <a href="{{ .SiteURL }}" title="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
  45. </li>
  46. <li>
  47. {{ t "page.feeds.last_check" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
  48. </li>
  49. </ul>
  50. <ul>
  51. <li>
  52. <a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "menu.refresh_feed" }}</a>
  53. </li>
  54. <li>
  55. <a href="{{ route "editFeed" "feedID" .ID }}">{{ t "menu.edit_feed" }}</a>
  56. </li>
  57. <li>
  58. <a href="#"
  59. data-confirm="true"
  60. data-label-question="{{ t "confirm.question" }}"
  61. data-label-yes="{{ t "confirm.yes" }}"
  62. data-label-no="{{ t "confirm.no" }}"
  63. data-label-loading="{{ t "confirm.loading" }}"
  64. data-url="{{ route "removeFeed" "feedID" .ID }}">{{ t "action.remove" }}</a>
  65. </li>
  66. </ul>
  67. </div>
  68. {{ if ne .ParsingErrorCount 0 }}
  69. <div class="parsing-error">
  70. <strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
  71. - <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
  72. </div>
  73. {{ end }}
  74. </article>
  75. {{ end }}
  76. </div>
  77. {{ end }}`,
  78. "item_meta": `{{ define "item_meta" }}
  79. <div class="item-meta">
  80. <ul>
  81. <li>
  82. <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}" title="{{ .entry.Feed.SiteURL }}">{{ truncate .entry.Feed.Title 35 }}</a>
  83. </li>
  84. <li>
  85. <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
  86. </li>
  87. {{ if .hasSaveEntry }}
  88. <li>
  89. <a href="#"
  90. title="{{ t "entry.save.title" }}"
  91. data-save-entry="true"
  92. data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
  93. data-label-loading="{{ t "entry.state.saving" }}"
  94. data-label-done="{{ t "entry.save.completed" }}"
  95. >{{ t "entry.save.label" }}</a>
  96. </li>
  97. {{ end }}
  98. <li>
  99. <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "entry.original.label" }}</a>
  100. </li>
  101. {{ if .entry.CommentsURL }}
  102. <li>
  103. <a href="{{ .entry.CommentsURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "entry.comments.label" }}</a>
  104. </li>
  105. {{ end }}
  106. <li>
  107. <a href="#"
  108. data-toggle-bookmark="true"
  109. data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
  110. data-label-loading="{{ t "entry.state.saving" }}"
  111. data-label-star="☆&nbsp;{{ t "entry.bookmark.toggle.on" }}"
  112. data-label-unstar="★&nbsp;{{ t "entry.bookmark.toggle.off" }}"
  113. data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
  114. >{{ if .entry.Starred }}★&nbsp;{{ t "entry.bookmark.toggle.off" }}{{ else }}☆&nbsp;{{ t "entry.bookmark.toggle.on" }}{{ end }}</a>
  115. </li>
  116. <li>
  117. <a href="#"
  118. title="{{ t "entry.status.title" }}"
  119. data-toggle-status="true"
  120. data-label-read="✔&#xfe0e;&nbsp;{{ t "entry.status.read" }}"
  121. data-label-unread="✘&nbsp;{{ t "entry.status.unread" }}"
  122. data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
  123. >{{ if eq .entry.Status "read" }}✘&nbsp;{{ t "entry.status.unread" }}{{ else }}✔&#xfe0e;&nbsp;{{ t "entry.status.read" }}{{ end }}</a>
  124. </li>
  125. </ul>
  126. </div>
  127. {{ end }}`,
  128. "layout": `{{ define "base" }}
  129. <!DOCTYPE html>
  130. <html>
  131. <head>
  132. <meta charset="utf-8">
  133. <title>{{template "title" .}} - Miniflux</title>
  134. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  135. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  136. <meta name="mobile-web-app-capable" content="yes">
  137. <meta name="apple-mobile-web-app-title" content="Miniflux">
  138. <link rel="manifest" href="{{ route "webManifest" }}" crossorigin="use-credentials"/>
  139. <meta name="robots" content="noindex,nofollow">
  140. <meta name="referrer" content="no-referrer">
  141. <meta name="google" content="notranslate">
  142. <!-- Favicons -->
  143. <link rel="icon" type="image/png" sizes="16x16" href="{{ route "appIcon" "filename" "favicon-16.png" }}">
  144. <link rel="icon" type="image/png" sizes="32x32" href="{{ route "appIcon" "filename" "favicon-32.png" }}">
  145. <!-- Android icons -->
  146. <link rel="icon" type="image/png" sizes="128x128" href="{{ route "appIcon" "filename" "icon-128.png" }}">
  147. <link rel="icon" type="image/png" sizes="192x192" href="{{ route "appIcon" "filename" "icon-192.png" }}">
  148. <!-- iOS icons -->
  149. <link rel="apple-touch-icon" sizes="120x120" href="{{ route "appIcon" "filename" "icon-120.png" }}">
  150. <link rel="apple-touch-icon" sizes="152x152" href="{{ route "appIcon" "filename" "icon-152.png" }}">
  151. <link rel="apple-touch-icon" sizes="167x167" href="{{ route "appIcon" "filename" "icon-167.png" }}">
  152. <link rel="apple-touch-icon" sizes="180x180" href="{{ route "appIcon" "filename" "icon-180.png" }}">
  153. {{ if .csrf }}
  154. <meta name="X-CSRF-Token" value="{{ .csrf }}">
  155. {{ end }}
  156. <meta name="theme-color" content="{{ theme_color .theme }}">
  157. <link rel="stylesheet" type="text/css" href="{{ route "stylesheet" "name" .theme }}?{{ .theme_checksum }}">
  158. <script type="text/javascript" src="{{ route "javascript" "name" "app" }}?{{ .app_js_checksum }}" defer></script>
  159. <script type="text/javascript" src="{{ route "javascript" "name" "sw" }}?{{ .sw_js_checksum }}" defer id="service-worker-script"></script>
  160. </head>
  161. <body
  162. data-entries-status-url="{{ route "updateEntriesStatus" }}"
  163. {{ if .user }}{{ if not .user.KeyboardShortcuts }}data-disable-keyboard-shortcuts="true"{{ end }}{{ end }}>
  164. <div class="toast-wrap">
  165. <span class="toast-msg"></span>
  166. </div>
  167. {{ if .user }}
  168. <header class="header">
  169. <nav>
  170. <div class="logo">
  171. <a href="{{ route "unread" }}">Mini<span>flux</span></a>
  172. </div>
  173. <ul>
  174. <li {{ if eq .menu "unread" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g u" }}">
  175. <a href="{{ route "unread" }}" data-page="unread">{{ t "menu.unread" }}
  176. {{ if gt .countUnread 0 }}
  177. <span class="unread-counter-wrapper">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  178. {{ end }}
  179. </a>
  180. </li>
  181. <li {{ if eq .menu "starred" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g b" }}">
  182. <a href="{{ route "starred" }}" data-page="starred">{{ t "menu.starred" }}</a>
  183. </li>
  184. <li {{ if eq .menu "history" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g h" }}">
  185. <a href="{{ route "history" }}" data-page="history">{{ t "menu.history" }}</a>
  186. </li>
  187. <li {{ if eq .menu "feeds" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g f" }}">
  188. <a href="{{ route "feeds" }}" data-page="feeds">{{ t "menu.feeds" }}
  189. {{ if gt .countErrorFeeds 0 }}
  190. <span class="error-feeds-counter-wrapper">(<span class="error-feeds-counter">{{ .countErrorFeeds }}</span>)</span>
  191. {{ end }}
  192. </a>
  193. </li>
  194. <li {{ if eq .menu "categories" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g c" }}">
  195. <a href="{{ route "categories" }}" data-page="categories">{{ t "menu.categories" }}</a>
  196. </li>
  197. <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
  198. <a href="{{ route "settings" }}" data-page="settings">{{ t "menu.settings" }}</a>
  199. </li>
  200. <li>
  201. <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
  202. </li>
  203. </ul>
  204. <div class="search">
  205. <div class="search-toggle-switch {{ if $.searchQuery }}has-search-query{{ end }}">
  206. <a href="#" data-action="search">&laquo;&nbsp;{{ t "search.label" }}</a>
  207. </div>
  208. <form action="{{ route "searchEntries" }}" class="search-form {{ if $.searchQuery }}has-search-query{{ end }}">
  209. <input type="search" name="q" id="search-input" placeholder="{{ t "search.placeholder" }}" {{ if $.searchQuery }}value="{{ .searchQuery }}"{{ end }} required>
  210. </form>
  211. </div>
  212. </nav>
  213. </header>
  214. {{ end }}
  215. {{ if .flashMessage }}
  216. <div class="flash-message alert alert-success">{{ .flashMessage }}</div>
  217. {{ end }}
  218. {{ if .flashErrorMessage }}
  219. <div class="flash-error-message alert alert-error">{{ .flashErrorMessage }}</div>
  220. {{ end }}
  221. <main>
  222. {{template "content" .}}
  223. </main>
  224. <template id="keyboard-shortcuts">
  225. <div id="modal-left">
  226. <a href="#" class="btn-close-modal">x</a>
  227. <h3>{{ t "page.keyboard_shortcuts.title" }}</h3>
  228. <div class="keyboard-shortcuts">
  229. <p>{{ t "page.keyboard_shortcuts.subtitle.sections" }}</p>
  230. <ul>
  231. <li>{{ t "page.keyboard_shortcuts.go_to_unread" }} = <strong>g + u</strong></li>
  232. <li>{{ t "page.keyboard_shortcuts.go_to_starred" }} = <strong>g + b</strong></li>
  233. <li>{{ t "page.keyboard_shortcuts.go_to_history" }} = <strong>g + h</strong></li>
  234. <li>{{ t "page.keyboard_shortcuts.go_to_feeds" }} = <strong>g + f</strong></li>
  235. <li>{{ t "page.keyboard_shortcuts.go_to_categories" }} = <strong>g + c</strong></li>
  236. <li>{{ t "page.keyboard_shortcuts.go_to_settings" }} = <strong>g + s</strong></li>
  237. <li>{{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = <strong>?</strong></li>
  238. </ul>
  239. <p>{{ t "page.keyboard_shortcuts.subtitle.items" }}</p>
  240. <ul>
  241. <li>{{ t "page.keyboard_shortcuts.go_to_previous_item" }} = <strong>p</strong>, <strong>k</strong>, <strong>◄</strong></li>
  242. <li>{{ t "page.keyboard_shortcuts.go_to_next_item" }} = <strong>n</strong>, <strong>j</strong>, <strong>►</strong></li>
  243. <li>{{ t "page.keyboard_shortcuts.go_to_feed" }} = <strong>g + f</strong></li>
  244. </ul>
  245. <p>{{ t "page.keyboard_shortcuts.subtitle.pages" }}</p>
  246. <ul>
  247. <li>{{ t "page.keyboard_shortcuts.go_to_previous_page" }} = <strong>h</strong></li>
  248. <li>{{ t "page.keyboard_shortcuts.go_to_next_page" }} = <strong>l</strong></li>
  249. </ul>
  250. <p>{{ t "page.keyboard_shortcuts.subtitle.actions" }}</p>
  251. <ul>
  252. <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong></li>
  253. <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li>
  254. <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li>
  255. <li>{{ t "page.keyboard_shortcuts.toggle_read_status" }} = <strong>m</strong></li>
  256. <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li>
  257. <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li>
  258. <li>{{ t "page.keyboard_shortcuts.toggle_bookmark_status" }} = <strong>f</strong></li>
  259. <li>{{ t "page.keyboard_shortcuts.save_article" }} = <strong>s</strong></li>
  260. <li>{{ t "page.keyboard_shortcuts.remove_feed" }} = <strong>#</strong></li>
  261. <li>{{ t "page.keyboard_shortcuts.go_to_search" }} = <strong>/</strong></li>
  262. <li>{{ t "page.keyboard_shortcuts.close_modal" }} = <strong>Esc</strong></li>
  263. </ul>
  264. </div>
  265. </div>
  266. </template>
  267. </body>
  268. </html>
  269. {{ end }}
  270. `,
  271. "pagination": `{{ define "pagination" }}
  272. <div class="pagination">
  273. <div class="pagination-prev">
  274. {{ if .ShowPrev }}
  275. <a href="{{ .Route }}{{ if gt .PrevOffset 0 }}?offset={{ .PrevOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}{{ else }}{{ if .SearchQuery }}?q={{ .SearchQuery }}{{ end }}{{ end }}" data-page="previous">{{ t "pagination.previous" }}</a>
  276. {{ else }}
  277. {{ t "pagination.previous" }}
  278. {{ end }}
  279. </div>
  280. <div class="pagination-next">
  281. {{ if .ShowNext }}
  282. <a href="{{ .Route }}?offset={{ .NextOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}" data-page="next">{{ t "pagination.next" }}</a>
  283. {{ else }}
  284. {{ t "pagination.next" }}
  285. {{ end }}
  286. </div>
  287. </div>
  288. {{ end }}
  289. `,
  290. "settings_menu": `{{ define "settings_menu" }}
  291. <ul>
  292. <li>
  293. <a href="{{ route "settings" }}">{{ t "menu.settings" }}</a>
  294. </li>
  295. <li>
  296. <a href="{{ route "integrations" }}">{{ t "menu.integrations" }}</a>
  297. </li>
  298. <li>
  299. <a href="{{ route "sessions" }}">{{ t "menu.sessions" }}</a>
  300. </li>
  301. {{ if .user.IsAdmin }}
  302. <li>
  303. <a href="{{ route "users" }}">{{ t "menu.users" }}</a>
  304. </li>
  305. <li>
  306. <a href="{{ route "createUser" }}">{{ t "menu.add_user" }}</a>
  307. </li>
  308. {{ end }}
  309. <li>
  310. <a href="{{ route "about" }}">{{ t "menu.about" }}</a>
  311. </li>
  312. </ul>
  313. {{ end }}`,
  314. }
  315. var templateCommonMapChecksums = map[string]string{
  316. "entry_pagination": "4faa91e2eae150c5e4eab4d258e039dfdd413bab7602f0009360e6d52898e353",
  317. "feed_list": "7b7ea2c7df07d048c83d86237d5b5e41bddce561273c652d9265950093ca261b",
  318. "item_meta": "34deb081a054f2948ad808bdb2c8603d6ab00c58f2f50c4ead0b47ae092888eb",
  319. "layout": "f19597d8cd74e17b33826c25b8421f46fef87276f0d95c695bba8f53bb4f95e6",
  320. "pagination": "3386e90c6e1230311459e9a484629bc5d5bf39514a75ef2e73bbbc61142f7abb",
  321. "settings_menu": "78e5a487ede18610b23db74184dab023170f9e083cc0625bc2c874d1eea1a4ce",
  322. }