Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (#1730): Allows scheduling of pending accepted/pending confirmed talks #1732

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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