display.phtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. $this->partial('aside_configure');
  5. ?>
  6. <main class="post">
  7. <h1><?= _t('conf.display') ?></h1>
  8. <form method="post" action="<?= _url('configure', 'display') ?>" data-auto-leave-validation="1">
  9. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  10. <div class="form-group">
  11. <label class="group-name" for="language"><?= _t('conf.display.language') ?></label>
  12. <div class="group-controls">
  13. <select name="language" id="language">
  14. <?php $languages = Minz_Translate::availableLanguages(); ?>
  15. <?php foreach ($languages as $lang) { ?>
  16. <option value="<?= $lang ?>"<?= FreshRSS_Context::userConf()->language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option>
  17. <?php } ?>
  18. </select>
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="group-name" for="timezone"><?= _t('conf.display.timezone') ?></label>
  23. <div class="group-controls">
  24. <select name="timezone" id="timezone">
  25. <?php
  26. $timezones = array_merge([''], DateTimeZone::listIdentifiers());
  27. if (!in_array(FreshRSS_Context::userConf()->timezone, $timezones, true)) {
  28. FreshRSS_Context::userConf()->timezone = '';
  29. }
  30. ?>
  31. <?php foreach ($timezones as $timezone): ?>
  32. <option value="<?= $timezone ?>"<?= FreshRSS_Context::userConf()->timezone === $timezone ? ' selected="selected"' : '' ?>>
  33. <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . FreshRSS_Context::defaultTimeZone() . ')' : $timezone ?>
  34. </option>
  35. <?php endforeach; ?>
  36. </select>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="group-name" for="theme"><?= _t('conf.display.theme') ?></label>
  41. <div class="group-controls">
  42. <select id="theme" name="theme">
  43. <?php foreach ($this->themes as $theme): ?>
  44. <option value="<?= $theme['id'] ?>"<?= FreshRSS_Context::userConf()->theme === $theme['id'] ? ' selected' : '' ?>><?= $theme['name'] ?></option>
  45. <?php endforeach ?>
  46. </select>
  47. <ul class="theme-preview-list">
  48. <?php $slides = count($this->themes); $i = 1; $themeAvailable = false; ?>
  49. <?php
  50. foreach ($this->themes as $theme) { ?>
  51. <?php
  52. $isCurrent = FreshRSS_Context::userConf()->theme === $theme['id'];
  53. if ($isCurrent) {
  54. $themeAvailable = true;
  55. }
  56. ?>
  57. <li class="preview-container<?= $isCurrent ? ' picked' : '' ?>" data-theme-preview="<?= $theme['id'] ?>">
  58. <div class="preview">
  59. <img src="<?= Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png') ?>" loading="lazy" />
  60. </div>
  61. <div class="properties">
  62. <div>
  63. <?php if (!empty($theme['deprecated'])) { ?>
  64. <span class="deprecated error"><?= _t('conf.display.theme.deprecated') ?>:</span>
  65. <?php } ?>
  66. <?= sprintf('%s — %s %s', $theme['name'], _t('gen.short.by_author'), $theme['author']) ?>
  67. </div>
  68. <div>
  69. <?php if (!empty($theme['deprecated'])) { ?>
  70. <span class="deprecated"><?= _t('conf.display.theme.deprecated.description') ?></span><br />
  71. <?php } ?>
  72. <?= $theme['description'] ?>
  73. </div>
  74. <?php if (!empty($theme['theme-color']['dark'])) { ?>
  75. <div class="darkMode">✔ <?= _t('conf.display.darkMode') ?></div>
  76. <?php } ?>
  77. </div>
  78. </li>
  79. <?php $i++ ?>
  80. <?php } ?>
  81. <?php if (!$themeAvailable) {?>
  82. <li class="preview-container picked">
  83. <div class="preview">
  84. </div>
  85. <div class="properties alert-error">
  86. <div><?= _t('conf.display.theme_not_available', FreshRSS_Context::userConf()->theme)?></div>
  87. </div>
  88. </li>
  89. <?php }?>
  90. </ul>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label class="group-name" for="darkMode"><?= _t('conf.display.darkMode') ?></label>
  95. <div class="group-controls">
  96. <select name="darkMode" id="darkMode">
  97. <option value="no"<?= FreshRSS_Context::userConf()->darkMode === 'no' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.no') ?></option>
  98. <option value="auto"<?= FreshRSS_Context::userConf()->darkMode === 'auto' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.auto') ?></option>
  99. </select>
  100. <span class="help"><?= _i('help') ?> <?= _t('conf.display.darkMode.help') ?></span>
  101. </div>
  102. </div>
  103. <?php $width = FreshRSS_Context::userConf()->content_width; ?>
  104. <div class="form-group">
  105. <label class="group-name" for="content_width"><?= _t('conf.display.width.content') ?></label>
  106. <div class="group-controls">
  107. <select name="content_width" id="content_width" required="">
  108. <option value="thin" <?= $width === 'thin' ? 'selected="selected"' : '' ?>>
  109. <?= _t('conf.display.width.thin') ?>
  110. </option>
  111. <option value="medium" <?= $width === 'medium' ? 'selected="selected"' : '' ?>>
  112. <?= _t('conf.display.width.medium') ?>
  113. </option>
  114. <option value="large" <?= $width === 'large' ? 'selected="selected"' : '' ?>>
  115. <?= _t('conf.display.width.large') ?>
  116. </option>
  117. <option value="no_limit" <?= $width === 'no_limit' ? 'selected="selected"' : '' ?>>
  118. <?= _t('conf.display.width.no_limit') ?>
  119. </option>
  120. </select>
  121. </div>
  122. </div>
  123. <?php $topline_website = FreshRSS_Context::userConf()->topline_website; ?>
  124. <div class="form-group">
  125. <label class="group-name" for="topline_website"><?= _t('conf.display.website.label') ?></label>
  126. <div class="group-controls">
  127. <select name="topline_website" id="topline_website" required="">
  128. <option value="none" <?= $topline_website === 'none' ? 'selected="selected"' : '' ?>>
  129. <?= _t('conf.display.website.none') ?>
  130. </option>
  131. <option value="icon" <?= $topline_website === 'icon' ? 'selected="selected"' : '' ?>>
  132. <?= _t('conf.display.website.icon') ?>
  133. </option>
  134. <option value="name" <?= $topline_website === 'name' ? 'selected="selected"' : '' ?>>
  135. <?= _t('conf.display.website.name') ?>
  136. </option>
  137. <option value="full" <?= $topline_website === 'full' ? 'selected="selected"' : '' ?>>
  138. <?= _t('conf.display.website.full') ?>
  139. </option>
  140. </select>
  141. </div>
  142. </div>
  143. <?php $topline_thumbnail = FreshRSS_Context::userConf()->topline_thumbnail; ?>
  144. <div class="form-group">
  145. <label class="group-name" for="topline_thumbnail"><?= _t('conf.display.thumbnail.label') ?></label>
  146. <div class="group-controls">
  147. <select name="topline_thumbnail" id="topline_thumbnail" required="">
  148. <option value="none" <?= $topline_thumbnail === 'none' ? 'selected="selected"' : '' ?>>
  149. <?= _t('conf.display.thumbnail.none') ?>
  150. </option>
  151. <option value="portrait" <?= $topline_thumbnail === 'portrait' ? 'selected="selected"' : '' ?>>
  152. <?= _t('conf.display.thumbnail.portrait') ?>
  153. </option>
  154. <option value="square" <?= $topline_thumbnail === 'square' ? 'selected="selected"' : '' ?>>
  155. <?= _t('conf.display.thumbnail.square') ?>
  156. </option>
  157. <option value="landscape" <?= $topline_thumbnail === 'landscape' ? 'selected="selected"' : '' ?>>
  158. <?= _t('conf.display.thumbnail.landscape') ?>
  159. </option>
  160. </select>
  161. </div>
  162. </div>
  163. <div class="form-group">
  164. <label class="group-name"><?= _t('conf.display.icon.entry') ?></label>
  165. <div class="group-controls">
  166. <table class="config-articleicons">
  167. <thead>
  168. <tr>
  169. <th> </th>
  170. <th title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i('read') ?></th>
  171. <th title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i('starred') ?></th>
  172. <th title="<?= _t('index.menu.mylabels') ?>"><?= _i('label') ?></th>
  173. <th title="<?= _t('conf.display.icon.related_tags') ?>"><?= _i('tag') ?></th>
  174. <th title="<?= _t('conf.display.icon.sharing') ?>"><?= _i('share') ?></th>
  175. <th><?= _t('conf.display.icon.summary') ?></th>
  176. <th><?= _t('conf.display.icon.display_authors') ?></th>
  177. <th><?= _t('conf.display.icon.publication_date') ?></th>
  178. <th><?= _i('link') ?></th>
  179. </tr>
  180. </thead>
  181. <tbody>
  182. <tr>
  183. <th><?= _t('conf.display.icon.top_line') ?></th>
  184. <td><input type="checkbox" name="topline_read" value="1"<?=
  185. FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?> /></td>
  186. <td><input type="checkbox" name="topline_favorite" value="1"<?=
  187. FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?> /></td>
  188. <td><input type="checkbox" name="topline_myLabels" value="1"<?=
  189. FreshRSS_Context::userConf()->topline_myLabels ? ' checked="checked"' : '' ?> /></td>
  190. <td><input type="checkbox" disabled="disabled" /></td>
  191. <td><input type="checkbox" name="topline_sharing" value="1"<?=
  192. FreshRSS_Context::userConf()->topline_sharing ? ' checked="checked"' : '' ?> /></td>
  193. <td><input type="checkbox" name="topline_summary" value="1"<?=
  194. FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?> /></td>
  195. <td><input type="checkbox" name="topline_display_authors" value="1"<?=
  196. FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?> /></td>
  197. <td><input type="checkbox" name="topline_date" value="1"<?=
  198. FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?> /></td>
  199. <td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::userConf()->topline_link ? ' checked="checked"' : '' ?> /></td>
  200. </tr><tr>
  201. <th><?= _t('conf.display.icon.bottom_line') ?></th>
  202. <td><input type="checkbox" name="bottomline_read" value="1"<?=
  203. FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?> /></td>
  204. <td><input type="checkbox" name="bottomline_favorite" value="1"<?=
  205. FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?> /></td>
  206. <td><input type="checkbox" name="bottomline_myLabels" value="1"<?=
  207. FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?> /></td>
  208. <td><input type="checkbox" name="bottomline_tags" value="1"<?=
  209. FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?> /></td>
  210. <td><input type="checkbox" name="bottomline_sharing" value="1"<?=
  211. FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?> /></td>
  212. <td><input type="checkbox" disabled="disabled" /></td>
  213. <td><input type="checkbox" disabled="disabled" /></td>
  214. <td><input type="checkbox" name="bottomline_date" value="1"<?=
  215. FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?> /></td>
  216. <td><input type="checkbox" name="bottomline_link" value="1"<?=
  217. FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?> /></td>
  218. </tr>
  219. </tbody>
  220. </table>
  221. </div>
  222. </div>
  223. <div class="form-group">
  224. <div class="group-controls">
  225. <label class="checkbox" for="html5_enable_notif">
  226. <input type="checkbox" name="html5_enable_notif" id="html5_enable_notif" value="1"<?=
  227. FreshRSS_Context::userConf()->html5_enable_notif ? ' checked="checked"' : '' ?> />
  228. <?= _t('conf.notification.html5_enable_notif') ?>
  229. </label>
  230. </div>
  231. </div>
  232. <div class="form-group">
  233. <label class="group-name" for="html5_notif_timeout"><?= _t('conf.display.notif_html5.timeout') ?></label>
  234. <div class="group-controls">
  235. <input type="number" min="0" max="60" id="html5_notif_timeout" name="html5_notif_timeout" value="<?=
  236. FreshRSS_Context::userConf()->html5_notif_timeout ?>" /> <?= _t('conf.display.notif_html5.seconds') ?>
  237. </div>
  238. </div>
  239. <div class="form-group">
  240. <label class="group-name" for="good_notification_timeout"><?= _t('conf.notification_timeout.good.label') ?></label>
  241. <div class="group-controls">
  242. <input type="number" min="0" max="60" id="good_notification_timeout" name="good_notification_timeout" value="<?=
  243. FreshRSS_Context::userConf()->good_notification_timeout ?>" /> <?= _t('conf.notification_timeout.good.seconds') ?>
  244. </div>
  245. </div>
  246. <div class="form-group">
  247. <label class="group-name" for="bad_notification_timeout"><?= _t('conf.notification_timeout.bad.label') ?></label>
  248. <div class="group-controls">
  249. <input type="number" min="1" max="60" id="bad_notification_timeout" name="bad_notification_timeout" value="<?=
  250. FreshRSS_Context::userConf()->bad_notification_timeout ?>" /> <?= _t('conf.notification_timeout.bad.seconds') ?>
  251. </div>
  252. </div>
  253. <div class="form-group">
  254. <div class="group-controls">
  255. <label class="checkbox" for="show_nav_buttons">
  256. <input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?=
  257. FreshRSS_Context::userConf()->show_nav_buttons ? ' checked="checked"' : '' ?> />
  258. <?= _t('conf.display.show_nav_buttons') ?>
  259. </label>
  260. </div>
  261. </div>
  262. <div class="form-group">
  263. <div class="group-controls">
  264. <label class="checkbox" for="sidebar_hidden_by_default">
  265. <input type="checkbox" name="sidebar_hidden_by_default" id="sidebar_hidden_by_default" value="1"<?=
  266. FreshRSS_Context::userConf()->sidebar_hidden_by_default ? ' checked="checked"' : '' ?> />
  267. <?= _t('conf.display.sidebar_hidden_by_default') ?>
  268. </label>
  269. </div>
  270. </div>
  271. <div class="form-group form-actions">
  272. <div class="group-controls">
  273. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  274. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  275. </div>
  276. </div>
  277. </form>
  278. </main>