This commit is contained in:
Frank Karlitschek 2013-09-01 10:33:11 +02:00
Родитель 516d242c48
Коммит d594ae3962
4 изменённых файлов: 22 добавлений и 12 удалений

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);
}