Added a project home.

This commit is contained in:
Loic d'Anterroches 2008-07-29 21:18:02 +02:00
parent ccf24df131
commit c50e218704
4 changed files with 48 additions and 2 deletions

View File

@ -31,6 +31,23 @@ Pluf::loadFunction('Pluf_Shortcuts_GetFormForModel');
*/ */
class IDF_Views_Project class IDF_Views_Project
{ {
/**
* Home page of a project.
*/
public function home($request, $match)
{
$prj = $request->project;
$team = $prj->getMembershipData();
$title = (string) $prj;
return Pluf_Shortcuts_RenderToResponse('project-home.html',
array(
'page_title' => $title,
'team' => $team,
),
$request);
}
/** /**
* Administrate the summary of a project. * Administrate the summary of a project.
*/ */

View File

@ -41,7 +41,7 @@
<div id="header"> <div id="header">
<div id="main-tabs"> <div id="main-tabs">
{if $project} {if $project}
{* <a href="{url 'IDF_Views_Project::home', array($project.shortname)}"{block tabhome}{/block}>{trans 'Project Home'}</a> *} <a href="{url 'IDF_Views_Project::home', array($project.shortname)}"{block tabhome}{/block}>{trans 'Project Home'}</a>
<a href="{url 'IDF_Views_Issue::index', array($project.shortname)}"{block tabissues}{/block}>{trans 'Issues'}</a> <a href="{url 'IDF_Views_Issue::index', array($project.shortname)}"{block tabissues}{/block}>{trans 'Issues'}</a>
<a href="{url 'IDF_Views_Source::treeBase', array($project.shortname, 'master')}"{block tabsource}{/block}>{trans 'Source'}</a> <a href="{url 'IDF_Views_Source::treeBase', array($project.shortname, 'master')}"{block tabsource}{/block}>{trans 'Source'}</a>
{if $isOwner} {if $isOwner}

View File

@ -6,7 +6,7 @@
{if $user.administrator}<p>{blocktrans}Create a new project.{/blocktrans}</p>{/if} {if $user.administrator}<p>{blocktrans}Create a new project.{/blocktrans}</p>{/if}
{else} {else}
<ul>{foreach $projects as $p} <ul>{foreach $projects as $p}
<li><a href="{url 'IDF_Views::projectHome', array($p.shortname)}">{$p}</a> - {$p.description}</li> <li><a href="{url 'IDF_Views_Project::home', array($p.shortname)}">{$p}</a></li>
{/foreach}</ul> {/foreach}</ul>
{/if} {/if}
{/block} {/block}

View File

@ -0,0 +1,29 @@
{extends "base.html"}
{block tabhome} class="active"{/block}
{block subtabs}
<div id="sub-tabs">
{trans 'Welcome'} {superblock}
</div>
{/block}
{block body}
{$project.description}
{/block}
{block context}
{assign $ko = 'owners'}
{assign $km = 'members'}
<p><strong>{trans 'Development Team'}</strong><br />
{trans 'Admins'}<br />
{foreach $team[$ko] as $owner}
<span class="label">{$owner}</span><br />
{/foreach}
{if count($team[$km]) > 0}
{trans 'Happy Crew'}<br />
{foreach $team[$km] as $member}
<span class="label">{$member}</span><br />
{/foreach}
{/if}
</p>
{/block}