Render resources in markdown context properly and implement all the

documented render options.
This commit is contained in:
Thomas Keller
2011-12-06 01:39:45 +01:00
parent 3897d7facb
commit 8fde1e4762
5 changed files with 221 additions and 11 deletions

View File

@@ -19,13 +19,16 @@ by {$submitter}.{/blocktrans}</p>
<div id="wiki-resource">
<p class="desc">{$resource.summary}</p>
<p class="preview">{$rev.render()|unsafe}</p>
{assign $preview = $rev.renderRaw()}
{if $preview == ''}
{assign $preview = __('Unable to render preview for this MIME type.')}
{/if}
<p class="preview">{$preview|unsafe}</p>
{aurl 'url', 'IDF_Views_Wiki::rawResource', array($project.shortname, $rev.id), array('attachment' => 1)}
<ul>
<li>{trans 'File size'}: {$rev.filesize|size}</li>
<li>{trans 'MIME type'}: {$resource.mime_type}</li>
<li><a href="{$url}">{trans 'Download this file'}</a></li>
<li><a href="{$rev.getRawURL(true)}">{trans 'Download this file'}</a></li>
</ul>
{if ($isOwner or $isAdmin) and !$rev.is_head}{aurl 'url', 'IDF_Views_Wiki::deleteResourceRev', array($project.shortname, $rev.id)}
<p class="delp"><a href="{$url}" title="{trans 'Delete this revision'}"><img src="{media '/idf/img/trash.png'}" style="vertical-align: text-bottom;" alt="{trans 'Trash'}" /></a> <a href="{$url}">{trans 'Delete this revision'}</a></p>