display.phtml 14 KB

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