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

Add space around brackets #233

Draft
wants to merge 2 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/pretalx/common/templates/common/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{% load i18n %}
{% load static %}
{% load socialaccount %}
{% load socialapp_extras %}

{% include "common/forms/errors.html" %}
{% if no_form %}
Expand Down
20 changes: 10 additions & 10 deletions src/pretalx/frontend/schedule-editor/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template lang="pug">
.pretalx-schedule(:style="{'--scrollparent-width': scrollParentWidth + 'px'}", :class="draggedSession ? ['is-dragging'] : []", @pointerup="stopDragging")
.pretalx-schedule(:style="{ '--scrollparent-width': scrollParentWidth + 'px' }", :class="draggedSession ? ['is-dragging'] : []", @pointerup="stopDragging")
template(v-if="schedule")
#main-wrapper
#unassigned.no-print(v-scrollbar.y="", @pointerenter="isUnassigning = true", @pointerleave="isUnassigning = false")
.title
bunt-input#filter-input(v-model="unassignedFilterString", :placeholder="translations.filterSessions", icon="search")
#unassigned-sort(@click="showUnassignedSortMenu = !showUnassignedSortMenu", :class="{'active': showUnassignedSortMenu}")
#unassigned-sort(@click="showUnassignedSortMenu = !showUnassignedSortMenu", :class="{ 'active': showUnassignedSortMenu }")
i.fa.fa-sort
#unassigned-sort-menu(v-if="showUnassignedSortMenu")
.sort-method(v-for="method of unassignedSortMethods", @click="unassignedSort === method.name ? unassignedSortDirection = unassignedSortDirection * -1 : unassignedSort = method.name; showUnassignedSortMenu = false")
span {{ method.label }}
i.fa.fa-sort-amount-asc(v-if="unassignedSort === method.name && unassignedSortDirection === 1")
i.fa.fa-sort-amount-desc(v-if="unassignedSort === method.name && unassignedSortDirection === -1")
session.new-break(:session="{title: '+ ' + translations.newBreak}", :isDragged="false", @startDragging="startNewBreak", @click="showNewBreakHint", v-tooltip.fixed="{text: newBreakTooltip, show: newBreakTooltip}", @pointerleave="removeNewBreakHint")
session.new-break(:session="{ title: '+ ' + translations.newBreak }", :isDragged="false", @startDragging="startNewBreak", @click="showNewBreakHint", v-tooltip.fixed="{ text: newBreakTooltip, show: newBreakTooltip }", @pointerleave="removeNewBreakHint")
session(v-for="un in unscheduled", :session="un", @startDragging="startDragging", :isDragged="draggedSession && un.id === draggedSession.id")
#schedule-wrapper(v-scrollbar.x.y="")
bunt-tabs.days(v-if="days", :modelValue="currentDay.format()", ref="tabs" :class="['grid-tabs']")
Expand Down Expand Up @@ -133,13 +133,13 @@ export default {
},
unassignedSortMethods () {
const sortMethods = [
{label: this.$t('Title'), name: 'title'},
{label: this.$t('Speakers'), name: 'speakers'},
{ label: this.$t('Title'), name: 'title' },
{ label: this.$t('Speakers'), name: 'speakers' },
]
if (this.schedule && this.schedule.tracks.length > 1) {
sortMethods.push({label: this.$t('Track'), name: 'track'})
sortMethods.push({ label: this.$t('Track'), name: 'track' })
}
sortMethods.push({label: this.$t('Duration'), name: 'duration' })
sortMethods.push({ label: this.$t('Duration'), name: 'duration' })
return sortMethods
},
speakersLookup () {
Expand Down Expand Up @@ -315,14 +315,14 @@ export default {
removeNewBreakHint () {
this.newBreakTooltip = ''
},
startNewBreak({event}) {
startNewBreak({ event }) {
const title = this.locales.reduce((obj, locale) => {
obj[locale] = this.$t("New break")
return obj
}, {})
this.startDragging({event, session: {title, duration: "5", uncreated: true}})
},
startDragging ({event, session}) {
startDragging ({ event, session }) {
if (this.availabilities && this.availabilities.talks[session.id] && this.availabilities.talks[session.id].length !== 0) {
session.availabilities = this.availabilities.talks[session.id]
}
Expand Down Expand Up @@ -363,7 +363,7 @@ export default {
this.warnings = await api.fetchWarnings()
},
async pollUpdates () {
this.fetchSchedule({since: this.since, warnings: true}).then(schedule => {
this.fetchSchedule({ since: this.since, warnings: true }).then(schedule => {
if (schedule.version !== this.schedule.version) {
// we need to reload if a new schedule version is available
window.location.reload()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
path(d="M 0 4 L 5 0 L 10 4 z")
path(d="M 0 6 L 5 10 L 10 6 z")
.timeseparator(:class="getSliceClasses(slice)", :style="getSliceStyle(slice)")
.room(:style="{'grid-area': `1 / 1 / auto / auto`}")
.room(v-for="(room, index) of visibleRooms", :style="{'grid-area': `1 / ${index + 2 } / auto / auto`}")
.room(:style="{ 'grid-area': `1 / 1 / auto / auto` }")
.room(v-for="(room, index) of visibleRooms", :style="{ 'grid-area': `1 / ${index + 2 } / auto / auto` }")
span {{ getLocalizedString(room.name) }}
.hide-room.no-print(v-if="visibleRooms.length > 1", @click="hiddenRooms = rooms.filter(r => hiddenRooms.includes(r) || r === room)")
i.fa.fa-eye-slash
Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
const minimumSliceMins = 30
const slices = []
const slicesLookup = {}
const pushSlice = function (date, {hasStart = false, hasEnd = false, hasSession = false, isExpanded = false} = {}) {
const pushSlice = function (date, { hasStart = false, hasEnd = false, hasSession = false, isExpanded = false } = {}) {
const name = getSliceName(date)
let slice = slicesLookup[name]
if (slice) {
Expand All @@ -117,7 +117,7 @@ export default {
slicesLookup[name] = slice
}
}
const fillHalfHours = function (start, end, {hasSession} = {}) {
const fillHalfHours = function (start, end, { hasSession } = {}) {
// fill to the nearest half hour, then each half hour, then fill to end
let mins = end.diff(start, 'minutes')
const startingMins = minimumSliceMins - start.minute() % minimumSliceMins
Expand All @@ -138,7 +138,7 @@ export default {

// last slice is actually just after the end of the session and has no session
const lastSlice = halfHourSlices.pop()
halfHourSlices.forEach(slice => pushSlice(slice, {hasSession}))
halfHourSlices.forEach(slice => pushSlice(slice, { hasSession }))
pushSlice(lastSlice)
}
for (const session of this.sessions) {
Expand All @@ -151,17 +151,17 @@ export default {
}

// add start and end slices for the session itself
pushSlice(session.start, {hasStart: true, hasSession: true})
pushSlice(session.end, {hasEnd: true})
pushSlice(session.start, { hasStart: true, hasSession: true })
pushSlice(session.end, { hasEnd: true })
// add half hour slices between a session
fillHalfHours(session.start, session.end, {hasSession: true})
fillHalfHours(session.start, session.end, { hasSession: true })
}
for (const slice of this.expandedTimes) {
pushSlice(slice, {isExpanded: true})
pushSlice(slice, { isExpanded: true })
}
// Always show business hours
fillHalfHours(this.start, this.end)
if (this.hoverEndSlice) pushSlice(this.hoverEndSlice, {hasEnd: true})
if (this.hoverEndSlice) pushSlice(this.hoverEndSlice, { hasEnd: true })
const sliceIsFraction = function (slice) {
if (!slice) return
return slice.date.minutes() !== 0 && slice.date.minutes() !== minimumSliceMins
Expand Down Expand Up @@ -258,7 +258,7 @@ export default {
}
}
for (const room of this.visibleRooms) {
if (!this.availabilities.rooms[room.id] || !this.availabilities.rooms[room.id].length) avails.push({room: room, start: earliestStart, end: latestEnd})
if (!this.availabilities.rooms[room.id] || !this.availabilities.rooms[room.id].length) avails.push({ room: room, start: earliestStart, end: latestEnd })
else {
for (const avail of this.availabilities.rooms[room.id]) {
avails.push({
Expand Down Expand Up @@ -328,14 +328,14 @@ export default {
this.gridOffset = this.$refs.grid.getBoundingClientRect().left
},
methods: {
startDragging({session, event}) {
startDragging({ session, event }) {
this.dragStart = {
x: event.clientX,
y: event.clientY,
session: session,
now: moment(),
}
this.$emit('startDragging', {event, session})
this.$emit('startDragging', { event, session })
},
stopDragging (event) {
if (this.dragStart && this.draggedSession) {
Expand All @@ -353,9 +353,9 @@ export default {
const start = this.hoverSlice.time
const end = this.hoverSlice.time.clone().add(this.draggedSession.duration, 'm')
if (!this.draggedSession.id) {
this.$emit('createSession', {session: {...this.draggedSession, start: start.format(), end: end.format(), room: this.hoverSlice.room.id}})
this.$emit('createSession', { session: { ...this.draggedSession, start: start.format(), end: end.format(), room: this.hoverSlice.room.id } })
} else {
this.$emit('rescheduleSession', {session: this.draggedSession, start: start.format(), end: end.format(), room: this.hoverSlice.room})
this.$emit('rescheduleSession', { session: this.draggedSession, start: start.format(), end: end.format(), room: this.hoverSlice.room })
}
},
expandTimeslice (slice) {
Expand Down Expand Up @@ -439,9 +439,9 @@ export default {
if (index < 0) {
index = this.timeslices.length - 1
}
return {'grid-area': `${slice.name} / 1 / ${this.timeslices[index].name} / auto`}
return { 'grid-area': `${slice.name} / 1 / ${this.timeslices[index].name} / auto` }
}
return {'grid-area': `${slice.name} / 1 / auto / auto`}
return { 'grid-area': `${slice.name} / 1 / auto / auto` }
},
getSliceLabel (slice) {
if (slice.datebreak) return slice.date.format('ddd[\n]DD. MMM')
Expand All @@ -455,10 +455,10 @@ export default {
this.scrollTo(offset)
},
scrollTo (offset) {
this.scrollParent.scroll({top: offset, behavior: "smooth"})
this.scrollParent.scroll({ top: offset, behavior: "smooth" })
},
scrollBy (offset) {
this.scrollParent.scrollBy({top: offset, behavior: "smooth"})
this.scrollParent.scrollBy({ top: offset, behavior: "smooth" })
},
dragOnScroll () {
if (!this.draggedSession) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="pug">
.c-linear-schedule-session(:style="style", @pointerdown.stop="$emit('startDragging', {session: session, event: $event})", :class="classes")
.c-linear-schedule-session(:style="style", @pointerdown.stop="$emit('startDragging', { session: session, event: $event })", :class="classes")
.time-box
.start(:class="{'has-ampm': startTime.ampm}", v-if="startTime")
.start(:class="{ 'has-ampm': startTime.ampm }", v-if="startTime")
.time {{ startTime.time }}
.ampm(v-if="startTime.ampm") {{ startTime.ampm }}
.duration {{ durationPretty }}
Expand Down Expand Up @@ -46,7 +46,7 @@ export default {
eventUrl: { default: null },
generateSessionLinkUrl: {
default () {
return ({eventUrl, session}) => `${eventUrl}talk/${session.id}/`
return ({ eventUrl, session }) => `${eventUrl}talk/${session.id}/`
}
}
},
Expand All @@ -57,7 +57,7 @@ export default {
},
computed: {
link () {
return this.generateSessionLinkUrl({eventUrl: this.eventUrl, session: this.session})
return this.generateSessionLinkUrl({ eventUrl: this.eventUrl, session: this.session })
},
isBreak () {
return !this.session.code
Expand Down
Loading