display.phtml 14 KB

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