Skip to content

Commit

Permalink
show ranks on document viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
thongnt99 committed Mar 12, 2021
1 parent 6553bf2 commit 27ef7bf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions diffir/templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ <h6 id="Run2Name" style="text-align: center;"></h6>
var newEl = $('<div></div>')
.append($('<div class="card"></div>')
.attr('data-docid', doc.doc_id)
.attr('rank1-rank', doc.rank)
.append($('<div class="card-header"></div>')
// .css('padding-' + docIdFloat, '30px')
.append(doc.rank)
Expand Down Expand Up @@ -379,6 +380,8 @@ <h6 id="Run2Name" style="text-align: center;"></h6>
var newEl = $('<div></div>')
// .append($('<span class="other-rank"></span>').text(symbol).css('float', docIdFloat).css('text-align', docIdFloat === 'right' ? 'left' : 'right').attr('title', tip))
.append($('<div class="card"></div>')
.attr("run1-rank", docIdFloat === 'right' ? doc.rank : (otherRank === null ? "No" : otherRank))
.attr("run2-rank", docIdFloat === 'right' ? (otherRank === null ? "No" : otherRank): doc.rank)
.attr('data-docid', doc.doc_id)
.append($('<div class="card-header"></div>')
.css('padding-' + docIdFloat, '30px')
Expand Down Expand Up @@ -474,20 +477,26 @@ <h6 id="Run2Name" style="text-align: center;"></h6>
.appendTo(document.body);
var legendTable = $('<table class="fields"></table>')
.appendTo(page);
var run1Rank = $(this).closest('[run1-rank]').attr('run1-rank');
legendTable.append($('<tr></tr>')
.append($('<th></th>').text(data.meta.run1_name))
.append($('<td></td>')
.append($('<span class="swatch"></span>').css('background-color', 'rgb(' + COLOR_A + ')'))
).append($('<td></td>').append($('<form><div class="form-group"><input type="range" class="form-control-range" min="0", max="1.1", step="0.1" value="0.1" id="weightThresholdA"></div></form>')))
)
.append($('<td></td>').append($(" <span class='border badge'></span>").text("Rank: " +run1Rank)))
.append($('<td></td>').append($('<form><div class="form-group"><input type="range" class="form-control-range" min="0", max="1.1", step="0.1" value="0.1" id="weightThresholdA"></div></form>').attr("title", "slide to change weight threshold")))
.append($('<td><span id="run1Threshold" class="badge border rounded threshold-value">0.1</span></td>'))
);
if (!singleRunView) {
var run2Rank = $(this).closest('[run2-rank]').attr('run2-rank');
legendTable.append($('<tr></tr>')
.append($('<th></th>').text(data.meta.run2_name))
.append($('<td></td>')
.append($('<span class="swatch"></span>').css('background-color', 'rgb(' + COLOR_B + ')'))
).append($('<td></td>')
.append($('<form><div class="form-group"><input type="range" class="form-control-range" min="0", max="1.1", step="0.1" value="0.1" id="weightThresholdB"></div></form>'))
)
.append($('<td></td>').append($(" <span class='border badge'></span>").text("Rank: " +run2Rank)))
.append($('<td></td>')
.append($('<form><div class="form-group"><input type="range" class="form-control-range" min="0", max="1.1", step="0.1" value="0.1" id="weightThresholdB"></div></form>').attr("title", "slide to change weight threshold"))
).append($('<td><span id="run2Threshold" class="badge border rounded threshold-value">0.1</span></td>'))
);
legendTable.append($('<tr></tr>')
Expand Down

0 comments on commit 27ef7bf

Please sign in to comment.