Skip to content

Commit

Permalink
Removed rating annotation inheritance change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-TBT committed Nov 24, 2024
1 parent 594f7b4 commit 84a911b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,29 +135,13 @@ var RatingsPane = function RatingsPane($element, opts) {
});
var average = Math.round(sum/anns.length);

var sum_inh = inh_anns.reduce(function(prev, ann){
return prev + ann.longValue;
}, 0);
var myRatings_inh = inh_anns.filter(function(ann){
return ann.owner.id == WEBCLIENT.USER.id;
});
var average_inh = Math.round(sum_inh/inh_anns.length);

// Update html...
var html = ratingsTempl({'anns': anns,
'canAnnotate': canAnnotate,
'average': average,
'count': anns.length,
'static': WEBCLIENT.URLS.static_webclient,
'isInherited': false});
if (inh_anns.length > 0) {
html = html + ratingsTempl({'anns': inh_anns,
'canAnnotate': false,
'average': average_inh,
'count': inh_anns.length,
'static': WEBCLIENT.URLS.static_webclient,
'isInherited': true});
}
$("#ratings_spinner").hide();
$rating_annotations.html(html);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<% if (isInherited) { %>
<hr /><h2>Inherited ratings</h2><br /><br />
<% } %>

<ul class="lnfiles">

<li class="rating myRating" style="position: relative">
Expand All @@ -19,7 +15,7 @@
/>
</a>
<% if (canAnnotate) { %>
<a href="#" class="removeRating removeTag" title="Delete rating">X</a>
<a href="#" class="removeRating removeTag" title="Delete rating">X</a>
<% } %>
</li>
</ul>
Expand All @@ -28,4 +24,4 @@
<span id="ratingsAverage"><%= average %></span>
/ <span id="ratingsCount"><%= count %></span>
votes)
</div>
</div>

0 comments on commit 84a911b

Please sign in to comment.