Commit e28ef768 authored by Pat Kira's avatar Pat Kira Committed by Aaron Wells

Individual artefact view (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: Ibff86b39cbcee44e51d8891a2f38874091ac942c
parent 6eed45ad
...@@ -2339,10 +2339,10 @@ class ArtefactTypeImage extends ArtefactTypeFile { ...@@ -2339,10 +2339,10 @@ class ArtefactTypeImage extends ArtefactTypeFile {
return array('html' => $smarty->fetch('artefact:file:image_render_self.tpl'), 'javascript' => ''); return array('html' => $smarty->fetch('artefact:file:image_render_self.tpl'), 'javascript' => '');
} }
$result = parent::render_self($options); $result = parent::render_self($options);
$result['html'] = '<div class="fl filedata-icon"><h4 class="title">' // $result['html'] = '<div class="fl filedata-icon"><h4 class="title">'
. get_string('Preview', 'artefact.file') . '</h4><a href="' // . get_string('Preview', 'artefact.file') . '</h4><a href="'
. hsc($downloadpath) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180' // . hsc($downloadpath) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180'
. '" alt=""></a></div>' . $result['html']; // . '" alt=""></a></div>' . $result['html'];
return $result; return $result;
} }
......
...@@ -23,7 +23,7 @@ function addFeedbackError(form, data) { ...@@ -23,7 +23,7 @@ function addFeedbackError(form, data) {
} }
function addFeedbackSuccess(form, data) { function addFeedbackSuccess(form, data) {
// addElementClass('add_feedback_form', 'hidden'); addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) { if ($('overlay')) {
removeElement('overlay'); removeElement('overlay');
} }
...@@ -55,7 +55,7 @@ function addFeedbackSuccess(form, data) { ...@@ -55,7 +55,7 @@ function addFeedbackSuccess(form, data) {
} }
function objectionSuccess(form, data) { function objectionSuccess(form, data) {
// addElementClass('objection_form', 'hidden'); addElementClass('objection_form', 'hidden');
$('objection_form_message').value = ''; $('objection_form_message').value = '';
rewriteCancelButtons(); rewriteCancelButtons();
formSuccess(form, data); formSuccess(form, data);
......
...@@ -123,34 +123,36 @@ ...@@ -123,34 +123,36 @@
$(workspace).show(); $(workspace).show();
equalHeights(); $(window).on('resize colresize', function(){
equalHeights();
});
// images need time to load before height can be properly calculated
window.setTimeout(function(){
$(window).trigger('colresize'); $(window).trigger('colresize');
}, 300);
} // init } // init
function equalHeights (){ function equalHeights (){
$(window).on('resize colresize', function(){ var rows = $('.js-col-row'),
i, j,
height,
cols;
var rows = $('.js-col-row'), for(i = 0; i < rows.length ; i = i + 1){
i, j, height = 0;
height, cols = $(rows[i]).find('.column .column-content');
cols; cols.height('auto');
for(i = 0; i < rows.length ; i = i + 1){
height = 0;
cols = $(rows[i]).find('.column .column-content');
cols.height('auto');
for(j = 0; j < cols.length ; j = j + 1){
height = $(cols[j]).height() > height ? $(cols[j]).height() : height;
}
cols.height(height); for(j = 0; j < cols.length ; j = j + 1){
height = $(cols[j]).height() > height ? $(cols[j]).height() : height;
} }
}); cols.height(height);
}
} }
...@@ -355,7 +357,10 @@ ...@@ -355,7 +357,10 @@
moveBlock(whereTo, blockinstanceId); moveBlock(whereTo, blockinstanceId);
} }
$(window).trigger('colresize'); window.setTimeout(function(){
$(window).trigger('colresize');
}, 300);
}, },
update: function(event, ui) { update: function(event, ui) {
...@@ -1134,8 +1139,10 @@ ...@@ -1134,8 +1139,10 @@
function hideDock() { function hideDock() {
$(window).trigger('blockupdate');
$(window).trigger('colresize'); window.setTimeout(function(){
$(window).trigger('colresize');
}, 300);
$('.configure').each( function() { $('.configure').each( function() {
$(this).removeClass('active'); $(this).removeClass('active');
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<h2>{$artefacttitle|safe}</h2> <h2>{$artefacttitle|safe}</h2>
{/if} {/if}
<div id="blogdescription" class="blogdescription">{$description|clean_html|safe} <div id="blogdescription" class="blogdescription ptl">{$description|clean_html|safe}
{if $tags} {if $tags}
<div class="tags pbl"> <div class="tags pbl">
<strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags} <strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags}
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
* This template displays a blog post. * This template displays a blog post.
*} *}
<div id="blogpost-{$postid}" class="panel-body"> <div id="blogpost-{$postid}" class="panel-body">
{if $artefacttitle}<h3 class="title">{$artefacttitle|safe}</h3>{/if}
{if $artefacttitle && $simpledisplay}
<h3 class="title">
{$artefacttitle|safe}
</h3>
{/if}
<div class="postdetails metadata mbm"> <div class="postdetails metadata mbm">
<span class="fa fa-calendar mrs"></span> <span class="fa fa-calendar mrs"></span>
...@@ -27,7 +32,7 @@ ...@@ -27,7 +32,7 @@
{if isset($attachments)} {if isset($attachments)}
<div class="has-attachment panel panel-default collapsible"> <div class="has-attachment panel panel-default collapsible">
<h4 class="panel-heading"> <h5 class="panel-heading">
<a class="text-left pts pbm collapsed" aria-expanded="false" href="#blog-attach-{$postid}" data-toggle="collapse"> <a class="text-left pts pbm collapsed" aria-expanded="false" href="#blog-attach-{$postid}" data-toggle="collapse">
<span class="fa prm fa-paperclip"></span> <span class="fa prm fa-paperclip"></span>
...@@ -35,23 +40,41 @@ ...@@ -35,23 +40,41 @@
<span class="metadata">({$attachments|count})</span> <span class="metadata">({$attachments|count})</span>
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span> <span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a> </a>
</h4> </h5>
<!-- Attachment list with view and download link -->
<div id="blog-attach-{$postid}" class="collapse"> <div id="blog-attach-{$postid}" class="collapse">
<ul class="list-unstyled list-group"> <ul class="list-unstyled list-group">
{foreach from=$attachments item=item} {foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link"> <li class="list-group-item">
<a href="{$item->downloadpath}"> <a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<div class="file-icon mrs"> <span class="sr-only">
{if $item->iconpath} {str tag=Download section=artefact.file} {$item->title}
<img src="{$item->iconpath}" alt=""> </span>
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$item->title|truncate:25}
</a> </a>
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
<span class="title list-group-item-heading plm inline">
<a href="{$item->viewpath}" class="inner-link">
{$item->title}
</a>
<span class="metadata"> -
[{$item->size|display_size}]
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
{if $item->description}
<div class="description ptm">
<p class="text-small">
{$item->description}
</p>
</div>
{/if}
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
......
...@@ -30,21 +30,39 @@ ...@@ -30,21 +30,39 @@
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span> <span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a> </a>
</h5> </h5>
<!-- Attachment list with view and download link -->
<div id="blogpost-attach-{$post->id}" class="collapse"> <div id="blogpost-attach-{$post->id}" class="collapse">
<ul class="list-unstyled list-group"> <ul class="list-unstyled list-group">
{foreach from=$post->files item=file} {foreach from=$post->files item=file}
<li class="list-group-item-text list-group-item-link"> <li class="list-group-item">
<a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}"> <a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}" class="outer-link icon-on-hover" {if $file->description} title="{$file->description}" data-toggle="tooltip"{/if}>
<div class="file-icon mrs"> <span class="sr-only">
{if $file->icon} {str tag=Download section=artefact.file} {$file->title}
<img src="{$file->icon}" alt=""> </span>
{else}
<span class="fa fa-{$file->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$file->title} [{$file->size|display_size}]
</a> </a>
{if $file->icon}
<img src="{$file->icon}" alt="">
{else}
<span class="fa fa-{$file->artefacttype} fa-lg text-default"></span>
{/if}
<span class="title list-group-item-heading plm inline">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$file->attachment}&view={$options.viewid}" class="inner-link">
{$file->title}
</a>
<span class="metadata"> -
[{$file->size|display_size}]
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
<!-- {if $file->description}
<div class="description ptm">
<p class="text-small">
{$file->description}
</p>
</div>
{/if} -->
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
......
<div> {if $artefacttype == 'image'}
<h3 class="title"><div class="fl filedata-thumb"><a href="{$downloadpath}"><img src="{$iconpath}" alt="{$description}"></a></div> <a href="{$downloadpath}">{$title}</a></h3> <h3 class="title">
{str tag=Preview section=artefact.file}
</h3>
<div class="filedata-icon pull-left prxl mrxl pbxl">
<a href=" hsc($downloadpath)">
<img src="{$downloadpath}&maxwidth=400&maxheight=180" alt="">
</a>
</div> </div>
{/if}
<table class="filedata"> <!-- <h3 class="title">
<tr><th>{str tag=Type section=artefact.file}:</th><td>{$filetype}</td></tr> <a href="{$downloadpath}">
<tr><th>{str tag=Description section=artefact.file}:</th><td>{$description}</td></tr> <img src="{$iconpath}" alt="{$description}">
<tr><th>{str tag=tags}:</th><td>{list_tags owner=$owner tags=$tags}</td></tr> </a>
<tr><th>{str tag=Owner section=artefact.file}:</th><td>{$ownername}</td></tr> <a href="{$downloadpath}">{$title}</a>
<tr><th>{str tag=Created section=artefact.file}:</th><td>{$created}</td></tr> </h3> -->
<tr><th>{str tag=lastmodified section=artefact.file}:</th><td>{$modified}</td></tr> <table class="filedata table-condensed">
<tr><th>{str tag=Size section=artefact.file}:</th><td>{$size}</td></tr> <tr>
<th>{str tag=Type section=artefact.file}:</th>
<td>{$filetype}</td>
</tr>
{if $description}
<tr>
<th>{str tag=Description section=artefact.file}:</th>
<td>{$description}</td>
</tr>
{/if}
{if $tags}
<tr>
<th>{str tag=tags}:</th>
<td>{list_tags owner=$owner tags=$tags}</td>
</tr>
{/if}
<tr>
<th>{str tag=Owner section=artefact.file}:</th>
<td>{$ownername}</td>
</tr>
<tr>
<th>{str tag=Created section=artefact.file}:</th>
<td>{$created}</td>
</tr>
<tr>
<th>{str tag=lastmodified section=artefact.file}:</th>
<td>{$modified}</td>
</tr>
<tr>
<th>{str tag=Size section=artefact.file}:</th>
<td>{$size}</td>
</tr>
{if $license!==false} {if $license!==false}
<tr><th>{str tag=License section=artefact.file}:</th><td>{$license|safe}</td></tr> <tr>
<th>{str tag=License section=artefact.file}:</th>
<td>{$license|safe}</td>
</tr>
{/if} {/if}
<tr><th>{str tag=Download section=artefact.file}:</th><td><a href="{$downloadpath}">{str tag=Download section=artefact.file}</a></td></tr> <tr>
<th class="sr-only">{str tag=Download section=artefact.file}:</th>
<td>
<a class="btn btn-default btn-sm" href="{$downloadpath}">{str tag=Download section=artefact.file}</a>
</td>
</tr>
</table> </table>
{if $simpledisplay}
<div class="panel-body"> <div class="panel-body">
{if !$simpledisplay} {/if}
<h3 class="title">
{$title}
</h3>
{/if}
<p class="detail"> <p class="detail">
{$description} {$description}
</p> </p>
{if $tags} {if $tags}
<div class="tags"> <div class="tags">
<span class="lead text-small">{str tag=tags}</span>: {list_tags owner=$owner tags=$tags} <span class="lead text-small">{str tag=tags}</span>:
{list_tags owner=$owner tags=$tags}
</div> </div>
{/if} {/if}
...@@ -67,5 +64,7 @@ ...@@ -67,5 +64,7 @@
</span> </span>
{/if} {/if}
</div> </div>
{if $simpledisplay}
</div> </div>
{/if}
<div> <div class="artefactfile-render">
<a href="{$downloadpath}"><img src="{$downloadpath}&maxwidth=1000&maxheight=750" alt="{$title}"></a> <a href="{$downloadpath}">
<p>{$description}</p> <img src="{$downloadpath}&maxwidth=1000&maxheight=750" alt="{$title}">
<div><a href="{$metadataurl}">{str tag=Details section=artefact.file}</a></div> </a>
<p>{$description}</p>
<div>
<a href="{$metadataurl}">{str tag=Details section=artefact.file}</a>
</div>
</div> </div>
...@@ -89,21 +89,26 @@ jQuery(function($) { ...@@ -89,21 +89,26 @@ jQuery(function($) {
for (i = 0; i < carousel.length; i = i + 1) { for (i = 0; i < carousel.length; i = i + 1) {
$(carousel[i]).find('.item').addClass('inline');
height = 0; height = 0;
image = $(carousel[i]).find('.item img'); image = $(carousel[i]).find('.item img');
console.log(image);
for (j = 0; j < image.length; j = j + 1){ for (j = 0; j < image.length; j = j + 1){
if($(image[j]).height() > height){ if($(image[j]).height() > height){
height = $(image[j]).height(); height = $(image[j]).height();
} }
} }
$(carousel[i]).find('.item').removeClass('inline');
$(carousel[i]).height(height); $(carousel[i]).height(height);
$(carousel[i]).addClass('carousel-ready'); $(carousel[i]).addClass('carousel-ready');
} }
} }
$(window).on('resize colresize blockupdate', function(){ $(window).on('resize colresize', function(){
carouselHeight(); carouselHeight();
}); });
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
} }
.inline { .inline {
display: inline-block; display: inline-block !important;
} }
.fullwidth { .fullwidth {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<h3 class="title"> <!-- <h3 class="title">
{$title} {$title}
</h3> </h3> -->
{if $tags} {if $tags}
<p class="tags s"> <p class="tags s">
......
...@@ -8,37 +8,38 @@ ...@@ -8,37 +8,38 @@
{$notrudeform|safe} {$notrudeform|safe}
</div> </div>
{/if} {/if}
<div class="text-thin pbl"> <h1 class="page-header ptl">
<span>
{$view->display_title()|safe}
</span>
{if $hasfeed}
<a href="{$feedlink}">
<span class="fa-rss fa pull-right"></span>
</a>
{/if}
</div>
<h1 class="page-header">
{foreach from=$artefactpath item=a name='path'} {foreach from=$artefactpath item=a name='path'}
<span class="subsection-heading"> {if $a.url}
{if $a.url} {if $.foreach.path.total == 1}
{if $.foreach.path.total == 1} {$a.title}
{elseif $.foreach.path.last}
<br />
<span class="subsection-heading">
{$a.title} {$a.title}
{elseif $.foreach.path.last} </span>
| {$a.title} {else}
{else} <span class="lead text-small ptl">
<a href="{$a.url}"> <a href="{$a.url}">
{$a.title} {$a.title}
</a> </a> /
{/if} </span>
{else}
{$a.title}
{/if} {/if}
</span> {else}
{$a.title}
{/if}
{/foreach} {/foreach}
<!-- <br /> -->
<span class="metadata">
<!-- <span class="section-heading"> -->
| {$view->display_title()|safe}
{if $hasfeed}
<a href="{$feedlink}">
<span class="fa-rss fa pull-right"></span>
</a>
{/if}
</span>
</h1> </h1>
<div class="text-right btn-top-right btn-group btn-group-top pull-right"> <div class="text-right btn-top-right btn-group btn-group-top pull-right">
...@@ -66,11 +67,6 @@ ...@@ -66,11 +67,6 @@
{/if} {/if}
</a> </a>
{/if} {/if}
<!-- <a id="print_link" class="print btn btn-sm btn-default" href="" onclick="window.print(); return false;">
<span class="fa fa-lg fa-print prs"></span>
{str tag=print section=view}
</a> -->
</div> </div>
<div id="view" class="view-pane">