Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix border around unread articles #120

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions daos/mysql/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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;
}


Expand All @@ -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;
}


Expand All @@ -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;
}


Expand All @@ -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 ) ";
Expand All @@ -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'];
}
Expand Down
30 changes: 28 additions & 2 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -146,6 +155,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;
Expand Down Expand Up @@ -348,6 +371,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 {
Expand Down