Skip to content

Commit

Permalink
OSEP: Blog feedback for June #116290
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored and sammarshallou committed Jun 10, 2016
1 parent 5c4a786 commit 0e2c549
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
1 change: 0 additions & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,6 @@ function oublog_get_links($oublog, $oubloginstance, $context) {
}

if ($canmanagelinks) {
$html .= '<br />';
if ($oublog->global) {
$html .= '<a href="editlink.php?blog='.$oublog->id.'&amp;bloginstance='.$oubloginstance->id.'" class="oublog-links">'.get_string('addlink', 'oublog').'</a>';
} else {
Expand Down
28 changes: 20 additions & 8 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ public function render_post($cm, $oublog, $post, $baseurl, $blogtype,
'/mod/oublog/deletepost.php?blog=' . $post->oublogid .
'&post=' . $post->id . '&delete=1' . '&referurl=' . urlencode($referurl)));
}
$output .= ' ';
}
}
// Show portfolio export link.
Expand Down Expand Up @@ -387,7 +388,7 @@ public function render_post($cm, $oublog, $post, $baseurl, $blogtype,
$a->fullname = s($last->authorname);
}
$a->timeposted = oublog_date($last->timeposted, true);
$output .= html_writer::tag('span', ' ' . get_string('lastcomment', 'oublog', $a));
$output .= html_writer::tag('span', ' ' . get_string('lastcomment', 'oublog', $a), array('class' => 'oublog_links_comment'));
}
} else if (oublog_can_comment($cm, $oublog, $post)) {
if (!$forexport && !$email) {
Expand Down Expand Up @@ -930,10 +931,12 @@ public function render_user_grade($course, $cm, $oublog, $user, $groupid) {
* @param bool $canaudit Has capability toggle
* @param bool $forexport Export output rendering toggle
* @param object $cm Current course module object
* @param string $format
* @param boolean $contenttitle True to position title with content
* @return html
*/
public function render_comments($post, $oublog, $canaudit, $canmanagecomments, $forexport,
$cm, $format = false) {
$cm, $format = false, $contenttitle = false) {
global $DB, $CFG, $USER, $OUTPUT;
$viewfullnames = true;
$strdelete = get_string('delete', 'oublog');
Expand All @@ -951,6 +954,14 @@ public function render_comments($post, $oublog, $canaudit, $canmanagecomments, $
foreach ($post->comments as $comment) {
$extraclasses = $comment->deletedby ? ' oublog-deleted' : '';
$extraclasses .= ' oublog-hasuserpic';
$title = '';
if (trim(format_string($comment->title))!=='') {
$title = html_writer::tag('h3', format_string($comment->title),
array('class' => 'oublog-title'));
} else if (!$forexport) {
$commenttitle = get_accesshide(get_string('newcomment', 'mod_oublog'));
$title = html_writer::tag('h3', $commenttitle, array('class' => 'oublog-title'));
}

$output .= html_writer::start_tag('div', array('class' =>
'oublog-comment' . $extraclasses, 'id' => 'cid' . $comment->id));
Expand All @@ -973,6 +984,7 @@ public function render_comments($post, $oublog, $canaudit, $canmanagecomments, $
$output .= html_writer::tag('div', get_string('deletedby', 'oublog', $a),
array('class' => 'oublog-comment-deletedby'));
}
$output .= html_writer::start_div('oublog-comment-details');
if ($comment->userid && !$forexport) {
$output .= html_writer::start_tag('div', array('class' => 'oublog-userpic'));
$commentuser = new stdClass();
Expand All @@ -988,12 +1000,8 @@ public function render_comments($post, $oublog, $canaudit, $canmanagecomments, $
array('courseid' => $oublog->course, 'size' => 70));
$output .= html_writer::end_tag('div');
}
if (trim(format_string($comment->title))!=='') {
$output .= html_writer::tag('h2', format_string($comment->title),
array('class' => 'oublog-title'));
} else if (!$forexport) {
$commenttitle = get_accesshide(get_string('newcomment', 'mod_oublog'));
$output .= html_writer::tag('h2', $commenttitle, array('class' => 'oublog-title'));
if (!$contenttitle) {
$output .= $title;
}
$output .= html_writer::start_tag('div', array('class' => 'oublog-post-date'));
$output .= oublog_date($comment->timeposted);
Expand All @@ -1020,8 +1028,12 @@ public function render_comments($post, $oublog, $canaudit, $canmanagecomments, $
}
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('div');
$output .= html_writer::end_div();
$output .= html_writer::start_tag('div',
array('class' => 'oublog-comment-content'));
if ($contenttitle) {
$output .= $title;
}
if (!$forexport) {
if ($post->visibility == OUBLOG_VISIBILITY_PUBLIC) {
$fileurlbase = 'mod/oublog/pluginfile.php';
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ div.oublog-deleted .oublog-post-content {
margin-right: 10px;
margin-bottom: 1em;
}
.oublog-comment h2.oublog-title {
.oublog-comment h3.oublog-title {
margin: 0 0 0.5em 0;
font-weight: normal;
}
Expand Down
17 changes: 11 additions & 6 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,11 @@

// Print blog posts.
if ($posts) {
echo "<div class='oublog-paging'>";
echo $OUTPUT->paging_bar($recordcount, $page, OUBLOG_POSTS_PER_PAGE, $returnurl);
echo '</div>';
if ($recordcount > OUBLOG_POSTS_PER_PAGE) {
echo "<div class='oublog-paging'>";
echo $OUTPUT->paging_bar($recordcount, $page, OUBLOG_POSTS_PER_PAGE, $returnurl);
echo '</div>';
}
echo '<div id="oublog-posts">';
$rowcounter = 1;
// Only add page onto returnurl within call to render post.
Expand All @@ -519,9 +521,12 @@
$canmanageposts, $canaudit, true, false);
$rowcounter++;
}
echo "<div class='oublog-paging'>";
echo $OUTPUT->paging_bar($recordcount, $page, OUBLOG_POSTS_PER_PAGE, $returnurl);
echo '</div></div>';
if ($recordcount > OUBLOG_POSTS_PER_PAGE) {
echo "<div class='oublog-paging'>";
echo $OUTPUT->paging_bar($recordcount, $page, OUBLOG_POSTS_PER_PAGE, $returnurl);
echo '</div>';
}
echo '</div>';

// Show portfolio export link.
// Will need to be passed enough details on the blog so it can accurately work out what
Expand Down
4 changes: 2 additions & 2 deletions viewpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@

// Title.
if (trim(format_string($comment->title))!=='') {
print '<h2 class="oublog-comment-title">' .
format_string($comment->title) . '</h2>';
print '<h3 class="oublog-comment-title">' .
format_string($comment->title) . '</h3>';
}

// Date and author.
Expand Down

0 comments on commit 0e2c549

Please sign in to comment.