diff options
| author | 2014-10-09 15:53:10 +0200 | |
|---|---|---|
| committer | 2014-10-09 15:53:10 +0200 | |
| commit | f97d4b3b6cca4a55636bbd50158f3c57666b0f08 (patch) | |
| tree | 3ca9dd42155228292f0842d65b9b6d90e9140639 /app/views | |
| parent | e51ceb6812e3736aa9b9ce1f2d5181f5b4b6aaa3 (diff) | |
| parent | 444b1552364b39761c3278c7da5152fd3998f216 (diff) | |
Merge branch 'master' into hotfixes
Diffstat (limited to 'app/views')
42 files changed, 1996 insertions, 980 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml new file mode 100644 index 000000000..c9cc7fe02 --- /dev/null +++ b/app/views/configure/archiving.phtml @@ -0,0 +1,79 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> + <legend><?php echo Minz_Translate::t('archiving_configuration'); ?></legend> + <p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('archiving_configuration_help'); ?></p> + + <div class="form-group"> + <label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></label> + <div class="group-controls"> + <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->old_entries; ?>" /> <?php echo Minz_Translate::t('month'); ?> + <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo Minz_Translate::t('purge_now'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="keep_history_default"><?php echo Minz_Translate::t('keep_history'), ' ', Minz_Translate::t('by_feed'); ?></label> + <div class="group-controls"> + <select class="number" name="keep_history_default" id="keep_history_default" required="required"><?php + foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; + } + ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl_default"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl_default" id="ttl_default" required="required"><?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', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->conf->ttl_default == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->conf->ttl_default) . '" selected="selected">' . intval($this->conf->ttl_default) . 's</option>'; + } + ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> + <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + + <div class="form-group"> + <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p> + <div class="group-controls"> + <p><?php echo formatNumber($this->nb_total), ' ', Minz_Translate::t('articles'), ', ', formatBytes($this->size_user); ?></p> + <input type="hidden" name="optimiseDatabase" value="1" /> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('optimize_bdd'); ?></button> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?> + </div> + </div> + + <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + <div class="form-group"> + <p class="group-name"><?php echo Minz_Translate::t('users'); ?></p> + <div class="group-controls"> + <p><?php echo formatBytes($this->size_total); ?></p> + </div> + </div> + <?php } ?> + </form> +</div> diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml index 9dac49ff8..23d1c9fa1 100644 --- a/app/views/configure/categorize.phtml +++ b/app/views/configure/categorize.phtml @@ -1,43 +1,55 @@ -<?php $this->partial ('aside_configure'); ?> +<?php $this->partial ('aside_feed'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url ('configure', 'categorize'); ?>"> - <legend><?php echo Translate::t ('categories_management'); ?> - <a href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Translate::t ('rss_feed_management'); ?></a></legend> + <legend><?php echo Minz_Translate::t ('categories_management'); ?></legend> - <p class="alert alert-warn"><?php echo Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p> + <p class="alert alert-warn"><?php echo Minz_Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p> <?php $i = 0; foreach ($this->categories as $cat) { $i++; ?> <div class="form-group"> <label class="group-name" for="cat_<?php echo $cat->id (); ?>"> - <?php echo Translate::t ('category_number', $i); ?> + <?php echo Minz_Translate::t ('category_number', $i); ?> </label> <div class="group-controls"> - <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> - <a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Translate::t ('ask_empty'); ?></a> (<?php echo Translate::t ('number_feeds', $cat->nbFeed ()); ?>) - <?php if ($cat->id () == $this->defaultCategory->id ()) { ?> - <i class="icon i_help"></i> <?php echo Translate::t ('can_not_be_deleted'); ?> + <div class="stick"> + <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> + + <?php if ($cat->nbFeed () > 0) { ?> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id ()); ?>"> + <?php echo _i('link'); ?> + </a> + <button formaction="<?php echo _url('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>" + class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" + type="submit"><?php echo _t('ask_empty'); ?></button> + <?php } ?> + </div> + (<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>) + + <?php if ($cat->id () === $this->defaultCategory->id ()) { ?> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?> <?php } ?> + <input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" /> </div> </div> <?php } ?> <div class="form-group"> - <label class="group-name" for="new_category"><?php echo Translate::t ('add_category'); ?></label> + <label class="group-name" for="new_category"><?php echo Minz_Translate::t ('add_category'); ?></label> <div class="group-controls"> - <input type="text" id="new_category" name="new_category" placeholder="<?php echo Translate::t ('new_category'); ?>" /> + <input type="text" id="new_category" name="new_category" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" /> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> </div> </div> </form> </div> - -<?php $this->renderHelper ('confirm_action_script'); ?> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 0f89437ac..8eb3a156b 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,184 +1,108 @@ <?php $this->partial ('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url ('configure', 'display'); ?>"> - <legend><?php echo Translate::t ('general_configuration'); ?></legend> + <legend><?php echo Minz_Translate::t ('display_configuration'); ?></legend> <div class="form-group"> - <label class="group-name" for="language"><?php echo Translate::t ('language'); ?></label> + <label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label> <div class="group-controls"> <select name="language" id="language"> <?php $languages = $this->conf->availableLanguages (); ?> <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $this->conf->language () == $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="theme"><?php echo Translate::t ('theme'); ?></label> + <label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label> <div class="group-controls"> - <select name="theme" id="theme"> - <?php foreach ($this->themes as $theme) { ?> - <option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme () == $theme['path'] ? ' selected="selected"' : ''; ?>> - <?php echo $theme['name'] . ' ' . Translate::t ('by') . ' ' . $theme['author']; ?> - </option> - <?php } ?> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo Translate::t ('delete_articles_every'); ?></label> - <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" value="<?php echo $this->conf->oldEntries (); ?>" /> <?php echo Translate::t ('month'); ?> + <select name="theme" id="theme" required=""><?php + $found = false; + foreach ($this->themes as $theme) { + ?><option value="<?php echo $theme['id']; ?>"<?php if ($this->conf->theme === $theme['id']) { echo ' selected="selected"'; $found = true; } ?>><?php + echo $theme['name'] . ' — ' . Minz_Translate::t ('by') . ' ' . $theme['author']; + ?></option><?php + } + if (!$found) { + ?><option selected="selected"></option><?php + } + ?></select> </div> </div> + <?php $width = $this->conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="mail_login"><?php echo Translate::t ('persona_connection_email'); ?></label> - <?php $mail = $this->conf->mailLogin (); ?> - <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" /> - <noscript><b><?php echo Translate::t ('javascript_should_be_activated'); ?></b></noscript> - <label class="checkbox" for="anon_access"> - <input type="checkbox" name="anon_access" id="anon_access" value="yes"<?php echo $this->conf->anonAccess () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('allow_anonymous'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="token"><?php echo Translate::t ('auth_token'); ?></label> - <?php $token = $this->conf->token (); ?> - <div class="group-controls"> - <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>"/> - <i class="icon i_help"></i> <?php echo Translate::t('explain_token', Url::display(), $token); ?> - </div> - </div> - - <legend><?php echo Translate::t ('reading_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="posts_per_page"><?php echo Translate::t ('articles_per_page'); ?></label> - <div class="group-controls"> - <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="sort_order"><?php echo Translate::t ('sort_order'); ?></label> - <div class="group-controls"> - <select name="sort_order" id="sort_order"> - <option value="low_to_high"<?php echo $this->conf->sortOrder () == 'low_to_high' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('newer_first'); ?></option> - <option value="high_to_low"<?php echo $this->conf->sortOrder () == 'high_to_low' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('older_first'); ?></option> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo Translate::t ('default_view'); ?></label> - <div class="group-controls"> - <select name="view_mode" id="view_mode"> - <option value="normal"<?php echo $this->conf->viewMode () == 'normal' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('normal_view'); ?></option> - <option value="reader"<?php echo $this->conf->viewMode () == 'reader' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('reader_view'); ?></option> - <option value="global"<?php echo $this->conf->viewMode () == 'global' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('global_view'); ?></option> + <label class="group-name" for="content_width"><?php echo Minz_Translate::t('content_width'); ?></label> + <div class="group-controls"> + <select name="content_width" id="content_width" required=""> + <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_thin'); ?> + </option> + <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_medium'); ?> + </option> + <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_large'); ?> + </option> + <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_no_limit'); ?> + </option> </select> - <label class="radio" for="radio_all"> - <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('show_all_articles'); ?> - </label> - <label class="radio" for="radio_not_read"> - <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('show_not_reads'); ?> - </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="yes"<?php echo $this->conf->autoLoadMore () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('auto_load_more'); ?> - <?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?> - </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="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('display_articles_unfolded'); ?> - <?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></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="yes"<?php echo $this->conf->lazyload () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('img_with_lazyload'); ?> - <?php echo $this->conf->lazyload () == 'yes' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name"><?php echo Translate::t ('auto_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="yes"<?php echo $this->conf->markWhenArticle () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('article_selected'); ?> - </label> - <label class="checkbox" for="check_open_site"> - <input type="checkbox" name="mark_open_site" id="check_open_site" value="yes"<?php echo $this->conf->markWhenSite () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('article_open_on_website'); ?> - </label> - <label class="checkbox" for="check_scroll"> - <input type="checkbox" name="mark_scroll" id="check_scroll" value="yes"<?php echo $this->conf->markWhenScroll () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('scroll'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name"><?php echo Translate::t ('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="yes"<?php echo $this->conf->onread_jump_next () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('jump_next'); ?> - </label> - </div> - </div> - - <legend><?php echo Translate::t ('sharing'); ?></legend> - <div class="form-group"> - <label class="group-name" for="shaarli"><?php echo Translate::t ('your_shaarli'); ?></label> - <div class="group-controls"> - <input type="text" id="shaarli" name="shaarli" value="<?php echo $this->conf->urlShaarli (); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>"/> - </div> - </div> - - <legend><?php echo Translate::t ('advanced'); ?></legend> + <label class="group-name" for="theme"><?php echo Minz_Translate::t ('article_icons'); ?></label> + <table> + <thead> + <tr> + <th> </th> + <th title="<?php echo Minz_Translate::t ('mark_read'); ?>"><?php echo FreshRSS_Themes::icon('read'); ?></th> + <th title="<?php echo Minz_Translate::t ('mark_favorite'); ?>"><?php echo FreshRSS_Themes::icon('bookmark'); ?></th> + <th><?php echo Minz_Translate::t ('sharing'); ?></th> + <th><?php echo Minz_Translate::t ('related_tags'); ?></th> + <th><?php echo Minz_Translate::t ('publication_date'); ?></th> + <th><?php echo FreshRSS_Themes::icon('link'); ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?php echo Minz_Translate::t ('top_line'); ?></th> + <td><input type="checkbox" name="topline_read" value="1"<?php echo $this->conf->topline_read ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_favorite" value="1"<?php echo $this->conf->topline_favorite ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" disabled="disabled" /></td> + <td><input type="checkbox" disabled="disabled" /></td> + <td><input type="checkbox" name="topline_date" value="1"<?php echo $this->conf->topline_date ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_link" value="1"<?php echo $this->conf->topline_link ? ' checked="checked"' : ''; ?> /></td> + </tr><tr> + <th><?php echo Minz_Translate::t ('bottom_line'); ?></th> + <td><input type="checkbox" name="bottomline_read" value="1"<?php echo $this->conf->bottomline_read ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo $this->conf->bottomline_favorite ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo $this->conf->bottomline_sharing ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo $this->conf->bottomline_tags ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_date" value="1"<?php echo $this->conf->bottomline_date ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_link" value="1"<?php echo $this->conf->bottomline_link ? ' checked="checked"' : ''; ?> /></td> + </tr> + </tbody> + </table><br /> + </div> + <div class="form-group"> - <label class="group-name"></label> + <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('html5_notif_timeout'); ?></label> <div class="group-controls"> - <a class="btn" href="<?php echo _url('entry', 'optimize'); ?>"> - <?php echo Translate::t('optimize_bdd'); ?> - </a> - <i class="icon i_help"></i> <?php echo Translate::t('optimize_todo_sometimes'); ?> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo $this->conf->html5_notif_timeout; ?>" /> <?php echo Minz_Translate::t ('seconds_(0_means_no_timeout)'); ?> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 49e2f3cf1..e96a28739 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -2,62 +2,55 @@ <?php if ($this->flux) { ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Translate::t ('filter'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a> <h1><?php echo $this->flux->name (); ?></h1> <?php echo $this->flux->description (); ?> + <?php $nbEntries = $this->flux->nbEntries (); ?> + <?php if ($this->flux->inError ()) { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo Translate::t ('damn'); ?></span> <?php echo Translate::t ('feed_in_error'); ?></p> + <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p> + <?php } elseif ($nbEntries === 0) { ?> + <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p> <?php } ?> - <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>"> - <legend><?php echo Translate::t ('informations'); ?></legend> - <div class="form-group"> - <label class="group-name" for="name"><?php echo Translate::t ('title'); ?></label> - <div class="group-controls"> - <input type="text" name="name" id="name" value="<?php echo $this->flux->name () ; ?>" /> - </div> - </div> + <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off"> + <legend><?php echo Minz_Translate::t ('informations'); ?></legend> <div class="form-group"> - <label class="group-name"><?php echo Translate::t ('website_url'); ?></label> + <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> <div class="group-controls"> - <span class="control"> - <?php echo $this->flux->website (); ?> - <a target="_blank" href="<?php echo $this->flux->website (); ?>"><i class="icon i_link"></i></a> - </span> + <input type="text" name="name" id="name" class="extend" value="<?php echo $this->flux->name () ; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo Translate::t ('feed_url'); ?></label> + <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> <div class="group-controls"> - <span class="control"> - <?php echo $this->flux->url (); ?> - <a target="_blank" href="<?php echo $this->flux->url (); ?>"><i class="icon i_link"></i></a> - </span> + <textarea name="description" id="description"><?php echo htmlspecialchars($this->flux->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> </div> </div> <div class="form-group"> - <label class="group-name"></label> + <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> <div class="group-controls"> - <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <i class="icon i_refresh"></i> <?php echo Translate::t('actualize'); ?> - </a> + <div class="stick"> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo Translate::t ('number_articles'); ?></label> + <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> <div class="group-controls"> - <span class="control"><?php echo $this->flux->nbEntries (); ?></span> - <label class="checkbox" for="keep_history"> - <input type="checkbox" name="keep_history" id="keep_history" value="yes"<?php echo $this->flux->keepHistory () == 'yes' ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('keep_history'); ?> - </label> + <div class="stick"> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a> </div> </div> - <div class="form-group"> - <label class="group-name" for="category"><?php echo Translate::t ('category'); ?></label> + <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label> <div class="group-controls"> <select name="category" id="category"> <?php foreach ($this->categories as $cat) { ?> @@ -66,54 +59,124 @@ </option> <?php } ?> </select> - <a href="<?php echo _url ('configure', 'categorize'); ?>"><?php echo Translate::t ('categories_management'); ?></a> </div> </div> - - <legend><?php echo Translate::t ('advanced'); ?></legend> <div class="form-group"> - <label class="group-name" for="priority"><?php echo Translate::t ('show_in_all_flux'); ?></label> + <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label> <div class="group-controls"> <label class="checkbox" for="priority"> <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> /> - <?php echo Translate::t ('yes'); ?> + <?php echo Minz_Translate::t ('yes'); ?> </label> </div> </div> <div class="form-group"> - <label class="group-name" for="path_entries"><?php echo Translate::t ('css_path_on_website'); ?></label> <div class="group-controls"> - <input type="text" name="path_entries" id="path_entries" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" /> - <i class="icon i_help"></i> <?php echo Translate::t ('retrieve_truncated_feeds'); ?> + <a href="<?php echo _url('stats', 'repartition', 'id', $this->flux->id()); ?>"> + <?php echo _i('stats'); ?> <?php echo _t('stats'); ?> + </a> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('save'); ?></button> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('feed', 'delete', 'id', $this->flux->id ()); ?>" + formmethod="post"><?php echo _t('delete'); ?></button> </div> </div> + <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> + + <div class="form-group"> + <div class="group-controls"> + <div class="stick"> + <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" /> + <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->flux->id ()); ?>"> + <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?> + </a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label> + <div class="group-controls"> + <select class="number" name="keep_history" id="keep_history" required="required"><?php + foreach (array('' => '', -2 => Minz_Translate::t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + } + ?></select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 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', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->flux->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend> <?php $auth = $this->flux->httpAuth (false); ?> <div class="form-group"> - <label class="group-name" for="http_user"><?php echo Translate::t ('http_username'); ?></label> + <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label> <div class="group-controls"> - <input type="text" name="http_user" id="http_user" value="<?php echo $auth['username']; ?>" /> - <i class="icon i_help"></i> <?php echo Translate::t ('access_protected_feeds'); ?> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?> </div> - <label class="group-name" for="http_pass"><?php echo Translate::t ('http_password'); ?></label> + <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label> <div class="group-controls"> - <input type="password" name="http_pass" id="http_pass" value="<?php echo $auth['password']; ?>" /> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> </div> </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + <div class="form-group"> + <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label> + <div class="group-controls"> + <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" /> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?> + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> - <button class="btn btn-important"><?php echo Translate::t ('save'); ?></button> - <button class="btn btn-attention confirm" formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Translate::t ('delete'); ?></button> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> </div> </div> </form> </div> -<?php $this->renderHelper ('confirm_action_script'); ?> - <?php } else { ?> -<div class="alert alert-warn"><span class="alert-head"><?php echo Translate::t ('no_selected_feed'); ?></span> <?php echo Translate::t ('think_to_add'); ?></div> +<div class="alert alert-warn"><span class="alert-head"><?php echo Minz_Translate::t ('no_selected_feed'); ?></span> <?php echo Minz_Translate::t ('think_to_add'); ?></div> <?php } ?> diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml deleted file mode 100644 index 4cc575356..000000000 --- a/app/views/configure/importExport.phtml +++ /dev/null @@ -1,37 +0,0 @@ -<?php if ($this->req == 'export') { ?> -<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; // résout bug sur certain serveur ?> -<!-- Generated by <?php echo Configuration::title (); ?> --> -<opml version="2.0"> - <head> - <title><?php echo Configuration::title (); ?> OPML Feed</title> - <dateCreated><?php echo date('D, d M Y H:i:s'); ?></dateCreated> - </head> - <body> -<?php echo opml_export ($this->categories); ?> - </body> -</opml> -<?php } else { ?> -<?php $this->partial ('aside_feed'); ?> - -<div class="post "> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> - - <form method="post" action="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data"> - <legend><?php echo Translate::t ('import_export_opml'); ?></legend> - <div class="form-group"> - <label class="group-name" for="file"><?php echo Translate::t ('file_to_import'); ?></label> - <div class="group-controls"> - <input type="file" name="file" id="file" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Translate::t ('import'); ?></button> - <?php echo Translate::t ('or'); ?> - <a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Translate::t ('export'); ?></a> - </div> - </div> - </form> -</div> -<?php } ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml new file mode 100644 index 000000000..e778ce078 --- /dev/null +++ b/app/views/configure/queries.phtml @@ -0,0 +1,97 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'queries'); ?>"> + <legend><?php echo _t('queries'); ?></legend> + + <?php foreach ($this->conf->queries as $key => $query) { ?> + <div class="form-group" id="query-group-<?php echo $key; ?>"> + <label class="group-name" for="queries_<?php echo $key; ?>_name"> + <?php echo _t('query_number', $key + 1); ?> + </label> + + <div class="group-controls"> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][search]" value="<?php echo isset($query['search']) ? $query['search'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_state" name="queries[<?php echo $key; ?>][state]" value="<?php echo isset($query['state']) ? $query['state'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_order" name="queries[<?php echo $key; ?>][order]" value="<?php echo isset($query['order']) ? $query['order'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_get" name="queries[<?php echo $key; ?>][get]" value="<?php echo isset($query['get']) ? $query['get'] : ""; ?>"/> + + <div class="stick"> + <input class="extend" + type="text" + id="queries_<?php echo $key; ?>_name" + name="queries[<?php echo $key; ?>][name]" + value="<?php echo $query['name']; ?>" + /> + + <a class="btn" href="<?php echo $query['url']; ?>"> + <?php echo _i('link'); ?> + </a> + + <a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>"> + <?php echo _i('close'); ?> + </a> + </div> + + <?php + $exist = (isset($query['search']) ? 1 : 0) + + (isset($query['state']) ? 1 : 0) + + (isset($query['order']) ? 1 : 0) + + (isset($query['get']) ? 1 : 0); + // If the only filter is "all" articles, we consider there is no filter + $exist = ($exist === 1 && isset($query['get']) && $query['get'] === 'a') ? 0 : $exist; + + $deprecated = (isset($this->query_get[$key]) && + $this->query_get[$key]['deprecated']); + ?> + + <?php if ($exist === 0) { ?> + <div class="alert alert-warn"> + <div class="alert-head"><?php echo _t('no_query_filter'); ?></div> + </div> + <?php } elseif ($deprecated) { ?> + <div class="alert alert-error"> + <div class="alert-head"><?php echo _t('query_deprecated'); ?></div> + </div> + <?php } else { ?> + <div class="alert alert-success"> + <div class="alert-head"><?php echo _t('query_filter'); ?></div> + + <ul> + <?php if (isset($query['search'])) { ?> + <li class="item"><?php echo _t('query_search', $query['search']); ?></li> + <?php } ?> + + <?php if (isset($query['state'])) { ?> + <li class="item"><?php echo _t('query_state_' . $query['state']); ?></li> + <?php } ?> + + <?php if (isset($query['order'])) { ?> + <li class="item"><?php echo _t('query_order_' . strtolower($query['order'])); ?></li> + <?php } ?> + + <?php if (isset($query['get'])) { ?> + <li class="item"><?php echo _t('query_get_' . $this->query_get[$key]['type'], $this->query_get[$key]['name']); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> + </div> + </div> + <?php } ?> + + <?php if (count($this->conf->queries) > 0) { ?> + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button> + <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + </div> + </div> + <?php } else { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('no_query'); ?></p> + <?php } ?> + </form> + +</div>
\ No newline at end of file diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml new file mode 100644 index 000000000..8b2da2a28 --- /dev/null +++ b/app/views/configure/reading.phtml @@ -0,0 +1,158 @@ +<?php $this->partial ('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url ('configure', 'reading'); ?>"> + <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label> + <div class="group-controls"> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" min="5" max="50" /> + <?php echo _i('help'); ?> <?php echo _t('number_divided_when_reader'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label> + <div class="group-controls"> + <select name="sort_order" id="sort_order"> + <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option> + <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <div class="group-controls"> + <select name="view_mode" id="view_mode"> + <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option> + <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option> + <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo _t('articles_to_display'); ?></label> + <div class="group-controls"> + <select name="default_view" id="default_view"> + <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_adaptive'); ?></option> + <option value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' selected="selected"' : ''; ?>><?php echo _t('show_all_articles'); ?></option> + <option value="<?php echo FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></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"<?php echo $this->conf->hide_read_feeds ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t('hide_read_feeds'); ?> + </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"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('display_articles_unfolded'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_categories"> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?php echo $this->conf->display_categories ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('display_categories_unfolded'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_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"<?php echo $this->conf->sticky_post ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('sticky_post'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_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"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('auto_load_more'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_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"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('img_with_lazyload'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_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"<?php echo $this->conf->reading_confirm ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('reading_confirm'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t ('auto_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"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t('article_viewed'); ?> + </label> + <label class="checkbox" for="check_open_site"> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('article_open_on_website'); ?> + </label> + <label class="checkbox" for="check_scroll"> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('scroll'); ?> + </label> + <label class="checkbox" for="check_reception"> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('upon_reception'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t ('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"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('jump_next'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + + </form> +</div> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml new file mode 100644 index 000000000..02ce331da --- /dev/null +++ b/app/views/configure/sharing.phtml @@ -0,0 +1,59 @@ +<?php $this->partial ('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>" + data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' + data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /> + <div class="stick"> + <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> + <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a></div> + <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a> + </div></div>'> + <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> + <?php foreach ($this->conf->sharing as $key => $sharing): ?> + <?php $share = $this->conf->shares[$sharing['type']]; ?> + <div class="form-group" id="group-share-<?php echo $key; ?>"> + <label class="group-name"> + <?php echo Minz_Translate::t ($sharing['type']); ?> + </label> + <div class="group-controls"> + <input type='hidden' id='share_<?php echo $key;?>_type' name="share[<?php echo $key;?>][type]" value='<?php echo $sharing['type']?>' /> + <?php if ($share['form'] === 'advanced') { ?> + <div class="stick"> + <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> + <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + </div> + + <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a> + <?php } else { ?> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <?php } ?> + </div> + </div> + <?php endforeach;?> + + <div class="form-group"> + <div class="group-controls"> + <select> + <?php foreach($this->conf->shares as $key => $params):?> + <option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo Minz_Translate::t($key) ?></option> + <?php endforeach; ?> + </select> + <a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 01e66adb4..a4029b676 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -1,7 +1,7 @@ <?php $this->partial ('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <datalist id="keys"> <?php foreach ($this->list_keys as $key) { ?> @@ -9,55 +9,119 @@ <?php } ?> </datalist> - <?php $s = $this->conf->shortcuts (); ?> + <?php $s = $this->conf->shortcuts; ?> <form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>"> - <legend><?php echo Translate::t ('shortcuts_management'); ?></legend> + <legend><?php echo Minz_Translate::t ('shortcuts'); ?></legend> - <noscript><p class="alert alert-error"><?php echo Translate::t ('javascript_for_shortcuts'); ?></p></noscript> + <noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript> + + <legend><?php echo Minz_Translate::t ('shortcuts_navigation'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_article'); ?></label> + <div class="group-controls"> + <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="prev_entry"><?php echo Minz_Translate::t ('previous_article'); ?></label> + <div class="group-controls"> + <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="first_entry"><?php echo Minz_Translate::t ('first_article'); ?></label> + <div class="group-controls"> + <input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="last_entry"><?php echo Minz_Translate::t ('last_article'); ?></label> + <div class="group-controls"> + <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" /> + </div> + </div> + + <div><?php echo Minz_Translate::t ('shortcuts_navigation_help');?></div> + + <legend><?php echo Minz_Translate::t ('shortcuts_article_action');?></legend> <div class="form-group"> - <label class="group-name" for="mark_read"><?php echo Translate::t ('mark_read'); ?></label> + <label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></label> <div class="group-controls"> <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" /> - <?php echo Translate::t ('shift_for_all_read'); ?> + <?php echo Minz_Translate::t ('shift_for_all_read'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="mark_favorite"><?php echo Translate::t ('mark_favorite'); ?></label> + <label class="group-name" for="mark_favorite"><?php echo Minz_Translate::t ('mark_favorite'); ?></label> <div class="group-controls"> <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="go_website"><?php echo Translate::t ('see_on_website'); ?></label> + <label class="group-name" for="go_website"><?php echo Minz_Translate::t ('see_on_website'); ?></label> <div class="group-controls"> <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="next_entry"><?php echo Translate::t ('next_article'); ?></label> + <label class="group-name" for="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label> <div class="group-controls"> - <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" /> - <?php echo Translate::t ('shift_for_last'); ?> + <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" /> + <?php echo Minz_Translate::t ('auto_share_help'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="prev_entry"><?php echo Translate::t ('previous_article'); ?></label> + <label class="group-name" for="collapse_entry"><?php echo Minz_Translate::t ('collapse_article'); ?></label> <div class="group-controls"> - <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" /> - <?php echo Translate::t ('shift_for_first'); ?> + <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" /> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('shortcuts_other_action');?></legend> + + <div class="form-group"> + <label class="group-name" for="load_more_shortcut"><?php echo Minz_Translate::t ('load_more'); ?></label> + <div class="group-controls"> + <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="focus_search_shortcut"><?php echo Minz_Translate::t ('focus_search'); ?></label> + <div class="group-controls"> + <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="user_filter_shortcut"><?php echo Minz_Translate::t ('user_filter'); ?></label> + <div class="group-controls"> + <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?php echo $s['user_filter']; ?>" /> + <?php echo Minz_Translate::t ('user_filter_help'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="help_shortcut"><?php echo Minz_Translate::t ('help'); ?></label> + <div class="group-controls"> + <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" /> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml new file mode 100644 index 000000000..272896fb2 --- /dev/null +++ b/app/views/configure/users.phtml @@ -0,0 +1,211 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('users', 'auth'); ?>"> + <legend><?php echo Minz_Translate::t('login_configuration'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="current_user"><?php echo Minz_Translate::t('current_user'); ?></label> + <div class="group-controls"> + <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <label class="checkbox" for="is_admin"> + <input type="checkbox" id="is_admin" disabled="disabled" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? 'checked="checked" ' : ''; ?>/> + <?php echo Minz_Translate::t('is_admin'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <?php if (Minz_Configuration::apiEnabled()) { ?> + <div class="form-group"> + <label class="group-name" for="apiPasswordPlain"><?php echo Minz_Translate::t('password_api'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> + <?php $mail = $this->conf->mail_login; ?> + <div class="group-controls"> + <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> + <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + + <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + + <legend><?php echo Minz_Translate::t('auth_type'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label> + <div class="group-controls"> + <select id="auth_type" name="auth_type" required="required"> + <?php if (!in_array(Minz_Configuration::authType(), array('form', 'persona', 'http_auth', 'none'))) { ?> + <option selected="selected"></option> + <?php } ?> + <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> + <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option> + <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_access"> + <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '', + Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_refresh"> + <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo Minz_Configuration::allowAnonymousRefresh() ? ' checked="checked"' : '', + Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('allow_anonymous_refresh'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="unsafe_autologin"> + <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo Minz_Configuration::unsafeAutologinEnabled() ? ' checked="checked"' : '', + Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('unsafe_autologin'); ?> + <kbd>p/i/?a=formLogin&u=Alice&p=1234</kbd> + </label> + </div> + </div> + + <?php if (Minz_Configuration::canLogIn()) { ?> + <div class="form-group"> + <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label> + <?php $token = $this->conf->token; ?> + <div class="group-controls"> + <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php + echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="api_enabled"> + <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo Minz_Configuration::apiEnabled() ? ' checked="checked"' : '', + Minz_Configuration::needsLogin() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('api_enabled'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('users', 'delete'); ?>"> + <legend><?php echo Minz_Translate::t('users'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label> + <div class="group-controls"> + <select id="users_list" name="username"><?php + foreach (listUsers() as $user) { + echo '<option>', $user, '</option>'; + } + ?></select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('users', 'create'); ?>"> + <legend><?php echo Minz_Translate::t('create_user'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label> + <div class="group-controls"> + <select name="new_user_language" id="new_user_language"> + <?php $languages = $this->conf->availableLanguages (); ?> + <?php foreach ($languages as $short => $lib) { ?> + <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label> + <div class="group-controls"> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> + <?php $mail = $this->conf->mail_login; ?> + <div class="group-controls"> + <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + + </form> + + <?php } ?> +</div> diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index 1ff1c220c..c1fc32b7f 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,15 +1,16 @@ <?php +header('Content-Type: application/json; charset=UTF-8'); -if (Request::param ('is_favorite')) { - Request::_param ('is_favorite', 0); +if (Minz_Request::param ('is_favorite', true)) { + Minz_Request::_param ('is_favorite', 0); } else { - Request::_param ('is_favorite', 1); + Minz_Request::_param ('is_favorite', 1); } -$url = Url::display (array ( - 'c' => Request::controllerName (), - 'a' => Request::actionName (), - 'params' => Request::params (), +$url = Minz_Url::display (array ( + 'c' => Minz_Request::controllerName (), + 'a' => Minz_Request::actionName (), + 'params' => Minz_Request::params (), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 6d3313a89..9e79d4c07 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,15 +1,16 @@ <?php +header('Content-Type: application/json; charset=UTF-8'); -if (Request::param ('is_read')) { - Request::_param ('is_read', 0); +if (Minz_Request::param ('is_read', true)) { + Minz_Request::_param ('is_read', 0); } else { - Request::_param ('is_read', 1); + Minz_Request::_param ('is_read', 1); } -$url = Url::display (array ( - 'c' => Request::controllerName (), - 'a' => Request::actionName (), - 'params' => Request::params (), +$url = Minz_Url::display (array ( + 'c' => Minz_Request::controllerName (), + 'a' => Minz_Request::actionName (), + 'params' => Minz_Request::params (), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read'))); diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index d5d090c72..ef4fbd39d 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -1,10 +1,9 @@ <div class="post"> <div class="alert alert-error"> <h1 class="alert-head"><?php echo $this->code; ?></h1> - <p> - <?php echo Translate::t ('page_not_found'); ?><br /> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <?php echo $this->errorMessage; ?><br /> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> </p> </div> </div> diff --git a/app/views/feed/actualize.phtml b/app/views/feed/actualize.phtml new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/app/views/feed/actualize.phtml @@ -0,0 +1 @@ +OK diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml new file mode 100644 index 000000000..849dacac6 --- /dev/null +++ b/app/views/feed/add.phtml @@ -0,0 +1,91 @@ +<?php if ($this->feed) { ?> +<div class="post"> + <h1><?php echo Minz_Translate::t ('add_rss_feed'); ?></h1> + + <?php if (!$this->load_ok) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t('damn'); ?></span> <?php echo Minz_Translate::t('internal_problem_feed', _url('index', 'logs')); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <legend><?php echo Minz_Translate::t('informations'); ?></legend> + <?php if ($this->load_ok) { ?> + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('title'); ?></label> + <div class="group-controls"> + <label><?php echo $this->feed->name() ; ?></label> + </div> + </div> + + <?php $desc = $this->feed->description(); if ($desc != '') { ?> + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('feed_description'); ?></label> + <div class="group-controls"> + <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('website_url'); ?></label> + <div class="group-controls"> + <?php echo $this->feed->website(); ?> + <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="url"><?php echo Minz_Translate::t('feed_url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo Minz_Translate::t('feed_validator'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo Minz_Translate::t('category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo Minz_Translate::t('new_category'); ?></option> + </select> + + <span style="display: none;"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t('new_category'); ?>" /> + </span> + </div> + </div> + + <legend><?php echo Minz_Translate::t('http_authentication'); ?></legend> + <?php $auth = $this->feed->httpAuth(false); ?> + <div class="form-group"> + <label class="group-name" for="http_user"><?php echo Minz_Translate::t('http_username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + </div> + + <label class="group-name" for="http_pass"><?php echo Minz_Translate::t('http_password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + + <div class="group-controls"> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('access_protected_feeds'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + </form> +</div> +<?php } ?> diff --git a/app/views/helpers/confirm_action_script.phtml b/app/views/helpers/confirm_action_script.phtml deleted file mode 100644 index f77006fcc..000000000 --- a/app/views/helpers/confirm_action_script.phtml +++ /dev/null @@ -1,5 +0,0 @@ -<script type="text/javascript"> - $('.confirm').click(function () { - return confirm("<?php echo Translate::t('confirm_action'); ?>"); - }); -</script>
\ No newline at end of file diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml new file mode 100644 index 000000000..ffdca1daa --- /dev/null +++ b/app/views/helpers/export/articles.phtml @@ -0,0 +1,47 @@ +<?php + $username = Minz_Session::param('currentUser', '_'); + + $articles = array( + 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type, + 'title' => $this->list_title, + 'author' => $username, + 'items' => array() + ); + + foreach ($this->entries as $entry) { + if (!isset($this->feed)) { + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $entry->feed ()); + } else { + $feed = $this->feed; + } + + $articles['items'][] = array( + 'id' => $entry->guid(), + 'categories' => array_values($entry->tags()), + 'title' => $entry->title(), + 'author' => $entry->author(), + 'published' => $entry->date(true), + 'updated' => $entry->date(true), + 'alternate' => array(array( + 'href' => $entry->link(), + 'type' => 'text/html' + )), + 'content' => array( + 'content' => $entry->content() + ), + 'origin' => array( + 'streamId' => $feed->id(), + 'title' => $feed->name(), + 'htmlUrl' => $feed->website(), + 'feedUrl' => $feed->url() + ) + ); + } + + $options = 0; + if (version_compare(PHP_VERSION, '5.4.0') >= 0) { + $options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + echo json_encode($articles, $options); +?> diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml new file mode 100644 index 000000000..8622d9144 --- /dev/null +++ b/app/views/helpers/export/opml.phtml @@ -0,0 +1,28 @@ +<?php + +$opml_array = array( + 'head' => array( + 'title' => Minz_Configuration::title(), + 'dateCreated' => date('D, d M Y H:i:s') + ), + 'body' => array() +); + +foreach ($this->categories as $key => $cat) { + $opml_array['body'][$key] = array( + 'text' => $cat['name'], + '@outlines' => array() + ); + + foreach ($cat['feeds'] as $feed) { + $opml_array['body'][$key]['@outlines'][] = array( + 'text' => htmlspecialchars_decode($feed->name()), + 'type' => 'rss', + 'xmlUrl' => htmlspecialchars_decode($feed->url()), + 'htmlUrl' => htmlspecialchars_decode($feed->website()), + 'description' => htmlspecialchars_decode($feed->description()), + ); + } +} + +echo libopml_render($opml_array); diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml new file mode 100644 index 000000000..1139eb446 --- /dev/null +++ b/app/views/helpers/javascript_vars.phtml @@ -0,0 +1,61 @@ +<?php + +echo '"use strict";', "\n"; + +$mark = $this->conf->mark_when; +echo 'var ', + 'help_url="', FRESHRSS_WIKI, '"', + ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', + ',auto_mark_article=', $mark['article'] ? 'true' : 'false', + ',auto_mark_site=', $mark['site'] ? 'true' : 'false', + ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', + ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', + ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false', + ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false'; + +$s = $this->conf->shortcuts; +echo ',shortcuts={', + 'mark_read:"', $s['mark_read'], '",', + 'mark_favorite:"', $s['mark_favorite'], '",', + 'go_website:"', $s['go_website'], '",', + 'prev_entry:"', $s['prev_entry'], '",', + 'next_entry:"', $s['next_entry'], '",', + 'first_entry:"', $s['first_entry'], '",', + 'last_entry:"', $s['last_entry'], '",', + 'collapse_entry:"', $s['collapse_entry'], '",', + 'load_more:"', $s['load_more'], '",', + 'auto_share:"', $s['auto_share'], '",', + 'focus_search:"', $s['focus_search'], '",', + 'user_filter:"', $s['user_filter'], '",', + 'help:"', $s['help'], '"', +"},\n"; + +if (Minz_Request::param ('output') === 'global') { + echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; +} + +$authType = Minz_Configuration::authType(); +if ($authType === 'persona') { + // If user is disconnected, current_user_mail MUST be null + $mail = Minz_Session::param ('mail', false); + if ($mail) { + echo 'current_user_mail="' . $mail . '",'; + } else { + echo 'current_user_mail=null,'; + } +} + +echo 'authType="', $authType, '",', + 'url_freshrss="', _url ('index', 'index'), '",', + 'url_login="', _url ('index', 'login'), '",', + 'url_logout="', _url ('index', 'logout'), '",'; + +echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; +echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; +echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; +echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; + + +$autoActualise = Minz_Session::param('actualize_feeds', false); +echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index 9f1d6cb23..e3d14810e 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -1,7 +1,7 @@ <?php - $c = Request::controllerName (); - $a = Request::actionName (); - $params = Request::params (); + $c = Minz_Request::controllerName (); + $a = Minz_Request::actionName (); + $params = Minz_Request::params (); ?> <?php if ($this->nbPage > 1) { ?> @@ -9,14 +9,14 @@ <?php $params[$getteur] = 1; ?> <li class="item pager-first"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Translate::t('first'); ?></a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a> <?php } ?> </li> <?php $params[$getteur] = $this->currentPage - 1; ?> <li class="item pager-previous"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Translate::t('previous'); ?></a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a> <?php } ?> </li> @@ -24,7 +24,7 @@ <?php if($i > 0 && $i <= $this->nbPage) { ?> <?php if ($i != $this->currentPage) { ?> <?php $params[$getteur] = $i; ?> - <li class="item pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <li class="item pager-item"><a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> <?php } else { ?> <li class="item pager-current"><?php echo $i; ?></li> <?php } ?> @@ -34,13 +34,13 @@ <?php $params[$getteur] = $this->currentPage + 1; ?> <li class="item pager-next"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('next'); ?> ›</a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a> <?php } ?> </li> <?php $params[$getteur] = $this->nbPage; ?> <li class="item pager-last"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('last'); ?> »</a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index 0018a951e..cea338364 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,20 +1,37 @@ <?php - $c = Request::controllerName (); - $a = Request::actionName (); - $params = Request::params (); + $c = Minz_Request::controllerName(); + $a = Minz_Request::actionName(); + $params = Minz_Request::params(); + $markReadUrl = Minz_Session::param('markReadUrl'); + Minz_Session::_param('markReadUrl', false); ?> +<form id="mark-read-pagination" method="post" style="display: none"></form> + <ul class="pagination"> <li class="item pager-next"> - <?php if ($this->next != '') { ?> - <?php $params[$getteur] = $this->next; ?> - <a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a> + <?php if (!empty($this->nextId)) { ?> + <?php + $params['next'] = $this->nextId; + $params['ajax'] = 1; + ?> + <a id="load_more" href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"> + <?php echo _t('load_more'); ?> + </a> + <?php } elseif ($markReadUrl) { ?> + <button id="bigMarkAsRead" + class="as-link <?php echo $this->conf->reading_confirm ? 'confirm' : ''; ?>" + form="mark-read-pagination" + formaction="<?php echo $markReadUrl; ?>" + type="submit"> + <?php echo _t('nothing_to_load'); ?><br /> + <span class="bigTick">✓</span><br /> + <?php echo _t('mark_all_read'); ?> + </button> <?php } else { ?> - <div class="bigMarkAsRead"> - <p><?php echo Translate::t ('nothing_to_load'); ?></p> - <p class="bigTick">✔</p> - <p><?php echo Translate::t ('mark_all_read'); ?></p> - </div> + <a id="bigMarkAsRead" href="."> + <?php echo _t('nothing_to_load'); ?><br /> + </a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index 131152f27..72bcf4c73 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -1,30 +1,34 @@ <?php $this->partial ('nav_menu'); ?> -<div id="stream" class="global"> +<?php if (!empty($this->entries)) { ?> +<div id="stream" class="global categories"> <?php + $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); + if ($this->conf->view_mode !== 'normal') { + $arUrl['params']['output'] = 'normal'; + } + $p = Minz_Request::param('state', ''); + if (($p != '') && ($this->conf->default_view !== $p)) { + $arUrl['params']['state'] = $p; + } + foreach ($this->cat_aside as $cat) { $feeds = $cat->feeds (); - $catNotRead = $cat->nbNotRead (); if (!empty ($feeds)) { ?> - <div class="category"> - <div class="cat_header"> - <a href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id (), 'output', 'normal'); ?>"> - <?php echo $cat->name(); ?><?php echo $catNotRead > 0 ? ' (' . $catNotRead . ')' : ''; ?> + <div class="box-category"> + <div class="category"> + <a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id (); echo Minz_Url::display($arUrl); ?>"> + <?php echo $cat->name(); ?> </a> </div> - <ul class="feeds"> <?php foreach ($feeds as $feed) { ?> <?php $not_read = $feed->nbNotRead (); ?> - <li class="item"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> - - <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id (), 'output', 'normal'); ?>"> - <?php echo $not_read > 0 ? '<b>' : ''; ?> + <li id="f_<?php echo $feed->id (); ?>" class="item<?php echo $feed->inError () ? ' error' : ''; ?><?php echo $feed->nbEntries () == 0 ? ' empty' : ''; ?>"> + <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> + <a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed->id(); echo Minz_Url::display($arUrl); ?>"> <?php echo $feed->name(); ?> - <?php echo $not_read > 0 ? ' (' . $not_read . ')' : ''; ?> - <?php echo $not_read > 0 ? '</b>' : ''; ?> </a> </li> <?php } ?> @@ -37,6 +41,13 @@ </div> <div id="overlay"></div> -<div id="panel"> - <a class="close" href="#"><i class="icon i_close"></i></a> -</div>
\ No newline at end of file +<div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>> + <a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a> +</div> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn global"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index d940e0dda..1dbf14f4c 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -3,170 +3,188 @@ $this->partial ('aside_flux'); $this->partial ('nav_menu'); -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -<div id="stream" class="normal"> - <?php - $display_today = true; - $display_yesterday = true; - $display_others = true; - ?> - <?php foreach ($items as $item) { ?> - - <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> - <div class="day"> - <?php echo Translate::t ('today'); ?> - <span class="date"> - <?php echo timestamptodate (time (), false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (Days::YESTERDAY)) { ?> - <div class="day"> - <?php echo Translate::t ('yesterday'); ?> - <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (Days::BEFORE_YESTERDAY)) { ?> - <div class="day"> - <?php echo Translate::t ('before_yesterday'); ?> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_others = false; } ?> +if (!empty($this->entries)) { + $display_today = true; + $display_yesterday = true; + $display_others = true; + if ($this->loginOk) { + $sharing = $this->conf->sharing; + } else { + $sharing = array(); + } + $hidePosts = !$this->conf->display_posts; + $lazyload = $this->conf->lazyload; + $topline_read = $this->conf->topline_read; + $topline_favorite = $this->conf->topline_favorite; + $topline_date = $this->conf->topline_date; + $topline_link = $this->conf->topline_link; + $bottomline_read = $this->conf->bottomline_read; + $bottomline_favorite = $this->conf->bottomline_favorite; + $bottomline_sharing = $this->conf->bottomline_sharing && (count($sharing)); + $bottomline_tags = $this->conf->bottomline_tags; + $bottomline_date = $this->conf->bottomline_date; + $bottomline_link = $this->conf->bottomline_link; - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <ul class="horizontal-list flux_header"> - <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> - <li class="item manage"> - <?php if (!$item->isRead ()) { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> - <?php } else { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> - <?php } ?> + $content_width = $this->conf->content_width; +?> - <?php if (!$item->isFavorite ()) { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> - <?php } else { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> - <?php } ?> - </li> - <?php } ?> - <?php - $feed = HelperCategory::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); - ?> - <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span></a></li> +<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + ?><div id="new-article"> + <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> + </div><?php + foreach ($this->entries as $item) { + if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { + ?><div class="day" id="day_today"><?php + echo Minz_Translate::t ('today'); + ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_today = false; + } + if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { + ?><div class="day" id="day_yesterday"><?php + echo Minz_Translate::t ('yesterday'); + ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_yesterday = false; + } + if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { + ?><div class="day" id="day_before_yesterday"><?php + echo Minz_Translate::t ('before_yesterday'); + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_others = false; + } + ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + <ul class="horizontal-list flux_header"><?php + if ($this->loginOk) { + if ($topline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($topline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } + $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache + if ($feed == null) { + $feed = $item->feed(true); + if ($feed == null) { + $feed = FreshRSS_Feed::example(); + } + } + ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> - <li class="item date"><?php echo $item->date (); ?></li> - <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> + <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> + <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> </ul> <div class="flux_content"> - <div class="content"> - <h1 class="title"><?php echo $item->title (); ?></h1> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; ?> + <div class="content <?php echo $content_width; ?>"> + <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1> <?php - if($this->conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } + $author = $item->author(); + echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); ?> </div> - - <ul class="horizontal-list bottom"> - <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> - <li class="item manage"> - <?php if (!$item->isRead ()) { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> - <?php } else { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> - <?php } ?> - - <?php if (!$item->isFavorite ()) { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> - <?php } else { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> - <?php } ?> - </li> - <?php } ?> - <li class="item"> - <?php $link = urlencode ($item->link ()); ?> - <?php $title = urlencode ($item->title () . ' - ' . $feed->name ()); ?> - <div class="dropdown"> + <ul class="horizontal-list bottom"><?php + if ($this->loginOk) { + if ($bottomline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($bottomline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } ?> + <li class="item"><?php + if ($bottomline_sharing) { + $link = urlencode ($item->link ()); + $title = urlencode ($item->title () . ' · ' . $feed->name ()); + ?><div class="dropdown"> <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> - <i class="icon i_share"></i> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"><?php echo Translate::t ('share'); ?></a> + <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> + <?php echo FreshRSS_Themes::icon('share'); ?> + <?php echo Minz_Translate::t ('share'); ?> + </a> <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close"> </a></li> - - <?php - $shaarli = $this->conf->urlShaarli (); - if ((!login_is_conf ($this->conf) || is_logged ()) && $shaarli) { - ?> - <li class="item"> - <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=bookmarklet'; ?>"> - Shaarli - </a> - </li> - <?php } ?> - <li class="item"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Translate::t ('by_email'); ?> - </a> - </li> - <li class="item"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - Twitter - </a> - </li> - <li class="item"> - <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - Facebook - </a> - </li> - <li class="item"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - Google+ - </a> - </li> + <li class="dropdown-close"><a href="#close">❌</a></li> + <?php foreach ($sharing as $share) :?> + <li class="item share"> + <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>"> + <?php echo Minz_Translate::t ($share['name']);?> + </a> + </li> + <?php endforeach;?> </ul> </div> - </li> - <?php $tags = $item->tags(); ?> - <?php if(!empty($tags)) { ?> - <li class="item"> + <?php } ?> + </li><?php + $tags = $bottomline_tags ? $item->tags() : null; + if (!empty($tags)) { + ?><li class="item"> <div class="dropdown"> <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> - <i class="icon i_tag"></i> <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php echo Translate::t ('related_tags'); ?></a> - + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php + echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags'); + ?></a> <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close"> </a></li> - - <?php foreach($tags as $tag) { ?> - <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> - <?php } ?> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach($tags as $tag) { + ?><li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php + } ?> </ul> </div> - </li> - <?php } ?> - <li class="item date"><?php echo $item->date (); ?></li> - <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> + </li><?php + } + if ($bottomline_date) { + ?><li class="item date"><?php echo $item->date (); ?></li><?php + } + if ($bottomline_link) { + ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php + } ?> </ul> </div> </div> <?php } ?> - - <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> + + <?php $this->renderHelper('pagination'); ?> </div> <?php $this->partial ('nav_entries'); ?> <?php } else { ?> -<div id="stream" class="alert alert-warn normal"> - <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> +<div id="stream" class="prompt alert alert-warn normal"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> </div> -<?php } ?>
\ No newline at end of file +<?php } ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 7b1e2bca0..c80dca519 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -1,48 +1,44 @@ <?php $this->partial ('nav_menu'); -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); +if (!empty($this->entries)) { + $lazyload = $this->conf->lazyload; + $content_width = $this->conf->content_width; ?> <div id="stream" class="reader"> - <?php foreach ($items as $item) { ?> + <?php foreach ($this->entries as $item) { ?> <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> <div class="flux_content"> - <div class="content"> + <div class="content <?php echo $content_width; ?>"> <?php - $feed = HelperCategory::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache + $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed (true); ?> <a href="<?php echo $item->link (); ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span> + <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> </a> <h1 class="title"><?php echo $item->title (); ?></h1> - <div class="author"> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? Translate::t ('by_author', $author) . ' - ' : ''; ?> - <?php echo $item->date (); ?> - </div> + <div class="author"><?php + $author = $item->author(); + echo $author != '' ? Minz_Translate::t('by_author', $author) . ' — ' : '', + $item->date(); + ?></div> - <?php - if($this->conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> + <?php echo $item->content(); ?> </div> </div> </div> <?php } ?> - - <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> + + <?php $this->renderHelper('pagination'); ?> </div> <?php } else { ?> -<div id="stream" class="alert alert-warn reader"> - <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> +<div id="stream" class="prompt alert alert-warn reader"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> </div> -<?php } ?>
\ No newline at end of file +<?php } ?> diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index 8ce636918..2c6ca610b 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -1,18 +1,17 @@ <?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> - <title><?php echo View::title(); ?></title> - <link><?php echo Url::display(); ?></link> - <description><?php echo Translate::t ('rss_feeds_of', View::title()); ?></description> + <title><?php echo $this->rss_title; ?></title> + <link><?php echo Minz_Url::display(null, 'html', true); ?></link> + <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description> <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo _url ('index', 'index', 'output', 'rss'); ?>" rel="self" type="application/rss+xml" /> + <atom:link href="<?php echo Minz_Url::display ($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> <?php -$items = $this->entryPaginator->items (); -foreach ($items as $item) { +foreach ($this->entries as $item) { ?> <item> - <title><?php echo htmlspecialchars(html_entity_decode($item->title (), ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8'); ?></title> + <title><?php echo $item->title (); ?></title> <link><?php echo $item->link (); ?></link> <?php $author = $item->author (); ?> <?php if ($author != '') { ?> @@ -24,7 +23,7 @@ foreach ($items as $item) { <pubDate><?php echo date('D, d M Y H:i:s O', $item->date (true)); ?></pubDate> <guid isPermaLink="false"><?php echo $item->id (); ?></guid> </item> -<?php } ?> +<?php } ?> </channel> </rss> diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/importExport/export.phtml diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml new file mode 100644 index 000000000..35371faca --- /dev/null +++ b/app/views/importExport/index.phtml @@ -0,0 +1,61 @@ +<?php $this->partial('aside_feed'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> + <legend><?php echo _t('import'); ?></legend> + <div class="form-group"> + <label class="group-name" for="file"> + <?php echo extension_loaded('zip') ? _t('file_to_import') : _t('file_to_import_no_zip'); ?> + </label> + <div class="group-controls"> + <input type="file" name="file" id="file" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('import'); ?></button> + </div> + </div> + </form> + + <?php if (count($this->feeds) > 0) { ?> + <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> + <legend><?php echo _t('export'); ?></legend> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="export_opml"> + <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> + <?php echo _t('export_opml'); ?> + </label> + + <label class="checkbox" for="export_starred"> + <input type="checkbox" name="export_starred" id="export_starred" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> /> + <?php echo _t('export_starred'); ?> + </label> + + <?php + $select_args = ''; + if (extension_loaded('zip')) { + $select_args = ' size="' . min(10, count($this->feeds)) .'" multiple="multiple"'; + } + ?> + <select name="export_feeds[]"<?php echo $select_args; ?>> + <?php echo extension_loaded('zip') ? '' : '<option></option>'; ?> + <?php foreach ($this->feeds as $feed) { ?> + <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index ca1254053..76ff804d8 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -1,24 +1,27 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - <h1><?php echo Translate::t ('about_freshrss'); ?></h1> + <h1><?php echo Minz_Translate::t ('about_freshrss'); ?></h1> <dl class="infos"> - <dt><?php echo Translate::t ('project_website'); ?></dt> - <dd><a href="http://marienfressinaud.github.io/FreshRSS/">http://marienfressinaud.github.io/FreshRSS/</a></dd> + <dt><?php echo Minz_Translate::t ('project_website'); ?></dt> + <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd> - <dt><?php echo Translate::t ('lead_developer'); ?></dt> - <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> - <a href="http://marienfressinaud.fr"><?php echo Translate::t ('website'); ?></a></dd> + <dt><?php echo Minz_Translate::t ('lead_developer'); ?></dt> + <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> — <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd> - <dt><?php echo Translate::t ('bugs_reports'); ?></dt> - <dd><?php echo Translate::t ('github_or_email'); ?></dd> + <dt><?php echo Minz_Translate::t ('bugs_reports'); ?></dt> + <dd><?php echo Minz_Translate::t ('github_or_email'); ?></dd> - <dt><?php echo Translate::t ('license'); ?></dt> - <dd><?php echo Translate::t ('agpl3'); ?></dd> + <dt><?php echo Minz_Translate::t ('license'); ?></dt> + <dd><?php echo Minz_Translate::t ('agpl3'); ?></dd> + + <dt><?php echo Minz_Translate::t ('version'); ?></dt> + <dd><?php echo FRESHRSS_VERSION; ?></dd> </dl> - <p><?php echo Translate::t ('freshrss_description'); ?></p> + <p><?php echo Minz_Translate::t ('freshrss_description'); ?></p> - <h1><?php echo Translate::t ('credits'); ?></h1> - <p><?php echo Translate::t ('credits_content'); ?></p> + <h1><?php echo Minz_Translate::t ('credits'); ?></h1> + <p><?php echo Minz_Translate::t ('credits_content'); ?></p> </div> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml new file mode 100644 index 000000000..b05cdced4 --- /dev/null +++ b/app/views/index/formLogin.phtml @@ -0,0 +1,46 @@ +<div class="prompt"> + <h1><?php echo _t('login'); ?></h1><?php + + switch (Minz_Configuration::authType()) { + case 'form': + ?><form id="crypto-form" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> + <div> + <label for="username"><?php echo _t('username'); ?></label> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + <div> + <label for="passwordPlain"><?php echo _t('password'); ?></label> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript> + </div> + <div> + <label class="checkbox" for="keep_logged_in"> + <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" /> + <?php echo _t('keep_logged_in'); ?> + </label> + <br /> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('login'); ?></button> + </div> + </form><?php + break; + + case 'persona': + ?><p> + <a class="signin btn btn-important" href="#"> + <?php echo _i('login'); ?> + <?php echo _t('login_with_persona'); ?> + </a><br /><br /> + + <?php echo _i('help'); ?> + <small> + <a href="<?php echo _url('index', 'resetAuth'); ?>"><?php echo _t('login_persona_problem'); ?></a> + </small> + </p><?php + break; + } ?> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></p> +</div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 73e5fcc4d..1ff36ca8e 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,28 +1,25 @@ <?php -$output = Request::param ('output', 'normal'); -$token = $this->conf->token(); -$token_param = Request::param ('token', ''); -$token_is_ok = ($token != '' && $token == $token_param); +$output = Minz_Request::param ('output', 'normal'); -if(!login_is_conf ($this->conf) || - is_logged() || - $this->conf->anonAccess() == 'yes' || - ($output == 'rss' && $token_is_ok)) { - if($output == 'rss') { - $this->renderHelper ('view/rss_view'); - } elseif($output == 'reader') { +if ($this->loginOk || Minz_Configuration::allowAnonymous()) { + if ($output === 'normal') { + $this->renderHelper ('view/normal_view'); + } elseif ($output === 'reader') { $this->renderHelper ('view/reader_view'); - } elseif($output == 'global') { + } elseif ($output === 'global') { $this->renderHelper ('view/global_view'); + } elseif ($output === 'rss') { + $this->renderHelper ('view/rss_view'); } else { + Minz_Request::_param ('output', 'normal'); + $output = 'normal'; $this->renderHelper ('view/normal_view'); } +} elseif ($output === 'rss') { + // token has already been checked in the controller so we can show the view + $this->renderHelper ('view/rss_view'); } else { -?> -<div class="post content"> - <h1><?php echo Translate::t ('forbidden_access'); ?></h1> - <p><?php echo Translate::t ('forbidden_access_description'); ?></p> -</div> -<?php -}
\ No newline at end of file + // Normally, it should not happen, but log it anyway + Minz_Log::record ('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR); +} diff --git a/app/views/index/logout.phtml b/app/views/index/logout.phtml new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/app/views/index/logout.phtml @@ -0,0 +1 @@ +OK
\ No newline at end of file diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index c72a84c86..1b77b39af 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,21 +1,25 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - <h1><?php echo Translate::t ('logs'); ?></h1> + <h1><?php echo Minz_Translate::t ('logs'); ?></h1> + <form method="post" action="<?php echo _url ('index', 'logs'); ?>"><p> + <input type="hidden" name="clearLogs" /> + <button type="submit" class="btn"><?php echo Minz_Translate::t ('clear_logs'); ?></button> + </p></form> <?php $items = $this->logsPaginator->items (); ?> <?php if (!empty ($items)) { ?> <div class="logs"> <?php $this->logsPaginator->render ('logs_pagination.phtml', 'page'); ?> - + <?php foreach ($items as $log) { ?> - <div class="log <?php echo $log->level (); ?>"><span class="date"><?php echo date ('d/m/Y - H:i:s', strtotime ($log->date ())); ?></span><?php echo $log->info (); ?></div> + <div class="log <?php echo $log->level (); ?>"><span class="date"><?php echo @date ('Y-m-d H:i:s', @strtotime ($log->date ())); ?></span><?php echo htmlspecialchars ($log->info (), ENT_NOQUOTES, 'UTF-8'); ?></div> <?php } ?> - + <?php $this->logsPaginator->render ('logs_pagination.phtml','page'); ?> </div> <?php } else { ?> - <p class="alert alert-warn"><?php echo Translate::t ('logs_empty'); ?></p> + <p class="alert alert-warn"><?php echo Minz_Translate::t ('logs_empty'); ?></p> <?php } ?> -</div>
\ No newline at end of file +</div> diff --git a/app/views/index/resetAuth.phtml b/app/views/index/resetAuth.phtml new file mode 100644 index 000000000..6d4282c14 --- /dev/null +++ b/app/views/index/resetAuth.phtml @@ -0,0 +1,33 @@ +<div class="prompt"> + <h1><?php echo _t('auth_reset'); ?></h1> + + <?php if (!empty($this->message)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span><br /> + <?php echo $this->message['body']; ?> + </p> + <?php } ?> + + <?php if (!$this->no_form) { ?> + <form id="crypto-form" method="post" action="<?php echo _url('index', 'resetAuth'); ?>"> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('attention'); ?></span><br /> + <?php echo _t('auth_will_reset'); ?> + </p> + + <div> + <label for="username"><?php echo _t('username_admin'); ?></label> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + <div> + <label for="passwordPlain"><?php echo _t('password'); ?></label> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('submit'); ?></button> + </div> + </form> + <?php } ?> +</div> diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index fa6e67ddb..74cef4998 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,45 +1,56 @@ -var feeds = new Array (); -<?php foreach ($this->feeds as $feed) { ?> -feeds.push ("<?php echo Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>"); -<?php } ?> +"use strict"; +var feeds = [<?php foreach ($this->feeds as $feed) { ?>{<?php + ?>url: "<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",<?php + ?>title: "<?php echo $feed->name(); ?>"<?php +?>},<?php } ?>], + feed_processed = 0, + feed_count = feeds.length; -function initProgressBar (init) { +function initProgressBar(init) { if (init) { - $("body").after ("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\ - <?php echo Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\ - <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\ + $("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\ + <?php echo _t('refresh'); ?><br /><span class=\"title\">/</span><br />\ + <span class=\"progress\">0 / " + feed_count + "</span>\ </div>"); } else { - window.location.reload (); + window.location.reload(); } } -function updateProgressBar (i) { - $("#actualizeProgressBar").val(i); - $("#actualizeProgress .progress").html (i + " / " + feeds.length); +function updateProgressBar(i, title_feed) { + $("#actualizeProgress .progress").html(i + " / " + feed_count); + $("#actualizeProgress .title").html(title_feed); } -function updateFeeds () { - initProgressBar (true); - - var i = 0; - for (var f in feeds) { - $.ajax ({ - type: 'POST', - url: feeds[f], - }).done (function (data) { - i++; - updateProgressBar (i); +function updateFeeds() { + if (feed_count === 0) { + openNotification("<?php echo _t('no_feed_to_refresh'); ?>", "good"); + ajax_loading = false; + return; + } + initProgressBar(true); - if (i == feeds.length) { - initProgressBar (false); - } - }); + for (var i = 0; i < 10; i++) { + updateFeed(); } } -$(document).ready (function () { - $("#actualize").click (function () { - updateFeeds (); - return false; +function updateFeed() { + var feed = feeds.pop(); + if (feed == undefined) { + return; + } + + $.ajax({ + type: 'POST', + url: feed['url'], + }).complete(function (data) { + feed_processed++; + updateProgressBar(feed_processed, feed['title']); + + if (feed_processed === feed_count) { + initProgressBar(false); + } else { + updateFeed(); + } }); -}); +} diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml deleted file mode 100644 index 03c60cc52..000000000 --- a/app/views/javascript/main.phtml +++ /dev/null @@ -1,415 +0,0 @@ -<?php if ($this->conf->displayPosts () == 'no') { ?> -var hide_posts = true; -<?php } else { ?> -var hide_posts = false; -<?php } ?> - -<?php - $s = $this->conf->shortcuts (); - $mark = $this->conf->markWhen (); - $auto_load_more = $this->conf->autoLoadMore () -?> - -function is_reader_mode() { - var stream = $("#stream.reader"); - return stream.html() != null; -} - -function is_normal_mode() { - var stream = $("#stream.normal"); - return stream.html() != null; -} - -function is_global_mode() { - var stream = $("#stream.global"); - return stream.html() != null; -} - -function redirect (url, new_tab) { - if (url) { - if (new_tab) { - window.open (url); - } else { - location.href = url; - } - } -} - -function toggleContent (new_active, old_active) { - old_active.removeClass ("active"); - if (old_active[0] != new_active[0]) { - new_active.addClass ("active"); - } - - var box_to_move = "html,body"; - var relative_move = false; - if(is_global_mode()) { - box_to_move = "#panel"; - relative_move = true; - } - - var new_pos = new_active.position ().top, - old_scroll = $(box_to_move).scrollTop (), - new_scroll = old_scroll; - if (hide_posts) { - old_active.children (".flux_content").toggle (0); - - new_pos = new_active.position ().top; - old_scroll = $(box_to_move).scrollTop (); - - if(relative_move) { - new_pos += old_scroll; - } - - if (old_active[0] != new_active[0]) { - new_active.children (".flux_content").toggle (0, function () { - new_scroll = $(box_to_move).scrollTop (new_pos).scrollTop (); - }); - } - } else { - if(relative_move) { - new_pos += old_scroll; - } - - new_scroll = $(box_to_move).scrollTop (new_pos).scrollTop (); - } - - if ((new_scroll === old_scroll) && $.fn.lazyload) { - $(window).trigger ("scroll"); //When no scroll was done, generate fake scroll event for LazyLoad to load images - } - - <?php if ($mark['article'] == 'yes') { ?> - mark_read(new_active, true); - <?php } ?> -} - -function mark_read (active, only_not_read) { - if (active[0] === undefined || ( - only_not_read === true && !active.hasClass("not_read"))) { - return false; - } - - url = active.find ("a.read").attr ("href"); - if (url === undefined) { - return false; - } - - $.ajax ({ - type: 'POST', - url: url, - data : { ajax: true } - }).done (function (data) { - res = jQuery.parseJSON(data); - - active.find ("a.read").attr ("href", res.url); - - if (active.hasClass ("not_read")) { - active.removeClass ("not_read"); - } else if(only_not_read !== true || active.hasClass("not_read")) { - active.addClass ("not_read"); - } - }); -} - -function mark_favorite (active) { - if (active[0] === undefined) { - return false; - } - - url = active.find ("a.bookmark").attr ("href"); - if (url === undefined) { - return false; - } - - $.ajax ({ - type: 'POST', - url: url, - data : { ajax: true } - }).done (function (data) { - res = jQuery.parseJSON(data); - - active.find ("a.bookmark").attr ("href", res.url); - if (active.hasClass ("favorite")) { - active.removeClass ("favorite"); - } else { - active.addClass ("favorite"); - } - }); -} - -function prev_entry() { - old_active = $(".flux.active"); - last_active = $(".flux:last"); - new_active = old_active.prevAll (".flux:first"); - - if (new_active.hasClass("flux")) { - toggleContent (new_active, old_active); - } else if (old_active[0] === undefined && - new_active[0] === undefined) { - toggleContent (last_active, old_active); - } -} - -function next_entry() { - old_active = $(".flux.active"); - first_active = $(".flux:first"); - last_active = $(".flux:last"); - new_active = old_active.nextAll (".flux:first"); - - if (new_active.hasClass("flux")) { - toggleContent (new_active, old_active); - } else if (old_active[0] === undefined && - new_active[0] === undefined) { - toggleContent (first_active, old_active); - } - - <?php if ($auto_load_more !== 'yes') { ?> - if(last_active.attr("id") == new_active.attr("id")) { - load_more_posts (); - } - <?php } ?> -} - -function init_img () { - var maxWidth = $(".flux_content .content").width() / 2; - $(".flux_content .content img").each (function () { - if ($(this).width () > maxWidth) { - $(this).addClass("big"); - } - }); -} - -function inMarkViewport(flux, box_to_follow, relative_follow) { - var top = flux.position().top; - if(relative_follow) { - top += box_to_follow.scrollTop(); - } - var height = flux.height(); - var begin = top + 3 * height / 4; - var bot = Math.min(begin + 75, top + height); - - var windowTop = box_to_follow.scrollTop(); - var windowBot = windowTop + box_to_follow.height() / 2; - - return (windowBot >= begin && windowBot <= bot); -} - -function init_posts () { - init_img (); - <?php if($this->conf->lazyload() == 'yes') { ?> - if(is_global_mode()) { - $(".flux .content img").lazyload({ - container: $("#panel") - }); - } else { - $(".flux .content img").lazyload(); - } - <?php } ?> - - if (hide_posts) { - $(".flux:not(.active) .flux_content").hide (); - } - - var box_to_follow = $(window); - var relative_follow = false; - if(is_global_mode()) { - box_to_follow = $("#panel"); - relative_follow = true; - } - - <?php if ($mark['scroll'] == 'yes') { ?> - box_to_follow.scroll(function() { - $('.flux.not_read:visible').each(function() { - if($(this).children(".flux_content").is(':visible') && - inMarkViewport($(this), box_to_follow, relative_follow)) { - mark_read($(this), true); - } - }); - }); - <?php } ?> - - <?php if ($auto_load_more == 'yes') { ?> - box_to_follow.scroll(function() { - var load_more = $("#load_more"); - if (!load_more.is(':visible')) return; - var boxBot = box_to_follow.scrollTop() + box_to_follow.height(); - var load_more_top = load_more.position().top; - if(relative_follow) { - load_more_top += box_to_follow.scrollTop(); - } - - if(boxBot >= load_more_top) { - load_more_posts (); - } - }); - <?php } ?> -} - -function init_column_categories () { - if(!is_normal_mode()) { - return; - } - - $(".category").addClass ("stick"); - $(".categories .category .btn:first-child").width ("160px"); - $(".category").append ("<a class=\"btn dropdown-toggle\" href=\"#\"><i class=\"icon i_down\"></i></a>"); - - $(".category + .feeds").not(".active").hide(); - $(".category.active a.dropdown-toggle i").toggleClass ("i_up"); - - $(".category a.dropdown-toggle").click (function () { - $(this).children ().toggleClass ("i_up"); - $(this).parent ().next (".feeds").slideToggle(); - return false; - }); -} - -function init_shortcuts () { - // Touches de manipulation - shortcut.add("<?php echo $s['mark_read']; ?>", function () { - // on marque comme lu ou non lu - active = $(".flux.active"); - mark_read (active, false); - }, { - 'disable_in_input':true - }); - shortcut.add("shift+<?php echo $s['mark_read']; ?>", function () { - // on marque tout comme lu - url = $(".nav_menu a.read_all").attr ("href"); - redirect (url, false); - }, { - 'disable_in_input':true - }); - shortcut.add("<?php echo $s['mark_favorite']; ?>", function () { - // on marque comme favori ou non favori - active = $(".flux.active"); - mark_favorite (active); - }, { - 'disable_in_input':true - }); - - // Touches de navigation - shortcut.add("<?php echo $s['prev_entry']; ?>", prev_entry, { - 'disable_in_input':true - }); - shortcut.add("shift+<?php echo $s['prev_entry']; ?>", function () { - old_active = $(".flux.active"); - first = $(".flux:first"); - - if (first.hasClass("flux")) { - toggleContent (first, old_active); - } - }, { - 'disable_in_input':true - }); - shortcut.add("<?php echo $s['next_entry']; ?>", next_entry, { - 'disable_in_input':true - }); - shortcut.add("shift+<?php echo $s['next_entry']; ?>", function () { - old_active = $(".flux.active"); - last = $(".flux:last"); - - if (last.hasClass("flux")) { - toggleContent (last, old_active); - } - }, { - 'disable_in_input':true - }); - shortcut.add("<?php echo $s['go_website']; ?>", function () { - url_website = $(".flux.active .link a").attr ("href"); - - <?php if ($mark['site'] == 'yes') { ?> - $(".flux.active").each (function () { - mark_read($(this), true); - }); - <?php } ?> - - redirect (url_website, true); - }, { - 'disable_in_input':true - }); -} - -function init_stream_delegates(divStream) { - divStream.on('click', '.flux_header .item.title, .flux_header .item.date', function (e) { //flux_header_toggle - old_active = $(".flux.active"); - new_active = $(this).parent ().parent (); - if (e.target.tagName.toUpperCase() === 'A') { //Leave real links alone - <?php if ($mark['article'] == 'yes') { ?> - mark_read(new_active, true); - <?php } ?> - return true; - } - toggleContent (new_active, old_active); - }); - - divStream.on('click', '.flux a.read', function () { - active = $(this).parents (".flux"); - mark_read (active, false); - - return false; - }); - - divStream.on('click', '.flux a.bookmark', function () { - active = $(this).parents (".flux"); - mark_favorite (active); - - return false; - }); - - divStream.on('click', '.flux .content a', function () { - $(this).attr ('target', '_blank'); - }); - - divStream.on('click', '.item.title>a',function (e) { - if (e.ctrlKey) return true; //Allow default control-click behaviour such as open in backround-tab - $(this).parent ().click (); //Will perform toggle flux_content - return false; - }); - - divStream.on('click', '.bigMarkAsRead', function() { - url = $(".nav_menu a.read_all").attr ("href"); - redirect (url, false); - return false; - }); - - <?php if ($mark['site'] == 'yes') { ?> - divStream.on('click', '.flux .link a', function () { - mark_read($(this).parent().parent().parent(), true); - }); - <?php } ?> -} - -function init_nav_entries() { - $('.nav_entries a.previous_entry').click(function() { - prev_entry(); - return false; - }); - $('.nav_entries a.next_entry').click(function() { - next_entry(); - return false; - }); - $('.nav_entries a.up').click(function() { - var active_item = $(".flux.active"); - var windowTop = $(window).scrollTop(); - var item_top = active_item.position ().top; - - if(windowTop > item_top) { - $("html,body").scrollTop (item_top); - } else { - $("html,body").scrollTop (0); - } - return false; - }); -} - -$(document).ready (function () { - if(is_reader_mode()) { - hide_posts = false; - } - init_posts (); - init_column_categories (); - init_shortcuts (); - init_stream_delegates($('#stream')); - init_nav_entries(); -}); diff --git a/app/views/javascript/nbUnreadsPerFeed.phtml b/app/views/javascript/nbUnreadsPerFeed.phtml new file mode 100644 index 000000000..68f98ce9e --- /dev/null +++ b/app/views/javascript/nbUnreadsPerFeed.phtml @@ -0,0 +1,8 @@ +<?php +$result = array(); +foreach ($this->categories as $cat) { + foreach ($cat->feeds() as $feed) { + $result[$feed->id()] = $feed->nbNotRead(); + } +} +echo json_encode($result); diff --git a/app/views/javascript/nonce.phtml b/app/views/javascript/nonce.phtml new file mode 100644 index 000000000..4ac46c8fc --- /dev/null +++ b/app/views/javascript/nonce.phtml @@ -0,0 +1,2 @@ +<?php +echo json_encode(array('salt1' => $this->salt1, 'nonce' => $this->nonce)); diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml new file mode 100644 index 000000000..6f3d4a117 --- /dev/null +++ b/app/views/stats/idle.phtml @@ -0,0 +1,48 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('stats_idle'); ?></h1> + + <?php + $current_url = urlencode(Minz_Url::display( + array('c' => 'stats', 'a' => 'idle'), + 'php', true + )); + $nothing = true; + foreach ($this->idleFeeds as $period => $feeds) { + if (!empty($feeds)) { + $nothing = false; + ?> + <div class="stat"> + <h2><?php echo _t($period); ?></h2> + + <form id="form-delete" method="post" style="display: none"></form> + + <?php foreach ($feeds as $feed) { ?> + <ul class="horizontal-list"> + <li class="item"> + <div class="stick"> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed['id']); ?>"><?php echo _i('link'); ?> <?php echo _t('filter'); ?></a> + <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('administration'); ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?php echo _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url); ?>"><?php echo _t('delete'); ?></button> + </div> + </li> + <li class="item"> + <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('number_articles', $feed['nb_articles']); ?>)</span> + </li> + </ul> + <?php } ?> + </div> + <?php + } + } + + if ($nothing) { + ?> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('stats_no_idle'); ?></span> + </p> + <?php } ?> +</div> diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml new file mode 100644 index 000000000..412e77e16 --- /dev/null +++ b/app/views/stats/index.phtml @@ -0,0 +1,127 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo _t ('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t ('stats_main'); ?></h1> + + <div class="stat half"> + <h2><?php echo _t ('stats_entry_repartition'); ?></h2> + <table> + <thead> + <tr> + <th> </th> + <th><?php echo _t ('main_stream'); ?></th> + <th><?php echo _t ('all_feeds'); ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?php echo _t ('status_total'); ?></th> + <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['total']); ?></td> + <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['total']); ?></td> + </tr> + <tr> + <th><?php echo _t ('status_read'); ?></th> + <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['read']); ?></td> + <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['read']); ?></td> + </tr> + <tr> + <th><?php echo _t ('status_unread'); ?></th> + <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['unread']); ?></td> + <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['unread']); ?></td> + </tr> + <tr> + <th><?php echo _t ('status_favorites'); ?></th> + <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['favorite']); ?></td> + <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['favorite']); ?></td> + </tr> + </tbody> + </table> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t ('stats_top_feed'); ?></h2> + <table> + <thead> + <tr> + <th><?php echo _t ('feed'); ?></th> + <th><?php echo _t ('category'); ?></th> + <th><?php echo _t ('stats_entry_count'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($this->topFeed as $feed): ?> + <tr> + <td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td> + <td><?php echo $feed['category']; ?></td> + <td class="numeric"><?php echo formatNumber($feed['count']); ?></td> + </tr> + <?php endforeach;?> + </tbody> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t ('stats_entry_per_day'); ?></h2> + <div id="statsEntryPerDay" style="height: 300px"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t ('stats_feed_per_category'); ?></h2> + <div id="statsFeedPerCategory" style="height: 300px"></div> + <div id="statsFeedPerCategoryLegend"></div> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t ('stats_entry_per_category'); ?></h2> + <div id="statsEntryPerCategory" style="height: 300px"></div> + <div id="statsEntryPerCategoryLegend"></div> + </div> +</div> + +<script> +"use strict"; +function initStats() { + if (!window.Flotr) { + if (window.console) { + console.log('FreshRSS waiting for Flotr…'); + } + window.setTimeout(initStats, 50); + return; + } + // Entry per day + Flotr.draw(document.getElementById('statsEntryPerDay'), + [<?php echo $this->count ?>], + { + grid: {verticalLines: false}, + bars: {horizontal: false, show: true}, + xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0}, + yaxis: {min: 0}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Feed per category + Flotr.draw(document.getElementById('statsFeedPerCategory'), + <?php echo $this->feedByCategory ?>, + { + grid: {verticalLines: false, horizontalLines: false}, + pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, + xaxis: {showLabels: false}, + yaxis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, + legend: {container: document.getElementById('statsFeedPerCategoryLegend'), noColumns: 3} + }); + // Entry per category + Flotr.draw(document.getElementById('statsEntryPerCategory'), + <?php echo $this->entryByCategory ?>, + { + grid: {verticalLines: false, horizontalLines: false}, + pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, + xaxis: {showLabels: false}, + yaxis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, + legend: {container: document.getElementById('statsEntryPerCategoryLegend'), noColumns: 3} + }); +} +initStats(); +</script> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml new file mode 100644 index 000000000..b425c1458 --- /dev/null +++ b/app/views/stats/repartition.phtml @@ -0,0 +1,150 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('stats_repartition'); ?></h1> + + <select id="feed_select"> + <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('all_feeds')?></option> + <?php foreach ($this->categories as $category) { + $feeds = $category->feeds(); + if (!empty($feeds)) { + echo '<optgroup label="', $category->name(), '">'; + foreach ($feeds as $feed) { + if ($this->feed && $feed->id() == $this->feed->id()){ + echo '<option value="', $feed->id(), '" selected="selected" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } else { + echo '<option value="', $feed->id(), '" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } + } + echo '</optgroup>'; + } + }?> + </select> + + <?php if ($this->feed) {?> + <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $this->feed->id()); ?>"> + <?php echo _i('configure'); ?> <?php echo _t('administration'); ?> + </a> + <?php }?> + + <div class="stat"> + <h2><?php echo _t('stats_entry_per_hour'); ?></h2> + <div id="statsEntryPerHour" style="height: 300px"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('stats_entry_per_day_of_week'); ?></h2> + <div id="statsEntryPerDayOfWeek" style="height: 300px"></div> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t('stats_entry_per_month'); ?></h2> + <div id="statsEntryPerMonth" style="height: 300px"></div> + </div> +</div> + +<script> +"use strict"; +function initStats() { + if (!window.Flotr) { + if (window.console) { + console.log('FreshRSS waiting for Flotr…'); + } + window.setTimeout(initStats, 50); + return; + } + // Entry per hour + var avg_h = []; + for (var i = -1; i <= 24; i++) { + avg_h.push([i, <?php echo $this->averageHour?>]); + } + Flotr.draw(document.getElementById('statsEntryPerHour'), + [{ + data: <?php echo $this->repartitionHour ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_h, + lines: {show: true}, + label: <?php echo $this->averageHour?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 23, + tickFormatter: function(x) { + var x = parseInt(x); + return x + 1; + }, + min: -0.9, + max: 23.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per day of week + var avg_dow = []; + for (var i = -1; i <= 7; i++) { + avg_dow.push([i, <?php echo $this->averageDayOfWeek?>]); + } + Flotr.draw(document.getElementById('statsEntryPerDayOfWeek'), + [{ + data: <?php echo $this->repartitionDayOfWeek ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_dow, + lines: {show: true}, + label: <?php echo $this->averageDayOfWeek?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 6, + tickFormatter: function(x) { + var x = parseInt(x), + days = <?php echo $this->days?>; + return days[x]; + }, + min: -0.9, + max: 6.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per month + var avg_m = []; + for (var i = 0; i <= 13; i++) { + avg_m.push([i, <?php echo $this->averageMonth?>]); + } + Flotr.draw(document.getElementById('statsEntryPerMonth'), + [{ + data: <?php echo $this->repartitionMonth ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_m, + lines: {show: true}, + label: <?php echo $this->averageMonth?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 12, + tickFormatter: function(x) { + var x = parseInt(x), + months = <?php echo $this->months?>; + return months[(x - 1)]; + }, + min: 0.1, + max: 12.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + +} +initStats(); +</script> diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml new file mode 100644 index 000000000..30566c7ab --- /dev/null +++ b/app/views/update/apply.phtml @@ -0,0 +1,9 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('update_system'); ?></h1> + + <?php ask_info_update(); ?> +</div> diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml new file mode 100644 index 000000000..401f6acd6 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,36 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('update_system'); ?></h1> + + <p> + <?php echo _i('help'); ?> <?php echo _t('update_last', $this->last_update_time); ?> + </p> + + <?php if (!empty($this->message)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span> + <?php echo $this->message['body']; ?> + </p> + <?php } elseif ($this->check_last_hour) { ?> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('damn'); ?></span> + <?php echo _t('no_update'); ?> + </p> + <?php } ?> + + <?php + if (!$this->check_last_hour && + (empty($this->message) || $this->message['status'] !== 'good')) { + ?> + <p> + <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('update_check'); ?></a> + </p> + <?php } ?> + + <?php if ($this->update_to_apply) { ?> + <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('update_apply'); ?></a> + <?php } ?> +</div> |
