aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-24 15:29:09 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-24 15:29:09 +0200
commit07444280d1a03daa7880c1539bde3a6e80945dab (patch)
treec328a11f59e07d12e624576ed86b11ada1b9d198 /app/views
parent1d2527b8bc2a125cc8b8508402417f60d314e330 (diff)
parentd1f79fee69a3667913f419cd9726ffb11f410bd0 (diff)
Merge branch 'dev' into beta
Conflicts: README.md
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/reading.phtml35
-rw-r--r--app/views/error/index.phtml13
-rw-r--r--app/views/helpers/export/opml.phtml6
-rw-r--r--app/views/helpers/javascript_vars.phtml3
-rwxr-xr-xapp/views/helpers/pagination.phtml2
-rw-r--r--app/views/helpers/view/normal_view.phtml17
-rw-r--r--app/views/helpers/view/reader_view.phtml18
-rw-r--r--app/views/importExport/export.phtml0
-rw-r--r--app/views/importExport/index.phtml31
-rw-r--r--app/views/index/formLogin.phtml23
-rw-r--r--app/views/javascript/actualize.phtml21
-rw-r--r--app/views/stats/idle.phtml20
-rw-r--r--app/views/stats/main.phtml127
-rw-r--r--app/views/stats/repartition.phtml114
14 files changed, 222 insertions, 208 deletions
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 4d439e83d..5a26501a4 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -9,7 +9,7 @@
<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; ?>" />
+ <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" min="5" max="50" />
</div>
</div>
@@ -44,10 +44,9 @@
<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 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>
@@ -64,9 +63,9 @@
<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'); ?>
+ <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>
@@ -84,6 +83,26 @@
<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'); ?>
diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml
index 6a09c3aa2..ef4fbd39d 100644
--- a/app/views/error/index.phtml
+++ b/app/views/error/index.phtml
@@ -1,18 +1,9 @@
<div class="post">
<div class="alert alert-error">
<h1 class="alert-head"><?php echo $this->code; ?></h1>
-
<p>
- <?php
- switch(Minz_Request::param ('code')) {
- case 403:
- echo Minz_Translate::t ('forbidden_access');
- break;
- case 404:
- default:
- echo Minz_Translate::t ('page_not_found');
- } ?><br />
- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_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/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index f667d093c..8622d9144 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -18,9 +18,9 @@ foreach ($this->categories as $key => $cat) {
$opml_array['body'][$key]['@outlines'][] = array(
'text' => htmlspecialchars_decode($feed->name()),
'type' => 'rss',
- 'xmlUrl' => $feed->url(),
- 'htmlUrl' => $feed->website(),
- 'description' => $feed->description()
+ 'xmlUrl' => htmlspecialchars_decode($feed->url()),
+ 'htmlUrl' => htmlspecialchars_decode($feed->website()),
+ 'description' => htmlspecialchars_decode($feed->description()),
);
}
}
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 6e0a20de3..7144c519a 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -10,7 +10,6 @@ echo 'var ',
',auto_mark_site=', $mark['site'] ? 'true' : 'false',
',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
- ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false',
',does_lazyload=', $this->conf->lazyload ? 'true' : 'false',
',sticky_post=', $this->conf->sticky_post ? 'true' : 'false';
@@ -50,6 +49,8 @@ echo 'authType="', $authType, '",',
'url_logout="', _url ('index', 'logout'), '",';
echo 'str_confirmation="', 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";
$autoActualise = Minz_Session::param('actualize_feeds', false);
echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";
diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml
index f38913c06..f237e1f3e 100755
--- a/app/views/helpers/pagination.phtml
+++ b/app/views/helpers/pagination.phtml
@@ -14,7 +14,7 @@
<?php } elseif ($markReadUrl) { ?>
<a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"<?php if ($this->conf->reading_confirm) { echo ' class="confirm"';} ?>>
<?php echo Minz_Translate::t ('nothing_to_load'); ?><br />
- <span class="bigTick">✔</span><br />
+ <span class="bigTick">✓</span><br />
<?php echo Minz_Translate::t ('mark_all_read'); ?>
</a>
<?php } else { ?>
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 6f172d579..87bf2e22a 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -81,7 +81,12 @@ if (!empty($this->entries)) {
}
}
$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);
+ 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>
<?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
@@ -92,13 +97,9 @@ if (!empty($this->entries)) {
<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
- $author = $item->author ();
- echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
- if ($lazyload) {
- echo $hidePosts ? lazyIframe(lazyimg($item->content())) : 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
diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml
index e37c78cb4..665f72849 100644
--- a/app/views/helpers/view/reader_view.phtml
+++ b/app/views/helpers/view/reader_view.phtml
@@ -21,19 +21,13 @@ if (!empty($this->entries)) {
</a>
<h1 class="title"><?php echo $item->title (); ?></h1>
- <div class="author">
- <?php $author = $item->author (); ?>
- <?php echo $author != '' ? Minz_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 ($lazyload) {
- echo lazyimg($item->content ());
- } else {
- echo $item->content();
- }
- ?>
+ <?php echo $item->content(); ?>
</div>
</div>
</div>
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
index 309058959..35371faca 100644
--- a/app/views/importExport/index.phtml
+++ b/app/views/importExport/index.phtml
@@ -1,12 +1,14 @@
-<?php $this->partial ('aside_feed'); ?>
+<?php $this->partial('aside_feed'); ?>
<div class="post ">
- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
+ <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 Minz_Translate::t ('import'); ?></legend>
+ <legend><?php echo _t('import'); ?></legend>
<div class="form-group">
- <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label>
+ <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>
@@ -14,27 +16,34 @@
<div class="form-group form-actions">
<div class="group-controls">
- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button>
+ <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 Minz_Translate::t ('export'); ?></legend>
+ <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 Minz_Translate::t ('export_opml'); ?>
+ <?php echo _t('export_opml'); ?>
</label>
<label class="checkbox" for="export_starred">
- <input type="checkbox" name="export_starred" id="export_starred" value="1" checked="checked" />
- <?php echo Minz_Translate::t ('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>
- <select name="export_feeds[]" size="<?php echo min(10, count($this->feeds)); ?>" multiple="multiple">
+ <?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 } ?>
@@ -44,7 +53,7 @@
<div class="form-group form-actions">
<div class="group-controls">
- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('export'); ?></button>
+ <button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button>
</div>
</div>
</form>
diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml
index cc925ea59..b79c1b614 100644
--- a/app/views/index/formLogin.phtml
+++ b/app/views/index/formLogin.phtml
@@ -1,32 +1,39 @@
<div class="prompt">
- <h1><?php echo Minz_Translate::t('login'); ?></h1><?php
+ <h1><?php echo _t('login'); ?></h1><?php
switch (Minz_Configuration::authType()) {
case 'form':
?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>">
<div>
- <label for="username"><?php echo Minz_Translate::t('username'); ?></label>
+ <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 Minz_Translate::t('password'); ?></label>
+ <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 Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript>
+ <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript>
</div>
<div>
- <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button>
+ <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>
- <?php echo FreshRSS_Themes::icon('login'); ?>
- <a class="signin" href="#"><?php echo Minz_Translate::t('login_with_persona'); ?></a>
+ <?php echo _i('login'); ?>
+ <a class="signin" href="#"><?php echo _t('login_with_persona'); ?></a>
</p><?php
break;
} ?>
- <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 _t('about_freshrss'); ?></a></p>
</div>
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index d08dc47d1..74cef4998 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,25 +1,24 @@
"use strict";
-var feeds = [<?php
- foreach ($this->feeds as $feed) {
- echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n";
- }
- ?>],
+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) {
if (init) {
$("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\
- <?php echo _t('refresh'); ?> <span class=\"progress\">0 / " + feed_count + "</span><br />\
- <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feed_count + "\"></progress>\
+ <?php echo _t('refresh'); ?><br /><span class=\"title\">/</span><br />\
+ <span class=\"progress\">0 / " + feed_count + "</span>\
</div>");
} else {
window.location.reload();
}
}
-function updateProgressBar(i) {
- $("#actualizeProgressBar").val(i);
+function updateProgressBar(i, title_feed) {
$("#actualizeProgress .progress").html(i + " / " + feed_count);
+ $("#actualizeProgress .title").html(title_feed);
}
function updateFeeds() {
@@ -43,10 +42,10 @@ function updateFeed() {
$.ajax({
type: 'POST',
- url: feed,
+ url: feed['url'],
}).complete(function (data) {
feed_processed++;
- updateProgressBar(feed_processed);
+ updateProgressBar(feed_processed, feed['title']);
if (feed_processed === feed_count) {
initProgressBar(false);
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index 356fea20f..2ba5237f7 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -1,19 +1,25 @@
<?php $this->partial('aside_stats'); ?>
<div class="post content">
- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo _t ('back_to_rss_feeds'); ?></a>
+ <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a>
- <h1><?php echo _t ('stats_idle'); ?></h1>
+ <h1><?php echo _t('stats_idle'); ?></h1>
- <?php foreach ($this->idleFeeds as $period => $feeds){ ?>
+ <?php
+ foreach ($this->idleFeeds as $period => $feeds) {
+ if (!empty($feeds)) {
+ ?>
<div class="stat">
- <h2><?php echo _t ($period); ?></h2>
+ <h2><?php echo _t($period); ?></h2>
<ul>
- <?php foreach ($feeds as $feed){ ?>
- <li><?php echo $feed; ?></li>
+ <?php foreach ($feeds as $feed) { ?>
+ <li><a href="<?php echo _url('configure', 'feed', 'id', $feed['id']); ?>" title="<?php echo date('Y-m-d', $feed['last_date']); ?>"><?php echo $feed['name']; ?></a></li>
<?php } ?>
</ul>
</div>
- <?php } ?>
+ <?php
+ }
+ }
+ ?>
</div>
diff --git a/app/views/stats/main.phtml b/app/views/stats/main.phtml
deleted file mode 100644
index fe372e221..000000000
--- a/app/views/stats/main.phtml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php $this->partial('aside_stats'); ?>
-
-<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_main'); ?></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 formatNumber($this->repartition['main_stream']['total']); ?></td>
- <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['total']); ?></td>
- </tr>
- <tr>
- <th><?php echo Minz_Translate::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 Minz_Translate::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 Minz_Translate::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">
- <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 formatNumber($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 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..9d2eb28e4
--- /dev/null
+++ b/app/views/stats/repartition.phtml
@@ -0,0 +1,114 @@
+<?php $this->partial('aside_stats'); ?>
+
+<div class="post content">
+ <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 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 href="<?php echo _url('configure', 'feed', 'id', $this->feed->id()); ?>">
+ <?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">
+ <h2><?php echo _t('stats_entry_per_day_of_week'); ?></h2>
+ <div id="statsEntryPerDayOfWeek" style="height: 300px"></div>
+ </div>
+
+ <div class="stat">
+ <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
+ Flotr.draw(document.getElementById('statsEntryPerHour'),
+ [<?php echo $this->repartitionHour ?>],
+ {
+ grid: {verticalLines: false},
+ bars: {horizontal: false, show: true},
+ xaxis: {noTicks: 23,
+ tickFormatter: function(x) {
+ var x = parseInt(x);
+ return x + 1;
+ },
+ min: -0.9,
+ max: 23.9,
+ tickDecimals: 0},
+ yaxis: {min: 0},
+ mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}}
+ });
+ // Entry per day of week
+ Flotr.draw(document.getElementById('statsEntryPerDayOfWeek'),
+ [<?php echo $this->repartitionDayOfWeek ?>],
+ {
+ grid: {verticalLines: false},
+ bars: {horizontal: false, show: true},
+ 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},
+ mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}}
+ });
+ // Entry per month
+ Flotr.draw(document.getElementById('statsEntryPerMonth'),
+ [<?php echo $this->repartitionMonth ?>],
+ {
+ grid: {verticalLines: false},
+ bars: {horizontal: false, show: true},
+ 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},
+ mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}}
+ });
+
+}
+initStats();
+</script>