Commit 6603794c authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon

Style commentlist (Bug #1465107)

Change-Id: I21d4245ea468f733b08fc3e5b737d59697e45976
parent 1801a17e
......@@ -41,7 +41,13 @@ class PluginBlocktypeComment extends SystemBlocktype {
public static function render_instance(BlockInstance $instance, $editing=false) {
global $USER;
if ($editing) {
$smarty = smarty_core();
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......@@ -72,7 +78,6 @@ class PluginBlocktypeComment extends SystemBlocktype {
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $instance->get_view();
$commentoptions->artefactview = true;
$feedback = ArtefactTypeComment::get_comments($commentoptions);
$smarty = smarty_core();
$smarty->assign('feedback', $feedback);
......@@ -81,12 +86,6 @@ class PluginBlocktypeComment extends SystemBlocktype {
$smarty->assign('addfeedbackpopup', $addfeedbackpopup);
}
if ($editing) {
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
}
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
......
......@@ -260,8 +260,8 @@ class ArtefactTypeComment extends ArtefactType {
}
public static function get_icon($options=null) {
global $THEME;
return false;
// global $THEME;
// return false;
}
public function delete() {
......@@ -341,7 +341,6 @@ class ArtefactTypeComment extends ArtefactType {
$options->artefact = null;
$options->export = false;
$options->onview = false;
$options->artefactview = false;
$sortorder = get_user_institution_comment_sort_order();
$options->sort = (!empty($sortorder)) ? $sortorder : 'earliest';
return $options;
......@@ -457,15 +456,13 @@ class ArtefactTypeComment extends ArtefactType {
// check to see if the feedback is to be displayed in a block instance
// or the base of the page
$result->position = 'base';
$blocks = get_records_array('block_instance', 'view', $viewid);
if (is_array($blocks)) {
if (!empty($blocks)) {
foreach ($blocks as $block) {
if ($options->artefactview === true) {
if ($block->blocktype === 'comment') {
$result->position = 'blockinstance';
}
else {
$result->position = 'base';
}
}
}
......@@ -536,7 +533,6 @@ class ArtefactTypeComment extends ArtefactType {
$commentoptions->view = $view;
$commentoptions->artefact = $artefact;
$commentoptions->onview = true;
$commentoptions->artefactview = true;
$comments = ArtefactTypeComment::get_comments($commentoptions);
$commentcount = isset($comments->count) ? $comments->count : 0;
......@@ -589,6 +585,9 @@ class ArtefactTypeComment extends ArtefactType {
}
$item->isauthor = $item->author && $item->author == $USER->get('id');
if (!empty($item->attachments)) {
$item->filescount = count($item->attachments);
if ($data->isowner) {
$item->attachmessage = get_string(
'feedbackattachmessage',
......@@ -709,8 +708,8 @@ class ArtefactTypeComment extends ArtefactType {
$smarty->assign('baseurl', $data->baseurl);
$smarty->assign('onview', $onview);
$data->tablerows = $smarty->fetch('artefact:comment:commentlist.tpl');
$pagination = build_pagination(array(
'id' => 'feedback_pagination',
'class' => 'center',
......
This diff is collapsed.
......@@ -3,8 +3,7 @@
<p class="metadata">{$editing}</p>
</div>
{elseif $feedback}
<div class="viewfooter">
<div id="feedbacktable" class="feedbacktable fullwidth table">
<div id="feedbacktable" class="feedbacktable feedbackblock fullwidth">
{$feedback->tablerows|safe}
</div>
{$feedback->pagination|safe}
......@@ -14,5 +13,4 @@
var feedbacklinkinblock = true;
</script>
{/if}
</div>
{/if}
\ No newline at end of file
<div class="list-group list-group-lite">
{foreach from=$data item=item}
<div class="clearfix list-group-item {if $item->pubmessage}list-group-item-warning{elseif $item->deletedmessage}deleted {/if} {cycle name=rows values='r0,r1'}">
{if $position == 'base'}<div class="pull-left" style="width: 70%;">{/if}
<div class="comment-heading clearfix">
<span class="user-icon small-icon pull-left mls mts mrm">
{if $item->author}
<img src="{profile_icon_url user=$item->author maxheight=40 maxwidth=40}" valign="middle" alt="{str tag=profileimagetext arg1=$item->author|display_default_name}"/>
{else}
<img src="{profile_icon_url user=null maxheight=40 maxwidth=40}" valign="middle" alt="{str tag=profileimagetextanonymous}"/>
{/if}
</span>
<h5 class="pull-left">
{if $item->author}
<a href="{$item->author->profileurl}">
{/if}
<div class="comment-item list-group-item {if $item->pubmessage}list-group-item-warning{elseif $item->deletedmessage}deleted {/if} {cycle name=rows values='r0,r1'} {if !$item->deletedmessage && $item->attachments}has-attachment{/if}">
<div class="comment-text">
<div class="comment-heading clearfix">
<span class="user-icon small-icon pull-left mls mts mrm">
{if $item->author}
<span>{$item->author|display_name}</span>
<img src="{profile_icon_url user=$item->author maxheight=40 maxwidth=40}" valign="middle" alt="{str tag=profileimagetext arg1=$item->author|display_default_name}"/>
{else}
<img src="{profile_icon_url user=null maxheight=40 maxwidth=40}" valign="middle" alt="{str tag=profileimagetextanonymous}"/>
{/if}
{if $item->author}
</a>
{/if}
<br />
<span class="postedon text-small">
{$item->date}
{if $item->updated}
[{str tag=Updated}: {$item->updated}]
{/if}
</span>
{if $item->ratingdata}
<span class="star-comment-rating ptm plm">
{for i $item->ratingdata->min_rating $item->ratingdata->max_rating}
{if !$item->ratingdata->export}
<input name="star{$item->id}" type="radio" class="star" {if $i === $item->ratingdata->value} checked="checked" {/if} disabled="disabled" />
{else}
<div class="star-rating star star-rating-applied star-rating-readonly{if $i <= $item->ratingdata->value} star-rating-on{/if}"><a>&nbsp;</a></div>
<h5 class="pull-left">
{if $item->author}
<a href="{$item->author->profileurl}">
{/if}
{if $item->author}
<span>{$item->author|display_name}</span>
{/if}
{/for}
</span>
{/if}
</h5>
<div class="btn-group btn-group-top">
{if $item->deleteform}
{$item->deleteform|safe}
{/if}
{if !$onview}
{if $item->canedit}
<a href="{$WWWROOT}artefact/comment/edit.php?id={$item->id}&amp;view={$viewid}" class="btn btn-default pull-left">
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{str tag=edit}</span>
{if $item->author}
</a>
{/if}
{/if}
<br />
<span class="postedon text-small">
{$item->date}
{if $item->updated}
[{str tag=Updated}: {$item->updated}]
{/if}
</span>
{if $item->ratingdata}
<span class="star-comment-rating ptm plm">
{for i $item->ratingdata->min_rating $item->ratingdata->max_rating}
{if !$item->ratingdata->export}
<input name="star{$item->id}" type="radio" class="star" {if $i === $item->ratingdata->value} checked="checked" {/if} disabled="disabled" />
{else}
<div class="star-rating star star-rating-applied star-rating-readonly{if $i <= $item->ratingdata->value} star-rating-on{/if}"><a>&nbsp;</a></div>
{/if}
{/for}
</span>
{/if}
</h5>
<div class="btn-group btn-group-top">
{if $item->deleteform}
{$item->deleteform|safe}
{/if}
{if !$onview}
{if $item->canedit}
<a href="{$WWWROOT}artefact/comment/edit.php?id={$item->id}&amp;view={$viewid}" class="btn btn-default pull-left">
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{str tag=edit}</span>
</a>
{/if}
{/if}
</div>
</div>
</div>
<div class="comment">
{if $item->deletedmessage}
<span class="metadata">
{$item->deletedmessage}
</span>
{else}
<div>
<div class="comment-content">
{if $item->deletedmessage}
<span class="metadata">
{$item->deletedmessage}
</span>
{else}
{$item->description|safe|clean_html}
</div>
{/if}
</div>
{/if}
</div>
{if $item->makepublicform || ($item->makepublicrequested && !$item->deletedmessage)}
<div class="metadata">
{if $item->pubmessage}
<em class="privatemessage"> {$item->pubmessage}
</em> -
{/if}
{if $item->makepublicform}
{$item->makepublicform|safe}
{/if}
{if $item->makepublicform || ($item->makepublicrequested && !$item->deletedmessage)}
<div class="metadata">
{if $item->pubmessage}
<em class="privatemessage"> {$item->pubmessage}
</em> -
{/if}
{if $item->makepublicform}
{$item->makepublicform|safe}
{/if}
{if $item->makepublicrequested && !$item->deletedmessage}
<span class="icon icon-lock text-default prs"></span>
<span>{str tag=youhaverequestedpublic section=artefact.comment}</span>
{if $item->makepublicrequested && !$item->deletedmessage}
<span class="icon icon-lock text-default prs"></span>
<span>{str tag=youhaverequestedpublic section=artefact.comment}</span>
{/if}
</div>
{/if}
</div>
{/if}
{if $position == 'base'}</div>{/if}
{if !$item->deletedmessage && $item->attachments}
{if $item->attachmessage}
<em class="attachmessage metadata"> - {$item->attachmessage}</em>
{/if}
<div class="panel panel-default {if $position == 'base'}pull-right{elseif $position == 'blockinstance'}has-attachment collapsible{/if}">
<h4 class="panel-heading">
{if $position == 'base'}
<span class="icon prm icon-paperclip"></span>
<span class="text-small">{str tag=Attachments section=artefact.comment}</span>
{elseif $position == 'blockinstance'}
<div class="comment-attachment">
<div class="panel panel-default has-attachment collapsible">
<h4 class="panel-heading">
<a class="collapsible collapsed" aria-expanded="false" href="#attachments_{$item->id}" data-toggle="collapse">
<span class="icon prm icon-paperclip"></span>
<span class="text-small">{str tag=Attachments section=artefact.comment}</span>
<span class="text-small">{str tag=Attachments section=artefact.comment} ({$item->filescount})</span>
<span class="icon icon-chevron-down pull-right collapse-indicator"></span>
</a>
{/if}
</h4>
{if $position == 'base'}
<div id="attachments_{$item->id}" class="panel-body">
{elseif $position == 'blockinstance'}
</h4>
<div id="attachments_{$item->id}" class="collapse" aria-expanded="false">
{/if}
<ul class=" list-group list-group-unbordered mb0">
{strip}
{foreach $item->attachments item=a name=attachments}
<li class="list-group-item">
<a href="{$WWWROOT}artefact/file/download.php?file={$a->attachid}&comment={$item->id}&view={$viewid}" class="outer-link icon-on-hover">
<span class="sr-only">{$a->attachtitle}</span>
</a>
<span class="title plm">
{$a->attachtitle}
<span class="attachsize metadata pls">
- [{$a->attachsize}]
<ul class=" list-group list-group-unbordered mb0">
{strip}
{foreach $item->attachments item=a name=attachments}
<li class="list-group-item">
<a href="{$WWWROOT}artefact/file/download.php?file={$a->attachid}&comment={$item->id}&view={$viewid}" class="outer-link icon-on-hover">
<span class="sr-only">{$a->attachtitle}</span>
</a>
<span class="title">
{$a->attachtitle}
<span class="attachsize metadata pls">
- [{$a->attachsize}]
</span>
</span>
</span>
<span class="icon icon-download icon-lg pull-right pts text-watermark icon-action"></span>
</li>
{/foreach}
{/strip}
</ul>
<span class="icon icon-download icon-lg pull-right pts text-watermark icon-action"></span>
</li>
{/foreach}
{/strip}
</ul>
</div>
</div>
{if $item->attachmessage}
<em class="attachmessage metadata">{$item->attachmessage}</em>
{/if}
</div>
{/if}
</div>
......
.comment-item {
@include clearfix;
.col-width-100 &,
.viewfooter & {
@media (min-width: $screen-md-min) {
.comment-text {
float: left;
width: 65%;
}
.comment-attachment {
padding-left: 15px;
margin-left: 15px;
border-left: 1px solid $brand-default;
float: left;
width: 32%;
.panel {
@include panel-as-link();
width: 100%;
}
.collapsed {
font-size: $font-size-base;
pointer-events: none;
}
// no need to collapse
.collapse-indicator{
display: none;
}
.collapse {
display: block;
visibility: visible;
}
.list-group-item {
font-size: $font-size-base - 2;
background-color: transparent;
}
.attachmessage {
display: block;
padding-top: 15px;
}
}
}
}
}
\ No newline at end of file
......@@ -306,8 +306,6 @@
width: 420px;
max-width: 85%;
.columns3 &,
.columns3 &,
.columns3 &,
.form-inline & {
max-width:100%;
}
......@@ -324,8 +322,6 @@
@media (min-width: $screen-sm-min) {
width: 420px;
max-width: 100%;
.columns3 &,
.columns3 &,
.columns3 & {
max-width: 100%;
}
......
......@@ -95,35 +95,8 @@
}
&.as-link {
&.collapsible {
legend {
@extend .clearfix;
clear: both;
display: block;
h4 {
float:left;
clear:both;
a,
a.collapsed {
padding-left:0;
border: 0;
font-size: $font-size-base - 2;
background: none;
color: $link-color;
}
}
}
.fieldset-body {
clear: both;
border: 0;
padding: 0;
//margin-top: $grid-gutter-width / 2;
background: transparent;
}
}
@include panel-as-link();
}
}
.link-expand-right.form-group {
......
......@@ -73,6 +73,7 @@
// Feature related sass. We avoid this where we can in favour of reusable components
@import "../features/comment";
@import "../features/dashboard-widget";
@import "../features/filebrowser";
@import "../features/forum-post";
......
......@@ -11,3 +11,37 @@
border: 0;
min-width:0;
}
@mixin panel-as-link(){
border: 0;
background: transparent;
&.collapsible {
legend {
@include clearfix;
clear: both;
display: block;
}
legend h4,
h4 {
float:left;
clear:both;
background: none;
a,
a.collapsed {
padding-left:0;
border: 0;
font-size: $font-size-base - 2;
background: none;
color: $link-color;
}
}
.fieldset-body,
.collapse {
clear: both;
border: 0;
padding: 0;
background: transparent;
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -93,9 +93,10 @@
<div class="viewfooter ptxl">
{if $feedback->count || $enablecomments}
<h4 class="title">{str tag="Comments" section="artefact.comment"}</h4>
{if $feedback->count == 0}
<hr />
<div id="commentlist" class="commentlist">
{/if}
<div id="commentlist" class="commentlist feedbackbase">
{$feedback->tablerows|safe}
</div>
......
......@@ -111,8 +111,10 @@
<h3 class="title">
{str tag="Comments" section="artefact.comment"}
</h3>
<hr>
<div id="feedbacktable" class="feedbacktable fullwidth">
{if $feedback->count == 0}
<hr />
{/if}
<div id="feedbacktable" class="feedbacktable feedbackbase fullwidth">
{$feedback->tablerows|safe}
</div>
{$feedback->pagination|safe}
......
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