mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-17 10:33:04 -04:00
* feature(normal) - Remember opened categories in the left menu
Session storage based implementation to remember opened categories in left menu
Issue Ref: #2248
* lib_phpQuery updates
* Updates covering feedback points and functionality fixes
* Feedback updates
* Revert "lib_phpQuery updates"
This reverts commit dcd23b9418.
* First review
Change variable name to "remember" instead of "open".
Start using localStorage instead of sessionStorage.
Simplify code.
* Simplify remember categories init function
Replace 'session' with 'local' in function names and comment
Set open categories CSS as same as when category is opened in 'active' unfold mode
* Remove URLSearchParams check in remember categories init function
* Delete open categories on login and logout
* JSHint check fix
* Second review
* Make new mode the default for new users
* Always open active category
* Reduce / simplify code
* i18n French
* Revert default value
Wait a bit more for this decision / change
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
200 lines
11 KiB
PHTML
200 lines
11 KiB
PHTML
<?php $this->partial('aside_configure'); ?>
|
|
|
|
<div class="post">
|
|
<a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
|
|
|
|
<form method="post" action="<?= _url('configure', 'reading') ?>">
|
|
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
|
<legend><?= _t('conf.reading') ?></legend>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name" for="posts_per_page"><?= _t('conf.reading.articles_per_page') ?></label>
|
|
<div class="group-controls">
|
|
<input type="number" id="posts_per_page" name="posts_per_page" value="<?= FreshRSS_Context::$user_conf->posts_per_page ?>" min="5" max="500" data-leave-validation="<?= FreshRSS_Context::$user_conf->posts_per_page ?>"/>
|
|
<p class="help"><?= _i('help') ?> <?= _t('conf.reading.number_divided_when_reader') ?></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name" for="sort_order"><?= _t('conf.reading.sort') ?></label>
|
|
<div class="group-controls">
|
|
<select name="sort_order" id="sort_order" data-leave-validation="<?= FreshRSS_Context::$user_conf->sort_order ?>">
|
|
<option value="DESC"<?= FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.newer_first') ?></option>
|
|
<option value="ASC"<?= FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.older_first') ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name" for="view_mode"><?= _t('conf.reading.view.default') ?></label>
|
|
<div class="group-controls">
|
|
<select name="view_mode" id="view_mode" data-leave-validation="<?= FreshRSS_Context::$user_conf->view_mode ?>">
|
|
<option value="normal"<?= FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.normal') ?></option>
|
|
<option value="reader"<?= FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.reader') ?></option>
|
|
<option value="global"<?= FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.global') ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name" for="default_view"><?= _t('conf.reading.show') ?></label>
|
|
<div class="group-controls">
|
|
<select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::$user_conf->default_view ?>">
|
|
<option value="adaptive"<?= FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option>
|
|
<option value="all"<?= FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option>
|
|
<option value="unread"<?= FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name" for="default_view"><?= _t('conf.reading.display_categories_unfolded') ?></label>
|
|
<div class="group-controls">
|
|
<select name="display_categories" id="display_categories" data-leave-validation="<?= FreshRSS_Context::$user_conf->display_categories ?>">
|
|
<option value="active"<?= FreshRSS_Context::$user_conf->display_categories === 'active' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.active_category') ?></option>
|
|
<option value="remember"<?= FreshRSS_Context::$user_conf->display_categories === 'remember' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.remember_categories') ?></option>
|
|
<option value="all"<?= FreshRSS_Context::$user_conf->display_categories === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_categories') ?></option>
|
|
<option value="none"<?= FreshRSS_Context::$user_conf->display_categories === 'none' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.no_category') ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="hide_read_feeds">
|
|
<input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?= FreshRSS_Context::$user_conf->hide_read_feeds ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->hide_read_feeds ?>"/>
|
|
<?= _t('conf.reading.hide_read_feeds') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="show_fav_unread">
|
|
<input type="checkbox" name="show_fav_unread" id="show_fav_unread" value="1"<?= FreshRSS_Context::$user_conf->show_fav_unread ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->show_fav_unread ?>"/>
|
|
<?= _t('conf.reading.always_show_favorites') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="display_posts">
|
|
<input type="checkbox" name="display_posts" id="display_posts" value="1"<?= FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->display_posts ?>"/>
|
|
<?= _t('conf.reading.display_articles_unfolded') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="sticky_post">
|
|
<input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?= FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->sticky_post ?>"/>
|
|
<?= _t('conf.reading.sticky_post') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="auto_load_more">
|
|
<input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?= FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_load_more ?>"/>
|
|
<?= _t('conf.reading.auto_load_more') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="lazyload">
|
|
<input type="checkbox" name="lazyload" id="lazyload" value="1"<?= FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->lazyload ?>"/>
|
|
<?= _t('conf.reading.img_with_lazyload') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="sides_close_article">
|
|
<input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?= FreshRSS_Context::$user_conf->sides_close_article ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->sides_close_article ?>"/>
|
|
<?= _t('conf.reading.sides_close_article') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="reading_confirm">
|
|
<input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?= FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->reading_confirm ?>"/>
|
|
<?= _t('conf.reading.confirm_enabled') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="auto_remove_article">
|
|
<input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?= FreshRSS_Context::$user_conf->auto_remove_article ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_remove_article ?>"/>
|
|
<?= _t('conf.reading.auto_remove_article') ?>
|
|
<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="mark_updated_article_unread">
|
|
<input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?= FreshRSS_Context::$user_conf->mark_updated_article_unread ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_updated_article_unread ?>"/>
|
|
<?= _t('conf.reading.mark_updated_article_unread') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name"><?= _t('conf.reading.read.when') ?></label>
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="check_open_article">
|
|
<input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?= FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['article'] ?>"/>
|
|
<?= _t('conf.reading.read.article_viewed') ?>
|
|
</label>
|
|
<label class="checkbox" for="check_open_site">
|
|
<input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?= FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['site'] ?>"/>
|
|
<?= _t('conf.reading.read.article_open_on_website') ?>
|
|
</label>
|
|
<label class="checkbox" for="check_scroll">
|
|
<input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?= FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['scroll'] ?>"/>
|
|
<?= _t('conf.reading.read.scroll') ?>
|
|
</label>
|
|
<label class="checkbox" for="check_reception">
|
|
<input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?= FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['reception'] ?>"/>
|
|
<?= _t('conf.reading.read.upon_reception') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="group-name"><?= _t('conf.reading.after_onread') ?></label>
|
|
<div class="group-controls">
|
|
<label class="checkbox" for="onread_jump_next">
|
|
<input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?= FreshRSS_Context::$user_conf->onread_jump_next ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->onread_jump_next ?>"/>
|
|
<?= _t('conf.reading.jump_next') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group form-actions">
|
|
<div class="group-controls">
|
|
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
|
|
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|