Apply the UI enhancement of issue tags cloud to wiki and download part too.

This commit is contained in:
William MARTIN 2011-02-23 22:35:43 +01:00
parent cdedaa4604
commit 6f1bb309d4
8 changed files with 19 additions and 32 deletions

View File

@ -71,12 +71,10 @@ class IDF_Views_Download
$pag->no_results_text = __('No downloads were found.'); $pag->no_results_text = __('No downloads were found.');
$pag->sort_order = array('creation_dtime', 'DESC'); $pag->sort_order = array('creation_dtime', 'DESC');
$pag->setFromRequest($request); $pag->setFromRequest($request);
$tags = $prj->getTagCloud('downloads');
return Pluf_Shortcuts_RenderToResponse('idf/downloads/index.html', return Pluf_Shortcuts_RenderToResponse('idf/downloads/index.html',
array( array(
'page_title' => $title, 'page_title' => $title,
'downloads' => $pag, 'downloads' => $pag,
'tags' => $tags,
'deprecated' => count($ids), 'deprecated' => count($ids),
'dlabel' => $dtag, 'dlabel' => $dtag,
), ),

View File

@ -71,8 +71,7 @@ class IDF_Views_Issue
'page_title' => $title, 'page_title' => $title,
'open' => $open, 'open' => $open,
'closed' => $closed, 'closed' => $closed,
'issues' => $pag, 'issues' => $pag);
'cloud' => 'issues');
if ($api) return $params; if ($api) return $params;
return Pluf_Shortcuts_RenderToResponse('idf/issues/index.html', return Pluf_Shortcuts_RenderToResponse('idf/issues/index.html',
$params, $request); $params, $request);

View File

@ -67,12 +67,10 @@ class IDF_Views_Wiki
$pag->no_results_text = __('No documentation pages were found.'); $pag->no_results_text = __('No documentation pages were found.');
$pag->sort_order = array('title', 'ASC'); $pag->sort_order = array('title', 'ASC');
$pag->setFromRequest($request); $pag->setFromRequest($request);
$tags = $prj->getTagCloud('wiki');
return Pluf_Shortcuts_RenderToResponse('idf/wiki/index.html', return Pluf_Shortcuts_RenderToResponse('idf/wiki/index.html',
array( array(
'page_title' => $title, 'page_title' => $title,
'pages' => $pag, 'pages' => $pag,
'tags' => $tags,
'deprecated' => count($ids), 'deprecated' => count($ids),
'dlabel' => $dtag, 'dlabel' => $dtag,
), ),

View File

@ -9,13 +9,8 @@
{/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} {assign $cloud = 'downloads'}
{if !$label or $label.id != $dlabel.id} {include 'idf/tags-cloud.html'}
<p class="smaller">{foreach $tags as $lab}
{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $lab.id)}
{if $class != $lab.class}{if $i != 0}<br />{/if}<strong class="label">{$lab.class}:</strong> {/if}
<a href="{$url}" class="label">{$lab.name}</a>,{assign $i = $i + 1}{assign $class = $lab.class}{/foreach}</p>
{/if}
{if $deprecated > 0} {if $deprecated > 0}
{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $dlabel.id)} {aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $dlabel.id)}
<p class="helptext">{blocktrans}See <a href="{$url}">the deprecated files</a>.{/blocktrans}</p> <p class="helptext">{blocktrans}See <a href="{$url}">the deprecated files</a>.{/blocktrans}</p>

View File

@ -12,12 +12,6 @@
{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} {assign $cloud = 'issues'}
<div id="issue-tags" class="smaller"><dl>{foreach $project.getTagCloud($cloud) as $label} {include 'idf/tags-cloud.html'}
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
{if $class != $label.class}<dt class="label">{$label.class}</dt>{assign $i = 0}{/if}
<dd><a href="{$url}" class="label">{$label.name},</a></dd>
{assign $class = $label.class}
{assign $i = $i + 1}
{/foreach}</dl></p>
{/block} {/block}

View File

@ -0,0 +1,8 @@
{assign $class = ''}{assign $i = 0}
<div id="tagscloud" class="smaller"><dl>{foreach $project.getTagCloud($cloud) as $label}
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
{if $class != $label.class}<dt class="label">{$label.class}</dt>{assign $i = 0}{/if}
<dd><a href="{$url}" class="label">{$label.name},</a></dd>
{assign $class = $label.class}
{assign $i = $i + 1}
{/foreach}</dl></p>

View File

@ -9,13 +9,8 @@
{/block} {/block}
{block context} {block context}
<p><strong>{trans 'Number of pages:'}</strong> {$pages.nb_items}</p> <p><strong>{trans 'Number of pages:'}</strong> {$pages.nb_items}</p>
{assign $class = ''}{assign $i = 0} {assign $cloud = 'wiki'}
{if !$label or $label.id != $dlabel.id} {include 'idf/tags-cloud.html'}
<p class="smaller">{foreach $tags as $lab}
{aurl 'url', 'IDF_Views_Wiki::listLabel', array($project.shortname, $lab.id)}
{if $class != $lab.class}{if $i != 0}<br />{/if}<strong class="label">{$lab.class}:</strong> {/if}
<a href="{$url}" class="label">{$lab.name}</a>,{assign $i = $i + 1}{assign $class = $lab.class}{/foreach}</p>
{/if}
{if $deprecated > 0} {if $deprecated > 0}
{aurl 'url', 'IDF_Views_Wiki::listLabel', array($project.shortname, $dlabel.id)} {aurl 'url', 'IDF_Views_Wiki::listLabel', array($project.shortname, $dlabel.id)}
<p class="helptext">{blocktrans}See <a href="{$url}">the deprecated pages</a>.{/blocktrans}</p> <p class="helptext">{blocktrans}See <a href="{$url}">the deprecated pages</a>.{/blocktrans}</p>

View File

@ -203,16 +203,16 @@ span.px-header-title a, span.px-header-title a:link, span.px-header-title a:visi
/** /**
* Issue * Issue
*/ */
#issue-tags dl { #tagscloud dl {
margin: 0; margin: 0;
} }
#issue-tags dt { #tagscloud dt {
margin-top: .5em; margin-top: .5em;
font-weight: bold; font-weight: bold;
} }
#issue-tags dd { #tagscloud dd {
margin: 0; margin: 0;
display: inline; display: inline;
} }