Added ticket 45, base implementation of a timeline.

Still some cleaning of the code to have a nicer display of the timeline
especially for the issue updates.
This commit is contained in:
Loic d'Anterroches
2008-11-14 15:41:51 +01:00
parent 386ff894fc
commit b85da85dfe
13 changed files with 585 additions and 32 deletions

View File

@@ -45,7 +45,7 @@ class IDF_Views_Project
// the first tag is the featured, the last is the deprecated.
$downloads = $tags[0]->get_idf_upload_list();
}
return Pluf_Shortcuts_RenderToResponse('project-home.html',
return Pluf_Shortcuts_RenderToResponse('project/home.html',
array(
'page_title' => $title,
'team' => $team,
@@ -54,6 +54,32 @@ class IDF_Views_Project
$request);
}
/**
* Timeline of the project.
*/
public function timeline($request, $match)
{
$prj = $request->project;
$title = sprintf(__('%s Timeline'), (string) $prj);
$team = $prj->getMembershipData();
$sql = new Pluf_SQL('project=%s', array($prj->id));
$timeline = Pluf::factory('IDF_Timeline')->getList(array('filter'=>$sql->gen(), 'order' => 'creation_dtime DESC'));
$downloads = array();
if ($request->rights['hasDownloadsAccess']) {
$tags = IDF_Views_Download::getDownloadTags($prj);
// the first tag is the featured, the last is the deprecated.
$downloads = $tags[0]->get_idf_upload_list();
}
return Pluf_Shortcuts_RenderToResponse('project/timeline.html',
array(
'page_title' => $title,
'timeline' => $timeline,
'team' => $team,
'downloads' => $downloads,
),
$request);
}
/**
* Administrate the summary of a project.

View File

@@ -46,13 +46,18 @@ class IDF_Views_Source
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
}
$res = new Pluf_Template_ContextVars($scm->getChangeLog($commit, 25));
$changes = $scm->getChangeLog($commit, 25);
// Sync with the database
foreach ($changes as $change) {
IDF_Commit::getOrAdd($change, $request->project);
}
$changes = new Pluf_Template_ContextVars($changes);
$scmConf = $request->conf->getVal('scm', 'git');
return Pluf_Shortcuts_RenderToResponse('source/changelog.html',
array(
'page_title' => $title,
'title' => $title,
'changes' => $res,
'changes' => $changes,
'commit' => $commit,
'branches' => $branches,
'scm' => $scmConf,