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
bfe41032
Commit
bfe41032
authored
Jun 25, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 25, 2015
Browse files
Merge "Style commentlist (Bug #1465107)"
parents
69b4e7f0
6603794c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/comment/blocktype/comment/lib.php
View file @
bfe41032
...
...
@@ -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
;
}
...
...
htdocs/artefact/comment/lib.php
View file @
bfe41032
...
...
@@ -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_arra
y
(
$blocks
))
{
if
(
!
empt
y
(
$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'
,
...
...
htdocs/theme/default/style/style.css
View file @
bfe41032
This diff is collapsed.
Click to expand it.
htdocs/theme/raw/plugintype/artefact/comment/blocktype/comment/templates/comment.tpl
View file @
bfe41032
...
...
@@ -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
htdocs/theme/raw/plugintype/artefact/comment/templates/commentlist.tpl
View file @
bfe41032
<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>
</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
}
&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>
</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
}
&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>
...
...
htdocs/theme/raw/sass/features/_comment.scss
0 → 100644
View file @
bfe41032
.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
htdocs/theme/raw/sass/form/_form-group.scss
View file @
bfe41032
...
...
@@ -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%
;
}
...
...
htdocs/theme/raw/sass/layout/panel/_panel-collapse.scss
View file @
bfe41032
...
...
@@ -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
{
...
...
htdocs/theme/raw/sass/utilities/_index.scss
View file @
bfe41032
...
...
@@ -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"
;
...
...
htdocs/theme/raw/sass/utilities/_mixins.scss
View file @
bfe41032
...
...
@@ -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
htdocs/theme/raw/style/style.css
View file @
bfe41032
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/theme/raw/style/tinymce.css
View file @
bfe41032
This diff is collapsed.
Click to expand it.
htdocs/theme/raw/templates/artefact/artefact.tpl
View file @
bfe41032
...
...
@@ -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>
...
...
htdocs/theme/raw/templates/view/view.tpl
View file @
bfe41032
...
...
@@ -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
}
...
...
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