From b7e9b16d4991dba1173e500b70112267072990c1 Mon Sep 17 00:00:00 2001 From: Piethein Strengholt Date: Thu, 21 Mar 2013 10:14:02 +0100 Subject: [PATCH 1/4] fix border around unread articles --- public/css/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/css/style.css b/public/css/style.css index 2a9791f7ae..e2d3d0602b 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -348,6 +348,9 @@ input { .entry.selected.unread, .entry.unread { border-left:3px solid #5f9490; + border-bottom: 1px solid #5F9490; + border-right: 1px solid #5F9490; + border-top: 1px solid #5F9490; } .entry.selected { From 03cdc65e75586ec2e1b344c2d1d286361a35acca Mon Sep 17 00:00:00 2001 From: Piethein Strengholt Date: Thu, 21 Mar 2013 10:44:51 +0100 Subject: [PATCH 2/4] improve readability for span.unread --- public/css/style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/public/css/style.css b/public/css/style.css index e2d3d0602b..06d750e07c 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -146,6 +146,20 @@ input { vertical-align:sub; color: #777; } + + #nav-tags li span.unread { + background-color: #E74C3C; + border-radius: 30px; + color: white; + font-size: 10px; + font-weight: 500; + line-height: 16px; + min-width: 8px; + padding: 0 4px 0 5px; + margin-top: 6px; + position: absolute; + margin-left: 5px; + } #nav-sources-wrapper { overflow:hidden; From 066db44ef9411e9fb2a8131554e558fc4e4ec8e3 Mon Sep 17 00:00:00 2001 From: Piethein Strengholt Date: Thu, 21 Mar 2013 13:49:54 +0100 Subject: [PATCH 3/4] improve readability nav-filter span --- public/css/style.css | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 06d750e07c..b15810f11f 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -89,8 +89,17 @@ input { } #nav-filter span { - font-size:0.55em; - color:#777; + background-color: #E74C3C; + border-radius: 30px; + color: white; + font-size: 10px; + font-weight: 500; + line-height: 16px; + min-width: 8px; + padding: 0 4px 0 5px; + margin-top: 6px; + position: absolute; + margin-left: 5px; } #nav h2 { From 68c685e1766f2782fd2a39352babf8140c3e1324 Mon Sep 17 00:00:00 2001 From: Piethein Strengholt Date: Thu, 21 Mar 2013 14:07:21 +0100 Subject: [PATCH 4/4] hide span when no items are available, speed up database performance for count --- daos/mysql/Items.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/daos/mysql/Items.php b/daos/mysql/Items.php index 8122dd8231..591862ffc0 100644 --- a/daos/mysql/Items.php +++ b/daos/mysql/Items.php @@ -133,7 +133,7 @@ public function add($values) { * @param string $uid */ public function exists($uid) { - $res = \F3::get('db')->exec('SELECT COUNT(*) AS amount FROM items WHERE uid=:uid', + $res = \F3::get('db')->exec('SELECT COUNT(1) AS amount FROM items WHERE uid=:uid', array(':uid' => $uid)); return $res[0]['amount']>0; } @@ -262,7 +262,7 @@ public function getIcons() { * @param string $thumbnail name */ public function hasThumbnail($thumbnail) { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE thumbnail=:thumbnail', array(':thumbnail' => $thumbnail)); @@ -280,7 +280,7 @@ public function hasThumbnail($thumbnail) { * @param string $icon file */ public function hasIcon($icon) { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE icon=:icon', array(':icon' => $icon)); @@ -342,8 +342,8 @@ public function getLastIcon($sourceid) { * @return int amount of entries in database */ public function numberOfItems() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount FROM items'); - return $res[0]['amount']; + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items'); + return $res[0]['amount']>0; } @@ -353,10 +353,10 @@ public function numberOfItems() { * @return int amount of entries in database which are unread */ public function numberOfUnread() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE unread=1'); - return $res[0]['amount']; + return $res[0]['amount']>0; } @@ -366,10 +366,10 @@ public function numberOfUnread() { * @return int amount of entries in database which are starred */ public function numberOfStarred() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE starred=1'); - return $res[0]['amount']; + return $res[0]['amount']>0; } @@ -379,7 +379,7 @@ public function numberOfStarred() { * @return int amount of entries in database per tag */ public function numberOfUnreadForTag($tag) { - $select = 'SELECT count(*) AS amount FROM items, sources'; + $select = 'SELECT count(1) AS amount FROM items, sources'; $where = ' WHERE items.source=sources.id AND unread=1'; if ( \F3::get( 'db_type' ) == 'mysql' ) { $where .= " AND ( CONCAT( ',' , sources.tags , ',' ) LIKE :tag ) "; @@ -398,7 +398,7 @@ public function numberOfUnreadForTag($tag) { */ public function numberOfUnreadForSource($sourceid) { $res = \F3::get('db')->exec( - 'SELECT count(*) AS amount FROM items WHERE source=:source AND unread=1', + 'SELECT count(1) AS amount FROM items WHERE source=:source AND unread=1', array(':source' => $sourceid)); return $res[0]['amount']; }