feat(PublicPage): add schedule parts system for page with a lot of schedule (dense schedule)

This commit is contained in:
Matthieu Bessat 2020-08-29 21:27:38 +02:00
parent 61a9a703e9
commit ebd725b0d3
3 changed files with 77 additions and 44 deletions

View file

@ -237,6 +237,17 @@ export default class PublicController {
})
}
if (version.schedule.length > 8) {
let isFirst = true;
version.scheduleParts = [[], []]
version.schedule.forEach((schedule: any) => {
version.scheduleParts[isFirst ? 0 : 1].push(schedule)
isFirst = !isFirst
})
} else {
version.scheduleParts = [version.schedule]
}
version.cutDescription = Utils.isStrUsable(version, 'descriptionLong') && version.descriptionLong.length > 800
// if (version.cutDescription) {