Skip to content

Commit

Permalink
Add button for breaking teams checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
DDH13 committed Dec 13, 2024
1 parent cc1229f commit f56f323
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
30 changes: 28 additions & 2 deletions tabbycat/checkins/templates/CheckInStatusContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@
</button>
</div>

<div class="btn-group mb-md-0 mb-3" v-if="!isForVenues">
<!-- Filter for Breaking status -->
<div class="btn-group mb-md-0 mb-3">
<button v-for="(optionState, optionKey) in filterByBreaking"
:key="optionKey" type="button"
:class="['btn btn-outline-primary', optionState ? 'active' : '']"
@click="setListContext('filterByBreaking', optionKey, !optionState)">
<span v-if="optionKey === 'All'" v-text="gettext('All')"></span>
<span v-if="optionKey === 'Breaking'" v-text="gettext('Breaking')"></span>
</button>
</div>


Check failure on line 30 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

More than 1 blank line not allowed
<div class="btn-group mb-md-0 mb-3" v-if="!isForVenues">
<button v-for="(optionState, optionKey) in this.filterByType"
:key="optionKey" type="button"
:class="['btn btn-outline-primary', optionState ? 'active' : '']"
Expand Down Expand Up @@ -145,6 +157,10 @@ export default {
filterByPresence: {
All: true, Absent: false, Present: false,
},
filterByBreaking: {
All: true,

Check failure on line 161 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 8 spaces but found 10
Breaking: false,

Check failure on line 162 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 8 spaces but found 10
},
sockets: ['checkins'],
// Keep internal copy as events needs to be mutated by the websocket
// pushed changes and the data is never updated by the parent
Expand Down Expand Up @@ -220,7 +236,9 @@ export default {
})
},
entitiesBySortingSetting: function () {
if (this.sortByGroup.Category === true) {
if (this.filterByBreaking.Breaking === true) {
return this.entitiesByBreaking;

Check failure on line 240 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 8 spaces but found 10

Check failure on line 240 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Extra semicolon
}else if (this.sortByGroup.Category === true) {

Check failure on line 241 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected space(s) before "else"
return this.venuesByCategory
} else if (this.sortByGroup.Priority === true) {
return this.venuesByPriority
Expand All @@ -233,6 +251,14 @@ export default {
}
return this.entitiesByTime
},
entitiesByBreaking: function () {
if (this.filterByBreaking.All) {

Check failure on line 255 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 6 spaces but found 8
return this.entitiesByPresence; // No filter, return all entities by presence

Check failure on line 256 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 8 spaces but found 12

Check failure on line 256 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Extra semicolon
} else if (this.filterByBreaking.Breaking) {

Check failure on line 257 in tabbycat/checkins/templates/CheckInStatusContainer.vue

View workflow job for this annotation

GitHub Actions / build-ubuntu

Expected indentation of 6 spaces but found 8
return _.filter(this.entitiesByPresence, p => p.breaking === true); // Only show breaking entities
}
return _.filter(this.entitiesByPresence, p => p.breaking !== true); // Only show non-breaking entities
},
tournamentSlugForWSPath: function () {
return this.tournamentSlug
},
Expand Down
4 changes: 3 additions & 1 deletion tabbycat/checkins/templates/checkin_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
:assistant-url="assistantUrl"
:team-codes="teamCodes"
:for-admin="forAdmin"
:team-size="teamSize">
:team-size="teamSize"
:is-break-round="isBreakRound">
</check-in-status-container>
</div>

Expand All @@ -30,6 +31,7 @@
'teamCodes': {{ team_codes }},
'forAdmin': {% if for_admin %}true{% else %}false{% endif %},
'teamSize': {{ team_size }},
'isBreakRound': {% if is_break_round %}true{% else %}false{% endif %},
}
</script>
{{ block.super }}
Expand Down

0 comments on commit f56f323

Please sign in to comment.