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 {
return array('html' => $smarty->fetch('artefact:file:image_render_self.tpl'), 'javascript' => '');
}
$result = parent::render_self($options);
$result['html'] = '<div class="fl filedata-icon"><h4 class="title">'
. get_string('Preview', 'artefact.file') . '</h4><a href="'
. hsc($downloadpath) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180'
. '" alt=""></a></div>' . $result['html'];
// $result['html'] = '<div class="fl filedata-icon"><h4 class="title">'
// . get_string('Preview', 'artefact.file') . '</h4><a href="'
// . hsc($downloadpath) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180'
// . '" alt=""></a></div>' . $result['html'];
return $result;
}
......
......@@ -23,7 +23,7 @@ function addFeedbackError(form, data) {
}
function addFeedbackSuccess(form, data) {
// addElementClass('add_feedback_form', 'hidden');
addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) {
removeElement('overlay');
}
......@@ -55,7 +55,7 @@ function addFeedbackSuccess(form, data) {
}
function objectionSuccess(form, data) {
// addElementClass('objection_form', 'hidden');
addElementClass('objection_form', 'hidden');
$('objection_form_message').value = '';
rewriteCancelButtons();
formSuccess(form, data);
......
......@@ -123,34 +123,36 @@
$(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');
}, 300);
} // init
function equalHeights (){
$(window).on('resize colresize', function(){
var rows = $('.js-col-row'),
i, j,
height,
cols;
var rows = $('.js-col-row'),
i, j,
height,
cols;
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;
}
for(i = 0; i < rows.length ; i = i + 1){
height = 0;
cols = $(rows[i]).find('.column .column-content');
cols.height('auto');
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 @@
moveBlock(whereTo, blockinstanceId);
}
$(window).trigger('colresize');
window.setTimeout(function(){
$(window).trigger('colresize');
}, 300);
},
update: function(event, ui) {
......@@ -1134,8 +1139,10 @@
function hideDock() {
$(window).trigger('blockupdate');
$(window).trigger('colresize');
window.setTimeout(function(){
$(window).trigger('colresize');
}, 300);
$('.configure').each( function() {
$(this).removeClass('active');
......
......@@ -3,7 +3,7 @@
<h2>{$artefacttitle|safe}</h2>
{/if}
<div id="blogdescription" class="blogdescription">{$description|clean_html|safe}
<div id="blogdescription" class="blogdescription ptl">{$description|clean_html|safe}
{if $tags}
<div class="tags pbl">
<strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags}
......
......@@ -2,7 +2,12 @@
* This template displays a blog post.
*}
<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">
<span class="fa fa-calendar mrs"></span>
......@@ -27,7 +32,7 @@
{if isset($attachments)}
<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">
<span class="fa prm fa-paperclip"></span>
......@@ -35,23 +40,41 @@
<span class="metadata">({$attachments|count})</span>
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a>
</h4>
</h5>
<!-- Attachment list with view and download link -->
<div id="blog-attach-{$postid}" class="collapse">
<ul class="list-unstyled list-group">
{foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link">
<a href="{$item->downloadpath}">
<div class="file-icon mrs">
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$item->title|truncate:25}
<li class="list-group-item">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<span class="sr-only">
{str tag=Download section=artefact.file} {$item->title}
</span>
</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>
{/foreach}
</ul>
......
......@@ -30,21 +30,39 @@
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a>
</h5>
<!-- Attachment list with view and download link -->
<div id="blogpost-attach-{$post->id}" class="collapse">
<ul class="list-unstyled list-group">
{foreach from=$post->files item=file}
<li class="list-group-item-text list-group-item-link">
<a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}">
<div class="file-icon mrs">
{if $file->icon}
<img src="{$file->icon}" alt="">
{else}
<span class="fa fa-{$file->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$file->title} [{$file->size|display_size}]
<li class="list-group-item">
<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}>
<span class="sr-only">
{str tag=Download section=artefact.file} {$file->title}
</span>
</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>
{/foreach}
</ul>
......
<div>
<h3 class="title"><div class="fl filedata-thumb"><a href="{$downloadpath}"><img src="{$iconpath}" alt="{$description}"></a></div> <a href="{$downloadpath}">{$title}</a></h3>
{if $artefacttype == 'image'}
<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>
{/if}
<table class="filedata">
<tr><th>{str tag=Type section=artefact.file}:</th><td>{$filetype}</td></tr>
<tr><th>{str tag=Description section=artefact.file}:</th><td>{$description}</td></tr>
<tr><th>{str tag=tags}:</th><td>{list_tags owner=$owner tags=$tags}</td></tr>
<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>
<!-- <h3 class="title">
<a href="{$downloadpath}">
<img src="{$iconpath}" alt="{$description}">
</a>
<a href="{$downloadpath}">{$title}</a>
</h3> -->
<table class="filedata table-condensed">
<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}
<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}
<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>
{if $simpledisplay}
<div class="panel-body">
{if !$simpledisplay}
<h3 class="title">
{$title}
</h3>
{/if}
{/if}
<p class="detail">
{$description}
</p>
{if $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>
{/if}
......@@ -67,5 +64,7 @@
</span>
{/if}
</div>
{if $simpledisplay}
</div>
{/if}
<div>
<a href="{$downloadpath}"><img src="{$downloadpath}&maxwidth=1000&maxheight=750" alt="{$title}"></a>
<p>{$description}</p>
<div><a href="{$metadataurl}">{str tag=Details section=artefact.file}</a></div>
<div class="artefactfile-render">
<a href="{$downloadpath}">
<img src="{$downloadpath}&maxwidth=1000&maxheight=750" alt="{$title}">
</a>
<p>{$description}</p>
<div>
<a href="{$metadataurl}">{str tag=Details section=artefact.file}</a>
</div>
</div>
......@@ -89,21 +89,26 @@ jQuery(function($) {
for (i = 0; i < carousel.length; i = i + 1) {
$(carousel[i]).find('.item').addClass('inline');
height = 0;
image = $(carousel[i]).find('.item img');
console.log(image);
for (j = 0; j < image.length; j = j + 1){
if($(image[j]).height() > height){
height = $(image[j]).height();
}
}
$(carousel[i]).find('.item').removeClass('inline');
$(carousel[i]).height(height);
$(carousel[i]).addClass('carousel-ready');
}
}
$(window).on('resize colresize blockupdate', function(){
$(window).on('resize colresize', function(){
carouselHeight();
});
......
......@@ -31,7 +31,7 @@
}
.inline {
display: inline-block;
display: inline-block !important;
}
.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}
</h3>
</h3> -->
{if $tags}
<p class="tags s">
......
......@@ -8,37 +8,38 @@
{$notrudeform|safe}
</div>
{/if}
<div class="text-thin pbl">
<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">
<h1 class="page-header ptl">
{foreach from=$artefactpath item=a name='path'}
<span class="subsection-heading">
{if $a.url}
{if $.foreach.path.total == 1}
{if $a.url}
{if $.foreach.path.total == 1}
{$a.title}
{elseif $.foreach.path.last}
<br />
<span class="subsection-heading">
{$a.title}
{elseif $.foreach.path.last}
| {$a.title}
{else}
</span>
{else}
<span class="lead text-small ptl">
<a href="{$a.url}">
{$a.title}
</a>
{/if}
{else}
{$a.title}
</a> /
</span>
{/if}
</span>
{else}
{$a.title}
{/if}
{/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>
<div class="text-right btn-top-right btn-group btn-group-top pull-right">
......@@ -66,11 +67,6 @@
{/if}
</a>
{/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 id="view" class="view-pane">
......@@ -97,7 +93,8 @@
<div id="viewmenu" class="view-menu">
{include file="view/viewmenuartefact.tpl"}
</div>
<div class="tab-content">
<div class="tab-content pt0">
<div id="comment-form" role="tabpanel" class="tab-pane active">
{$addfeedbackform|safe}
</div>
......
{if $allowcomments}
<div class="comments panel-body pt0">
<div class="comments mbl ptm pbl">
<a class="commentlink text-thin pull-left" id="block_{$blockid}" href="{$artefacturl}">
{str tag=Comments section=artefact.comment} ({$commentcount})
</a>
......
......@@ -40,9 +40,9 @@
</form>
<div id="view-wizard-controls" class="col-collapse-offset col-with-collapse">
{if $issitetemplate}
<!-- {if $issitetemplate}
<form action="{$WWWROOT}admin/site/views.php" method="GET">
<input class="submit btn btn-success" type="submit" value="{str tag='done'}">
<input class="submit btn btn-success" type="submit" value="{str tag=displayview section=view}">
</form>
{else}
<form action="{$WWWROOT}{if $groupid}{if $viewtype == 'grouphomepage'}{$groupurl}{else}view/groupviews.php{/if}{elseif $institution}view/institutionviews.php{elseif $viewtype == 'dashboard'}index.php{else}view/index.php{/if}" method="GET">
......@@ -55,8 +55,14 @@
{elseif $institution}
<input type="hidden" name="institution" value="{$institution}">
{/if}
<input class="submit btn btn-success" type="submit" value="{str tag='done'}">
<input class="submit btn btn-success" type="submit" value="{str tag=displayview section=view}">
</form>
{/if} -->
{if !$issitetemplate}
<a class="btn btn-success" href="{$displaylink}">
{str tag=displayview section=view}
</a>
{/if}
</div>
......
......@@ -29,7 +29,7 @@
</div>
{if !$issitetemplate}
{if !$issitetemplate}
<a class="text-small pull-left" href="{$displaylink}">
{str tag=displayview section=view}
......
......@@ -107,24 +107,24 @@
<div id="viewmenu" class="view-menu ptxl pbl">
{include file="view/viewmenu.tpl"}
{if $feedback->position eq 'base' && $enablecomments}
<div class="tab-content">
{if $feedback->position eq 'base' && $enablecomments}
<div id="comment-form" role="tabpanel" class="tab-pane active">
{$addfeedbackform|safe}
</div>
{if $LOGGEDIN}
<div id="report-form" role="tabpanel" class="tab-pane">
{$objectionform|safe}
</div>
{/if}
{else}
{if $LOGGEDIN}
<div id="report-form" role="tabpanel" class="tab-pane active">
{$objectionform|safe}
</div>
{/if}
<div id="comment-form" role="tabpanel" class="tab-pane active">
{$addfeedbackform|safe}
</div>
{if $LOGGEDIN}
<div id="report-form" role="tabpanel" class="tab-pane">
{$objectionform|safe}
</div>
{/if}
</div>
{else}
{if $LOGGEDIN}
<div id="report-form">
{$objectionform|safe}
</div>
{/if}
{/if}
</div>
</div>
</div>
......
......@@ -2,31 +2,29 @@
{contextualhelp plugintype='core' pluginname='view' section='viewmenu'}
</div>
{if $feedback->position eq 'base' && $enablecomments}
<ul class="nav nav-tabs ">
{if $feedback->position eq 'base' && $enablecomments}
<li class="active">
<a id="add_feedback_link" class="feedback" href="#comment-form" aria-controls="comment-form" role="tab" data-toggle="tab">
<span class="fa fa-lg fa-comments prm"></span>
{str tag=Comment section=artefact.comment}
</a>
</li>
{if $LOGGEDIN}
<li>
<a id="objection_link" class="objection" href="#report-form" role="tab" aria-controls="report-form" data-toggle="tab">
<span class="fa fa-lg fa-flag prs"></span>
{str tag=reportobjectionablematerial}
</a>