display.phtml 13 KB

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