display.phtml 12 KB

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