-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(labeler): sidebar, image, text match to seperate components
- Loading branch information
Roshan Jossy
committed
Oct 7, 2021
1 parent
04c22f7
commit 9a23560
Showing
5 changed files
with
267 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
finetuner/labeler/ui/js/components/image-match-card.vue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const imageMatchCard = { | ||
props: { | ||
doc: Object, | ||
docIdx: Number, | ||
getContent: Function, | ||
toggleRelevance: Function, | ||
invertSelection: Function, | ||
submitDoc: Function, | ||
}, | ||
template: ` | ||
<div class="card image-card"> | ||
<div class="card-header"> | ||
<p class="fs-6 fw-light mb-2">Select all images similar to the image on right</p> | ||
<img v-bind:src="getContent(doc)" class="img-thumbnail img-fluid my-2"> | ||
</div> | ||
<div class="card-body"> | ||
<div class="image-matches-container"> | ||
<div class="col compact-img" v-for="(match, matchIndex) in doc.matches"> | ||
<div class="w-100" v-bind:class="{ 'positive-match': match.tags.finetuner_label }"> | ||
<img v-bind:src="getContent(match)" class="img-thumbnail img-fluid" | ||
v-on:click="toggleRelevance(match)"> | ||
</div> | ||
<div class="kbd">{{matchIndex}}</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="btn-toolbar justify-content-between g-2"> | ||
<button type="button" class="btn btn-outline-success" | ||
v-on:click="invertSelection(doc.matches)"> | ||
Invert | ||
<div class="kbd">i</div> | ||
</button> | ||
<button type="button" class="btn btn-outline-primary" v-on:click="submitDoc(docIdx)"> | ||
Done | ||
<div class="kbd">space</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
`, | ||
mounted() { | ||
} | ||
} |
Oops, something went wrong.