From 269c6b88c4486a0ae1a92df65578ee6ab6f0bbca Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 22 Aug 2015 09:33:58 -0400 Subject: Add a system configuration page It allows to modify system configuration from the interface. At the moment, only limits are modifiable. The user limit was removed from the user page and added here along with categories and feeds limits. --- app/layout/aside_configure.phtml | 3 +++ app/layout/header.phtml | 1 + 2 files changed, 4 insertions(+) (limited to 'app/layout') diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 7567a8206..d956ec21f 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -27,6 +27,9 @@ +
  • + +
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 41a63a565..238c664b0 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -67,6 +67,7 @@ if (FreshRSS_Auth::accessNeedsAction()) {
  • +
  • -- cgit v1.2.3 From 84824f8599ef8b7613c7c6829221aa8b88aa3846 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 12 Sep 2015 18:58:08 -0400 Subject: Add a visual alert on categories When a category has one or more feeds with errors, a visual warning is displayed before the name of the category. --- app/Models/Category.php | 7 +++++++ app/layout/aside_feed.phtml | 2 +- p/themes/base-theme/template.css | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'app/layout') diff --git a/app/Models/Category.php b/app/Models/Category.php index 37cb44dc3..9a44a2d09 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -6,6 +6,7 @@ class FreshRSS_Category extends Minz_Model { private $nbFeed = -1; private $nbNotRead = -1; private $feeds = null; + private $hasFeedsWithError = false; public function __construct($name = '', $feeds = null) { $this->_name($name); @@ -16,6 +17,7 @@ class FreshRSS_Category extends Minz_Model { foreach ($feeds as $feed) { $this->nbFeed++; $this->nbNotRead += $feed->nbNotRead(); + $this->hasFeedsWithError |= $feed->inError(); } } } @@ -51,12 +53,17 @@ class FreshRSS_Category extends Minz_Model { foreach ($this->feeds as $feed) { $this->nbFeed++; $this->nbNotRead += $feed->nbNotRead(); + $this->hasFeedsWithError |= $feed->inError(); } } return $this->feeds; } + public function hasFeedsWithError() { + return $this->hasFeedsWithError; + } + public function _id($value) { $this->id = $value; } diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index a6d22f878..307db6af8 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -45,7 +45,7 @@
    • diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index a299a5ddf..918d05942 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -776,6 +776,9 @@ input:checked + .slide-container .properties { .category .title:not([data-unread="0"]):after { content: attr(data-unread); } +.category .title.error::before { + content: "⚠"; +} .feed .item-title:not([data-unread="0"]):before { content: "(" attr(data-unread) ") "; } -- cgit v1.2.3 From 02a3cb4652d4c87ec3202d39f6cd8a240a1a7373 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Oct 2015 23:47:13 +0200 Subject: Config allow robots https://github.com/FreshRSS/FreshRSS/issues/938 --- app/Models/Context.php | 13 +++++++++++-- app/layout/layout.phtml | 4 ++++ data/config.default.php | 3 +++ index.html | 2 +- p/index.html | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) (limited to 'app/layout') diff --git a/app/Models/Context.php b/app/Models/Context.php index dbdbfaa69..d8dd81e88 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -10,6 +10,7 @@ class FreshRSS_Context { public static $categories = array(); public static $name = ''; + public static $description = ''; public static $total_unread = 0; public static $total_starred = array( @@ -93,6 +94,13 @@ class FreshRSS_Context { } } + /** + * Return true iif the current requests target a feed and not a category or all articles. + */ + public static function isFeed() { + return self::$current_get['feed'] != false; + } + /** * Return true if $get parameter correspond to the $current_get attribute. */ @@ -146,8 +154,8 @@ class FreshRSS_Context { self::$state = self::$state | FreshRSS_Entry::STATE_FAVORITE; break; case 'f': - // We try to find the corresponding feed. - $feed = FreshRSS_CategoryDAO::findFeed(self::$categories, $id); + // We try to find the corresponding feed. When allowing robots, always retrieve the full feed including description + $feed = FreshRSS_Context::$system_conf->allow_robots ? null : FreshRSS_CategoryDAO::findFeed(self::$categories, $id); if ($feed === null) { $feedDAO = FreshRSS_Factory::createFeedDao(); $feed = $feedDAO->searchById($id); @@ -160,6 +168,7 @@ class FreshRSS_Context { self::$current_get['feed'] = $id; self::$current_get['category'] = $feed->category(); self::$name = $feed->name(); + self::$description = $feed->description(); self::$get_unread = $feed->nbNotRead(); break; case 'c': diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 083ffd4b3..d7e9d115b 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -36,7 +36,11 @@ +allow_robots) { ?> + + + partial('header'); ?> diff --git a/data/config.default.php b/data/config.default.php index a7a29b12c..8eccee8a5 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -61,6 +61,9 @@ return array( # /!\ It should NOT be enabled if base_url is not reachable by an external server. 'pubsubhubbub_enabled' => false, + # Allow or not Web robots (e.g. search engines) in HTML headers. + 'allow_robots' => false, + 'limits' => array( # Duration in seconds of the SimplePie cache, diff --git a/index.html b/index.html index 6ac025960..5414211a1 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Redirection - + diff --git a/p/index.html b/p/index.html index 260f437bd..ef5cb87ce 100644 --- a/p/index.html +++ b/p/index.html @@ -8,7 +8,7 @@ - +