diff options
Diffstat (limited to 'app/views/configure/archiving.phtml')
| -rw-r--r-- | app/views/configure/archiving.phtml | 140 |
1 files changed, 101 insertions, 39 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 09be55fd9..7d76e4dcc 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -1,34 +1,17 @@ <?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('conf.archiving'); ?></legend> - <p><?php echo _i('help'); ?> <?php echo _t('conf.archiving.help'); ?></p> + <form method="post" action="<?= _url('configure', 'archiving') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('conf.archiving') ?></legend> + <p><?= _i('help') ?> <?= _t('conf.archiving.help') ?></p> <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo _t('conf.archiving.delete_after'); ?></label> + <label class="group-name" for="ttl_default"><?= _t('conf.archiving.ttl') ?></label> <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>"/> <?php echo _t('gen.date.month'); ?> - <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo _t('conf.archiving.purge_now'); ?></a> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="keep_history_default"><?php echo _t('conf.archiving.keep_history_by_feed'); ?></label> - <div class="group-controls"> - <select class="number" name="keep_history_default" id="keep_history_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->keep_history_default; ?>"><?php - foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', FreshRSS_Feed::KEEP_HISTORY_INFINITE => '∞') as $v => $t) { - echo '<option value="' . $v . (FreshRSS_Context::$user_conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; - } - ?></select> (<?php echo _t('gen.short.by_default'); ?>) - </div> - </div> - <div class="form-group"> - <label class="group-name" for="ttl_default"><?php echo _t('conf.archiving.ttl'); ?></label> - <div class="group-controls"> - <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->ttl_default; ?>"><?php + <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?= FreshRSS_Context::$user_conf->ttl_default ?>"><?php $found = false; foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', @@ -43,44 +26,123 @@ if (!$found) { echo '<option value="' . intval(FreshRSS_Context::$user_conf->ttl_default) . '" selected="selected">' . intval(FreshRSS_Context::$user_conf->ttl_default) . 's</option>'; } - ?></select> (<?php echo _t('gen.short.by_default'); ?>) + ?></select> (<?= _t('gen.short.by_default') ?>) + </div> + </div> + + <p class="alert alert-warn"> + <?= _t('conf.archiving.policy_warning') ?> + </p> + + <div class="form-group"> + <label class="group-name"><?= _t('conf.archiving.policy') ?><br /><small>(<?= _t('gen.short.by_default') ?>)</small></label> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_max"> + <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? '' : ' checked="checked"' ?> data-leave-validation="<?= empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 0 : 1 ?>"/> + <?= _t('conf.archiving.keep_max') ?> + <?php $keepMax = empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 200 : FreshRSS_Context::$user_conf->archiving['keep_max']; ?> + <input type="number" id="keep_max" name="keep_max" min="0" value="<?= $keepMax ?>" data-leave-validation="<?= $keepMax ?>"/> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_period"> + <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= FreshRSS_Context::$user_conf->volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['enable_keep_period'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_period') ?> + <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>" data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>"/> + <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ?>"> + <option></option> + <option value="P1Y" <?= 'P1Y' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> + <option value="P1M" <?= 'P1M' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> + <option value="P1W" <?= 'P1W' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> + <option value="P1D" <?= 'P1D' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> + <option value="PT1H" <?= 'PT1H' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> + </select> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?= _t('conf.archiving.exception') ?><br /><small>(<?= _t('gen.short.by_default') ?>)</small></label> + <div class="group-controls"> + <label class="checkbox" for="keep_favourites"> + <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_favourites') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="keep_labels"> + <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_labels') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="keep_unreads"> + <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_unreads') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label for="keep_min_default"><?= _t('conf.archiving.keep_min_by_feed') ?> + <input type="number" id="keep_min_default" name="keep_min_default" min="0" value="<?= FreshRSS_Context::$user_conf->archiving['keep_min'] ?>" data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_min'] ?>"> + </label> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> - <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + <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> - <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('conf.archiving.advanced'); ?></legend> + <legend><?= _t('conf.archiving.maintenance') ?></legend> + <form method="post" action="<?= _url('entry', 'purge') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div class="form-group"> - <label class="group-name"><?php echo _t('conf.user.current'); ?></label> + <label class="group-name"><?= _t('conf.user.current') ?></label> <div class="group-controls"> - <?php echo _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)); ?> + <?= _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)) ?> </div> </div> - <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> - <label class="group-name"><?php echo _t('conf.user.users'); ?></label> <div class="group-controls"> - <?php echo format_bytes($this->size_total); ?> + <button type="submit" class="btn btn-important confirm"><?= _t('conf.archiving.purge_now') ?></button> </div> </div> + </form> - <div class="form-group form-actions"> + <form method="post" action="<?= _url('entry', 'optimize') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <div class="form-group"> <div class="group-controls"> <input type="hidden" name="optimiseDatabase" value="1" /> - <button type="submit" class="btn btn-important"><?php echo _t('conf.archiving.optimize'); ?></button> - <?php echo _i('help'); ?> <?php echo _t('conf.archiving.optimize_help'); ?> + <button type="submit" class="btn btn-important"><?= _t('conf.archiving.optimize') ?></button> + <?= _i('help') ?> <?= _t('conf.archiving.optimize_help') ?> </div> </div> - <?php } ?> </form> + + <?php if (FreshRSS_Auth::hasAccess('admin')): ?> + <div class="form-group"> + <label class="group-name"><?= _t('conf.user.users') ?></label> + <div class="group-controls"> + <?= format_bytes($this->size_total) ?> + </div> + </div> + <?php endif; ?> </div> |
