Fixed issue 8, show the featured downloads on the homepage.

This commit is contained in:
Loic d'Anterroches 2008-08-05 20:33:43 +02:00
parent 884a41fbba
commit 64f41c0cd2
4 changed files with 26 additions and 1 deletions

View File

@ -185,6 +185,19 @@ class IDF_Views_Download
}
return substr($auto, 0, -1);
}
/**
* Get the download tags.
*
* @param IDF_Project
* @return ArrayObject The tags
*/
public static function getDownloadTags($project)
{
return $project->getTagsFromConfig('labels_downloads_predefined',
IDF_Form_UploadConf::init_predefined);
}
}
/**

View File

@ -39,10 +39,14 @@ class IDF_Views_Project
$prj = $request->project;
$team = $prj->getMembershipData();
$title = (string) $prj;
$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-home.html',
array(
'page_title' => $title,
'team' => $team,
'downloads' => $downloads,
),
$request);
}

View File

@ -26,5 +26,7 @@ $m['IDF_Tag'] = array('relate_to' => array('IDF_Project'));
$m['IDF_Issue'] = array('relate_to' => array('IDF_Project', 'Pluf_User', 'IDF_Tag'),
'relate_to_many' => array('IDF_Tag', 'Pluf_User'));
$m['IDF_IssueComment'] = array('relate_to' => array('IDF_Issue', 'Pluf_User'));
$m['IDF_Upload'] = array('relate_to' => array('IDF_Project', 'Pluf_User'),
'relate_to_many' => array('IDF_Tag'));
return $m;

View File

@ -10,6 +10,13 @@
{$project.description|markdown}
{/block}
{block context}
{if $downloads.count() > 0}
<p><strong>{trans 'Featured Downloads'}</strong><br />
{foreach $downloads as $download}
<span class="label"><a href="{url 'IDF_Views_Download::view', array($project.shortname, $download.id)}" title="{$download.summary}">{$download}</a></span><br />
{/foreach}
<span class="label"> </span><span class="note"><a href="{url 'IDF_Views_Download::index', array($project.shortname)}">{trans 'show more...'}</a></span>
{/if}
{assign $ko = 'owners'}
{assign $km = 'members'}
<p><strong>{trans 'Development Team'}</strong><br />
@ -17,7 +24,6 @@
{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}