display.phtml 13 KB

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