Skip to content

Commit

Permalink
feat (#1730): Allows scheduling of pending accepted/pending confirmed…
Browse files Browse the repository at this point in the history
… talks
  • Loading branch information
margau committed Apr 13, 2024
1 parent dd9f391 commit 8eb9824
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/pretalx/frontend/schedule-editor/src/components/Session.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.info
.title {{ getLocalizedString(session.title) }}
.speakers(v-if="session.speakers") {{ session.speakers.map(s => s.name).join(', ') }}
.pending-line(v-if="session.state && session.state !== 'confirmed' && session.state !== 'accepted'")
i.fa.fa-exclamation-circle
span {{ $t('Pending acceptance/confirmation') }}
.bottom-info(v-if="!isBreak")
.track(v-if="session.track") {{ getLocalizedString(session.track.name) }}
.warning.no-print(v-if="warnings?.length")
Expand Down Expand Up @@ -64,7 +67,8 @@ export default {
if (this.isBreak) classes.push('isbreak')
else {
classes.push('istalk')
if (this.session.state !== "confirmed") classes.push('unconfirmed')
if (this.session.state !== "confirmed" && this.session.state !== "accepted") classes.push('pending')
else if (this.session.state !== "confirmed") classes.push('unconfirmed')
}
if (this.isDragged) classes.push('dragging')
if (this.isDragClone) classes.push('clone')
Expand Down Expand Up @@ -167,6 +171,12 @@ export default {
border-left: none
.title
color: var(--pretalx-clr-primary)
&.pending
.time-box
opacity: 0.5
.info
background-image: repeating-linear-gradient(-38deg, $clr-grey-100, $clr-grey-100 10px, $clr-white 10px, $clr-white 20px)
border-style: dashed dashed dashed none
.time-box
width: 69px
box-sizing: border-box
Expand Down Expand Up @@ -206,6 +216,9 @@ export default {
color: var(--track-color)
ellipsis()
margin-right: 4px
.pending-line
span
margin-left: 1em
.warning
position: absolute
top: 0
Expand Down
2 changes: 1 addition & 1 deletion src/pretalx/orga/templates/orga/schedule/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>
{% plural %}
{{ count }} sessions are still <strong>unconfirmed</strong> and will not show up
on the public schedule.
{% endblocktranslate %} <a href="{{ request.event.orga_urls.submissions }}?state=accepted">{% translate "See all unconfirmed sessions." %}</a></li>
{% endblocktranslate %} <a href="{{ request.event.orga_urls.submissions }}?state=accepted&state=pending_state__accepted&state=pending_state__confirmed">{% translate "See all unconfirmed sessions." %}</a></li>
{% endif %}
{% if warnings.unscheduled %}
<li>{% blocktranslate trimmed count count=warnings.unscheduled %}
Expand Down
6 changes: 6 additions & 0 deletions src/pretalx/orga/views/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ def do(self, force=False, pending=False):
if pending:
self.object.pending_state = self._target
self.object.save()
if self.object.pending_state in [
SubmissionStates.ACCEPTED,
SubmissionStates.CONFIRMED,
]:
# allow configureability of pending accepted/confirmed talks
self.object.update_talk_slots()
else:
method = getattr(self.object, SubmissionStates.method_names[self._target])
method(person=self.request.user, force=force, orga=True)
Expand Down
5 changes: 4 additions & 1 deletion src/pretalx/submission/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ def update_talk_slots(self):
"""
from pretalx.schedule.models import TalkSlot

if self.state not in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED]:
# scheduling is only allowed (and therefore slots needed) for accepted and confirmed talks, or those pending counterparts
scheduling_allowed = self.state in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED] or self.pending_state in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED]

if not scheduling_allowed:
TalkSlot.objects.filter(
submission=self, schedule=self.event.wip_schedule
).delete()
Expand Down

0 comments on commit 8eb9824

Please sign in to comment.