Commit 764de368 authored by Jono Mingard's avatar Jono Mingard Committed by Gerrit Code Review
Browse files

Use expanders for all attachment tables (Bug #1279529)



Modified Journal entries (including blocktypes) and Notes list

Change-Id: Ib544bfb7fd70a26903dea99446dbca4167289f53
Signed-off-by: default avatarJono Mingard <jonom@catalyst.net.nz>
parent 9d52504d
......@@ -32,8 +32,12 @@
{if $post->files}
<div id="postfiles_{$post->id}">
<table class="attachments fullwidth">
<tbody>
<tr><th colspan=3>{str tag=attachedfiles section=artefact.blog}</th></tr>
<thead class="expandable-head">
<tr>
<th colspan="3"><a class="toggle" href="#">{str tag=attachedfiles section=artefact.blog}</a></th>
</tr>
</thead>
<tbody class="expandable-body">
{foreach from=$post->files item=file}
<tr class="{cycle values='r1,r0'}">
<td class="icon-container"><img src="{$file->icon}" alt=""></td>
......
{**
* This template displays a blog post.
*}
* This template displays a blog post.
*}
<div id="blogpost">
{if $artefacttitle}<h3 class="title">{$artefacttitle|safe}</h3>{/if}
{$artefactdescription|clean_html|safe}
{if isset($attachments)}
<table class="cb attachments fullwidth">
<tbody>
<tr><th colspan="2">{str tag=attachedfiles section=artefact.blog}:</th></tr>
{if $artefact->get('tags')}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$artefact->get('owner') tags=$artefact->get('tags')}</div>{/if}
{foreach from=$attachments item=item}
<tr class="{cycle values='r0,r1'}">
{if $icons}<td class="icon-container"><img src="{$item->iconpath}" alt=""></td>{/if}
<td><a href="{$item->viewpath}">{$item->title}</a> ({$item->size}) - <strong><a href="{$item->downloadpath}">{str tag=Download section=artefact.file}</a></strong>
<br>{$item->description}</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
<div class="postdetails">{$postedbyon}
{if isset($commentcount) && $artefact->get('allowcomments')} | <a href="{$artefacturl}">{str tag=Comments section=artefact.comment} ({$commentcount})</a>{/if}
</div>
{if $license}
{if $artefacttitle}<h3 class="title">{$artefacttitle|safe}</h3>{/if}
{$artefactdescription|clean_html|safe}
{if isset($attachments)}
<table class="cb attachments fullwidth">
<thead class="expandable-head">
<tr>
<td colspan="2">
<a class="toggle" href="#">{str tag=attachedfiles section=artefact.blog}</a>
<span class="fr">
<img class="fl" alt="{str tag=attachments section=artefact.blog}" src="{theme_url images/attachment.png}">
{$attachments|count}
</span>
</td>
</tr>
</thead>
<tbody class="expandable-body">
{if $artefact->get('tags')}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$artefact->get('owner') tags=$artefact->get('tags')}</div>{/if}
{foreach from=$attachments item=item}
<tr class="{cycle values='r0,r1'}">
{if $icons}<td class="icon-container"><img src="{$item->iconpath}" alt=""></td>{/if}
<td>
<a href="{$item->viewpath}">{$item->title}</a> ({$item->size}) - <strong><a href="{$item->downloadpath}">{str tag=Download section=artefact.file}</a></strong>
<br>{$item->description}
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
<div class="postdetails">{$postedbyon}
{if isset($commentcount) && $artefact->get('allowcomments')} | <a href="{$artefacturl}">{str tag=Comments section=artefact.comment} ({$commentcount})</a>{/if}
</div>
{if $license}
<div class="postlicense">
{$license|safe}
{$license|safe}
</div>
{/if}
{/if}
</div>
{foreach from=$posts item=post}
<div class="post">
<div class="post">
<h3 class="title"><a href="{$WWWROOT}view/artefact.php?artefact={$post->id}&view={$options.viewid}">{$post->title}</a></h3>
<div>{$post->description|clean_html|safe}
{if $post->tags}
......@@ -7,21 +7,32 @@
{/if}</div>
{if $post->files}
<table class="cb attachments fullwidth">
<tbody>
<tr><th>{str tag=attachedfiles section=artefact.blog}:</th></tr>
{foreach from=$post->files item=file}
<tr class="{cycle values='r0,r1'}">
<td>
<a href="{$WWWROOT}view/artefact.php?artefact={$file->attachment}&view={$options.viewid}">{$file->title}</a>
({$file->size|display_size})
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}">{str tag=Download section=artefact.file}</a></strong>
</td>
</tr>
{/foreach}
</tbody>
<thead class="expandable-head">
<tr>
<td>
<a class="toggle" href="#">{str tag=attachedfiles section=artefact.blog}</a>
<span class="fr">
<img class="fl" src="{theme_url filename='images/attachment.png'}" alt="{str tag=attachments section=artefact.blog}">
{$post->files|count}
</span>
</td>
</tr>
</thead>
<tbody class="expandable-body">
{foreach from=$post->files item=file}
<tr class="{cycle values='r0,r1'}">
<td>
<a href="{$WWWROOT}view/artefact.php?artefact={$file->attachment}&view={$options.viewid}">{$file->title}</a>
({$file->size|display_size})
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}">{str tag=Download section=artefact.file}</a></strong>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
<div class="postdetails">{$post->postedby}
{if $options.viewid && $post->allowcomments} | <a href="{$WWWROOT}view/artefact.php?artefact={$post->id}&view={$options.viewid}">{str tag=Comments section=artefact.comment} ({$post->commentcount})</a>{/if}</div>
{if $options.viewid && $post->allowcomments} | <a href="{$WWWROOT}view/artefact.php?artefact={$post->id}&view={$options.viewid}">{str tag=Comments section=artefact.comment} ({$post->commentcount})</a>{/if}
</div>
</div>
{/foreach}
......@@ -89,7 +89,7 @@ function delete_success(form, data) {
}
EOF;
$smarty = smarty(array('paginator'));
$smarty = smarty(array('paginator', 'expandable'));
$smarty->assign('PAGEHEADING', $blog->get('title'));
$smarty->assign('INLINEJAVASCRIPT', $js);
......
......@@ -193,7 +193,7 @@ $j(function() {
});
});';
$smarty = smarty();
$smarty = smarty(array('expandable'));
$smarty->assign('PAGEHEADING', $pageheading);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign_by_ref('data', $data);
......
......@@ -29,8 +29,12 @@
<col width="5%">
<col width="40%">
<col width="55%">
<tbody>
<tr><th colspan=3>{str tag=attachedfiles section=artefact.blog}</th></tr>
<thead class="expandable-head">
<tr>
<th colspan="3"><a class="toggle" href="#">{str tag=attachedfiles section=artefact.blog}</a></th>
</tr>
</thead>
<tbody class="expandable-body">
{foreach from=$n->files item=file}
<tr class="{cycle values='r1,r0'}">
<td><img src="{$file->icon}" alt=""></td>
......
......@@ -508,6 +508,9 @@ td.icon-container img {
.valign-middle {
vertical-align: middle;
}
.expandable-head th {
font-size: 1em;
}
.expandable-head a.toggle {
font-weight: bold;
background-image: url(../images/expand.png);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment