Skip to content

Commit

Permalink
MDL-40759 fontawesome: lang strings comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Mar 21, 2017
1 parent 7e8940b commit dc633a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 7 additions & 6 deletions comment/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,15 @@ M.core_comment = {
}
}, '13,32');
// 13 and 32 are the keycodes for space and enter.

require(['core/templates', 'core/notification'], function(Templates, Notification) {
var title = node.getAttribute('title');
Templates.renderPix('t/delete', 'core', title).then(function(html) {
node.set('innerHTML', html);
}).catch(Notification.exception);
});
}
);

require(['core/templates', 'core/notification'], function(Templates, Notification) {
Templates.renderPix('t/delete', 'core', M.util.get_string('deletecomment', 'moodle')).then(function(html) {
Y.all('div.comment-delete a').set('innerHTML', html);
}).catch(Notification.exception);
});
},
register_pagination: function() {
var scope = this;
Expand Down
8 changes: 5 additions & 3 deletions comment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ public static function init(moodle_page $page = null) {
'comments',
'commentscount',
'commentsrequirelogin',
'deletecommentbyon',
'deletecomment',
'deletecommentbyon'
),
'moodle'
);
Expand Down Expand Up @@ -916,8 +915,11 @@ public function print_comment($cmt, $nonjs = true) {
$replacements = array();

if (!empty($cmt->delete) && empty($nonjs)) {
$strdelete = get_string('deletecommentbyon', 'moodle', (object)['user' => $cmt->fullname, 'time' => $cmt->time]);
$deletelink = html_writer::start_tag('div', array('class'=>'comment-delete'));
$deletelink .= html_writer::start_tag('a', array('href' => '#', 'id' => 'comment-delete-'.$this->cid.'-'.$cmt->id));
$deletelink .= html_writer::start_tag('a', array('href' => '#', 'id' => 'comment-delete-'.$this->cid.'-'.$cmt->id,
'title' => $strdelete));

$deletelink .= $OUTPUT->pix_icon('t/delete', get_string('delete'));
$deletelink .= html_writer::end_tag('a');
$deletelink .= html_writer::end_tag('div');
Expand Down

0 comments on commit dc633a2

Please sign in to comment.