Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
1801a17e
Commit
1801a17e
authored
Jun 15, 2015
by
Pat Kira
Committed by
Robert Lyon
Jun 24, 2015
Browse files
Commentlist fullwidth WIP (Bug #1465107)
Change-Id: I23ff972fc4721e00b319ac121a38dab4b1111f17
parent
50031f15
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/comment/blocktype/comment/lib.php
View file @
1801a17e
...
...
@@ -72,6 +72,7 @@ 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
);
...
...
htdocs/artefact/comment/lib.php
View file @
1801a17e
...
...
@@ -341,6 +341,7 @@ 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
;
...
...
@@ -456,13 +457,14 @@ 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
(
!
empt
y
(
$blocks
))
{
if
(
is_arra
y
(
$blocks
))
{
foreach
(
$blocks
as
$block
)
{
if
(
$
block
->
blocktype
==
'comment'
)
{
if
(
$
options
->
artefactview
===
true
)
{
$result
->
position
=
'blockinstance'
;
break
;
}
else
{
$result
->
position
=
'base'
;
}
}
}
...
...
@@ -534,6 +536,7 @@ 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
;
...
...
@@ -701,10 +704,12 @@ class ArtefactTypeComment extends ArtefactType {
$smarty
=
smarty_core
();
$smarty
->
assign_by_ref
(
'data'
,
$data
->
data
);
$smarty
->
assign
(
'canedit'
,
$data
->
canedit
);
$smarty
->
assign
(
'viewid'
,
$data
->
view
);
$smarty
->
assign
(
'position'
,
$data
->
position
);
$smarty
->
assign
(
'viewid'
,
$data
->
view
);
$smarty
->
assign
(
'baseurl'
,
$data
->
baseurl
);
$smarty
->
assign
(
'onview'
,
$onview
);
$data
->
tablerows
=
$smarty
->
fetch
(
'artefact:comment:commentlist.tpl'
);
$pagination
=
build_pagination
(
array
(
'id'
=>
'feedback_pagination'
,
...
...
htdocs/theme/raw/plugintype/artefact/comment/templates/commentlist.tpl
View file @
1801a17e
<div
class=
"list-group list-group-lite"
>
{
foreach
from
=
$data
item
=
item
}
<div
class=
"list-group-item
{
if
$item
->
pubmessage
}
list-group-item-warning
{
elseif
$item
->
deletedmessage
}
deleted
{/
if
}
{
cycle
name
=
rows
values
=
'r0,r1'
}
"
>
<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
}
...
...
@@ -85,20 +85,30 @@
{/
if
}
</div>
{/
if
}
{
if
$position
==
'base'
}
</div>
{/
if
}
{
if
!
$item
->
deletedmessage
&&
$item
->
attachments
}
<div
class=
"has-attachment panel panel-default collapsible"
>
{
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"
>
<a
class=
"collapsible collapsed"
aria-expanded=
"false"
href=
"#attachments_
{
$item
->
id
}
"
data-toggle=
"collapse"
>
{
if
$position
==
'base'
}
<span
class=
"icon prm icon-paperclip"
></span>
<span
class=
"text-small"
>
{
str
tag
=
Attachments
section
=
artefact
.
comment
}
</span>
<span
class=
"icon icon-chevron-down pull-right collapse-indicator"
></span>
{
if
$item
->
attachmessage
}
<em
class=
"attachmessage metadata"
>
-
{
$item
->
attachmessage
}
</em>
{/
if
}
</a>
{
elseif
$position
==
'blockinstance'
}
<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=
"icon icon-chevron-down pull-right collapse-indicator"
></span>
</a>
{/
if
}
</h4>
<div
id=
"attachments_
{
$item
->
id
}
"
class=
"collapse"
aria-expanded=
"false"
>
{
if
$position
==
'base'
}
<div
id=
"attachments_
{
$item
->
id
}
"
class=
"panel-body"
>
{
elseif
$position
==
'blockinstance'
}
<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
}
...
...
htdocs/theme/raw/plugintype/artefact/comment/templates/edit.tpl
View file @
1801a17e
{
include
file
=
"header.tpl"
}
<p>
{
$strdescription
}
</p>
<p
clas=
"lead"
>
{
$strdescription
}
</p>
{
$form
|
safe
}
{
include
file
=
"footer.tpl"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment