1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-31 01:52:11 +01:00

Add Real public count and add actions imgs on tags

This commit is contained in:
Brice Maron 2012-06-27 17:37:38 +02:00
parent f9dfa562b9
commit 8c0a621fb3
4 changed files with 45 additions and 5 deletions

View File

@ -179,7 +179,7 @@
padding: 0.2em;
padding-left:1em;
}
#leftcontent .tag_list > li span , #leftcontent .share_list > li span{
#leftcontent .tag_list > li .tag , #leftcontent .share_list > li .tag{
background: none repeat scroll 0 0 #DEE7F8;
border: 1px solid #CAD8F3;
border-radius: 6px 6px 6px 6px;
@ -195,4 +195,13 @@
.tag_list em , .share_list em{
float:right;
display:block;
}
}
.tags_actions {
display:none;
margin-left: 0.5em;
float:right;
}
li:hover .tags_actions {
display:block;
}
li:hover em { display : none; }

View File

@ -33,7 +33,9 @@ OCP\Util::addscript('bookmarks','bookmarks');
OCP\Util::addStyle('bookmarks', 'bookmarks');
$qtags = OC_Bookmarks_Bookmarks::findTags();
$shared = OC_Bookmarks_Bookmarks::findSharing();
$tmpl = new OCP\Template( 'bookmarks', 'list', 'user' );
$tmpl->assign('tags', $qtags);
$tmpl->assign('shared', $shared);
$tmpl->printPage();

View File

@ -25,6 +25,15 @@
*/
class OC_Bookmarks_Bookmarks{
/**
* @brief Find People with whome we shared bookmarks and how much
*/
public static function findSharing($offset = 0, $limit = 10){
$query = OCP\DB::prepare('SELECT \'@public\' as name, count(*) as nbr from *PREFIX*bookmarks where public=1 group by public LIMIT '.$offset.', '.$limit);
$tags = $query->execute()->fetchAll();
return $tags;
}
/**
* @brief Finds all tags for bookmarks
*/

View File

@ -18,15 +18,35 @@
<ul class="tag_list">
<?php foreach($_['tags'] as $tag):?>
<li><span><?php echo $tag['tag'];?></span> <em><?php echo $tag['nbr'];?></em></li>
<li><span class="tag"><?php echo $tag['tag'];?></span>
<p class="tags_actions">
<span class="bookmark_edit">
<img class="svg" src="<?php echo OCP\image_path('core','actions/rename.svg') ?>" title="Edit">
</span>
<span class="bookmark_delete">
<img class="svg" src="<?php echo OCP\image_path('core','actions/delete.svg') ?>" title="Delete">
</span>
</p>
<em><?php echo $tag['nbr'];?></em>
</li>
<?php endforeach;?>
</ul>
<hr />
<ul class="share_list">
<?php foreach(array('public','user1','user2') as $tag):?>
<li><span><?php echo $tag;?></span></li>
<?php foreach($_['shared'] as $users):?>
<li><span class="tag"><?php echo $users['name'];?></span>
<p class="tags_actions">
<span class="bookmark_edit">
<img class="svg" src="<?php echo OCP\image_path('core','actions/rename.svg') ?>" title="Edit">
</span>
<span class="bookmark_delete">
<img class="svg" src="<?php echo OCP\image_path('core','actions/delete.svg') ?>" title="Delete">
</span>
</p>
<em><?php echo $users['nbr'];?></em>
</li>
<?php endforeach;?>
<ul>
</div>