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
.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