diff options
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/archiving.phtml | 2 | ||||
| -rw-r--r-- | app/views/configure/display.phtml | 19 | ||||
| -rw-r--r-- | app/views/configure/feed.phtml | 18 | ||||
| -rw-r--r-- | app/views/configure/sharing.phtml | 12 | ||||
| -rw-r--r-- | app/views/configure/users.phtml | 8 | ||||
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 16 | ||||
| -rw-r--r-- | app/views/index/formLogin.phtml | 31 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 2 | ||||
| -rw-r--r-- | app/views/index/stats.phtml | 125 |
9 files changed, 179 insertions, 54 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 6e26ca81e..e144d0f45 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -39,7 +39,7 @@ <div class="form-group"> <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p> <div class="group-controls"> - <p><?php echo $this->nb_total, ' ', Minz_Translate::t('articles'), ', ', formatBytes($this->size_user); ?></p> + <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'); ?> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 725356c8d..9104e4ef1 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -21,14 +21,17 @@ <div class="form-group"> <label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label> <div class="group-controls"> - <select name="theme" id="theme" required=""> - <option></option> - <?php foreach ($this->themes as $theme) { ?> - <option value="<?php echo $theme['id']; ?>"<?php echo $this->conf->theme === $theme['id'] ? ' selected="selected"' : ''; ?>> - <?php echo $theme['name'] . ' — ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?> - </option> - <?php } ?> - </select> + <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> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index fc26ab58b..138808a9f 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -16,26 +16,26 @@ <div class="form-group"> <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> <div class="group-controls"> - <input type="text" name="name" id="name" value="<?php echo $this->flux->name () ; ?>" /> + <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 Minz_Translate::t ('feed_description'); ?></label> + <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> <div class="group-controls"> <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"><?php echo Minz_Translate::t ('website_url'); ?></label> + <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> <div class="group-controls"> - <input type="text" name="website" id="website" value="<?php echo $this->flux->website (); ?>" /> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> <a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('feed_url'); ?></label> + <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> <div class="group-controls"> - <input type="text" name="url" id="url" value="<?php echo $this->flux->url (); ?>" /> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> <a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> <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> @@ -106,13 +106,13 @@ <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" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + <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 Minz_Translate::t ('http_password'); ?></label> <div class="group-controls"> - <input type="password" name="http_pass" id="http_pass" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> </div> </div> @@ -127,7 +127,7 @@ <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" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" /> + <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> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index c6a96b48a..e3ea11665 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -10,20 +10,20 @@ <?php echo Minz_Translate::t ('your_shaarli'); ?> </label> <div class="group-controls"> - <input type="url" id="shaarli" name="shaarli" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> + <input type="url" id="shaarli" name="shaarli" class="extend" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Minz_Translate::t ('more_information'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="poche"> - <?php echo Minz_Translate::t ('your_poche'); ?> + <label class="group-name" for="wallabag"> + <?php echo Minz_Translate::t ('your_wallabag'); ?> </label> <div class="group-controls"> - <input type="url" id="poche" name="poche" value="<?php echo $this->conf->sharing ('poche'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> + <input type="url" id="wallabag" name="wallabag" class="extend" value="<?php echo $this->conf->sharing ('wallabag'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.inthepoche.com/"><?php echo Minz_Translate::t ('more_information'); ?></a> + <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.wallabag.org"><?php echo Minz_Translate::t ('more_information'); ?></a> </div> </div> @@ -32,7 +32,7 @@ <?php echo Minz_Translate::t ('your_diaspora_pod'); ?> </label> <div class="group-controls"> - <input type="url" id="diaspora" name="diaspora" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> + <input type="url" id="diaspora" name="diaspora" class="extend" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Minz_Translate::t ('more_information'); ?></a> </div> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 990c80acc..8ab4c04ba 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -29,7 +29,7 @@ <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" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> + <input type="email" id="mail_login" name="mail_login" class="extend" 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> @@ -49,7 +49,9 @@ <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"> - <option value=""></option> + <?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"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' 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> @@ -143,7 +145,7 @@ <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" placeholder="alice@example.net" /> + <input type="email" id="new_user_email" name="new_user_email" class="extend" placeholder="alice@example.net" /> </div> </div> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index a1df87579..7b7faccee 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -9,11 +9,11 @@ if (!empty($this->entries)) { $display_others = true; if ($this->loginOk) { $shaarli = $this->conf->sharing ('shaarli'); - $poche = $this->conf->sharing ('poche'); + $wallabag = $this->conf->sharing ('wallabag'); $diaspora = $this->conf->sharing ('diaspora'); } else { $shaarli = ''; - $poche = ''; + $wallabag = ''; $diaspora = ''; } $twitter = $this->conf->sharing ('twitter'); @@ -30,7 +30,7 @@ if (!empty($this->entries)) { $bottomline_read = $this->conf->bottomline_read; $bottomline_favorite = $this->conf->bottomline_favorite; $bottomline_sharing = $this->conf->bottomline_sharing && ( - $shaarli || $poche || $diaspora || $twitter || + $shaarli || $wallabag || $diaspora || $twitter || $google_plus || $facebook || $email || $print); $bottomline_tags = $this->conf->bottomline_tags; $bottomline_date = $this->conf->bottomline_date; @@ -38,6 +38,9 @@ if (!empty($this->entries)) { ?> <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + ?><div id="new-article"> + <a href="<?php echo _url('index', 'index'); ?>"><?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 @@ -62,7 +65,6 @@ if (!empty($this->entries)) { ?></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) { @@ -150,10 +152,10 @@ if (!empty($this->entries)) { <?php echo Minz_Translate::t ('shaarli'); ?> </a> </li> - <?php } if ($poche) { ?> + <?php } if ($wallabag) { ?> <li class="item"> - <a target="_blank" href="<?php echo $poche . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Minz_Translate::t ('poche'); ?> + <a target="_blank" href="<?php echo $wallabag . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> + <?php echo Minz_Translate::t ('wallabag'); ?> </a> </li> <?php } if ($diaspora) { ?> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml index cc43bcd19..e4560c1a0 100644 --- a/app/views/index/formLogin.phtml +++ b/app/views/index/formLogin.phtml @@ -1,5 +1,4 @@ -<div class="post content"> - +<div class="prompt"> <?php if (Minz_Configuration::canLogIn()) { ?><h1><?php echo Minz_Translate::t('login'); ?></h1><?php @@ -7,25 +6,17 @@ if (Minz_Configuration::canLogIn()) { case 'form': ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> - <div class="form-group"> - <label class="group-name" for="username"><?php echo Minz_Translate::t('username'); ?></label> - <div class="group-controls"> - <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> - <div class="group-controls"> + <p> + <label for="username"><?php echo Minz_Translate::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" /> + </p><p> + <label for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> <input type="password" id="passwordPlain" required="required" /> - <input type="hidden" id="challenge" name="challenge" /> + <input type="hidden" id="challenge" name="challenge" /><br /> <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> - </div> - </div> + </p><p> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> + </p> </form><?php break; @@ -39,5 +30,5 @@ if (Minz_Configuration::canLogIn()) { } ?> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> +<p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> </div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 9a7c9f3b9..4545a33e4 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -12,6 +12,8 @@ if ($this->loginOk || Minz_Configuration::allowAnonymous()) { } elseif ($output === 'global') { $this->renderHelper ('view/global_view'); } else { + Minz_Request::_param ('output', 'normal'); + $output = 'normal'; $this->renderHelper ('view/normal_view'); } } elseif ($output === 'rss') { diff --git a/app/views/index/stats.phtml b/app/views/index/stats.phtml new file mode 100644 index 000000000..ae9db172b --- /dev/null +++ b/app/views/index/stats.phtml @@ -0,0 +1,125 @@ +<div class="post content"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + + <h1><?php echo Minz_Translate::t ('stats'); ?></h1> + + <div class="stat"> + <h2><?php echo Minz_Translate::t ('stats_entry_repartition')?></h2> + <table> + <thead> + <tr> + <th> </th> + <th><?php echo Minz_Translate::t ('main_stream')?></th> + <th><?php echo Minz_Translate::t ('all_feeds')?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?php echo Minz_Translate::t ('status_total')?></th> + <td class="numeric"><?php echo $this->repartition['main_stream']['total']?></td> + <td class="numeric"><?php echo $this->repartition['all_feeds']['total']?></td> + </tr> + <tr> + <th><?php echo Minz_Translate::t ('status_read')?></th> + <td class="numeric"><?php echo $this->repartition['main_stream']['read']?></td> + <td class="numeric"><?php echo $this->repartition['all_feeds']['read']?></td> + </tr> + <tr> + <th><?php echo Minz_Translate::t ('status_unread')?></th> + <td class="numeric"><?php echo $this->repartition['main_stream']['unread']?></td> + <td class="numeric"><?php echo $this->repartition['all_feeds']['unread']?></td> + </tr> + <tr> + <th><?php echo Minz_Translate::t ('status_favorites')?></th> + <td class="numeric"><?php echo $this->repartition['main_stream']['favorite']?></td> + <td class="numeric"><?php echo $this->repartition['all_feeds']['favorite']?></td> + </tr> + </tbody> + </table> + </div> + + <div class="stat"> + <h2><?php echo Minz_Translate::t ('stats_entry_per_day')?></h2> + <div id="statsEntryPerDay" style="height: 300px"></div> + </div> + + <div class="stat"> + <h2><?php echo Minz_Translate::t ('stats_feed_per_category')?></h2> + <div id="statsFeedPerCategory" style="height: 300px"></div> + <div id="statsFeedPerCategoryLegend"></div> + </div> + + <div class="stat"> + <h2><?php echo Minz_Translate::t ('stats_entry_per_category')?></h2> + <div id="statsEntryPerCategory" style="height: 300px"></div> + <div id="statsEntryPerCategoryLegend"></div> + </div> + + <div class="stat"> + <h2><?php echo Minz_Translate::t ('stats_top_feed')?></h2> + <table> + <thead> + <tr> + <th><?php echo Minz_Translate::t ('feed')?></th> + <th><?php echo Minz_Translate::t ('category')?></th> + <th><?php echo Minz_Translate::t ('stats_entry_count')?></th> + </tr> + </thead> + <tbody> + <?php foreach ($this->topFeed as $feed):?> + <tr> + <td><?php echo $feed['name']?></td> + <td><?php echo $feed['category']?></td> + <td class="numeric"><?php echo $feed['count']?></td> + </tr> + <?php endforeach;?> + </tbody> + </table> + </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 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 + ' - '+ 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 + ' - '+ obj.y + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, + legend: {container: document.getElementById('statsEntryPerCategoryLegend'), noColumns: 3} + }); +} +initStats(); +</script> |
