Indefero

Indefero Commit Details


Date:2008-08-06 15:19:46 (16 years 4 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3, svn
Commit:a8699db26800e6ecf96bea7747507c042d4fcbed
Parents: 3b5251c1b4808cc20a31a622fefafd849b8fb109
Message:Improved the style for the labels in the context column.

Changes:

File differences

src/IDF/Project.php
263263
264264
265265
266
266
267
267268
269
268270
269271
270
272
271273
272274
273
274
275
276
277
275
276
277
278
279
280
278281
279
280
282
283
281284
285
286
287
288
289
290
291
292
282293
283294
284295
*
* Return an array of tags sorted class, then name. Each tag get
* 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
*/
public function getTagCloud()
public function getTagCloud($what='issues')
{
$tag_t = Pluf::factory('IDF_Tag')->getSqlTable();
$issue_t = Pluf::factory('IDF_Issue')->getSqlTable();
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
$ostatus = $this->getTagIdsByStatus('open');
if (count($ostatus) == 0) $ostatus[] = 0;
$sql = sprintf('SELECT '.$tag_t.'.id AS id, COUNT(*) AS nb_use FROM '.$tag_t.' '."\n".
if ($what == 'issues') {
$what_t = Pluf::factory('IDF_Issue')->getSqlTable();
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
$ostatus = $this->getTagIdsByStatus('open');
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 '.$issue_t.' ON idf_issue_id='.$issue_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',
'LEFT JOIN '.$what_t.' ON idf_issue_id='.$what_t.'.id '."\n".
'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));
} 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();
foreach ($this->_con->select($sql) as $idc) {
$tag = new IDF_Tag($idc['id']);
src/IDF/Views/Download.php
6363
6464
6565
66
6667
67
68
6869
6970
71
7072
7173
7274
......
219221
220222
221223
224
222225
223226
224227
225228
226229
230
227231
228232
229233
$pag->no_results_text = __('No downloads were found.');
$pag->sort_order = array('file', 'ASC');
$pag->setFromRequest($request);
$tags = $prj->getTagCloud('downloads');
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
array('project' => $prj,
array(
'page_title' => $title,
'downloads' => $pag,
'tags' => $tags,
),
$request);
$pag->no_results_text = __('No downloads were found.');
$pag->sort_order = array('file', 'ASC');
$pag->setFromRequest($request);
$tags = $prj->getTagCloud('downloads');
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
array(
'page_title' => $title,
'label' => $tag,
'downloads' => $pag,
'tags' => $tags,
),
$request);
}
src/IDF/templates/downloads/index.html
99
1010
1111
12
13
14
15
16
17
1218
1319
{/block}
{block context}
<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}
src/IDF/templates/issues/index.html
1212
1313
1414
15
15
1616
1717
18
19
18
19
2020
{aurl 'closed_url', 'IDF_Views_Issue::listStatus', array($project.shortname, 'closed')}
{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}
{assign $class = ''}{assign $i = 0}
<p class="smaller">{foreach $project.getTagCloud() as $label}
{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}
www/media/idf/css/style.css
188188
189189
190190
191
192
193
194
191195
192196
193197
text-decoration: none;
}
.label {
color: #204a87;
}
span.nobrk {
white-space: nowrap;
}

Archive Download the corresponding diff file

Page rendered in 0.13058s using 13 queries.