require_once('pages/shortlog.class.php');
class page_summary {
- private $page, $phpgitweb;
+ private $page, $phpgitweb;
- public function main($phpgitweb, $project) {
+ public function main($phpgitweb, $project) {
$this->phpgitweb = $phpgitweb;
if(!$project)
- return;
+ return new ContentProvider('main', 'err400');
$project['refs'] = $phpgitweb->get_project_loader()->getProjectRefs($project);
+ $phpgitweb->append_header_nav("summary", null, true);
+ $phpgitweb->append_title("summary");
+ CommitLoader::parse(true);
$this->page = new ContentProvider('summary', 'main');
$this->page->set('description', htmlentities($project['description']));
$this->page->set('owner', htmlentities($project['owner']));
+ $giturls = GitConfig::$GIT_BASE_URL;
+ $urlfield = "";
+ foreach($giturls as $url) {
+ if($urlfield != "")
+ $urlfield .= "<br \>";
+ $urlfield .= $url.(substr($url, -1) == '/' ? '' : '/').$project['name'];
+ }
+ if($urlfield != "")
+ $this->page->set('giturl', new ContentProvider('summary', 'giturl', array('git_link' => $urlfield)));
+ else
+ $this->page->set('giturl', '');
+
$shortlog = new shortlog();
$this->page->set('shortlog', $shortlog->generate_shortlog($project, null, 16, 0, null, false));
+ $first_commit = $shortlog->get_first_commit();
+
+ $this->page->set('last_change', gmdate('r', $first_commit['committer_time']));
return $this->page;
}