views.go 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  1. // Code generated by go generate; DO NOT EDIT.
  2. // 2018-06-19 22:56:40.310658103 -0700 PDT m=+0.032470223
  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. <fieldset>
  75. <legend>{{ t "Advanced Options" }}</legend>
  76. <label><input type="checkbox" name="crawler" value="1" {{ if .form.Crawler }}checked{{ end }}> {{ t "Fetch original content" }}</label>
  77. <label for="form-username">{{ t "Feed Username" }}</label>
  78. <input type="text" name="username" id="form-username" value="{{ .form.Username }}">
  79. <label for="form-password">{{ t "Feed Password" }}</label>
  80. <input type="password" name="password" id="form-password" value="{{ .form.Password }}">
  81. </fieldset>
  82. <div class="buttons">
  83. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Find a subscription" }}</button>
  84. </div>
  85. </form>
  86. {{ end }}
  87. {{ end }}
  88. `,
  89. "bookmark_entries": `{{ define "title"}}{{ t "Favorites" }} ({{ .total }}){{ end }}
  90. {{ define "content"}}
  91. <section class="page-header">
  92. <h1>{{ t "Favorites" }} ({{ .total }})</h1>
  93. </section>
  94. {{ if not .entries }}
  95. <p class="alert alert-info">{{ t "There is no bookmark at the moment." }}</p>
  96. {{ else }}
  97. <div class="items">
  98. {{ range .entries }}
  99. <article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
  100. <div class="item-header">
  101. <span class="item-title">
  102. {{ if ne .Feed.Icon.IconID 0 }}
  103. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  104. {{ end }}
  105. <a href="{{ route "starredEntry" "entryID" .ID }}">{{ .Title }}</a>
  106. </span>
  107. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  108. </div>
  109. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  110. </article>
  111. {{ end }}
  112. </div>
  113. {{ template "pagination" .pagination }}
  114. {{ end }}
  115. {{ end }}
  116. `,
  117. "categories": `{{ define "title"}}{{ t "Categories" }} ({{ .total }}){{ end }}
  118. {{ define "content"}}
  119. <section class="page-header">
  120. <h1>{{ t "Categories" }} ({{ .total }})</h1>
  121. <ul>
  122. <li>
  123. <a href="{{ route "createCategory" }}">{{ t "Create a category" }}</a>
  124. </li>
  125. </ul>
  126. </section>
  127. {{ if not .categories }}
  128. <p class="alert alert-error">{{ t "There is no category." }}</p>
  129. {{ else }}
  130. <div class="items">
  131. {{ range .categories }}
  132. <article class="item">
  133. <div class="item-header">
  134. <span class="item-title">
  135. <a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
  136. </span>
  137. </div>
  138. <div class="item-meta">
  139. <ul>
  140. <li>
  141. {{ if eq .FeedCount 0 }}
  142. {{ t "No feed." }}
  143. {{ else }}
  144. {{ plural "plural.categories.feed_count" .FeedCount .FeedCount }}
  145. {{ end }}
  146. </li>
  147. </ul>
  148. <ul>
  149. <li>
  150. <a href="{{ route "editCategory" "categoryID" .ID }}">{{ t "Edit" }}</a>
  151. </li>
  152. {{ if eq .FeedCount 0 }}
  153. <li>
  154. <a href="#"
  155. data-confirm="true"
  156. data-label-question="{{ t "Are you sure?" }}"
  157. data-label-yes="{{ t "yes" }}"
  158. data-label-no="{{ t "no" }}"
  159. data-label-loading="{{ t "Work in progress..." }}"
  160. data-url="{{ route "removeCategory" "categoryID" .ID }}">{{ t "Remove" }}</a>
  161. </li>
  162. {{ end }}
  163. </ul>
  164. </div>
  165. </article>
  166. {{ end }}
  167. </div>
  168. {{ end }}
  169. {{ end }}
  170. `,
  171. "category_entries": `{{ define "title"}}{{ .category.Title }} ({{ .total }}){{ end }}
  172. {{ define "content"}}
  173. <section class="page-header">
  174. <h1>{{ .category.Title }} ({{ .total }})</h1>
  175. {{ if .entries }}
  176. <ul>
  177. <li>
  178. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  179. </li>
  180. </ul>
  181. {{ end }}
  182. </section>
  183. {{ if not .entries }}
  184. <p class="alert">{{ t "There is no article in this category." }}</p>
  185. {{ else }}
  186. <div class="items">
  187. {{ range .entries }}
  188. <article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
  189. <div class="item-header">
  190. <span class="item-title">
  191. {{ if ne .Feed.Icon.IconID 0 }}
  192. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  193. {{ end }}
  194. <a href="{{ route "categoryEntry" "categoryID" .Feed.Category.ID "entryID" .ID }}">{{ .Title }}</a>
  195. </span>
  196. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  197. </div>
  198. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  199. </article>
  200. {{ end }}
  201. </div>
  202. {{ template "pagination" .pagination }}
  203. {{ end }}
  204. {{ end }}
  205. `,
  206. "choose_subscription": `{{ define "title"}}{{ t "Choose a Subscription" }}{{ end }}
  207. {{ define "content"}}
  208. <section class="page-header">
  209. <h1>{{ t "New Subscription" }}</h1>
  210. <ul>
  211. <li>
  212. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  213. </li>
  214. <li>
  215. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  216. </li>
  217. <li>
  218. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  219. </li>
  220. </ul>
  221. </section>
  222. <form action="{{ route "chooseSubscription" }}" method="POST">
  223. <input type="hidden" name="csrf" value="{{ .csrf }}">
  224. <input type="hidden" name="category_id" value="{{ .form.CategoryID }}">
  225. <input type="hidden" name="username" value="{{ .form.Username }}">
  226. <input type="hidden" name="password" value="{{ .form.Password }}">
  227. {{ if .form.Crawler }}
  228. <input type="hidden" name="crawler" value="1">
  229. {{ end }}
  230. <h3>{{ t "Choose a Subscription" }}</h3>
  231. {{ range .subscriptions }}
  232. <div class="radio-group">
  233. <label title="{{ .URL }}"><input type="radio" name="url" value="{{ .URL }}"> {{ .Title }}</label> ({{ .Type }})
  234. <small title="Type = {{ .Type }}"><a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .URL }}</a></small>
  235. </div>
  236. {{ end }}
  237. <div class="buttons">
  238. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Subscribe" }}</button>
  239. </div>
  240. </form>
  241. {{ end }}
  242. `,
  243. "create_category": `{{ define "title"}}{{ t "New Category" }}{{ end }}
  244. {{ define "content"}}
  245. <section class="page-header">
  246. <h1>{{ t "New Category" }}</h1>
  247. <ul>
  248. <li>
  249. <a href="{{ route "categories" }}">{{ t "Categories" }}</a>
  250. </li>
  251. </ul>
  252. </section>
  253. <form action="{{ route "saveCategory" }}" method="post" autocomplete="off">
  254. <input type="hidden" name="csrf" value="{{ .csrf }}">
  255. {{ if .errorMessage }}
  256. <div class="alert alert-error">{{ t .errorMessage }}</div>
  257. {{ end }}
  258. <label for="form-title">{{ t "Title" }}</label>
  259. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  260. <div class="buttons">
  261. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Save" }}</button> {{ t "or" }} <a href="{{ route "categories" }}">{{ t "cancel" }}</a>
  262. </div>
  263. </form>
  264. {{ end }}
  265. `,
  266. "create_user": `{{ define "title"}}{{ t "New User" }}{{ end }}
  267. {{ define "content"}}
  268. <section class="page-header">
  269. <h1>{{ t "New User" }}</h1>
  270. <ul>
  271. <li>
  272. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  273. </li>
  274. <li>
  275. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  276. </li>
  277. <li>
  278. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  279. </li>
  280. <li>
  281. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  282. </li>
  283. <li>
  284. <a href="{{ route "about" }}">{{ t "About" }}</a>
  285. </li>
  286. </ul>
  287. </section>
  288. <form action="{{ route "saveUser" }}" method="post" autocomplete="off">
  289. <input type="hidden" name="csrf" value="{{ .csrf }}">
  290. {{ if .errorMessage }}
  291. <div class="alert alert-error">{{ t .errorMessage }}</div>
  292. {{ end }}
  293. <label for="form-username">{{ t "Username" }}</label>
  294. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required autofocus>
  295. <label for="form-password">{{ t "Password" }}</label>
  296. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" required>
  297. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  298. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" required>
  299. <label><input type="checkbox" name="is_admin" value="1" {{ if .form.IsAdmin }}checked{{ end }}> {{ t "Administrator" }}</label>
  300. <div class="buttons">
  301. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Save" }}</button> {{ t "or" }} <a href="{{ route "users" }}">{{ t "cancel" }}</a>
  302. </div>
  303. </form>
  304. {{ end }}
  305. `,
  306. "edit_category": `{{ define "title"}}{{ t "Edit Category: %s" .category.Title }}{{ end }}
  307. {{ define "content"}}
  308. <section class="page-header">
  309. <h1>{{ t "Edit Category: %s" .category.Title }}</h1>
  310. <ul>
  311. <li>
  312. <a href="{{ route "categories" }}">{{ t "Categories" }}</a>
  313. </li>
  314. <li>
  315. <a href="{{ route "createCategory" }}">{{ t "Create a category" }}</a>
  316. </li>
  317. </ul>
  318. </section>
  319. <form action="{{ route "updateCategory" "categoryID" .category.ID }}" method="post" autocomplete="off">
  320. <input type="hidden" name="csrf" value="{{ .csrf }}">
  321. {{ if .errorMessage }}
  322. <div class="alert alert-error">{{ t .errorMessage }}</div>
  323. {{ end }}
  324. <label for="form-title">{{ t "Title" }}</label>
  325. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  326. <div class="buttons">
  327. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "categories" }}">{{ t "cancel" }}</a>
  328. </div>
  329. </form>
  330. {{ end }}
  331. `,
  332. "edit_feed": `{{ define "title"}}{{ t "Edit Feed: %s" .feed.Title }}{{ end }}
  333. {{ define "content"}}
  334. <section class="page-header">
  335. <h1>{{ .feed.Title }}</h1>
  336. <ul>
  337. <li>
  338. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  339. </li>
  340. <li>
  341. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  342. </li>
  343. <li>
  344. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  345. </li>
  346. <li>
  347. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  348. </li>
  349. </ul>
  350. </section>
  351. {{ if not .categories }}
  352. <p class="alert alert-error">{{ t "There is no category!" }}</p>
  353. {{ else }}
  354. {{ if ne .feed.ParsingErrorCount 0 }}
  355. <div class="alert alert-error">
  356. <h3>{{ t "Last Parsing Error" }}</h3>
  357. <p>{{ t .feed.ParsingErrorMsg }}</p>
  358. </div>
  359. {{ end }}
  360. <form action="{{ route "updateFeed" "feedID" .feed.ID }}" method="post" autocomplete="off">
  361. <input type="hidden" name="csrf" value="{{ .csrf }}">
  362. {{ if .errorMessage }}
  363. <div class="alert alert-error">{{ t .errorMessage }}</div>
  364. {{ end }}
  365. <label for="form-title">{{ t "Title" }}</label>
  366. <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>
  367. <label for="form-site-url">{{ t "Site URL" }}</label>
  368. <input type="url" name="site_url" id="form-site-url" placeholder="https://domain.tld/" value="{{ .form.SiteURL }}" required>
  369. <label for="form-feed-url">{{ t "Feed URL" }}</label>
  370. <input type="url" name="feed_url" id="form-feed-url" placeholder="https://domain.tld/" value="{{ .form.FeedURL }}" required>
  371. <label for="form-username">{{ t "Feed Username" }}</label>
  372. <input type="text" name="username" id="form-username" value="{{ .form.Username }}">
  373. <label for="form-password">{{ t "Feed Password" }}</label>
  374. <input type="password" name="password" id="form-password" value="{{ .form.Password }}">
  375. <label for="form-scraper-rules">{{ t "Scraper Rules" }}</label>
  376. <input type="text" name="scraper_rules" id="form-scraper-rules" value="{{ .form.ScraperRules }}">
  377. <label for="form-rewrite-rules">{{ t "Rewrite Rules" }}</label>
  378. <input type="text" name="rewrite_rules" id="form-rewrite-rules" value="{{ .form.RewriteRules }}">
  379. <label for="form-category">{{ t "Category" }}</label>
  380. <select id="form-category" name="category_id">
  381. {{ range .categories }}
  382. <option value="{{ .ID }}" {{ if eq .ID $.form.CategoryID }}selected="selected"{{ end }}>{{ .Title }}</option>
  383. {{ end }}
  384. </select>
  385. <label><input type="checkbox" name="crawler" value="1" {{ if .form.Crawler }}checked{{ end }}> {{ t "Fetch original content" }}</label>
  386. <div class="buttons">
  387. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "feeds" }}">{{ t "cancel" }}</a>
  388. </div>
  389. </form>
  390. <div class="panel">
  391. <ul>
  392. <li><strong>{{ t "Last checked:" }} </strong><time datetime="{{ isodate .feed.CheckedAt }}" title="{{ isodate .feed.CheckedAt }}">{{ elapsed $.user.Timezone .feed.CheckedAt }}</time></li>
  393. <li><strong>{{ t "ETag header:" }} </strong>{{ if .feed.EtagHeader }}{{ .feed.EtagHeader }}{{ else }}{{ t "None" }}{{ end }}</li>
  394. <li><strong>{{ t "LastModified header:" }} </strong>{{ if .feed.LastModifiedHeader }}{{ .feed.LastModifiedHeader }}{{ else }}{{ t "None" }}{{ end }}</li>
  395. </ul>
  396. </div>
  397. {{ end }}
  398. {{ end }}`,
  399. "edit_user": `{{ define "title"}}{{ t "Edit user: %s" .selected_user.Username }}{{ end }}
  400. {{ define "content"}}
  401. <section class="page-header">
  402. <h1>{{ t "Edit user %s" .selected_user.Username }}</h1>
  403. <ul>
  404. <li>
  405. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  406. </li>
  407. <li>
  408. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  409. </li>
  410. <li>
  411. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  412. </li>
  413. <li>
  414. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  415. </li>
  416. <li>
  417. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  418. </li>
  419. <li>
  420. <a href="{{ route "about" }}">{{ t "About" }}</a>
  421. </li>
  422. </ul>
  423. </section>
  424. <form action="{{ route "updateUser" "userID" .selected_user.ID }}" method="post" autocomplete="off">
  425. <input type="hidden" name="csrf" value="{{ .csrf }}">
  426. {{ if .errorMessage }}
  427. <div class="alert alert-error">{{ t .errorMessage }}</div>
  428. {{ end }}
  429. <label for="form-username">{{ t "Username" }}</label>
  430. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required autofocus>
  431. <label for="form-password">{{ t "Password" }}</label>
  432. <input type="password" name="password" id="form-password" value="{{ .form.Password }}">
  433. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  434. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}">
  435. <label><input type="checkbox" name="is_admin" value="1" {{ if .form.IsAdmin }}checked{{ end }}> {{ t "Administrator" }}</label>
  436. <div class="buttons">
  437. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button> {{ t "or" }} <a href="{{ route "users" }}">{{ t "cancel" }}</a>
  438. </div>
  439. </form>
  440. {{ end }}
  441. `,
  442. "entry": `{{ define "title"}}{{ .entry.Title }}{{ end }}
  443. {{ define "content"}}
  444. <section class="entry">
  445. <header class="entry-header">
  446. <h1>
  447. <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .entry.Title }}</a>
  448. </h1>
  449. <div class="entry-actions">
  450. <ul>
  451. <li>
  452. <a href="#"
  453. data-toggle-bookmark="true"
  454. data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
  455. data-label-loading="{{ t "Saving..." }}"
  456. data-label-star="☆ {{ t "Star" }}"
  457. data-label-unstar="★ {{ t "Unstar" }}"
  458. data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}"
  459. >{{ if .entry.Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a>
  460. </li>
  461. {{ if .hasSaveEntry }}
  462. <li>
  463. <a href="#"
  464. title="{{ t "Save this article" }}"
  465. data-save-entry="true"
  466. data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
  467. data-label-loading="{{ t "Saving..." }}"
  468. data-label-done="{{ t "Done!" }}"
  469. >{{ t "Save" }}</a>
  470. </li>
  471. {{ end }}
  472. <li>
  473. <a href="#"
  474. title="{{ t "Fetch original content" }}"
  475. data-fetch-content-entry="true"
  476. data-fetch-content-url="{{ route "fetchContent" "entryID" .entry.ID }}"
  477. data-label-loading="{{ t "Loading..." }}"
  478. data-label-done="{{ t "Done!" }}"
  479. >{{ t "Fetch original content" }}</a>
  480. </li>
  481. {{ if .entry.CommentsURL }}
  482. <li>
  483. <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
  484. </li>
  485. {{ end }}
  486. </ul>
  487. </div>
  488. <div class="entry-meta">
  489. <span class="entry-website">
  490. {{ if ne .entry.Feed.Icon.IconID 0 }}
  491. <img src="{{ route "icon" "iconID" .entry.Feed.Icon.IconID }}" width="16" height="16">
  492. {{ end }}
  493. <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}">{{ .entry.Feed.Title }}</a>
  494. </span>
  495. {{ if .entry.Author }}
  496. <span class="entry-author">
  497. {{ if isEmail .entry.Author }}
  498. - <a href="mailto:{{ .entry.Author }}">{{ .entry.Author }}</a>
  499. {{ else }}
  500. – <em>{{ .entry.Author }}</em>
  501. {{ end }}
  502. </span>
  503. {{ end }}
  504. <span class="category">
  505. <a href="{{ route "categoryEntries" "categoryID" .entry.Feed.Category.ID }}">{{ .entry.Feed.Category.Title }}</a>
  506. </span>
  507. </div>
  508. <div class="entry-date">
  509. <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed $.user.Timezone .entry.Date }}</time>
  510. </div>
  511. </header>
  512. {{ if gt (len .entry.Content) 120 }}
  513. <div class="pagination-top">
  514. {{ template "entry_pagination" . }}
  515. </div>
  516. {{ end }}
  517. <article class="entry-content">
  518. {{ noescape (proxyFilter .entry.Content) }}
  519. </article>
  520. {{ if .entry.Enclosures }}
  521. <aside class="entry-enclosures">
  522. <h3>{{ t "Attachments" }}</h3>
  523. {{ range .entry.Enclosures }}
  524. <div class="entry-enclosure">
  525. {{ if hasPrefix .MimeType "audio/" }}
  526. <div class="enclosure-audio">
  527. <audio controls preload="metadata">
  528. <source src="{{ .URL }}" type="{{ .MimeType }}">
  529. </audio>
  530. </div>
  531. {{ else if hasPrefix .MimeType "video/" }}
  532. <div class="enclosure-video">
  533. <video controls preload="metadata">
  534. <source src="{{ .URL }}" type="{{ .MimeType }}">
  535. </video>
  536. </div>
  537. {{ else if hasPrefix .MimeType "image/" }}
  538. <div class="enclosure-image">
  539. <img src="{{ proxyURL .URL }}" title="{{ .URL }} ({{ .MimeType }})" alt="{{ .URL }} ({{ .MimeType }})">
  540. </div>
  541. {{ end }}
  542. <div class="entry-enclosure-download">
  543. <a href="{{ .URL }}" title="{{ .URL }} ({{ .MimeType }})" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Download" }}</a>
  544. <small>({{ .URL }})</small>
  545. </div>
  546. </div>
  547. {{ end }}
  548. </aside>
  549. {{ end }}
  550. </section>
  551. <div class="pagination-bottom">
  552. {{ template "entry_pagination" . }}
  553. </div>
  554. {{ end }}
  555. `,
  556. "feed_entries": `{{ define "title"}}{{ .feed.Title }} ({{ .total }}){{ end }}
  557. {{ define "content"}}
  558. <section class="page-header">
  559. <h1>{{ .feed.Title }} ({{ .total }})</h1>
  560. <ul>
  561. <li>
  562. <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
  563. </li>
  564. <li>
  565. <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
  566. </li>
  567. {{ if .entries }}
  568. <li>
  569. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  570. </li>
  571. {{ end }}
  572. </ul>
  573. </section>
  574. {{ if ne .feed.ParsingErrorCount 0 }}
  575. <div class="alert alert-error">
  576. <h3>{{ t "There is a problem with this feed" }}</h3>
  577. <p>{{ t .feed.ParsingErrorMsg }}</p>
  578. </div>
  579. {{ else if not .entries }}
  580. <p class="alert">{{ t "There is no article for this feed." }}</p>
  581. {{ else }}
  582. <div class="items">
  583. {{ range .entries }}
  584. <article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
  585. <div class="item-header">
  586. <span class="item-title">
  587. {{ if ne .Feed.Icon.IconID 0 }}
  588. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  589. {{ end }}
  590. <a href="{{ route "feedEntry" "feedID" .Feed.ID "entryID" .ID }}">{{ .Title }}</a>
  591. </span>
  592. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  593. </div>
  594. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  595. </article>
  596. {{ end }}
  597. </div>
  598. {{ template "pagination" .pagination }}
  599. {{ end }}
  600. {{ end }}
  601. `,
  602. "feeds": `{{ define "title"}}{{ t "Feeds" }} ({{ .total }}){{ end }}
  603. {{ define "content"}}
  604. <section class="page-header">
  605. <h1>{{ t "Feeds" }} ({{ .total }})</h1>
  606. <ul>
  607. <li>
  608. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  609. </li>
  610. <li>
  611. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  612. </li>
  613. <li>
  614. <a href="{{ route "import" }}">{{ t "Import" }}</a>
  615. </li>
  616. <li>
  617. <a href="{{ route "refreshAllFeeds" }}">{{ t "Refresh all feeds in background" }}</a>
  618. </li>
  619. </ul>
  620. </section>
  621. {{ if not .feeds }}
  622. <p class="alert">{{ t "You don't have any subscription." }}</p>
  623. {{ else }}
  624. <div class="items">
  625. {{ range .feeds }}
  626. <article class="item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ end }}">
  627. <div class="item-header">
  628. <span class="item-title">
  629. {{ if .Icon }}
  630. <img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16">
  631. {{ end }}
  632. <a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
  633. </span>
  634. <span class="category">
  635. <a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
  636. </span>
  637. </div>
  638. <div class="item-meta">
  639. <ul>
  640. <li>
  641. <a href="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
  642. </li>
  643. <li>
  644. {{ t "Last check:" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
  645. </li>
  646. </ul>
  647. <ul>
  648. <li>
  649. <a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "Refresh" }}</a>
  650. </li>
  651. <li>
  652. <a href="{{ route "editFeed" "feedID" .ID }}">{{ t "Edit" }}</a>
  653. </li>
  654. <li>
  655. <a href="#"
  656. data-confirm="true"
  657. data-label-question="{{ t "Are you sure?" }}"
  658. data-label-yes="{{ t "yes" }}"
  659. data-label-no="{{ t "no" }}"
  660. data-label-loading="{{ t "Work in progress..." }}"
  661. data-url="{{ route "removeFeed" "feedID" .ID }}">{{ t "Remove" }}</a>
  662. </li>
  663. </ul>
  664. </div>
  665. {{ if ne .ParsingErrorCount 0 }}
  666. <div class="parsing-error">
  667. <strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "plural.feed.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
  668. - <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
  669. </div>
  670. {{ end }}
  671. </article>
  672. {{ end }}
  673. </div>
  674. {{ end }}
  675. {{ end }}
  676. `,
  677. "history_entries": `{{ define "title"}}{{ t "History" }} ({{ .total }}){{ end }}
  678. {{ define "content"}}
  679. <section class="page-header">
  680. <h1>{{ t "History" }} ({{ .total }})</h1>
  681. {{ if .entries }}
  682. <ul>
  683. <li>
  684. <a href="{{ route "flushHistory" }}">{{ t "Flush history" }}</a>
  685. </li>
  686. </ul>
  687. {{ end }}
  688. </section>
  689. {{ if not .entries }}
  690. <p class="alert alert-info">{{ t "There is no history at the moment." }}</p>
  691. {{ else }}
  692. <div class="items">
  693. {{ range .entries }}
  694. <article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
  695. <div class="item-header">
  696. <span class="item-title">
  697. {{ if ne .Feed.Icon.IconID 0 }}
  698. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  699. {{ end }}
  700. <a href="{{ route "readEntry" "entryID" .ID }}">{{ .Title }}</a>
  701. </span>
  702. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  703. </div>
  704. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  705. </article>
  706. {{ end }}
  707. </div>
  708. {{ template "pagination" .pagination }}
  709. {{ end }}
  710. {{ end }}
  711. `,
  712. "import": `{{ define "title"}}{{ t "Import" }}{{ end }}
  713. {{ define "content"}}
  714. <section class="page-header">
  715. <h1>{{ t "Import" }}</h1>
  716. <ul>
  717. <li>
  718. <a href="{{ route "feeds" }}">{{ t "Feeds" }}</a>
  719. </li>
  720. <li>
  721. <a href="{{ route "addSubscription" }}">{{ t "Add subscription" }}</a>
  722. </li>
  723. <li>
  724. <a href="{{ route "export" }}">{{ t "Export" }}</a>
  725. </li>
  726. </ul>
  727. </section>
  728. <form action="{{ route "uploadOPML" }}" method="post" enctype="multipart/form-data">
  729. <input type="hidden" name="csrf" value="{{ .csrf }}">
  730. {{ if .errorMessage }}
  731. <div class="alert alert-error">{{ t .errorMessage }}</div>
  732. {{ end }}
  733. <label for="form-file">{{ t "OPML file" }}</label>
  734. <input type="file" name="file" id="form-file">
  735. <div class="buttons">
  736. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Import" }}</button>
  737. </div>
  738. </form>
  739. {{ end }}
  740. `,
  741. "integrations": `{{ define "title"}}{{ t "Integrations" }}{{ end }}
  742. {{ define "content"}}
  743. <section class="page-header">
  744. <h1>{{ t "Integrations" }}</h1>
  745. <ul>
  746. <li>
  747. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  748. </li>
  749. <li>
  750. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  751. </li>
  752. {{ if .user.IsAdmin }}
  753. <li>
  754. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  755. </li>
  756. {{ end }}
  757. <li>
  758. <a href="{{ route "about" }}">{{ t "About" }}</a>
  759. </li>
  760. </ul>
  761. </section>
  762. <form method="post" autocomplete="off" action="{{ route "updateIntegration" }}">
  763. <input type="hidden" name="csrf" value="{{ .csrf }}">
  764. {{ if .errorMessage }}
  765. <div class="alert alert-error">{{ t .errorMessage }}</div>
  766. {{ end }}
  767. <h3>Fever</h3>
  768. <div class="form-section">
  769. <label>
  770. <input type="checkbox" name="fever_enabled" value="1" {{ if .form.FeverEnabled }}checked{{ end }}> {{ t "Activate Fever API" }}
  771. </label>
  772. <label for="form-fever-username">{{ t "Fever Username" }}</label>
  773. <input type="text" name="fever_username" id="form-fever-username" value="{{ .form.FeverUsername }}">
  774. <label for="form-fever-password">{{ t "Fever Password" }}</label>
  775. <input type="password" name="fever_password" id="form-fever-password" value="{{ .form.FeverPassword }}">
  776. <p>{{ t "Fever API endpoint:" }} <strong>{{ rootURL }}{{ route "feverEndpoint" }}</strong></p>
  777. </div>
  778. <h3>Pinboard</h3>
  779. <div class="form-section">
  780. <label>
  781. <input type="checkbox" name="pinboard_enabled" value="1" {{ if .form.PinboardEnabled }}checked{{ end }}> {{ t "Save articles to Pinboard" }}
  782. </label>
  783. <label for="form-pinboard-token">{{ t "Pinboard API Token" }}</label>
  784. <input type="password" name="pinboard_token" id="form-pinboard-token" value="{{ .form.PinboardToken }}">
  785. <label for="form-pinboard-tags">{{ t "Pinboard Tags" }}</label>
  786. <input type="text" name="pinboard_tags" id="form-pinboard-tags" value="{{ .form.PinboardTags }}">
  787. <label>
  788. <input type="checkbox" name="pinboard_mark_as_unread" value="1" {{ if .form.PinboardMarkAsUnread }}checked{{ end }}> {{ t "Mark bookmark as unread" }}
  789. </label>
  790. </div>
  791. <h3>Instapaper</h3>
  792. <div class="form-section">
  793. <label>
  794. <input type="checkbox" name="instapaper_enabled" value="1" {{ if .form.InstapaperEnabled }}checked{{ end }}> {{ t "Save articles to Instapaper" }}
  795. </label>
  796. <label for="form-instapaper-username">{{ t "Instapaper Username" }}</label>
  797. <input type="text" name="instapaper_username" id="form-instapaper-username" value="{{ .form.InstapaperUsername }}">
  798. <label for="form-instapaper-password">{{ t "Instapaper Password" }}</label>
  799. <input type="password" name="instapaper_password" id="form-instapaper-password" value="{{ .form.InstapaperPassword }}">
  800. </div>
  801. <h3>Pocket</h3>
  802. <div class="form-section">
  803. <label>
  804. <input type="checkbox" name="pocket_enabled" value="1" {{ if .form.PocketEnabled }}checked{{ end }}> {{ t "Save articles to Pocket" }}
  805. </label>
  806. {{ if not .hasPocketConsumerKeyConfigured }}
  807. <label for="form-pocket-consumer-key">{{ t "Pocket Consumer Key" }}</label>
  808. <input type="text" name="pocket_consumer_key" id="form-pocket-consumer-key" value="{{ .form.PocketConsumerKey }}">
  809. {{ end }}
  810. <label for="form-pocket-access-token">{{ t "Pocket Access Token" }}</label>
  811. <input type="password" name="pocket_access_token" id="form-pocket-access-token" value="{{ .form.PocketAccessToken }}">
  812. {{ if not .form.PocketAccessToken }}
  813. <p><a href="{{ route "pocketAuthorize" }}">{{ t "Connect your Pocket account" }}</a></p>
  814. {{ end }}
  815. </div>
  816. <h3>Wallabag</h3>
  817. <div class="form-section">
  818. <label>
  819. <input type="checkbox" name="wallabag_enabled" value="1" {{ if .form.WallabagEnabled }}checked{{ end }}> {{ t "Save articles to Wallabag" }}
  820. </label>
  821. <label for="form-wallabag-url">{{ t "Wallabag API Endpoint" }}</label>
  822. <input type="url" name="wallabag_url" id="form-wallabag-url" value="{{ .form.WallabagURL }}" placeholder="http://v2.wallabag.org/">
  823. <label for="form-wallabag-client-id">{{ t "Wallabag Client ID" }}</label>
  824. <input type="text" name="wallabag_client_id" id="form-wallabag-client-id" value="{{ .form.WallabagClientID }}">
  825. <label for="form-wallabag-client-secret">{{ t "Wallabag Client Secret" }}</label>
  826. <input type="password" name="wallabag_client_secret" id="form-wallabag-client-secret" value="{{ .form.WallabagClientSecret }}">
  827. <label for="form-wallabag-username">{{ t "Wallabag Username" }}</label>
  828. <input type="text" name="wallabag_username" id="form-wallabag-username" value="{{ .form.WallabagUsername }}">
  829. <label for="form-wallabag-password">{{ t "Wallabag Password" }}</label>
  830. <input type="password" name="wallabag_password" id="form-wallabag-password" value="{{ .form.WallabagPassword }}">
  831. </div>
  832. <h3>Nunux Keeper</h3>
  833. <div class="form-section">
  834. <label>
  835. <input type="checkbox" name="nunux_keeper_enabled" value="1" {{ if .form.NunuxKeeperEnabled }}checked{{ end }}> {{ t "Save articles to Nunux Keeper" }}
  836. </label>
  837. <label for="form-nunux-keeper-url">{{ t "Nunux Keeper API Endpoint" }}</label>
  838. <input type="url" name="nunux_keeper_url" id="form-nunux-keeper-url" value="{{ .form.NunuxKeeperURL }}" placeholder="https://api.nunux.org/keeper">
  839. <label for="form-nunux-keeper-api-key">{{ t "Nunux Keeper API key" }}</label>
  840. <input type="text" name="nunux_keeper_api_key" id="form-nunux-keeper-api-key" value="{{ .form.NunuxKeeperAPIKey }}">
  841. </div>
  842. <div class="buttons">
  843. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button>
  844. </div>
  845. </form>
  846. <h3>{{ t "Miniflux API" }}</h3>
  847. <div class="panel">
  848. <ul>
  849. <li>
  850. {{ t "API Endpoint" }} = <strong>{{ baseURL }}/v1/</strong>
  851. </li>
  852. <li>
  853. {{ t "Username" }} = <strong>{{ .user.Username }}</strong>
  854. </li>
  855. <li>
  856. {{ t "Password" }} = <strong>{{ t "Your account password" }}</strong>
  857. </li>
  858. </ul>
  859. </div>
  860. <h3>{{ t "Bookmarklet" }}</h3>
  861. <div class="panel">
  862. <p>{{ t "This special link allows you to subscribe to a website directly by using a bookmark in your web browser." }}</p>
  863. <div class="bookmarklet">
  864. <a href="javascript:location.href='{{ rootURL }}{{ route "bookmarklet" }}?uri='+encodeURIComponent(window.location.href)">{{ t "Add to Miniflux" }}</a>
  865. </div>
  866. <p>{{ t "Drag and drop this link to your bookmarks." }}</p>
  867. </div>
  868. {{ end }}
  869. `,
  870. "login": `{{ define "title"}}{{ t "Sign In" }}{{ end }}
  871. {{ define "content"}}
  872. <section class="login-form">
  873. <form action="{{ route "checkLogin" }}" method="post">
  874. <input type="hidden" name="csrf" value="{{ .csrf }}">
  875. {{ if .errorMessage }}
  876. <div class="alert alert-error">{{ t .errorMessage }}</div>
  877. {{ end }}
  878. <label for="form-username">{{ t "Username" }}</label>
  879. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required autofocus>
  880. <label for="form-password">{{ t "Password" }}</label>
  881. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" required>
  882. <div class="buttons">
  883. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Sign in" }}</button>
  884. </div>
  885. </form>
  886. {{ if hasOAuth2Provider "google" }}
  887. <div class="oauth2">
  888. <a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "Sign in with Google" }}</a>
  889. </div>
  890. {{ end }}
  891. </section>
  892. {{ end }}
  893. `,
  894. "sessions": `{{ define "title"}}{{ t "Sessions" }}{{ end }}
  895. {{ define "content"}}
  896. <section class="page-header">
  897. <h1>{{ t "Sessions" }}</h1>
  898. <ul>
  899. <li>
  900. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  901. </li>
  902. <li>
  903. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  904. </li>
  905. {{ if .user.IsAdmin }}
  906. <li>
  907. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  908. </li>
  909. <li>
  910. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  911. </li>
  912. {{ end }}
  913. <li>
  914. <a href="{{ route "about" }}">{{ t "About" }}</a>
  915. </li>
  916. </ul>
  917. </section>
  918. <table>
  919. <tr>
  920. <th>{{ t "Date" }}</th>
  921. <th>{{ t "IP Address" }}</th>
  922. <th>{{ t "User Agent" }}</th>
  923. <th>{{ t "Actions" }}</th>
  924. </tr>
  925. {{ range .sessions }}
  926. <tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
  927. <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed $.user.Timezone .CreatedAt }}</td>
  928. <td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
  929. <td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
  930. <td class="column-20">
  931. {{ if eq .Token $.currentSessionToken }}
  932. {{ t "Current session" }}
  933. {{ else }}
  934. <a href="#"
  935. data-confirm="true"
  936. data-label-question="{{ t "Are you sure?" }}"
  937. data-label-yes="{{ t "yes" }}"
  938. data-label-no="{{ t "no" }}"
  939. data-label-loading="{{ t "Work in progress..." }}"
  940. data-url="{{ route "removeSession" "sessionID" .ID }}">{{ t "Remove" }}</a>
  941. {{ end }}
  942. </td>
  943. </tr>
  944. {{ end }}
  945. </table>
  946. {{ end }}
  947. `,
  948. "settings": `{{ define "title"}}{{ t "Settings" }}{{ end }}
  949. {{ define "content"}}
  950. <section class="page-header">
  951. <h1>{{ t "Settings" }}</h1>
  952. <ul>
  953. <li>
  954. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  955. </li>
  956. <li>
  957. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  958. </li>
  959. {{ if .user.IsAdmin }}
  960. <li>
  961. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  962. </li>
  963. {{ end }}
  964. <li>
  965. <a href="{{ route "about" }}">{{ t "About" }}</a>
  966. </li>
  967. </ul>
  968. </section>
  969. <form method="post" autocomplete="off" action="{{ route "updateSettings" }}">
  970. <input type="hidden" name="csrf" value="{{ .csrf }}">
  971. {{ if .errorMessage }}
  972. <div class="alert alert-error">{{ t .errorMessage }}</div>
  973. {{ end }}
  974. <label for="form-username">{{ t "Username" }}</label>
  975. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" required>
  976. <label for="form-password">{{ t "Password" }}</label>
  977. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="off">
  978. <label for="form-confirmation">{{ t "Confirmation" }}</label>
  979. <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" autocomplete="off">
  980. <label for="form-language">{{ t "Language" }}</label>
  981. <select id="form-language" name="language">
  982. {{ range $key, $value := .languages }}
  983. <option value="{{ $key }}" {{ if eq $key $.form.Language }}selected="selected"{{ end }}>{{ $value }}</option>
  984. {{ end }}
  985. </select>
  986. <label for="form-timezone">{{ t "Timezone" }}</label>
  987. <select id="form-timezone" name="timezone">
  988. {{ range $key, $value := .timezones }}
  989. <option value="{{ $key }}" {{ if eq $key $.form.Timezone }}selected="selected"{{ end }}>{{ $value }}</option>
  990. {{ end }}
  991. </select>
  992. <label for="form-theme">{{ t "Theme" }}</label>
  993. <select id="form-theme" name="theme">
  994. {{ range $key, $value := .themes }}
  995. <option value="{{ $key }}" {{ if eq $key $.form.Theme }}selected="selected"{{ end }}>{{ $value }}</option>
  996. {{ end }}
  997. </select>
  998. <label for="form-entry-direction">{{ t "Entry Sorting" }}</label>
  999. <select id="form-entry-direction" name="entry_direction">
  1000. <option value="asc" {{ if eq "asc" $.form.EntryDirection }}selected="selected"{{ end }}>{{ t "Older entries first" }}</option>
  1001. <option value="desc" {{ if eq "desc" $.form.EntryDirection }}selected="selected"{{ end }}>{{ t "Recent entries first" }}</option>
  1002. </select>
  1003. <div class="buttons">
  1004. <button type="submit" class="button button-primary" data-label-loading="{{ t "Loading..." }}">{{ t "Update" }}</button>
  1005. </div>
  1006. </form>
  1007. {{ if hasOAuth2Provider "google" }}
  1008. <div class="panel">
  1009. {{ if hasKey .user.Extra "google_id" }}
  1010. <a href="{{ route "oauth2Unlink" "provider" "google" }}">{{ t "Unlink my Google account" }}</a>
  1011. {{ else }}
  1012. <a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "Link my Google account" }}</a>
  1013. {{ end }}
  1014. </div>
  1015. {{ end }}
  1016. {{ end }}
  1017. `,
  1018. "unread_entries": `{{ define "title"}}{{ t "Unread Items" }} {{ if gt .countUnread 0 }}({{ .countUnread }}){{ end }} {{ end }}
  1019. {{ define "content"}}
  1020. <section class="page-header">
  1021. <h1>{{ t "Unread" }} (<span class="unread-counter">{{ .countUnread }}</span>)</h1>
  1022. {{ if .entries }}
  1023. <ul>
  1024. <li>
  1025. <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
  1026. </li>
  1027. <li>
  1028. <a href="{{ route "markAllAsRead" }}">{{ t "Mark all as read" }}</a>
  1029. </li>
  1030. </ul>
  1031. {{ end }}
  1032. </section>
  1033. {{ if not .entries }}
  1034. <p class="alert">{{ t "There is no unread article." }}</p>
  1035. {{ else }}
  1036. <div class="items hide-read-items">
  1037. {{ range .entries }}
  1038. <article class="item touch-item item-status-{{ .Status }}" data-id="{{ .ID }}">
  1039. <div class="item-header">
  1040. <span class="item-title">
  1041. {{ if ne .Feed.Icon.IconID 0 }}
  1042. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16">
  1043. {{ end }}
  1044. <a href="{{ route "unreadEntry" "entryID" .ID }}">{{ .Title }}</a>
  1045. </span>
  1046. <span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
  1047. </div>
  1048. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  1049. </article>
  1050. {{ end }}
  1051. </div>
  1052. {{ template "pagination" .pagination }}
  1053. {{ end }}
  1054. {{ end }}`,
  1055. "users": `{{ define "title"}}{{ t "Users" }}{{ end }}
  1056. {{ define "content"}}
  1057. <section class="page-header">
  1058. <h1>{{ t "Users" }}</h1>
  1059. <ul>
  1060. <li>
  1061. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  1062. </li>
  1063. <li>
  1064. <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
  1065. </li>
  1066. <li>
  1067. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  1068. </li>
  1069. <li>
  1070. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  1071. </li>
  1072. <li>
  1073. <a href="{{ route "about" }}">{{ t "About" }}</a>
  1074. </li>
  1075. </ul>
  1076. </section>
  1077. {{ if eq (len .users) 1 }}
  1078. <p class="alert">{{ t "You are the only user." }}</p>
  1079. {{ else }}
  1080. <table>
  1081. <tr>
  1082. <th class="column-20">{{ t "Username" }}</th>
  1083. <th>{{ t "Administrator" }}</th>
  1084. <th>{{ t "Last Login" }}</th>
  1085. <th>{{ t "Actions" }}</th>
  1086. </tr>
  1087. {{ range .users }}
  1088. {{ if ne .ID $.user.ID }}
  1089. <tr>
  1090. <td>{{ .Username }}</td>
  1091. <td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
  1092. <td>
  1093. {{ if .LastLoginAt }}
  1094. <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed $.user.Timezone .LastLoginAt }}</time>
  1095. {{ else }}
  1096. {{ t "Never" }}
  1097. {{ end }}
  1098. </td>
  1099. <td>
  1100. <a href="{{ route "editUser" "userID" .ID }}">{{ t "Edit" }}</a>,
  1101. <a href="#"
  1102. data-confirm="true"
  1103. data-label-question="{{ t "Are you sure?" }}"
  1104. data-label-yes="{{ t "yes" }}"
  1105. data-label-no="{{ t "no" }}"
  1106. data-label-loading="{{ t "Work in progress..." }}"
  1107. data-url="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
  1108. </td>
  1109. </tr>
  1110. {{ end }}
  1111. {{ end }}
  1112. </table>
  1113. {{ end }}
  1114. {{ end }}
  1115. `,
  1116. }
  1117. var templateViewsMapChecksums = map[string]string{
  1118. "about": "ad2fb778fc73c39b733b3f81b13e5c7d689b041fadd24ee2d4577f545aa788ad",
  1119. "add_subscription": "5067776ce452543fceed8b62defe5fbfed41e3d5bd79b5f2acf8c45ef4faac6d",
  1120. "bookmark_entries": "8e5fea7559218a34289c2f0e54955fc0ef3b9e629205927841cbcc2276aefb2a",
  1121. "categories": "ca1280cd157bb527d4fc907da67b05a8347378f6dce965b9389d4bcdf3600a11",
  1122. "category_entries": "6ad52c8d0c28e21ea48be76228ea8432adde1dc190010753a48928477d52e065",
  1123. "choose_subscription": "c680e690255d53da1f4f11e9b997bc2a32ca659f1245076e5738243859e17876",
  1124. "create_category": "2b82af5d2dcd67898dc5daa57a6461e6ff8121a6089b2a2a1be909f35e4a2275",
  1125. "create_user": "233764778c915754141a20429ec8db9bf80ef2d7704867a2d7232c1e9df233ae",
  1126. "edit_category": "cee720faadcec58289b707ad30af623d2ee66c1ce23a732965463250d7ff41c5",
  1127. "edit_feed": "66dd3ca6357645944a99f8b9c0455253e6d2bf5f36faf9aa322689b6299b0104",
  1128. "edit_user": "321e0a60cf3bf7441bff970f4920e4c5b7c1883f80ab1d1674f8137954b25033",
  1129. "entry": "bd611521ebb46714fce434fe7fa5d4e53e50da4c3ed02450ad3557f614f16e14",
  1130. "feed_entries": "4dffdb55cfad29df20612efe7ed2dbed03d919c4556898543ab6450f610d3c99",
  1131. "feeds": "2a5abe37968ea34a0576dbef52341645cb1fc9562e351382fbf721491da6f4fa",
  1132. "history_entries": "451f0b202f47c9db5344d3e73862f5b7afbd4323fbdba21b6087866c40f045d3",
  1133. "import": "73b5112e20bfd232bf73334544186ea419505936bc237d481517a8622901878f",
  1134. "integrations": "4f93dab2630e6b3bf8bf51fc844e48fc763b8e7d6bb98c3c1692ea43f0e93930",
  1135. "login": "7d83c3067c02f1f6aafdd8816c7f97a4eb5a5a4bdaaaa4cc1e2fbb9c17ea65e8",
  1136. "sessions": "3fa79031dd883847eba92fbafe5f535fa3a4e1614bb610f20588b6f8fc8b3624",
  1137. "settings": "ea2505b9d0a6d6bb594dba87a92079de19baa6d494f0651693a7685489fb7de9",
  1138. "unread_entries": "ca3ef1547d7d170b005a2f48fabd4c0a15550884db5e481659c13ffe6a47d19d",
  1139. "users": "c6d91b0b29984b4cb3073bec6a2933cfb72981ec60f54b6c7aa05194f0e860bd",
  1140. }