views.go 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. // Code generated by go generate; DO NOT EDIT.
  2. // 2017-12-01 22:52:50.615711322 -0800 PST m=+0.016980549
  3. package template
  4. var templateViewsMap = map[string]string{
  5. "about": `{{ define "title"}}{{ t "About" }}{{ end }}
  6. {{ define "content"}}
  7. <section class="page-header">
  8. <h1>{{ t "About" }}</h1>
  9. <ul>
  10. <li>
  11. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  12. </li>
  13. <li>
  14. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  15. </li>
  16. <li>
  17. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  18. </li>
  19. {{ if .user.IsAdmin }}
  20. <li>
  21. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  22. </li>
  23. {{ end }}
  24. </ul>
  25. </section>
  26. <div class="panel">
  27. <h3>{{ t "Version" }}</h3>
  28. <ul>
  29. <li><strong>{{ t "Version:" }}</strong> {{ .version }}</li>
  30. <li><strong>{{ t "Build Date:" }}</strong> {{ .build_date }}</li>
  31. </ul>
  32. </div>
  33. <div class="panel">
  34. <h3>{{ t "Authors" }}</h3>
  35. <ul>
  36. <li><strong>{{ t "Author:" }}</strong> Frédéric Guillot</li>
  37. <li><strong>{{ t "License:" }}</strong> Apache 2.0</li>
  38. </ul>
  39. </div>
  40. {{ end }}
  41. `,
  42. "add_subscription": `{{ define "title"}}{{ t "New Subscription" }}{{ end }}
  43. {{ define "content"}}
  44. <section class="page-header">
  45. <h1>{{ t "New Subscription" }}</h1>
  46. <ul>
  47. <li>
  48. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  49. </li>
  50. <li>
  51. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  52. </li>
  53. <li>
  54. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  55. </li>
  56. </ul>
  57. </section>
  58. {{ if not .categories }}
  59. <p class="alert alert-error">{{ t "There is no category. You must have at least one category." }}</p>
  60. {{ else }}
  61. <form action="{{ route "submitSubscription" }}" method="post" autocomplete="off">
  62. <input type="hidden" name="csrf" value="{{ .csrf }}">
  63. {{ if .errorMessage }}
  64. <div class="alert alert-error">{{ t .errorMessage }}</div>
  65. {{ end }}
  66. <label for="form-url">{{ t "URL" }}</label>
  67. <input type="url" name="url" id="form-url" placeholder="https://domain.tld/" value="{{ .form.URL }}" required autofocus>
  68. <label for="form-category">{{ t "Category" }}</label>
  69. <select id="form-category" name="category_id">
  70. {{ range .categories }}
  71. <option value="{{ .ID }}">{{ .Title }}</option>
  72. {{ end }}
  73. </select>
  74. <div class="buttons">
  75. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Find a subscription" }}</button>
  76. </div>
  77. </form>
  78. {{ end }}
  79. {{ end }}
  80. `,
  81. "categories": `{{ define "title"}}{{ t "Categories" }} ({{ .total }}){{ end }}
  82. {{ define "content"}}
  83. <section class="page-header">
  84. <h1>{{ t "Categories" }} ({{ .total }})</h1>
  85. <ul>
  86. <li>
  87. <a href="{{ route "createCategory" }}">{{ t "Create a category" }}</a>
  88. </li>
  89. </ul>
  90. </section>
  91. {{ if not .categories }}
  92. <p class="alert alert-error">{{ t "There is no category." }}</p>
  93. {{ else }}
  94. <div class="items">
  95. {{ range .categories }}
  96. <article class="item">
  97. <div class="item-header">
  98. <span class="item-title">
  99. <a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
  100. </span>
  101. </div>
  102. <div class="item-meta">
  103. <ul>
  104. <li>
  105. {{ if eq .FeedCount 0 }}
  106. {{ t "No feed." }}
  107. {{ else }}
  108. {{ plural "plural.categories.feed_count" .FeedCount .FeedCount }}
  109. {{ end }}
  110. </li>
  111. </ul>
  112. <ul>
  113. <li>
  114. <a href="{{ route "editCategory" "categoryID" .ID }}">{{ t "Edit" }}</a>
  115. </li>
  116. {{ if eq .FeedCount 0 }}
  117. <li>
  118. <a href="#"
  119. data-confirm="true"
  120. data-label-question="{{ t "Are you sure?" }}"
  121. data-label-yes="{{ t "yes" }}"
  122. data-label-no="{{ t "no" }}"
  123. data-label-loading="{{ t "Work in progress..." }}"
  124. data-url="{{ route "removeCategory" "categoryID" .ID }}">{{ t "Remove" }}</a>
  125. </li>
  126. {{ end }}
  127. </ul>
  128. </div>
  129. </article>
  130. {{ end }}
  131. </div>
  132. {{ end }}
  133. {{ end }}
  134. `,
  135. "category_entries": `{{ define "title"}}{{ .category.Title }} ({{ .total }}){{ end }}
  136. {{ define "content"}}
  137. <section class="page-header">
  138. <h1>{{ .category.Title }} ({{ .total }})</h1>
  139. {{ if .entries }}
  140. <ul>
  141. <li>
  142. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  143. </li>
  144. </ul>
  145. {{ end }}
  146. </section>
  147. {{ if not .entries }}
  148. <p class="alert">{{ t "There is no article in this category." }}</p>
  149. {{ else }}
  150. <div class="items">
  151. {{ range .entries }}
  152. <article class="item item-status-{{ .Status }}" data-id="{{ .ID }}">
  153. <div class="item-header">
  154. <span class="item-title">
  155. {{ if ne .Feed.Icon.IconID 0 }}
  156. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  157. {{ end }}
  158. <a href="{{ route "categoryEntry" "categoryID" .Feed.Category.ID "entryID" .ID }}">{{ .Title }}</a>
  159. </span>
  160. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  161. </div>
  162. <div class="item-meta">
  163. <ul>
  164. <li>
  165. <a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.Title }}">{{ domain .Feed.SiteURL }}</a>
  166. </li>
  167. <li>
  168. <time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed .Date }}</time>
  169. </li>
  170. <li>
  171. <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
  172. </li>
  173. </ul>
  174. </div>
  175. </article>
  176. {{ end }}
  177. </div>
  178. {{ template "pagination" .pagination }}
  179. {{ end }}
  180. {{ end }}
  181. `,
  182. "choose_subscription": `{{ define "title"}}{{ t "Choose a Subscription" }}{{ end }}
  183. {{ define "content"}}
  184. <section class="page-header">
  185. <h1>{{ t "New Subscription" }}</h1>
  186. <ul>
  187. <li>
  188. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  189. </li>
  190. <li>
  191. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  192. </li>
  193. <li>
  194. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  195. </li>
  196. </ul>
  197. </section>
  198. <form action="{{ route "chooseSubscription" }}" method="POST">
  199. <input type="hidden" name="csrf" value="{{ .csrf }}">
  200. <input type="hidden" name="category_id" value="{{ .categoryID }}">
  201. <h3>{{ t "Choose a Subscription" }}</h3>
  202. {{ range .subscriptions }}
  203. <div class="radio-group">
  204. <label title="{{ .URL }}"><input type="radio" name="url" value="{{ .URL }}"> {{ .Title }}</label> ({{ .Type }})
  205. <small title="Type = {{ .Type }}"><a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .URL }}</a></small>
  206. </div>
  207. {{ end }}
  208. <div class="buttons">
  209. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Subscribe" }}</button>
  210. </div>
  211. </form>
  212. {{ end }}
  213. `,
  214. "create_category": `{{ define "title"}}{{ t "New Category" }}{{ end }}
  215. {{ define "content"}}
  216. <section class="page-header">
  217. <h1>{{ t "New Category" }}</h1>
  218. <ul>
  219. <li>
  220. <a href="{{ route "categories" }}">{{ t "Categories" }}</a>
  221. </li>
  222. </ul>
  223. </section>
  224. <form action="{{ route "saveCategory" }}" method="post" autocomplete="off">
  225. <input type="hidden" name="csrf" value="{{ .csrf }}">
  226. {{ if .errorMessage }}
  227. <div class="alert alert-error">{{ t .errorMessage }}</div>
  228. {{ end }}
  229. <label for="form-title">{{ t "Title" }}</label>
  230. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  231. <div class="buttons">
  232. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Save" }}</button> {{ t "or" }} <a href="{{ route "categories" }}">{{ t "cancel" }}</a>
  233. </div>
  234. </form>
  235. {{ end }}
  236. `,
  237. "create_user": `{{ define "title"}}{{ t "New User" }}{{ end }}
  238. {{ define "content"}}
  239. <section class="page-header">
  240. <h1>{{ t "New User" }}</h1>
  241. <ul>
  242. <li>
  243. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  244. </li>
  245. <li>
  246. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  247. </li>
  248. <li>
  249. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  250. </li>
  251. <li>
  252. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  253. </li>
  254. </ul>
  255. </section>
  256. <form action="{{ route "saveUser" }}" method="post" autocomplete="off">
  257. <input type="hidden" name="csrf" value="{{ .csrf }}">
  258. {{ if .errorMessage }}
  259. <div class="alert alert-error">{{ t .errorMessage }}</div>
  260. {{ end }}
  261. <label for="form-username">{{ t "Username" }}</label>
  262. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required autofocus>
  263. <label for="form-password">{{ t "Password" }}</label>
  264. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" required>
  265. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  266. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" required>
  267. <label><input type="checkbox" name="is_admin" value="1" {{ if .form.IsAdmin }}checked="checked"{{ end }}> {{ t "Administrator" }}</label>
  268. <div class="buttons">
  269. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Save" }}</button> {{ t "or" }} <a href="{{ route "users" }}">{{ t "cancel" }}</a>
  270. </div>
  271. </form>
  272. {{ end }}
  273. `,
  274. "edit_category": `{{ define "title"}}{{ t "Edit Category: %s" .category.Title }}{{ end }}
  275. {{ define "content"}}
  276. <section class="page-header">
  277. <h1>{{ t "Edit Category: %s" .category.Title }}</h1>
  278. <ul>
  279. <li>
  280. <a href="{{ route "categories" }}">{{ t "Categories" }}</a>
  281. </li>
  282. <li>
  283. <a href="{{ route "createCategory" }}">{{ t "Create a category" }}</a>
  284. </li>
  285. </ul>
  286. </section>
  287. <form action="{{ route "updateCategory" "categoryID" .category.ID }}" method="post" autocomplete="off">
  288. <input type="hidden" name="csrf" value="{{ .csrf }}">
  289. {{ if .errorMessage }}
  290. <div class="alert alert-error">{{ t .errorMessage }}</div>
  291. {{ end }}
  292. <label for="form-title">{{ t "Title" }}</label>
  293. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  294. <div class="buttons">
  295. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "categories" }}">{{ t "cancel" }}</a>
  296. </div>
  297. </form>
  298. {{ end }}
  299. `,
  300. "edit_feed": `{{ define "title"}}{{ t "Edit Feed: %s" .feed.Title }}{{ end }}
  301. {{ define "content"}}
  302. <section class="page-header">
  303. <h1>{{ .feed.Title }}</h1>
  304. <ul>
  305. <li>
  306. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  307. </li>
  308. <li>
  309. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  310. </li>
  311. <li>
  312. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  313. </li>
  314. <li>
  315. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  316. </li>
  317. </ul>
  318. </section>
  319. {{ if not .categories }}
  320. <p class="alert alert-error">{{ t "There is no category!" }}</p>
  321. {{ else }}
  322. {{ if ne .feed.ParsingErrorCount 0 }}
  323. <div class="alert alert-error">
  324. <h3>{{ t "Last Parsing Error" }}</h3>
  325. {{ .feed.ParsingErrorMsg }}
  326. </div>
  327. {{ end }}
  328. <form action="{{ route "updateFeed" "feedID" .feed.ID }}" method="post" autocomplete="off">
  329. <input type="hidden" name="csrf" value="{{ .csrf }}">
  330. {{ if .errorMessage }}
  331. <div class="alert alert-error">{{ t .errorMessage }}</div>
  332. {{ end }}
  333. <label for="form-title">{{ t "Title" }}</label>
  334. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  335. <label for="form-site-url">{{ t "Site URL" }}</label>
  336. <input type="url" name="site_url" id="form-site-url" placeholder="https://domain.tld/" value="{{ .form.SiteURL }}" required>
  337. <label for="form-feed-url">{{ t "Feed URL" }}</label>
  338. <input type="url" name="feed_url" id="form-feed-url" placeholder="https://domain.tld/" value="{{ .form.FeedURL }}" required>
  339. <label for="form-category">{{ t "Category" }}</label>
  340. <select id="form-category" name="category_id">
  341. {{ range .categories }}
  342. <option value="{{ .ID }}" {{ if eq .ID $.form.CategoryID }}selected="selected"{{ end }}>{{ .Title }}</option>
  343. {{ end }}
  344. </select>
  345. <div class="buttons">
  346. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "feeds" }}">{{ t "cancel" }}</a>
  347. </div>
  348. </form>
  349. {{ end }}
  350. {{ end }}`,
  351. "edit_user": `{{ define "title"}}{{ t "Edit user: %s" .selected_user.Username }}{{ end }}
  352. {{ define "content"}}
  353. <section class="page-header">
  354. <h1>{{ t "Edit user %s" .selected_user.Username }}"</h1>
  355. <ul>
  356. <li>
  357. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  358. </li>
  359. <li>
  360. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  361. </li>
  362. <li>
  363. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  364. </li>
  365. <li>
  366. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  367. </li>
  368. <li>
  369. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  370. </li>
  371. </ul>
  372. </section>
  373. <form action="{{ route "updateUser" "userID" .selected_user.ID }}" method="post" autocomplete="off">
  374. <input type="hidden" name="csrf" value="{{ .csrf }}">
  375. {{ if .errorMessage }}
  376. <div class="alert alert-error">{{ t .errorMessage }}</div>
  377. {{ end }}
  378. <label for="form-username">{{ t "Username" }}</label>
  379. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required autofocus>
  380. <label for="form-password">{{ t "Password" }}</label>
  381. <input type="password" name="password" id="form-password" value="{{ .form.Password }}">
  382. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  383. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}">
  384. <label><input type="checkbox" name="is_admin" value="1" {{ if .form.IsAdmin }}checked="checked"{{ end }}> {{ t "Administrator" }}</label>
  385. <div class="buttons">
  386. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "users" }}">{{ t "cancel" }}</a>
  387. </div>
  388. </form>
  389. {{ end }}
  390. `,
  391. "entry": `{{ define "title"}}{{ .entry.Title }}{{ end }}
  392. {{ define "content"}}
  393. <section class="entry">
  394. <header class="entry-header">
  395. <h1>
  396. <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .entry.Title }}</a>
  397. </h1>
  398. <div class="entry-meta">
  399. <span class="entry-website">
  400. {{ if ne .entry.Feed.Icon.IconID 0 }}
  401. <img src="{{ route "icon" "iconID" .entry.Feed.Icon.IconID }}" width="16" height="16">
  402. {{ end }}
  403. <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}">{{ .entry.Feed.Title }}</a>
  404. </span>
  405. {{ if .entry.Author }}
  406. <span class="entry-author">
  407. {{ if isEmail .entry.Author }}
  408. - <a href="mailto:{{ .entry.Author }}">{{ .entry.Author }}</a>
  409. {{ else }}
  410. – <em>{{ .entry.Author }}</em>
  411. {{ end }}
  412. </span>
  413. {{ end }}
  414. <span class="category">
  415. <a href="{{ route "categoryEntries" "categoryID" .entry.Feed.Category.ID }}">{{ .entry.Feed.Category.Title }}</a>
  416. </span>
  417. </div>
  418. <div class="entry-date">
  419. <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .entry.Date }}</time>
  420. </div>
  421. </header>
  422. <div class="pagination-top">
  423. {{ template "entry_pagination" . }}
  424. </div>
  425. <article class="entry-content">
  426. {{ noescape (proxyFilter .entry.Content) }}
  427. </article>
  428. {{ if .entry.Enclosures }}
  429. <aside class="entry-enclosures">
  430. <h3>{{ t "Attachments" }}</h3>
  431. {{ range .entry.Enclosures }}
  432. <div class="entry-enclosure">
  433. {{ if hasPrefix .MimeType "audio/" }}
  434. <div class="enclosure-audio">
  435. <audio controls preload="metadata">
  436. <source src="{{ .URL }}" type="{{ .MimeType }}">
  437. </audio>
  438. </div>
  439. {{ else if hasPrefix .MimeType "video/" }}
  440. <div class="enclosure-video">
  441. <video controls preload="metadata">
  442. <source src="{{ .URL }}" type="{{ .MimeType }}">
  443. </video>
  444. </div>
  445. {{ else if hasPrefix .MimeType "image/" }}
  446. <div class="enclosure-image">
  447. <img src="{{ proxyURL .URL }}" title="{{ .URL }} ({{ .MimeType }})" alt="{{ .URL }} ({{ .MimeType }})">
  448. </div>
  449. {{ end }}
  450. <div class="entry-enclosure-download">
  451. <a href="{{ .URL }}" title="{{ .URL }} ({{ .MimeType }})" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Download" }}</a>
  452. <small>({{ .URL }})</small>
  453. </div>
  454. </div>
  455. {{ end }}
  456. </aside>
  457. {{ end }}
  458. </section>
  459. <div class="pagination-bottom">
  460. {{ template "entry_pagination" . }}
  461. </div>
  462. {{ end }}
  463. `,
  464. "feed_entries": `{{ define "title"}}{{ .feed.Title }} ({{ .total }}){{ end }}
  465. {{ define "content"}}
  466. <section class="page-header">
  467. <h1>{{ .feed.Title }} ({{ .total }})</h1>
  468. <ul>
  469. <li>
  470. <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
  471. </li>
  472. <li>
  473. <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
  474. </li>
  475. {{ if .entries }}
  476. <li>
  477. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  478. </li>
  479. {{ end }}
  480. </ul>
  481. </section>
  482. {{ if ne .feed.ParsingErrorCount 0 }}
  483. <div class="alert alert-error">
  484. <h3>{{ t "There is a problem with this feed" }}</h3>
  485. {{ .feed.ParsingErrorMsg }}
  486. </div>
  487. {{ else if not .entries }}
  488. <p class="alert">{{ t "There is no article for this feed." }}</p>
  489. {{ else }}
  490. <div class="items">
  491. {{ range .entries }}
  492. <article class="item item-status-{{ .Status }}" data-id="{{ .ID }}">
  493. <div class="item-header">
  494. <span class="item-title">
  495. {{ if ne .Feed.Icon.IconID 0 }}
  496. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  497. {{ end }}
  498. <a href="{{ route "feedEntry" "feedID" .Feed.ID "entryID" .ID }}">{{ .Title }}</a>
  499. </span>
  500. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  501. </div>
  502. <div class="item-meta">
  503. <ul>
  504. <li>
  505. <a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.Title }}">{{ domain .Feed.SiteURL }}</a>
  506. </li>
  507. <li>
  508. <time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed .Date }}</time>
  509. </li>
  510. <li>
  511. <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
  512. </li>
  513. </ul>
  514. </div>
  515. </article>
  516. {{ end }}
  517. </div>
  518. {{ template "pagination" .pagination }}
  519. {{ end }}
  520. {{ end }}
  521. `,
  522. "feeds": `{{ define "title"}}{{ t "Feeds" }} ({{ .total }}){{ end }}
  523. {{ define "content"}}
  524. <section class="page-header">
  525. <h1>{{ t "Feeds" }} ({{ .total }})</h1>
  526. <ul>
  527. <li>
  528. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  529. </li>
  530. <li>
  531. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  532. </li>
  533. <li>
  534. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  535. </li>
  536. <li>
  537. <a href="{{ route "refreshAllFeeds" }}">{{ t "Refresh all feeds in the background" }}</a>
  538. </li>
  539. </ul>
  540. </section>
  541. {{ if not .feeds }}
  542. <p class="alert">{{ t "You don't have any subscription." }}</p>
  543. {{ else }}
  544. <div class="items">
  545. {{ range .feeds }}
  546. <article class="item">
  547. <div class="item-header">
  548. <span class="item-title">
  549. {{ if ne .Icon.IconID 0 }}
  550. <img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16">
  551. {{ end }}
  552. <a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
  553. </span>
  554. <span class="category">
  555. <a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
  556. </span>
  557. </div>
  558. <div class="item-meta">
  559. <ul>
  560. <li>
  561. <a href="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
  562. </li>
  563. <li>
  564. {{ t "Last check:" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed .CheckedAt }}</time>
  565. </li>
  566. {{ if ne .ParsingErrorCount 0 }}
  567. <li><strong title="{{ .ParsingErrorMsg }}">{{ plural "plural.feed.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong></li>
  568. {{ end }}
  569. </ul>
  570. <ul>
  571. <li>
  572. <a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "Refresh" }}</a>
  573. </li>
  574. <li>
  575. <a href="{{ route "editFeed" "feedID" .ID }}">{{ t "Edit" }}</a>
  576. </li>
  577. <li>
  578. <a href="#"
  579. data-confirm="true"
  580. data-label-question="{{ t "Are you sure?" }}"
  581. data-label-yes="{{ t "yes" }}"
  582. data-label-no="{{ t "no" }}"
  583. data-label-loading="{{ t "Work in progress..." }}"
  584. data-url="{{ route "removeFeed" "feedID" .ID }}">{{ t "Remove" }}</a>
  585. </li>
  586. </ul>
  587. </div>
  588. </article>
  589. {{ end }}
  590. </div>
  591. {{ end }}
  592. {{ end }}
  593. `,
  594. "history": `{{ define "title"}}{{ t "History" }} ({{ .total }}){{ end }}
  595. {{ define "content"}}
  596. <section class="page-header">
  597. <h1>{{ t "History" }} ({{ .total }})</h1>
  598. {{ if .entries }}
  599. <ul>
  600. <li>
  601. <a href="{{ route "flushHistory" }}">{{ t "Flush history" }}</a>
  602. </li>
  603. </ul>
  604. {{ end }}
  605. </section>
  606. {{ if not .entries }}
  607. <p class="alert alert-info">{{ t "There is no history at the moment." }}</p>
  608. {{ else }}
  609. <div class="items">
  610. {{ range .entries }}
  611. <article class="item item-status-{{ .Status }}" data-id="{{ .ID }}">
  612. <div class="item-header">
  613. <span class="item-title">
  614. {{ if ne .Feed.Icon.IconID 0 }}
  615. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  616. {{ end }}
  617. <a href="{{ route "readEntry" "entryID" .ID }}">{{ .Title }}</a>
  618. </span>
  619. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  620. </div>
  621. <div class="item-meta">
  622. <ul>
  623. <li>
  624. <a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.Title }}">{{ domain .Feed.SiteURL }}</a>
  625. </li>
  626. <li>
  627. <time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed .Date }}</time>
  628. </li>
  629. <li>
  630. <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
  631. </li>
  632. </ul>
  633. </div>
  634. </article>
  635. {{ end }}
  636. </div>
  637. {{ template "pagination" .pagination }}
  638. {{ end }}
  639. {{ end }}
  640. `,
  641. "import": `{{ define "title"}}{{ t "Import" }}{{ end }}
  642. {{ define "content"}}
  643. <section class="page-header">
  644. <h1>{{ t "Import" }}</h1>
  645. <ul>
  646. <li>
  647. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  648. </li>
  649. <li>
  650. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  651. </li>
  652. <li>
  653. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  654. </li>
  655. </ul>
  656. </section>
  657. <form action="{{ route "uploadOPML" }}" method="post" enctype="multipart/form-data">
  658. <input type="hidden" name="csrf" value="{{ .csrf }}">
  659. {{ if .errorMessage }}
  660. <div class="alert alert-error">{{ t .errorMessage }}</div>
  661. {{ end }}
  662. <label for="form-file">{{ t "OPML file" }}</label>
  663. <input type="file" name="file" id="form-file">
  664. <div class="buttons">
  665. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Import" }}</button>
  666. </div>
  667. </form>
  668. {{ end }}
  669. `,
  670. "integrations": `{{ define "title"}}{{ t "Integrations" }}{{ end }}
  671. {{ define "content"}}
  672. <section class="page-header">
  673. <h1>{{ t "Integrations" }}</h1>
  674. <ul>
  675. <li>
  676. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  677. </li>
  678. <li>
  679. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  680. </li>
  681. {{ if .user.IsAdmin }}
  682. <li>
  683. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  684. </li>
  685. {{ end }}
  686. <li>
  687. <a href="{{ route "about" }}">{{ t "About" }}</a>
  688. </li>
  689. </ul>
  690. </section>
  691. <div class="panel">
  692. <h3>{{ t "Bookmarklet" }}</h3>
  693. <p>{{ t "This special link allows you to subscribe to a website directly by using a bookmark in your web browser." }}</p>
  694. <div class="bookmarklet">
  695. <a href="javascript:location.href='{{ baseURL }}{{ route "bookmarklet" }}?uri='+encodeURIComponent(window.location.href)">{{ t "Add to Miniflux" }}</a>
  696. </div>
  697. <p>{{ t "Drag and drop this link to your bookmarks." }}</p>
  698. </div>
  699. {{ end }}
  700. `,
  701. "login": `{{ define "title"}}{{ t "Sign In" }}{{ end }}
  702. {{ define "content"}}
  703. <section class="login-form">
  704. <form action="{{ route "checkLogin" }}" method="post">
  705. <input type="hidden" name="csrf" value="{{ .csrf }}">
  706. {{ if .errorMessage }}
  707. <div class="alert alert-error">{{ t .errorMessage }}</div>
  708. {{ end }}
  709. <label for="form-username">{{ t "Username" }}</label>
  710. <input type="text" name="username" id="form-username" required autofocus>
  711. <label for="form-password">{{ t "Password" }}</label>
  712. <input type="password" name="password" id="form-password" required>
  713. <div class="buttons">
  714. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Sign in" }}</button>
  715. </div>
  716. </form>
  717. {{ if hasOAuth2Provider "google" }}
  718. <div class="oauth2">
  719. <a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "Sign in with Google" }}</a>
  720. </div>
  721. {{ end }}
  722. </section>
  723. {{ end }}
  724. `,
  725. "sessions": `{{ define "title"}}{{ t "Sessions" }}{{ end }}
  726. {{ define "content"}}
  727. <section class="page-header">
  728. <h1>{{ t "Sessions" }}</h1>
  729. <ul>
  730. <li>
  731. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  732. </li>
  733. <li>
  734. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  735. </li>
  736. <li>
  737. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  738. </li>
  739. <li>
  740. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  741. </li>
  742. </ul>
  743. </section>
  744. <table>
  745. <tr>
  746. <th>{{ t "Date" }}</th>
  747. <th>{{ t "IP Address" }}</th>
  748. <th>{{ t "User Agent" }}</th>
  749. <th>{{ t "Actions" }}</th>
  750. </tr>
  751. {{ range .sessions }}
  752. <tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
  753. <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed .CreatedAt }}</td>
  754. <td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
  755. <td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
  756. <td class="column-20">
  757. {{ if eq .Token $.currentSessionToken }}
  758. {{ t "Current session" }}
  759. {{ else }}
  760. <a href="#"
  761. data-confirm="true"
  762. data-label-question="{{ t "Are you sure?" }}"
  763. data-label-yes="{{ t "yes" }}"
  764. data-label-no="{{ t "no" }}"
  765. data-label-loading="{{ t "Work in progress..." }}"
  766. data-url="{{ route "removeSession" "sessionID" .ID }}">{{ t "Remove" }}</a>
  767. {{ end }}
  768. </td>
  769. </tr>
  770. {{ end }}
  771. </table>
  772. {{ end }}
  773. `,
  774. "settings": `{{ define "title"}}{{ t "Settings" }}{{ end }}
  775. {{ define "content"}}
  776. <section class="page-header">
  777. <h1>{{ t "Settings" }}</h1>
  778. <ul>
  779. <li>
  780. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  781. </li>
  782. <li>
  783. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  784. </li>
  785. {{ if .user.IsAdmin }}
  786. <li>
  787. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  788. </li>
  789. {{ end }}
  790. <li>
  791. <a href="{{ route "about" }}">{{ t "About" }}</a>
  792. </li>
  793. </ul>
  794. </section>
  795. <form method="post" autocomplete="off" action="{{ route "updateSettings" }}">
  796. <input type="hidden" name="csrf" value="{{ .csrf }}">
  797. {{ if .errorMessage }}
  798. <div class="alert alert-error">{{ t .errorMessage }}</div>
  799. {{ end }}
  800. <label for="form-username">{{ t "Username" }}</label>
  801. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required>
  802. <label for="form-password">{{ t "Password" }}</label>
  803. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="off">
  804. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  805. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" autocomplete="off">
  806. <label for="form-language">{{ t "Language" }}</label>
  807. <select id="form-language" name="language">
  808. {{ range $key, $value := .languages }}
  809. <option value="{{ $key }}" {{ if eq $key $.form.Language }}selected="selected"{{ end }}>{{ $value }}</option>
  810. {{ end }}
  811. </select>
  812. <label for="form-timezone">{{ t "Timezone" }}</label>
  813. <select id="form-timezone" name="timezone">
  814. {{ range $key, $value := .timezones }}
  815. <option value="{{ $key }}" {{ if eq $key $.form.Timezone }}selected="selected"{{ end }}>{{ $value }}</option>
  816. {{ end }}
  817. </select>
  818. <label for="form-theme">{{ t "Theme" }}</label>
  819. <select id="form-theme" name="theme">
  820. {{ range $key, $value := .themes }}
  821. <option value="{{ $key }}" {{ if eq $key $.form.Theme }}selected="selected"{{ end }}>{{ $value }}</option>
  822. {{ end }}
  823. </select>
  824. <div class="buttons">
  825. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button>
  826. </div>
  827. </form>
  828. {{ if hasOAuth2Provider "google" }}
  829. <div class="panel">
  830. {{ if hasKey .user.Extra "google_id" }}
  831. <a href="{{ route "oauth2Unlink" "provider" "google" }}">{{ t "Unlink my Google account" }}</a>
  832. {{ else }}
  833. <a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "Link my Google account" }}</a>
  834. {{ end }}
  835. </div>
  836. {{ end }}
  837. {{ end }}
  838. `,
  839. "unread": `{{ define "title"}}{{ t "Unread Items" }} {{ if gt .countUnread 0 }}({{ .countUnread }}){{ end }} {{ end }}
  840. {{ define "content"}}
  841. <section class="page-header">
  842. <h1>{{ t "Unread" }} ({{ .countUnread }})</h1>
  843. {{ if .entries }}
  844. <ul>
  845. <li>
  846. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  847. </li>
  848. </ul>
  849. {{ end }}
  850. </section>
  851. {{ if not .entries }}
  852. <p class="alert">{{ t "There is no unread article." }}</p>
  853. {{ else }}
  854. <div class="items hide-read-items">
  855. {{ range .entries }}
  856. <article class="item item-status-{{ .Status }}" data-id="{{ .ID }}">
  857. <div class="item-header">
  858. <span class="item-title">
  859. {{ if ne .Feed.Icon.IconID 0 }}
  860. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  861. {{ end }}
  862. <a href="{{ route "unreadEntry" "entryID" .ID }}">{{ .Title }}</a>
  863. </span>
  864. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  865. </div>
  866. <div class="item-meta">
  867. <ul>
  868. <li>
  869. <a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.Title }}">{{ domain .Feed.SiteURL }}</a>
  870. </li>
  871. <li>
  872. <time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed .Date }}</time>
  873. </li>
  874. <li>
  875. <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
  876. </li>
  877. </ul>
  878. </div>
  879. </article>
  880. {{ end }}
  881. </div>
  882. {{ template "pagination" .pagination }}
  883. {{ end }}
  884. {{ end }}`,
  885. "users": `{{ define "title"}}{{ t "Users" }}{{ end }}
  886. {{ define "content"}}
  887. <section class="page-header">
  888. <h1>{{ t "Users" }}</h1>
  889. <ul>
  890. <li>
  891. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  892. </li>
  893. <li>
  894. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  895. </li>
  896. <li>
  897. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  898. </li>
  899. <li>
  900. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  901. </li>
  902. </ul>
  903. </section>
  904. {{ if eq (len .users) 1 }}
  905. <p class="alert">{{ t "You are the only user." }}</p>
  906. {{ else }}
  907. <table>
  908. <tr>
  909. <th class="column-20">{{ t "Username" }}</th>
  910. <th>{{ t "Administrator" }}</th>
  911. <th>{{ t "Last Login" }}</th>
  912. <th>{{ t "Actions" }}</th>
  913. </tr>
  914. {{ range .users }}
  915. {{ if ne .ID $.user.ID }}
  916. <tr>
  917. <td>{{ .Username }}</td>
  918. <td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
  919. <td>
  920. {{ if .LastLoginAt }}
  921. <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed .LastLoginAt }}</time>
  922. {{ else }}
  923. {{ t "Never" }}
  924. {{ end }}
  925. </td>
  926. <td>
  927. <a href="{{ route "editUser" "userID" .ID }}">{{ t "Edit" }}</a>,
  928. <a href="#"
  929. data-confirm="true"
  930. data-label-question="{{ t "Are you sure?" }}"
  931. data-label-yes="{{ t "yes" }}"
  932. data-label-no="{{ t "no" }}"
  933. data-label-loading="{{ t "Work in progress..." }}"
  934. data-url="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
  935. </td>
  936. </tr>
  937. {{ end }}
  938. {{ end }}
  939. </table>
  940. {{ end }}
  941. {{ end }}
  942. `,
  943. }
  944. var templateViewsMapChecksums = map[string]string{
  945. "about": "ad2fb778fc73c39b733b3f81b13e5c7d689b041fadd24ee2d4577f545aa788ad",
  946. "add_subscription": "098ea9e492e18242bd414b22c4d8638006d113f728e5ae78c9186663f60ae3f1",
  947. "categories": "ca1280cd157bb527d4fc907da67b05a8347378f6dce965b9389d4bcdf3600a11",
  948. "category_entries": "219d315877664c84edaf4815bd52a76039585570a35b197332cd0a6bc25c4c55",
  949. "choose_subscription": "d37682743d8bbd84738a964e238103db2651f95fa340c6e285ffe2e12548d673",
  950. "create_category": "2b82af5d2dcd67898dc5daa57a6461e6ff8121a6089b2a2a1be909f35e4a2275",
  951. "create_user": "815dd31faaa6e9ba81a2a6664e5707aaf4153c392accd2b1f77cf1937035a881",
  952. "edit_category": "cee720faadcec58289b707ad30af623d2ee66c1ce23a732965463250d7ff41c5",
  953. "edit_feed": "c5bc4c22bf7e8348d880395250545595d21fb8c8e723fc5d7cca68e25d250884",
  954. "edit_user": "c835d78f7cf36c11533db9cef253457a9003987d704070d59446cb2b0e84dcb9",
  955. "entry": "12e863c777368185091008adc851ddc0327317849f1566f7803be2b5bd358fd7",
  956. "feed_entries": "c2b1b4181a64b8cbacac0e59d9f48906d77a52b5b40f973befb7e67604009198",
  957. "feeds": "c22af39b42ba9ca69ea0914ca789303ec2c5b484abcd4eaa49016e365381257c",
  958. "history": "78bb9b4216c66a7d03cc1407476a8599269c6ee228dcd4b439ace9c94703938b",
  959. "import": "73b5112e20bfd232bf73334544186ea419505936bc237d481517a8622901878f",
  960. "integrations": "c485d6d9ed996635e55e73320610e6bcb01a41c1153e8e739ae2294b0b14b243",
  961. "login": "04f3ce79bfa5753f69e0d956c2a8999c0da549c7925634a3e8134975da0b0e0f",
  962. "sessions": "878dbe8f8ea783b44130c495814179519fa5c3aa2666ac87508f94d58dd008bf",
  963. "settings": "1e2df11f5436eb2d05ae1fae30dd6f1362613011edbfcc79ae8b23854fa348b4",
  964. "unread": "f631cec5e3bf0daa9ccce99985aac8f6004ae41330e449d4f927f2179937cb21",
  965. "users": "44677e28bb5347799ed0020c90ec785aadec4b1454446d92411cfdaf6e32110b",
  966. }