зеркало из https://github.com/nextcloud/activity.git
add file previews
This commit is contained in:
Родитель
516d242c48
Коммит
d594ae3962
1
TODO
1
TODO
|
@ -2,7 +2,6 @@
|
|||
Todos:
|
||||
|
||||
- Add dividers for different days
|
||||
- Integrate file previews
|
||||
- Implement an public OCP API so that all apps can push events
|
||||
- Implement automatic grouping of events so that the activities are easier to read
|
||||
- Implement filtering of event types
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.activityheadline { font-weight: bold; font-size:2.5em; color: #666; padding:10px;}
|
||||
.activityheadline { font-weight: bold; font-size:2.2em; color: #666; padding:10px;}
|
||||
|
||||
.activitysubject { font-weight: bold; font-size:1.2em; color: #555;}
|
||||
.activitysubject { font-weight: bold; font-size:1.0em; color: #555;}
|
||||
.activitymessage { font-size:0.8em; color:#999;}
|
||||
.activitytime {
|
||||
font-size:0.8em;
|
||||
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
|
||||
.box {
|
||||
width: 200px;
|
||||
width: 150px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
|
|
|
@ -108,12 +108,23 @@ class Data {
|
|||
*/
|
||||
public static function show($event) {
|
||||
|
||||
$user=\OCP\User::getUser();
|
||||
|
||||
echo('<div class="box">');
|
||||
|
||||
if($event['link']<>'') echo('<a href="'.$event['link'].'">');
|
||||
echo('<span class="activitysubject">'.$event['subject'].'</span><br />');
|
||||
echo('<span class="activitymessage">'.$event['message'].'</span><br />');
|
||||
echo('<br />');
|
||||
echo('<span class="activitymessage">'.$event['message'].'</span>');
|
||||
|
||||
|
||||
$rootView = new \OC\Files\View('');
|
||||
$exist=$rootView->file_exists('/'.$user.'/files'.$event['file']);
|
||||
unset($rootView);
|
||||
// show a preview image if the file still exists
|
||||
if($exist) {
|
||||
echo('<img src="'.\OCP\Util::linkToRoute( 'core_ajax_preview' ,array('file'=>$event['file'],'x'=>150,'y'=>150)).'" />');
|
||||
}
|
||||
|
||||
if($event['link']<>'') echo('</a>');
|
||||
echo('<span class="activitytime">'.\OCP\relative_modified_date($event['timestamp']).'</span><br />');
|
||||
|
||||
|
@ -135,9 +146,6 @@ class Data {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Generate an RSS feed
|
||||
* @param string $link
|
||||
|
|
|
@ -54,7 +54,8 @@ class Hook {
|
|||
error_log('write hook '.$params['path']);
|
||||
|
||||
$link=\OCP\Util::linkToAbsolute('files','index.php',array('dir' => dirname($params['path'])));
|
||||
\OCA\Activity\Data::send('files', $params['path'].' changed', '', $params['path'], $link);
|
||||
$subject=substr($params['path'],1).' changed';
|
||||
\OCA\Activity\Data::send('files', $subject, '', $params['path'], $link);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +67,8 @@ class Hook {
|
|||
error_log('delete hook '.$params['path']);
|
||||
|
||||
$link=\OCP\Util::linkToAbsolute('files','index.php',array('dir' => dirname($params['path'])));
|
||||
\OCA\Activity\Data::send('files', $params['path'].' deleted', '', $params['path'], $link);
|
||||
$subject=substr($params['path'],1).' deleted';
|
||||
\OCA\Activity\Data::send('files', $subject, '', $params['path'], $link);
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,7 +81,8 @@ class Hook {
|
|||
error_log('create hook '.$params['path']);
|
||||
|
||||
$link=\OCP\Util::linkToAbsolute('files','index.php',array('dir' => dirname($params['path'])));
|
||||
\OCA\Activity\Data::send('files', $params['path'].' created', '', $params['path'], $link);
|
||||
$subject=substr($params['path'],1).' created';
|
||||
\OCA\Activity\Data::send('files', $subject, '', $params['path'], $link);
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче