Improved the style for the labels in the context column.
This commit is contained in:
parent
3b5251c1b4
commit
a8699db268
@ -263,22 +263,33 @@ class IDF_Project extends Pluf_Model
|
|||||||
*
|
*
|
||||||
* Return an array of tags sorted class, then name. Each tag get
|
* Return an array of tags sorted class, then name. Each tag get
|
||||||
* the extra property 'nb_use' for the number of use in the
|
* the extra property 'nb_use' for the number of use in the
|
||||||
* project. Only open issues are used to generate the cloud.
|
* project. For issues, only open issues are used to generate the
|
||||||
|
* cloud.
|
||||||
*
|
*
|
||||||
|
* @param string ('issues') or 'downloads'
|
||||||
* @return ArrayObject of IDF_Tag
|
* @return ArrayObject of IDF_Tag
|
||||||
*/
|
*/
|
||||||
public function getTagCloud()
|
public function getTagCloud($what='issues')
|
||||||
{
|
{
|
||||||
$tag_t = Pluf::factory('IDF_Tag')->getSqlTable();
|
$tag_t = Pluf::factory('IDF_Tag')->getSqlTable();
|
||||||
$issue_t = Pluf::factory('IDF_Issue')->getSqlTable();
|
if ($what == 'issues') {
|
||||||
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
|
$what_t = Pluf::factory('IDF_Issue')->getSqlTable();
|
||||||
$ostatus = $this->getTagIdsByStatus('open');
|
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
|
||||||
if (count($ostatus) == 0) $ostatus[] = 0;
|
$ostatus = $this->getTagIdsByStatus('open');
|
||||||
$sql = sprintf('SELECT '.$tag_t.'.id AS id, COUNT(*) AS nb_use FROM '.$tag_t.' '."\n".
|
if (count($ostatus) == 0) $ostatus[] = 0;
|
||||||
|
$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".
|
||||||
'LEFT JOIN '.$issue_t.' ON idf_issue_id='.$issue_t.'.id '."\n".
|
'LEFT JOIN '.$what_t.' ON idf_issue_id='.$what_t.'.id '."\n".
|
||||||
'WHERE idf_tag_id IS NOT NULL AND '.$issue_t.'.status IN (%s) AND '.$issue_t.'.project='.$this->id.' GROUP BY '.$tag_t.'.id, '.$tag_t.'.class, '.$tag_t.'.name ORDER BY '.$tag_t.'.class ASC, '.$tag_t.'.name ASC',
|
'WHERE idf_tag_id IS NOT NULL AND '.$what_t.'.status IN (%s) AND '.$what_t.'.project='.$this->id.' GROUP BY '.$tag_t.'.id, '.$tag_t.'.class, '.$tag_t.'.name ORDER BY '.$tag_t.'.class ASC, '.$tag_t.'.name ASC',
|
||||||
implode(', ', $ostatus));
|
implode(', ', $ostatus));
|
||||||
|
} else {
|
||||||
|
$what_t = Pluf::factory('IDF_Upload')->getSqlTable();
|
||||||
|
$asso_t = $this->_con->pfx.'idf_tag_idf_upload_assoc';
|
||||||
|
$sql = '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 '.$what_t.' ON idf_upload_id='.$what_t.'.id '."\n".
|
||||||
|
'WHERE idf_tag_id IS NOT NULL AND '.$what_t.'.project='.$this->id.' GROUP BY '.$tag_t.'.id, '.$tag_t.'.class, '.$tag_t.'.name ORDER BY '.$tag_t.'.class ASC, '.$tag_t.'.name ASC';
|
||||||
|
}
|
||||||
$tags = array();
|
$tags = array();
|
||||||
foreach ($this->_con->select($sql) as $idc) {
|
foreach ($this->_con->select($sql) as $idc) {
|
||||||
$tag = new IDF_Tag($idc['id']);
|
$tag = new IDF_Tag($idc['id']);
|
||||||
|
@ -63,10 +63,12 @@ class IDF_Views_Download
|
|||||||
$pag->no_results_text = __('No downloads were found.');
|
$pag->no_results_text = __('No downloads were found.');
|
||||||
$pag->sort_order = array('file', 'ASC');
|
$pag->sort_order = array('file', 'ASC');
|
||||||
$pag->setFromRequest($request);
|
$pag->setFromRequest($request);
|
||||||
|
$tags = $prj->getTagCloud('downloads');
|
||||||
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
|
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
|
||||||
array('project' => $prj,
|
array(
|
||||||
'page_title' => $title,
|
'page_title' => $title,
|
||||||
'downloads' => $pag,
|
'downloads' => $pag,
|
||||||
|
'tags' => $tags,
|
||||||
),
|
),
|
||||||
$request);
|
$request);
|
||||||
|
|
||||||
@ -219,11 +221,13 @@ class IDF_Views_Download
|
|||||||
$pag->no_results_text = __('No downloads were found.');
|
$pag->no_results_text = __('No downloads were found.');
|
||||||
$pag->sort_order = array('file', 'ASC');
|
$pag->sort_order = array('file', 'ASC');
|
||||||
$pag->setFromRequest($request);
|
$pag->setFromRequest($request);
|
||||||
|
$tags = $prj->getTagCloud('downloads');
|
||||||
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
|
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
|
||||||
array(
|
array(
|
||||||
'page_title' => $title,
|
'page_title' => $title,
|
||||||
'label' => $tag,
|
'label' => $tag,
|
||||||
'downloads' => $pag,
|
'downloads' => $pag,
|
||||||
|
'tags' => $tags,
|
||||||
),
|
),
|
||||||
$request);
|
$request);
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,11 @@
|
|||||||
{/block}
|
{/block}
|
||||||
{block context}
|
{block context}
|
||||||
<p><strong>{trans 'Number of files:'}</strong> {$downloads.nb_items}</p>
|
<p><strong>{trans 'Number of files:'}</strong> {$downloads.nb_items}</p>
|
||||||
|
{assign $class = ''}{assign $i = 0}
|
||||||
|
<p class="smaller">{foreach $tags as $label}
|
||||||
|
{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $label.id)}
|
||||||
|
{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 $i = $i + 1}{assign $class = $label.class}{/foreach}</p>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
{aurl 'closed_url', 'IDF_Views_Issue::listStatus', array($project.shortname, 'closed')}
|
{aurl 'closed_url', 'IDF_Views_Issue::listStatus', array($project.shortname, 'closed')}
|
||||||
{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}
|
||||||
<p class="smaller">{foreach $project.getTagCloud() as $label}
|
<p class="smaller">{foreach $project.getTagCloud() 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')}
|
||||||
<a href="{$url}" class="label"><strong>{$label.class}:</strong>{$label.name}</a>{/foreach}</p>
|
{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>
|
||||||
{/block}
|
{/block}
|
||||||
|
@ -188,6 +188,10 @@ a.label {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #204a87;
|
||||||
|
}
|
||||||
|
|
||||||
span.nobrk {
|
span.nobrk {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user