Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from fcamblor/2023-the-voxx
refactor: showing consecutive break rooms count in schedule debug mode
- Loading branch information
Showing
2 changed files
with
66 additions
and
62 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
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 |
---|---|---|
@@ -1,73 +1,77 @@ | ||
@(subSlots: List[Slot], room: Room, roomIndex: Int, sortedRooms: List[Room], overallSlots: List[Slot], showTimeBox:Boolean, secretPublishKey: Option[String], favoritesActivated: Boolean = false, debug: Boolean = false)(implicit req:RequestHeader) | ||
|
||
@if(debug) { | ||
<td> | ||
@subSlots.find(_.room.id == room.id).map { zeSlot: Slot => | ||
@if(zeSlot.isFiller){<strong><u>isFiller</u></strong>}else{isFiller}=@zeSlot.isFiller<br> | ||
@if(zeSlot.notAllocated){<strong><u>notAllocated</u></strong>}else{notAllocated}=@zeSlot.notAllocated<br> | ||
@if(zeSlot.break.isDefined){<strong><u>break</u></strong>}else{break}=<span title="@zeSlot.break.map(_.id).getOrElse("")">@zeSlot.break.isDefined</span><br> | ||
@if(zeSlot.proposal.isDefined){<strong><u>proposal</u></strong>}else{proposal}=<span title="@zeSlot.proposal.map(_.title).getOrElse("")">@zeSlot.proposal.isDefined</span> | ||
} | ||
</td> | ||
} else { | ||
@defining(( | ||
roomIndex != 0 && subSlots.exists(slot => slot.room.id == sortedRooms(roomIndex-1).id && slot.break.isDefined), | ||
sortedRooms.slice(roomIndex, sortedRooms.size).takeWhile{ testedRoom => !subSlots.exists(_.roomId == testedRoom.id) || subSlots.exists(slot => slot.roomId == testedRoom.id && slot.break.isDefined) }, | ||
subSlots.find(_.room.id == room.id) | ||
)) { case (previousSlotIsBreak: Boolean, consecutiveBreakRooms: List[Room], maybeSlot: Option[Slot]) => | ||
@maybeSlot.map { zeSlot => | ||
|
||
@if(zeSlot.notAllocated && !zeSlot.isFiller) { | ||
<td class="proposal tba" rowspan="@(overallSlots.count(s => s.fillerForSlotId.contains(zeSlot.id)) + 1)"> </td> | ||
@defining(( | ||
sortedRooms.slice(roomIndex, sortedRooms.size).takeWhile{ testedRoom => !subSlots.exists(_.roomId == testedRoom.id) || subSlots.exists(slot => slot.roomId == testedRoom.id && slot.break.isDefined) } | ||
)) { case (consecutiveBreakRooms: List[Room]) => | ||
@if(debug) { | ||
<td> | ||
@subSlots.find(_.room.id == room.id).map { zeSlot: Slot => | ||
@if(zeSlot.isFiller){<strong><u>isFiller</u></strong>}else{isFiller}=@zeSlot.isFiller<br> | ||
@if(zeSlot.notAllocated){<strong><u>notAllocated</u></strong>}else{notAllocated}=@zeSlot.notAllocated<br> | ||
@if(zeSlot.break.isDefined){<strong><u>break</u></strong>}else{break}=<span title="@zeSlot.break.map(_.id).getOrElse("")">@zeSlot.break.isDefined</span><br> | ||
@if(zeSlot.break.isDefined){<strong><u>consBreakRooms</u></strong>}else{consBreakRooms}=@(consecutiveBreakRooms.size) | ||
@if(zeSlot.proposal.isDefined){<strong><u>proposal</u></strong>}else{proposal}=<span title="@zeSlot.proposal.map(_.title).getOrElse("")">@zeSlot.proposal.isDefined</span><br> | ||
} | ||
@if(zeSlot.break.isDefined /* && roomIndex == 0 */ ) { | ||
@if(previousSlotIsBreak) { | ||
@* nothing to do.. we're on a break filler *@ | ||
} else { | ||
<td class="break skip-print-defaults" colspan="@(consecutiveBreakRooms.size)"> | ||
@Messages(s"sw.${zeSlot.break.get.id}") | ||
</td> | ||
</td> | ||
} else { | ||
@defining(( | ||
roomIndex != 0 && subSlots.exists(slot => slot.room.id == sortedRooms(roomIndex-1).id && slot.break.isDefined), | ||
subSlots.find(_.room.id == room.id) | ||
)) { case (previousSlotIsBreak: Boolean, maybeSlot: Option[Slot]) => | ||
@maybeSlot.map { zeSlot => | ||
|
||
@if(zeSlot.notAllocated && !zeSlot.isFiller) { | ||
<td class="proposal tba" rowspan="@(overallSlots.count(s => s.fillerForSlotId.contains(zeSlot.id)) + 1)"> </td> | ||
} | ||
} | ||
@if(zeSlot.isFiller) { | ||
@* nothing to do.. we're on a filler *@ | ||
} else { | ||
@zeSlot.proposal.map { p: Proposal => | ||
<td class="skip-max-width-on-divs proposal proposal_id_is_@p.cssId @zeSlot.id proposal_type_is_@p.talkType.id proposal_track_is_@p.track.id lang_is_@p.lang" rowspan="@(overallSlots.count(s => s.fillerForSlotId.contains(zeSlot.id)) + 1)"> | ||
<i class="proposal_badge track"></i> | ||
<div class="ribbon-wrapper"> | ||
<div class="ribbon-white"> | ||
<i class="en_badge"></i> | ||
@if(zeSlot.break.isDefined /* && roomIndex == 0 */ ) { | ||
@if(previousSlotIsBreak) { | ||
@* nothing to do.. we're on a break filler *@ | ||
} else { | ||
<td class="break skip-print-defaults" colspan="@(consecutiveBreakRooms.size)"> | ||
@Messages(s"sw.${zeSlot.break.get.id}") | ||
</td> | ||
} | ||
} | ||
@if(zeSlot.isFiller) { | ||
@* nothing to do.. we're on a filler *@ | ||
} else { | ||
@zeSlot.proposal.map { p: Proposal => | ||
<td class="skip-max-width-on-divs proposal proposal_id_is_@p.cssId @zeSlot.id proposal_type_is_@p.talkType.id proposal_track_is_@p.track.id lang_is_@p.lang" rowspan="@(overallSlots.count(s => s.fillerForSlotId.contains(zeSlot.id)) + 1)"> | ||
<i class="proposal_badge track"></i> | ||
<div class="ribbon-wrapper"> | ||
<div class="ribbon-white"> | ||
<i class="en_badge"></i> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="content"> | ||
<span class="title"><a class="blackLink skip-print-defaults" href="@routes.Publisher.showDetailsForProposal(p.id, p.escapedTitle, secretPublishKey)">@p.title</a></span> | ||
<span class="speaker"> @p.allSpeakerUUIDs.map { speakerUUID => | ||
@tags.publisher.renderSpeaker(speakerUUID) | ||
}</span> | ||
<div class="content"> | ||
<span class="title"><a class="blackLink skip-print-defaults" href="@routes.Publisher.showDetailsForProposal(p.id, p.escapedTitle, secretPublishKey)">@p.title</a></span> | ||
<span class="speaker"> @p.allSpeakerUUIDs.map { speakerUUID => | ||
@tags.publisher.renderSpeaker(speakerUUID) | ||
}</span> | ||
|
||
@if(showTimeBox){ | ||
<span class="timeSlotBox"> @zeSlot.from.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm") - @zeSlot.to.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm")</span> | ||
} | ||
</div> | ||
<div class="proposal_actions"> | ||
@tags.publisher.renderFavorite(p.id, favoritesActivated) | ||
</div> | ||
@if(!showTimeBox) { | ||
<div class="timeSlotBox hide-on-print "> | ||
<p class="timeSlotBox"> | ||
<small>@zeSlot.from.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm") | ||
- @zeSlot.to.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm")</small> | ||
</p> | ||
@if(showTimeBox){ | ||
<span class="timeSlotBox"> @zeSlot.from.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm") - @zeSlot.to.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm")</span> | ||
} | ||
</div> | ||
<div class="proposal_actions"> | ||
@tags.publisher.renderFavorite(p.id, favoritesActivated) | ||
</div> | ||
} | ||
</td> | ||
@if(!showTimeBox) { | ||
<div class="timeSlotBox hide-on-print "> | ||
<p class="timeSlotBox"> | ||
<small>@zeSlot.from.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm") | ||
- @zeSlot.to.toDateTime(ConferenceDescriptor.current().timezone).toString("HH:mm")</small> | ||
</p> | ||
</div> | ||
} | ||
</td> | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@if(!subSlots.exists(_.room.id == room.id) && !subSlots.exists(_.break.isDefined)) { | ||
<td class="room-closed"> </td> | ||
@if(!subSlots.exists(_.room.id == room.id) && !subSlots.exists(_.break.isDefined)) { | ||
<td class="room-closed"> </td> | ||
} | ||
} | ||
} |