Commit dc44324b authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Ruslan Kabalin
Browse files

Refactor comment rating image output (bug #816176)



Rating html output is moved to the template.

Change-Id: I8e401464e3d60367bff829c9fbf4b84495d0aa69
Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@gmail.com>
parent 8fbf3b44
......@@ -494,15 +494,11 @@ class ArtefactTypeComment extends ArtefactType {
}
if (get_config_plugin('artefact', 'comment', 'commentratings') and $item->rating) {
$item->rating = valid_rating($item->rating);
$item->ratingimage = '';
for ($i = MIN_RATING; $i <= MAX_RATING; $i++) {
$checked = '';
if ($i === $item->rating) {
$checked = 'checked="checked"';
}
$item->ratingimage .= '<input name="star'.$item->id.'" type="radio" class="star" '.$checked.' disabled="disabled"/>';
}
$item->ratingdata = (object) array(
'value' => valid_rating($item->rating),
'min_rating' => MIN_RATING,
'max_rating' => MAX_RATING,
);
}
}
......
......@@ -29,7 +29,13 @@
{else}
<div class="commentright">
{if $item->makepublicform}<div class="makepublicbtn">{$item->makepublicform|safe}</div>{/if}
{if $item->ratingimage}<div class="commentrating">{$item->ratingimage|safe}</div><br />{/if}
{if $item->ratingdata}
<div class="commentrating">
{for i $item->ratingdata->min_rating $item->ratingdata->max_rating}
<input name="star{$item->id}" type="radio" class="star" {if $i === $item->ratingdata->value} checked="checked" {/if} disabled="disabled" />
{/for}
</div><br />
{/if}
{$item->description|safe|clean_html}
{if $item->attachmessage}<div class="attachmessage">{$item->attachmessage}</div>{/if}
</div>
......
Supports Markdown
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