Fixed some inconsistencies in the interface (thanks Luigi).

This commit is contained in:
Loic d'Anterroches 2008-08-08 20:34:40 +02:00
parent 6360ea93be
commit bd0209a28e
7 changed files with 824 additions and 136 deletions

View File

@ -266,16 +266,20 @@ class IDF_Project extends Pluf_Model
* project. For issues, only open issues are used to generate the * project. For issues, only open issues are used to generate the
* cloud. * cloud.
* *
* @param string ('issues') or 'downloads' * @param string ('issues') 'closed_issues' or 'downloads'
* @return ArrayObject of IDF_Tag * @return ArrayObject of IDF_Tag
*/ */
public function getTagCloud($what='issues') public function getTagCloud($what='issues')
{ {
$tag_t = Pluf::factory('IDF_Tag')->getSqlTable(); $tag_t = Pluf::factory('IDF_Tag')->getSqlTable();
if ($what == 'issues') { if ($what == 'issues' or $what == 'closed_issues') {
$what_t = Pluf::factory('IDF_Issue')->getSqlTable(); $what_t = Pluf::factory('IDF_Issue')->getSqlTable();
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc'; $asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
if ($what == 'issues') {
$ostatus = $this->getTagIdsByStatus('open'); $ostatus = $this->getTagIdsByStatus('open');
} else {
$ostatus = $this->getTagIdsByStatus('closed');
}
if (count($ostatus) == 0) $ostatus[] = 0; if (count($ostatus) == 0) $ostatus[] = 0;
$sql = sprintf('SELECT '.$tag_t.'.id AS id, COUNT(*) AS nb_use FROM '.$tag_t.' '."\n". $sql = sprintf('SELECT '.$tag_t.'.id AS id, COUNT(*) AS nb_use FROM '.$tag_t.' '."\n".
'LEFT JOIN '.$asso_t.' ON idf_tag_id='.$tag_t.'.id '."\n". 'LEFT JOIN '.$asso_t.' ON idf_tag_id='.$tag_t.'.id '."\n".

View File

@ -38,7 +38,7 @@ class IDF_Views_Issue
public function index($request, $match) public function index($request, $match)
{ {
$prj = $request->project; $prj = $request->project;
$title = sprintf(__('%s Recent Issues'), (string) $prj); $title = sprintf(__('%s Open Issues'), (string) $prj);
// Get stats about the issues // Get stats about the issues
$open = $prj->getIssueCountByStatus('open'); $open = $prj->getIssueCountByStatus('open');
$closed = $prj->getIssueCountByStatus('closed'); $closed = $prj->getIssueCountByStatus('closed');
@ -47,7 +47,7 @@ class IDF_Views_Issue
$pag->class = 'recent-issues'; $pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj, $pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname); 'shortname' => $prj->shortname);
$pag->summary = __('This table shows the open recent issues.'); $pag->summary = __('This table shows the open issues.');
$otags = $prj->getTagIdsByStatus('open'); $otags = $prj->getTagIdsByStatus('open');
if (count($otags) == 0) $otags[] = 0; if (count($otags) == 0) $otags[] = 0;
$pag->forced_where = new Pluf_SQL('project=%s AND status IN ('.implode(', ', $otags).')', array($prj->id)); $pag->forced_where = new Pluf_SQL('project=%s AND status IN ('.implode(', ', $otags).')', array($prj->id));
@ -69,6 +69,7 @@ class IDF_Views_Issue
'open' => $open, 'open' => $open,
'closed' => $closed, 'closed' => $closed,
'issues' => $pag, 'issues' => $pag,
'cloud' => 'issues',
), ),
$request); $request);
} }
@ -102,7 +103,7 @@ class IDF_Views_Issue
$pag->class = 'recent-issues'; $pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj, $pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname); 'shortname' => $prj->shortname);
$pag->summary = __('This table shows the open recent issues.'); $pag->summary = __('This table shows the open issues.');
$pag->forced_where = $f_sql; $pag->forced_where = $f_sql;
$pag->action = array('IDF_Views_Issue::myIssues', array($prj->shortname, $match[2])); $pag->action = array('IDF_Views_Issue::myIssues', array($prj->shortname, $match[2]));
$pag->sort_order = array('modif_dtime', 'DESC'); $pag->sort_order = array('modif_dtime', 'DESC');
@ -294,6 +295,7 @@ class IDF_Views_Issue
'open' => $open, 'open' => $open,
'closed' => $closed, 'closed' => $closed,
'issues' => $pag, 'issues' => $pag,
'cloud' => 'closed_issues',
), ),
$request); $request);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
<li>{trans '<kbd>Shift+d</kbd>: Downloads.'}</li> <li>{trans '<kbd>Shift+d</kbd>: Downloads.'}</li>
<li>{trans '<kbd>Shift+s</kbd>: Source.'}</li> <li>{trans '<kbd>Shift+s</kbd>: Source.'}</li>
<li>{trans '<kbd>Shift+a</kbd>: Create a new issue.'}</li> <li>{trans '<kbd>Shift+a</kbd>: Create a new issue.'}</li>
<li>{trans '<kbd>Shift+i</kbd>: List of recently submitted issues.'}</li> <li>{trans '<kbd>Shift+i</kbd>: List of open issues.'}</li>
<li>{trans '<kbd>Shift+m</kbd>: The issues you submitted.'}</li> <li>{trans '<kbd>Shift+m</kbd>: The issues you submitted.'}</li>
<li>{trans '<kbd>Shift+w</kbd>: The issues assigned to you.'}</li> <li>{trans '<kbd>Shift+w</kbd>: The issues assigned to you.'}</li>
</ul> </ul>

View File

@ -2,7 +2,7 @@
{block tabissues} class="active"{/block} {block tabissues} class="active"{/block}
{block subtabs} {block subtabs}
<div id="sub-tabs"> <div id="sub-tabs">
<a href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'Recent issues'}</a> <a href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'Open issues'}</a>
{if !$user.isAnonymous()} | <a href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a> | <a href="{url 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}">{trans 'My Issues'}</a>{/if} {if !$user.isAnonymous()} | <a href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a> | <a href="{url 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}">{trans 'My Issues'}</a>{/if}
{superblock} {superblock}
</div> </div>

View File

@ -13,7 +13,7 @@
{blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p> {blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p>
<p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans} <p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans}
{assign $class = ''}{assign $i = 0} {assign $class = ''}{assign $i = 0}
<p class="smaller">{foreach $project.getTagCloud() as $label} <p class="smaller">{foreach $project.getTagCloud($cloud) as $label}
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')} {aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
{if $class != $label.class}{if $i != 0}<br />{/if}<strong class="label">{$label.class}:</strong> {/if} {if $class != $label.class}{if $i != 0}<br />{/if}<strong class="label">{$label.class}:</strong> {/if}
<a href="{$url}" class="label">{$label.name}</a>,{assign $class = $label.class}{assign $i = $i + 1}{/foreach}</p> <a href="{$url}" class="label">{$label.name}</a>,{assign $class = $label.class}{assign $i = $i + 1}{/foreach}</p>