display.phtml 13 KB

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