Compare commits
No commits in common. "1b84ab88e3d5f91c623cc1f3626503a841e70ac9" and "bd8f10f1e78bb504de7500984e2adc5a3f0de9be" have entirely different histories.
1b84ab88e3
...
bd8f10f1e7
32 changed files with 1277 additions and 1959 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,4 +9,3 @@ data/
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
*.db
|
*.db
|
||||||
twitter.toml
|
|
||||||
|
|
|
@ -97,10 +97,6 @@ kotlin {
|
||||||
implementation "com.soywiz:klock-jvm:$klockVersion"
|
implementation "com.soywiz:klock-jvm:$klockVersion"
|
||||||
implementation "com.soywiz:klock-locale-jvm:$klockVersion"
|
implementation "com.soywiz:klock-locale-jvm:$klockVersion"
|
||||||
|
|
||||||
//implementation 'com.twitter:hbc-core:2.2.0'
|
|
||||||
//implementation 'com.twitter:hbc-twitter4j:2.2.0'
|
|
||||||
api 'org.twitter4j:twitter4j-stream:4.0.1'
|
|
||||||
|
|
||||||
implementation 'com.github.uchuhimo:konf:master-SNAPSHOT'
|
implementation 'com.github.uchuhimo:konf:master-SNAPSHOT'
|
||||||
implementation 'com.vladsch.flexmark:flexmark-all:0.42.10'
|
implementation 'com.vladsch.flexmark:flexmark-all:0.42.10'
|
||||||
api 'io.github.microutils:kotlin-logging:1.6.23'
|
api 'io.github.microutils:kotlin-logging:1.6.23'
|
||||||
|
|
|
@ -3,7 +3,7 @@ host = "localhost"
|
||||||
port = 8080
|
port = 8080
|
||||||
|
|
||||||
[schedule]
|
[schedule]
|
||||||
reference = "2019-06-06"
|
reference = "2019-06-12"
|
||||||
|
|
||||||
[general]
|
[general]
|
||||||
wiki_url = "https://wiki.kif.rocks/w/index.php?title=KIF470:Arbeitskreise&action=raw"
|
wiki_url = "https://wiki.kif.rocks/w/index.php?title=KIF470:Arbeitskreise&action=raw"
|
||||||
|
|
|
@ -31,7 +31,7 @@ data class Schedule(
|
||||||
fun getAbsoluteEndTime(): Int = getAbsoluteStartTime() + workGroup.length
|
fun getAbsoluteEndTime(): Int = getAbsoluteStartTime() + workGroup.length
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun timeOfDayToString(time: Int): String {
|
fun timeToString(time: Int): String {
|
||||||
var day = time % (24 * 60)
|
var day = time % (24 * 60)
|
||||||
if (day < 0) day += 24 * 60
|
if (day < 0) day += 24 * 60
|
||||||
|
|
||||||
|
@ -40,37 +40,5 @@ data class Schedule(
|
||||||
|
|
||||||
return hour.toString().padStart(2, '0') + ":" + minute.toString().padStart(2, '0')
|
return hour.toString().padStart(2, '0') + ":" + minute.toString().padStart(2, '0')
|
||||||
}
|
}
|
||||||
|
|
||||||
fun timeDifferenceToString(time: Long): String {
|
|
||||||
if (time < 0) {
|
|
||||||
return "running"
|
|
||||||
}
|
|
||||||
|
|
||||||
var remainder = time
|
|
||||||
|
|
||||||
val seconds = (remainder % 60).toString().padStart(2, '0')
|
|
||||||
remainder /= 60
|
|
||||||
|
|
||||||
val minutes = (remainder % 60).toString().padStart(2, '0')
|
|
||||||
remainder /= 60
|
|
||||||
|
|
||||||
val hours = (remainder % 24).toString().padStart(2, '0')
|
|
||||||
remainder /= 24
|
|
||||||
|
|
||||||
val days = remainder
|
|
||||||
|
|
||||||
if (days > 1) {
|
|
||||||
return "$days days"
|
|
||||||
}
|
|
||||||
if (days > 0) {
|
|
||||||
return "1 day"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hours == "00") {
|
|
||||||
return "$minutes:$seconds"
|
|
||||||
}
|
|
||||||
|
|
||||||
return "$hours:$minutes:$seconds"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package de.kif.frontend
|
package de.kif.frontend
|
||||||
|
|
||||||
import de.kif.frontend.views.board.initBoard
|
|
||||||
import de.kif.frontend.views.calendar.initCalendar
|
import de.kif.frontend.views.calendar.initCalendar
|
||||||
import de.kif.frontend.views.table.initTableLayout
|
import de.kif.frontend.views.table.initTableLayout
|
||||||
import de.kif.frontend.views.initWorkGroupConstraints
|
import de.kif.frontend.views.initWorkGroupConstraints
|
||||||
|
@ -31,7 +30,4 @@ fun main() = init {
|
||||||
if (document.getElementsByClassName("post-edit-right").length > 0) {
|
if (document.getElementsByClassName("post-edit-right").length > 0) {
|
||||||
initPostEdit()
|
initPostEdit()
|
||||||
}
|
}
|
||||||
if (document.getElementsByClassName("board").length > 0) {
|
|
||||||
initBoard()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import kotlin.js.Promise
|
||||||
suspend fun repositoryGet(
|
suspend fun repositoryGet(
|
||||||
url: String
|
url: String
|
||||||
): dynamic {
|
): dynamic {
|
||||||
|
console.log("GET: $url")
|
||||||
val promise = Promise<dynamic> { resolve, reject ->
|
val promise = Promise<dynamic> { resolve, reject ->
|
||||||
val xhttp = XMLHttpRequest()
|
val xhttp = XMLHttpRequest()
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ suspend fun repositoryPost(
|
||||||
url: String,
|
url: String,
|
||||||
data: String? = null
|
data: String? = null
|
||||||
): dynamic {
|
): dynamic {
|
||||||
|
console.log("POST: $url", data)
|
||||||
val promise = Promise<dynamic> { resolve, reject ->
|
val promise = Promise<dynamic> { resolve, reject ->
|
||||||
val xhttp = XMLHttpRequest()
|
val xhttp = XMLHttpRequest()
|
||||||
|
|
||||||
|
@ -83,6 +85,7 @@ suspend fun repositoryPost(
|
||||||
suspend fun repositoryRawGet(
|
suspend fun repositoryRawGet(
|
||||||
url: String
|
url: String
|
||||||
): String {
|
): String {
|
||||||
|
console.log("GET: $url")
|
||||||
val promise = Promise<String> { resolve, reject ->
|
val promise = Promise<String> { resolve, reject ->
|
||||||
val xhttp = XMLHttpRequest()
|
val xhttp = XMLHttpRequest()
|
||||||
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package de.kif.frontend.views.board
|
|
||||||
|
|
||||||
import de.kif.common.formatDateTime
|
|
||||||
import de.kif.frontend.iterator
|
|
||||||
import de.westermann.kwebview.interval
|
|
||||||
import org.w3c.dom.HTMLElement
|
|
||||||
import org.w3c.dom.get
|
|
||||||
import kotlin.browser.document
|
|
||||||
import kotlin.js.Date
|
|
||||||
|
|
||||||
fun initBoard() {
|
|
||||||
val boardSchedules = document.getElementsByClassName("board-schedules")[0] as HTMLElement
|
|
||||||
val dateView = document.getElementsByClassName("board-header-date")[0] as HTMLElement
|
|
||||||
val referenceTime = boardSchedules.dataset["reference"]?.toLongOrNull() ?: 0L
|
|
||||||
|
|
||||||
val scheduleList = mutableListOf<BoardSchedule>()
|
|
||||||
|
|
||||||
for (bs in boardSchedules.getElementsByClassName("board-schedule").iterator()) {
|
|
||||||
scheduleList += BoardSchedule(bs)
|
|
||||||
}
|
|
||||||
|
|
||||||
interval(1000) {
|
|
||||||
val currentTime = Date.now().toLong()
|
|
||||||
dateView.innerText = formatDateTime(currentTime)
|
|
||||||
|
|
||||||
val now = referenceTime - currentTime / 1000
|
|
||||||
scheduleList.forEach { it.updateTime(now) }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
package de.kif.frontend.views.board
|
|
||||||
|
|
||||||
import de.kif.common.model.Schedule
|
|
||||||
import de.kif.frontend.views.overview.getByClassOrCreate
|
|
||||||
import de.westermann.kwebview.View
|
|
||||||
import org.w3c.dom.HTMLElement
|
|
||||||
import org.w3c.dom.HTMLSpanElement
|
|
||||||
import org.w3c.dom.get
|
|
||||||
|
|
||||||
class BoardSchedule(
|
|
||||||
view: HTMLElement
|
|
||||||
) : View(view) {
|
|
||||||
private val roomView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-room")
|
|
||||||
private val timeView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-time")
|
|
||||||
private val colorView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-color")
|
|
||||||
private val nameView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-name")
|
|
||||||
|
|
||||||
private var time: Long = timeView.dataset["time"]?.toLongOrNull() ?: 0L
|
|
||||||
|
|
||||||
fun updateTime(now: Long) {
|
|
||||||
//console.log(time.toString(), now.toString())
|
|
||||||
timeView.textContent = Schedule.timeDifferenceToString(time + now)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,9 +4,9 @@ import de.kif.frontend.iterator
|
||||||
import de.kif.frontend.launch
|
import de.kif.frontend.launch
|
||||||
import de.kif.frontend.repository.ScheduleRepository
|
import de.kif.frontend.repository.ScheduleRepository
|
||||||
import de.westermann.kwebview.View
|
import de.westermann.kwebview.View
|
||||||
|
import de.westermann.kwebview.createHtmlView
|
||||||
import org.w3c.dom.*
|
import org.w3c.dom.*
|
||||||
import kotlin.browser.document
|
import kotlin.browser.document
|
||||||
import kotlin.browser.window
|
|
||||||
|
|
||||||
|
|
||||||
class Calendar(calendar: HTMLElement) : View(calendar) {
|
class Calendar(calendar: HTMLElement) : View(calendar) {
|
||||||
|
@ -15,23 +15,23 @@ class Calendar(calendar: HTMLElement) : View(calendar) {
|
||||||
|
|
||||||
val day: Int
|
val day: Int
|
||||||
|
|
||||||
val htmlTag = document.body as HTMLElement
|
val htmlTag = document.documentElement as HTMLHtmlElement
|
||||||
val calendarTable = calendar.getElementsByClassName("calendar-table")[0] as HTMLElement
|
val calendarTable = calendar.getElementsByClassName("calendar-table")[0] as HTMLElement
|
||||||
|
|
||||||
fun scrollVerticalBy(pixel: Double, scrollBehavior: ScrollBehavior = ScrollBehavior.SMOOTH) {
|
fun scrollVerticalBy(pixel: Double) {
|
||||||
htmlTag.scrollBy(ScrollToOptions(0.0, pixel, scrollBehavior))
|
htmlTag.scrollBy(ScrollToOptions(0.0, pixel, ScrollBehavior.SMOOTH))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun scrollHorizontalBy(pixel: Double, scrollBehavior: ScrollBehavior = ScrollBehavior.SMOOTH) {
|
fun scrollHorizontalBy(pixel: Double) {
|
||||||
calendarTable.scrollBy(ScrollToOptions(pixel, 0.0, scrollBehavior))
|
calendarTable.scrollBy(ScrollToOptions(pixel, 0.0, ScrollBehavior.SMOOTH))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun scrollVerticalTo(pixel: Double, scrollBehavior: ScrollBehavior = ScrollBehavior.SMOOTH) {
|
fun scrollVerticalTo(pixel: Double) {
|
||||||
htmlTag.scrollTo(ScrollToOptions(0.0, pixel, scrollBehavior))
|
htmlTag.scrollTo(ScrollToOptions(0.0, pixel, ScrollBehavior.SMOOTH))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun scrollHorizontalTo(pixel: Double, scrollBehavior: ScrollBehavior = ScrollBehavior.SMOOTH) {
|
fun scrollHorizontalTo(pixel: Double) {
|
||||||
calendarTable.scrollTo(ScrollToOptions(pixel, 0.0, scrollBehavior))
|
calendarTable.scrollTo(ScrollToOptions(pixel, 0.0, ScrollBehavior.SMOOTH))
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -78,7 +78,8 @@ class Calendar(calendar: HTMLElement) : View(calendar) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(document.getElementById("calendar-check-constraints") as? HTMLElement)?.let { wrap(it) }?.onClick?.addListener {
|
val view = View.wrap(document.getElementById("calendar-check-constraints") as HTMLElement)
|
||||||
|
view.onClick {
|
||||||
launch {
|
launch {
|
||||||
val errors = ScheduleRepository.checkConstraints()
|
val errors = ScheduleRepository.checkConstraints()
|
||||||
|
|
||||||
|
@ -93,19 +94,6 @@ class Calendar(calendar: HTMLElement) : View(calendar) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel {
|
|
||||||
val multiplier = when (it.deltaMode) {
|
|
||||||
1 -> 16.0
|
|
||||||
2 -> window.innerHeight.toDouble()
|
|
||||||
else -> 1.0
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollHorizontalBy(it.deltaX * multiplier, ScrollBehavior.INSTANT)
|
|
||||||
scrollVerticalBy(it.deltaY * multiplier, ScrollBehavior.INSTANT)
|
|
||||||
|
|
||||||
it.preventDefault()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import de.westermann.kwebview.components.*
|
||||||
class CalendarTools(entry: CalendarEntry) : ViewCollection<View>() {
|
class CalendarTools(entry: CalendarEntry) : ViewCollection<View>() {
|
||||||
|
|
||||||
fun setName(room: Room, time: Int) {
|
fun setName(room: Room, time: Int) {
|
||||||
nameView.text = room.name + " - " + Schedule.timeOfDayToString(time)
|
nameView.text = room.name + " - " + Schedule.timeToString(time)
|
||||||
}
|
}
|
||||||
|
|
||||||
lateinit var schedule: Schedule
|
lateinit var schedule: Schedule
|
||||||
|
|
|
@ -70,9 +70,9 @@ fun async(timeout: Int = 1, block: () -> Unit): Int {
|
||||||
return window.setTimeout(block, timeout)
|
return window.setTimeout(block, timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun interval(delay: Int, block: () -> Unit): Int {
|
fun interval(timeout: Int, block: () -> Unit): Int {
|
||||||
if (delay < 1) throw IllegalArgumentException("Delay must be greater than 0!")
|
if (timeout < 1) throw IllegalArgumentException("Timeout must be greater than 0!")
|
||||||
return window.setInterval(block, delay)
|
return window.setInterval(block, timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearTimeout(id: Int) {
|
fun clearTimeout(id: Int) {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
$border-radius: 0.2rem;
|
|
||||||
$transitionTime: 150ms;
|
|
||||||
|
|
||||||
@mixin no-select() {
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.board-header {
|
|
||||||
line-height: 6rem;
|
|
||||||
display: flex;
|
|
||||||
padding: 0 2rem;
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
flex-grow: 1;
|
|
||||||
font-family: "Bungee", sans-serif;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
&:last-child {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.board {
|
|
||||||
padding: 1rem 1rem 2rem;
|
|
||||||
display: flex;
|
|
||||||
overflow: hidden;
|
|
||||||
height: calc(100vh - 6rem);
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
flex-grow: 1;
|
|
||||||
flex-basis: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.board-schedule {
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
padding: 1rem 1rem;
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
|
||||||
border-bottom: solid 1px var(--table-border-color)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.board-schedule-room {
|
|
||||||
display: block;
|
|
||||||
padding-left: 1rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.board-schedule-time {
|
|
||||||
position: absolute;
|
|
||||||
top: 1rem;
|
|
||||||
right: 1rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.board-schedule-color {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
position: absolute;
|
|
||||||
top: 3.25rem;
|
|
||||||
left: 1rem;
|
|
||||||
width: 0.5rem;
|
|
||||||
height: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.board-schedule-name {
|
|
||||||
display: block;
|
|
||||||
padding-left: 1rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
|
@ -1,590 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.header {
|
|
||||||
height: 2.2rem;
|
|
||||||
line-height: 2.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-left {
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
& > * {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
i {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child i::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 100%;
|
|
||||||
height: 100%;
|
|
||||||
width: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child i::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
height: 100%;
|
|
||||||
left: -4rem;
|
|
||||||
width: 4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-right {
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar {
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-table {
|
|
||||||
width: 100%;
|
|
||||||
overflow-x: scroll;
|
|
||||||
overflow-y: visible;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
position: relative;
|
|
||||||
transition: width $transitionTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-edit {
|
|
||||||
width: 0;
|
|
||||||
height: 100%;
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
transition: width $transitionTime;
|
|
||||||
|
|
||||||
.calendar-edit-main {
|
|
||||||
position: sticky;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity $transitionTime, visibility $transitionTime;
|
|
||||||
top: 1rem;
|
|
||||||
visibility: hidden;
|
|
||||||
height: 100vh;
|
|
||||||
z-index: 2;
|
|
||||||
background-color: var(--background-secondary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-edit-search {
|
|
||||||
padding: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-edit-list {
|
|
||||||
height: calc(100% - 4.5rem);
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-work-group {
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
border-radius: $border-radius;
|
|
||||||
line-height: 2rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
margin: 0.5rem;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: attr(data-language);
|
|
||||||
bottom: 0;
|
|
||||||
right: 1rem;
|
|
||||||
opacity: 0.6;
|
|
||||||
position: absolute;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .calendar-tools {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.drag {
|
|
||||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.calendar-tools {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.pending::before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include no-select()
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar[data-editable = "true"].edit {
|
|
||||||
.calendar-table {
|
|
||||||
width: calc(100% - 16rem);
|
|
||||||
border-right: solid 1px var(--table-border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-edit {
|
|
||||||
width: 16rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-edit-main {
|
|
||||||
opacity: 1;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-tools {
|
|
||||||
position: absolute;
|
|
||||||
top: -5rem;
|
|
||||||
right: 0;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
border-radius: $border-radius;
|
|
||||||
display: none;
|
|
||||||
z-index: 10;
|
|
||||||
width: max-content;
|
|
||||||
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
|
||||||
|
|
||||||
div {
|
|
||||||
clear: left;
|
|
||||||
|
|
||||||
span {
|
|
||||||
float: left;
|
|
||||||
display: block;
|
|
||||||
width: 2rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
height: 2rem;
|
|
||||||
text-align: center;
|
|
||||||
color: var(--icon-color-focused);
|
|
||||||
transition: color $transitionTime, background-color $transitionTime;
|
|
||||||
box-sizing: content-box;
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: var(--table-header-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.disabled {
|
|
||||||
color: var(--icon-color-inactive);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-left: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
padding-right: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
span:first-child {
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
width: 6rem;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
padding-top: 0.2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
span {
|
|
||||||
padding-bottom: 0.2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: -1rem;
|
|
||||||
height: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-entry {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
border-radius: $border-radius;
|
|
||||||
z-index: 1;
|
|
||||||
line-height: 2rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: attr(data-language);
|
|
||||||
bottom: 0;
|
|
||||||
right: 1rem;
|
|
||||||
opacity: 0.6;
|
|
||||||
position: absolute;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .calendar-tools {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.drag {
|
|
||||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.calendar-tools {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.pending::before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.error {
|
|
||||||
outline: solid 0.4rem var(--error-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@include no-select()
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-table-box {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
flex-direction: column;
|
|
||||||
width: max-content;
|
|
||||||
height: max-content;
|
|
||||||
|
|
||||||
.calendar-header, .calendar-row {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
flex-direction: row;
|
|
||||||
width: max-content;
|
|
||||||
height: max-content;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-row {
|
|
||||||
.calendar-cell:not(:first-child) {
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.room-to-time {
|
|
||||||
.calendar-header {
|
|
||||||
line-height: 2rem;
|
|
||||||
height: 2rem;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.calendar-cell:first-child {
|
|
||||||
flex-grow: 1;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-cell:not(:first-child) {
|
|
||||||
width: 12rem;
|
|
||||||
position: relative;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
height: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
border-left: solid 1px var(--table-border-color);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-row {
|
|
||||||
line-height: 2rem;
|
|
||||||
height: 1.3rem;
|
|
||||||
|
|
||||||
.calendar-cell {
|
|
||||||
position: relative;
|
|
||||||
width: 12rem;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
border-left: solid 1px var(--table-border-color);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-entry {
|
|
||||||
top: 0.1rem;
|
|
||||||
bottom: 0;
|
|
||||||
width: auto !important;
|
|
||||||
left: 0.1rem !important;
|
|
||||||
right: 0.1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-cell:first-child {
|
|
||||||
width: 6rem;
|
|
||||||
left: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-cell:first-child::before {
|
|
||||||
border-left: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:nth-child(4n + 2) .calendar-cell::before {
|
|
||||||
border-top: solid 1px var(--table-border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.calendar-now::before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 6rem;
|
|
||||||
right: 0;
|
|
||||||
height: 1px;
|
|
||||||
border-bottom: solid 1px $primary-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.calendar-now::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 6rem;
|
|
||||||
transform: scale(1, 0.5) rotate(-45deg);
|
|
||||||
transform-origin: bottom;
|
|
||||||
border-bottom: solid 0.4rem $primary-color;
|
|
||||||
border-right: solid 0.4rem $primary-color;
|
|
||||||
border-top: solid 0.4rem transparent;
|
|
||||||
border-left: solid 0.4rem transparent;
|
|
||||||
margin-top: -0.55rem;
|
|
||||||
margin-left: -0.3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@for $i from 0 through 14 {
|
|
||||||
&.calendar-now-#{$i}::after, &.calendar-now-#{$i}::before {
|
|
||||||
top: ($i / 16) * 100%
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.time-to-room {
|
|
||||||
flex-direction: row;
|
|
||||||
|
|
||||||
.calendar-header, .calendar-row {
|
|
||||||
flex-direction: column;
|
|
||||||
line-height: 3rem;
|
|
||||||
|
|
||||||
.calendar-cell {
|
|
||||||
height: 3rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-header {
|
|
||||||
.calendar-cell {
|
|
||||||
position: relative;
|
|
||||||
width: 6rem;
|
|
||||||
|
|
||||||
&:not(:first-child) {
|
|
||||||
border-top: solid 1px var(--table-border-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-row {
|
|
||||||
.calendar-cell {
|
|
||||||
position: relative;
|
|
||||||
width: 1.5rem;
|
|
||||||
|
|
||||||
&:not(:first-child) {
|
|
||||||
border-top: solid 1px var(--table-border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-entry {
|
|
||||||
top: 0.5rem !important;
|
|
||||||
bottom: 0.5rem;
|
|
||||||
width: 0;
|
|
||||||
left: 0;
|
|
||||||
height: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
position: relative;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:nth-child(2n + 2) .calendar-cell::before {
|
|
||||||
content: '';
|
|
||||||
height: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
border-left: solid 1px var(--table-border-color);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.calendar-now::before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 3rem;
|
|
||||||
bottom: 0;
|
|
||||||
width: 1px;
|
|
||||||
border-right: solid 1px $primary-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.calendar-now::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 3rem;
|
|
||||||
transform: scale(0.5, 1) rotate(45deg);
|
|
||||||
transform-origin: right;
|
|
||||||
border-bottom: solid 0.4rem $primary-color;
|
|
||||||
border-right: solid 0.4rem $primary-color;
|
|
||||||
border-top: solid 0.4rem transparent;
|
|
||||||
border-left: solid 0.4rem transparent;
|
|
||||||
margin-top: -0.3rem;
|
|
||||||
margin-left: -0.55rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@for $i from 0 through 14 {
|
|
||||||
&.calendar-now-#{$i}::after, &.calendar-now-#{$i}::before {
|
|
||||||
left: ($i / 16) * 100%
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-picker {
|
|
||||||
.color-picker-entry {
|
|
||||||
position: relative;
|
|
||||||
width: 4rem;
|
|
||||||
height: 4rem;
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
input {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
position: absolute;
|
|
||||||
top: 0.5rem;
|
|
||||||
left: 0.5rem;
|
|
||||||
width: 3rem;
|
|
||||||
height: 3rem;
|
|
||||||
border-radius: 1.5rem;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:checked ~ label::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
background-color: transparent;
|
|
||||||
top: 1rem;
|
|
||||||
left: 0.8rem;
|
|
||||||
width: 1.1rem;
|
|
||||||
height: 0.5rem;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
border-left: solid 0.3rem var(--background-primary-color);
|
|
||||||
border-bottom: solid 0.3rem var(--background-primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-picker-custom {
|
|
||||||
position: relative;
|
|
||||||
clear: both;
|
|
||||||
height: 4rem;
|
|
||||||
|
|
||||||
& > input {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
position: absolute;
|
|
||||||
top: 0.5rem;
|
|
||||||
left: 0.5rem;
|
|
||||||
width: 3rem;
|
|
||||||
height: 3rem;
|
|
||||||
border-radius: 1.5rem;
|
|
||||||
z-index: 1;
|
|
||||||
border: solid 0.1rem var(--text-primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
input:checked ~ label::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
background-color: transparent;
|
|
||||||
top: 1rem;
|
|
||||||
left: 0.8rem;
|
|
||||||
width: 1.1rem;
|
|
||||||
height: 0.5rem;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
border-left: solid 0.3rem var(--text-primary-color);
|
|
||||||
border-bottom: solid 0.3rem var(--text-primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
label input {
|
|
||||||
position: absolute;
|
|
||||||
left: 4rem;
|
|
||||||
top: 0.2rem;
|
|
||||||
height: 2rem;
|
|
||||||
width: 4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,193 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.form-control {
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
outline: none;
|
|
||||||
padding: 0 1rem;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
height: 2.5rem;
|
|
||||||
width: 100%;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
border-radius: $border-radius;
|
|
||||||
margin: 1px;
|
|
||||||
transition: border-color $transitionTime;
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
border-width: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea.form-control {
|
|
||||||
height: 16rem;
|
|
||||||
line-height: 1.1rem;
|
|
||||||
padding: 0.6rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
select:-moz-focusring {
|
|
||||||
color: transparent;
|
|
||||||
text-shadow: 0 0 0 var(--text-primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
clear: both;
|
|
||||||
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
padding-bottom: 0.3rem;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-switch {
|
|
||||||
line-height: 24px;
|
|
||||||
|
|
||||||
input {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
padding: 0 0 0 44px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
left: 0;
|
|
||||||
width: 36px;
|
|
||||||
height: 14px;
|
|
||||||
background-color: var(--bg-disabled-color);
|
|
||||||
border-radius: 14px;
|
|
||||||
z-index: 1;
|
|
||||||
transition: background-color 0.28s cubic-bezier(.4, 0, .2, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 2px;
|
|
||||||
left: 0;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
background-color: var(--lever-disabled-color);
|
|
||||||
border-radius: 14px;
|
|
||||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
|
||||||
z-index: 2;
|
|
||||||
transition: all 0.28s cubic-bezier(.4, 0, .2, 1);
|
|
||||||
transition-property: left, background-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include no-select
|
|
||||||
}
|
|
||||||
|
|
||||||
input:checked + label {
|
|
||||||
&:before {
|
|
||||||
background-color: var(--bg-enabled-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
left: 16px;
|
|
||||||
background-color: var(--lever-enabled-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-switch-group {
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-btn {
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
outline: none;
|
|
||||||
padding: 0 1rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
color: var(--primary-color);
|
|
||||||
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 0.6rem;
|
|
||||||
|
|
||||||
border-radius: $border-radius;
|
|
||||||
font-weight: 600;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
|
|
||||||
transition: border-color $transitionTime, outline-color $transitionTime;
|
|
||||||
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:focus, &:hover {
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
outline-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-danger {
|
|
||||||
background-color: var(--error-color);
|
|
||||||
color: var(--error-text-color);
|
|
||||||
border-color: var(--error-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
button::-moz-focus-inner, input::-moz-focus-inner, select::-moz-focus-inner {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
form {
|
|
||||||
width: 24rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-group {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.form-btn {
|
|
||||||
height: 2.5rem;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
& > * {
|
|
||||||
margin-right: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
flex-shrink: 1;
|
|
||||||
|
|
||||||
&:not(:first-child) {
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
margin-left: -1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,135 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.menu {
|
|
||||||
background-color: var(--background-secondary-color);
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
width: 100%;
|
|
||||||
clear: both;
|
|
||||||
height: 6rem;
|
|
||||||
line-height: 6rem;
|
|
||||||
|
|
||||||
a {
|
|
||||||
padding: 0 1rem;
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
height: 100%;
|
|
||||||
display: inline-block;
|
|
||||||
font-family: "Bungee", sans-serif;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
position: relative;
|
|
||||||
text-transform: uppercase;
|
|
||||||
white-space: nowrap;
|
|
||||||
z-index: 6;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 1rem;
|
|
||||||
right: 1rem;
|
|
||||||
bottom: 1.8em;
|
|
||||||
height: 0.25rem;
|
|
||||||
|
|
||||||
background: transparent;
|
|
||||||
transition: background-color $transitionTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active::after {
|
|
||||||
background: var(--text-primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--table-border-color);
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
background: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& ~ * {
|
|
||||||
content: '';
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-left {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-right {
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
.menu-icon {
|
|
||||||
display: block;
|
|
||||||
cursor: default;
|
|
||||||
|
|
||||||
padding: 0 1rem;
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
height: 100%;
|
|
||||||
font-size: 2rem;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-content {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
background-color: var(--background-secondary-color);
|
|
||||||
z-index: 5;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
top: -8rem;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 8rem;
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
display: block;
|
|
||||||
line-height: 3rem;
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
bottom: 0.55rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.menu-content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
|
||||||
.menu-right {
|
|
||||||
.menu-icon {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-content {
|
|
||||||
display: block;
|
|
||||||
position: static;
|
|
||||||
background-color: transparent;
|
|
||||||
z-index: unset;
|
|
||||||
|
|
||||||
a {
|
|
||||||
display: inline-block;
|
|
||||||
line-height: unset;
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
bottom: 1.8em
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,223 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-main {
|
|
||||||
flex-grow: 4;
|
|
||||||
margin-right: 1rem;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-side {
|
|
||||||
min-width: 20%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-twitter {
|
|
||||||
height: 20rem;
|
|
||||||
background-color: #b3e6f9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post {
|
|
||||||
position: relative;
|
|
||||||
padding-top: 2rem;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-name {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
color: var(--primary-color);
|
|
||||||
line-height: 2rem;
|
|
||||||
padding: 0 1rem;
|
|
||||||
|
|
||||||
&:empty::before {
|
|
||||||
display: block;
|
|
||||||
content: 'No title';
|
|
||||||
opacity: 0.5;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
color: var(--text-primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-edit {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 1rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-column {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-column-left, .post-column-right {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-image {
|
|
||||||
width: 100%;
|
|
||||||
margin: 1rem 0 0;
|
|
||||||
padding-top: 75%;
|
|
||||||
background-position: center;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-no-image .post-column-left {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-content {
|
|
||||||
padding: 0 1rem;
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6, p {
|
|
||||||
margin: 0.7rem 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h5 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h6 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
border-top: solid 1px var(--table-border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
td, th {
|
|
||||||
padding: 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-footer {
|
|
||||||
color: var(--text-secondary-color);
|
|
||||||
padding: 0 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 400;
|
|
||||||
margin-top: -0.3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-edit-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-edit-right {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-edit-image-box {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
margin-top: 0.4rem;
|
|
||||||
|
|
||||||
& > div:nth-child(1) {
|
|
||||||
width: 20%;
|
|
||||||
}
|
|
||||||
|
|
||||||
& > div:nth-child(2) {
|
|
||||||
width: 80%;
|
|
||||||
padding-left: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-edit-image {
|
|
||||||
width: 100%;
|
|
||||||
padding-top: 75%;
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
margin: 0;
|
|
||||||
background-color: var(--background-primary-color);
|
|
||||||
background-position: center;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-post {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
bottom: -1rem;
|
|
||||||
height: 1px;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background: var(--table-border-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.post-column {
|
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-post::after {
|
|
||||||
left: 1rem;
|
|
||||||
right: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-content, .post-footer {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-post {
|
|
||||||
.post-column {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-column-left {
|
|
||||||
width: 30%;
|
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-column-right {
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
|
||||||
.post-edit-container {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
.post-edit-right {
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
|
||||||
.overview {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,149 +0,0 @@
|
||||||
@import "../config";
|
|
||||||
|
|
||||||
.table-layout-search {
|
|
||||||
float: left;
|
|
||||||
padding-bottom: 0.5rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-layout-action {
|
|
||||||
float: right;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-layout-table {
|
|
||||||
width: 100%;
|
|
||||||
border-spacing: 0;
|
|
||||||
border-collapse: collapse;
|
|
||||||
clear: both;
|
|
||||||
|
|
||||||
th {
|
|
||||||
text-align: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
th, td {
|
|
||||||
padding: 0 0.6rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr {
|
|
||||||
border-top: solid 1px var(--table-border-color);
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
height: 2.5rem;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(:first-child) {
|
|
||||||
height: 2rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:empty:before {
|
|
||||||
content: "\200b";
|
|
||||||
}
|
|
||||||
|
|
||||||
&.error {
|
|
||||||
background-color: var(--error-background-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-select-box {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
background: var(--background-primary-color);
|
|
||||||
width: 10rem;
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
border-radius: $border-radius;
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
|
|
||||||
span {
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-group-constraints {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
& > label {
|
|
||||||
margin-bottom: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-group {
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
|
|
||||||
span {
|
|
||||||
width: 4rem;
|
|
||||||
position: relative;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&:hover::after {
|
|
||||||
content: 'DELETE';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
background: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-control {
|
|
||||||
width: 12rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-group-constraints-add {
|
|
||||||
position: absolute;
|
|
||||||
top: -0.5rem;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-group-constraints-add-list {
|
|
||||||
position: absolute;
|
|
||||||
top: -2rem;
|
|
||||||
right: 0;
|
|
||||||
z-index: 1;
|
|
||||||
display: none;
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
|
|
||||||
background: var(--background-primary-color);
|
|
||||||
border: solid 1px var(--input-border-color);
|
|
||||||
border-radius: $border-radius;
|
|
||||||
|
|
||||||
span {
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--table-header-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
@import "_color.scss";
|
|
||||||
|
|
||||||
$background-primary-color: #ffc3e1;
|
|
||||||
$background-secondary-color: #ffa5d2;
|
|
||||||
|
|
||||||
$text-primary-color: #333;
|
|
||||||
$text-secondary-color: rgba($text-primary-color, 0.5);
|
|
||||||
|
|
||||||
$primary-color: #B11D33;
|
|
||||||
$primary-text-color: #fff;
|
|
||||||
|
|
||||||
$error-color: #F00;
|
|
||||||
$error-text-color: #fff;
|
|
||||||
$error-background-color: rgba($error-color, 0.5);
|
|
||||||
|
|
||||||
$input-border-color: #888;
|
|
||||||
$table-border-color: rgba($text-primary-color, 0.1);
|
|
||||||
$table-header-color: rgba($text-primary-color, 0.06);
|
|
||||||
|
|
||||||
$shadow-color: rgba($text-primary-color, 0.8);
|
|
||||||
|
|
||||||
$icon-color-focused: rgba($text-primary-color, 0.87);
|
|
||||||
$icon-color: rgba($text-primary-color, 0.54);
|
|
||||||
$icon-color-inactive: rgba($text-primary-color, 0.38);
|
|
||||||
|
|
||||||
$bg-disabled-color: rgba($text-primary-color, .26);
|
|
||||||
$bg-enabled-color: rgba($primary-color, .5);
|
|
||||||
$lever-disabled-color: $background-primary-color;
|
|
||||||
$lever-enabled-color: $primary-color;
|
|
||||||
|
|
||||||
@include color-setting;
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,17 +5,13 @@ import de.kif.backend.route.*
|
||||||
import de.kif.backend.route.api.*
|
import de.kif.backend.route.api.*
|
||||||
import de.kif.backend.util.pushService
|
import de.kif.backend.util.pushService
|
||||||
import io.ktor.application.Application
|
import io.ktor.application.Application
|
||||||
import io.ktor.application.call
|
|
||||||
import io.ktor.application.install
|
import io.ktor.application.install
|
||||||
import io.ktor.features.*
|
import io.ktor.features.*
|
||||||
import io.ktor.http.HttpStatusCode
|
|
||||||
import io.ktor.http.content.files
|
import io.ktor.http.content.files
|
||||||
import io.ktor.http.content.static
|
import io.ktor.http.content.static
|
||||||
import io.ktor.jackson.jackson
|
import io.ktor.jackson.jackson
|
||||||
import io.ktor.response.respond
|
|
||||||
import io.ktor.routing.routing
|
import io.ktor.routing.routing
|
||||||
import io.ktor.websocket.WebSockets
|
import io.ktor.websocket.WebSockets
|
||||||
import java.nio.file.Paths
|
|
||||||
|
|
||||||
fun Application.main() {
|
fun Application.main() {
|
||||||
install(DefaultHeaders)
|
install(DefaultHeaders)
|
||||||
|
@ -25,14 +21,6 @@ fun Application.main() {
|
||||||
install(DataConversion)
|
install(DataConversion)
|
||||||
install(WebSockets)
|
install(WebSockets)
|
||||||
|
|
||||||
install(StatusPages) {
|
|
||||||
exception<Throwable> {
|
|
||||||
it.printStackTrace()
|
|
||||||
call.respond(HttpStatusCode.InternalServerError)
|
|
||||||
}
|
|
||||||
statusFile(HttpStatusCode.NotFound, HttpStatusCode.InternalServerError, filePattern = "error#.html")
|
|
||||||
}
|
|
||||||
|
|
||||||
install(ContentNegotiation) {
|
install(ContentNegotiation) {
|
||||||
jackson {
|
jackson {
|
||||||
enable(SerializationFeature.INDENT_OUTPUT)
|
enable(SerializationFeature.INDENT_OUTPUT)
|
||||||
|
@ -50,21 +38,12 @@ fun Application.main() {
|
||||||
files(Configuration.Path.uploadsPath.toFile())
|
files(Configuration.Path.uploadsPath.toFile())
|
||||||
}
|
}
|
||||||
|
|
||||||
val srcFile = Paths.get("src")?.toFile()
|
|
||||||
if (srcFile != null && srcFile.exists() && srcFile.isDirectory) {
|
|
||||||
static("/src") {
|
|
||||||
files("src")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// UI routes
|
// UI routes
|
||||||
overview()
|
overview()
|
||||||
calendar()
|
calendar()
|
||||||
login()
|
login()
|
||||||
account()
|
account()
|
||||||
|
|
||||||
board()
|
|
||||||
|
|
||||||
workGroup()
|
workGroup()
|
||||||
track()
|
track()
|
||||||
room()
|
room()
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.uchuhimo.konf.Config
|
||||||
import com.uchuhimo.konf.ConfigSpec
|
import com.uchuhimo.konf.ConfigSpec
|
||||||
import com.uchuhimo.konf.Item
|
import com.uchuhimo.konf.Item
|
||||||
import java.io.FileNotFoundException
|
import java.io.FileNotFoundException
|
||||||
import java.nio.file.Files
|
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.time.ZoneId
|
import java.time.ZoneId
|
||||||
|
@ -90,16 +89,6 @@ object Configuration {
|
||||||
val wikiUrl by c(GeneralSpec.wikiUrl)
|
val wikiUrl by c(GeneralSpec.wikiUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
private object TwitterSpec : ConfigSpec("twitter") {
|
|
||||||
val username by required<String>("username")
|
|
||||||
val password by required<String>("password")
|
|
||||||
}
|
|
||||||
|
|
||||||
object Twitter {
|
|
||||||
val username by c(TwitterSpec.username)
|
|
||||||
val password by c(TwitterSpec.password)
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
var config = Config {
|
var config = Config {
|
||||||
addSpec(ServerSpec)
|
addSpec(ServerSpec)
|
||||||
|
@ -107,16 +96,11 @@ object Configuration {
|
||||||
addSpec(ScheduleSpec)
|
addSpec(ScheduleSpec)
|
||||||
addSpec(SecuritySpec)
|
addSpec(SecuritySpec)
|
||||||
addSpec(GeneralSpec)
|
addSpec(GeneralSpec)
|
||||||
addSpec(TwitterSpec)
|
|
||||||
}.from.toml.resource("portal.toml")
|
}.from.toml.resource("portal.toml")
|
||||||
|
|
||||||
for (file in Files.list(Paths.get("."))) {
|
try {
|
||||||
if (file.fileName.toString().endsWith(".toml")) {
|
config = config.from.toml.file("portal.toml")
|
||||||
try {
|
} catch (_: FileNotFoundException) {
|
||||||
config = config.from.toml.file(file.toFile())
|
|
||||||
} catch (_: FileNotFoundException) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.config = config.from.env()
|
this.config = config.from.env()
|
||||||
|
|
|
@ -18,8 +18,6 @@ object Main {
|
||||||
|
|
||||||
Connection.init()
|
Connection.init()
|
||||||
|
|
||||||
// twitter()
|
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
if (UserRepository.all().isEmpty()) {
|
if (UserRepository.all().isEmpty()) {
|
||||||
|
|
||||||
|
|
|
@ -1,142 +0,0 @@
|
||||||
package de.kif.backend
|
|
||||||
|
|
||||||
import twitter4j.*
|
|
||||||
import twitter4j.conf.ConfigurationBuilder
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
fun twitter() {
|
|
||||||
val msgQueue = LinkedBlockingQueue<String>(100000)
|
|
||||||
val eventQueue = LinkedBlockingQueue<Event>(1000)
|
|
||||||
|
|
||||||
val hosts = HttpHosts(Constants.STREAM_HOST)
|
|
||||||
|
|
||||||
val filterEndpoint = StatusesFilterEndpoint()
|
|
||||||
filterEndpoint.trackTerms(listOf("kif"))
|
|
||||||
|
|
||||||
println(Configuration.Twitter.username)
|
|
||||||
println(Configuration.Twitter.password)
|
|
||||||
|
|
||||||
val authentication = BasicAuth(
|
|
||||||
Configuration.Twitter.username,
|
|
||||||
Configuration.Twitter.password
|
|
||||||
)
|
|
||||||
|
|
||||||
val builder = ClientBuilder()
|
|
||||||
.name("kif-portal")
|
|
||||||
.hosts(hosts)
|
|
||||||
.authentication(authentication)
|
|
||||||
.endpoint(filterEndpoint)
|
|
||||||
.processor(StringDelimitedProcessor(msgQueue))
|
|
||||||
.eventMessageQueue(eventQueue)
|
|
||||||
|
|
||||||
val client = builder.build()
|
|
||||||
|
|
||||||
val listener = object: StatusStreamHandler {
|
|
||||||
override fun onUnknownMessageType(msg: String?) {
|
|
||||||
println("onUnknownMessageType")
|
|
||||||
println(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDisconnectMessage(message: DisconnectMessage?) {
|
|
||||||
println("onDisconnectMessage")
|
|
||||||
println(message?.disconnectReason)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStallWarningMessage(warning: StallWarningMessage?) {
|
|
||||||
println("onStallWarningMessage")
|
|
||||||
println(warning?.message)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTrackLimitationNotice(numberOfLimitedStatuses: Int) {
|
|
||||||
println("onTrackLimitationNotice")
|
|
||||||
println(numberOfLimitedStatuses)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStallWarning(warning: StallWarning?) {
|
|
||||||
println("onStallWarning")
|
|
||||||
println(warning?.message)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onException(ex: Exception?) {
|
|
||||||
println("onException")
|
|
||||||
ex?.printStackTrace()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDeletionNotice(statusDeletionNotice: StatusDeletionNotice?) {
|
|
||||||
println("onDeletionNotice")
|
|
||||||
println(statusDeletionNotice?.statusId)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStatus(status: Status?) {
|
|
||||||
println("onStatus")
|
|
||||||
println(status?.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onScrubGeo(userId: Long, upToStatusId: Long) {
|
|
||||||
println("onScrubGeo")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
val t4jClient = Twitter4jStatusClient(
|
|
||||||
client,
|
|
||||||
msgQueue,
|
|
||||||
listOf(listener),
|
|
||||||
Executors.newFixedThreadPool(4)
|
|
||||||
)
|
|
||||||
|
|
||||||
t4jClient.connect()
|
|
||||||
|
|
||||||
t4jClient.process()
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
fun twitter() {
|
|
||||||
val cb = ConfigurationBuilder()
|
|
||||||
cb.setDebugEnabled(true)
|
|
||||||
.setUser(Configuration.Twitter.username)
|
|
||||||
.setPassword(Configuration.Twitter.password)
|
|
||||||
|
|
||||||
val listener = object : StatusListener {
|
|
||||||
|
|
||||||
override fun onTrackLimitationNotice(numberOfLimitedStatuses: Int) {
|
|
||||||
println("onTrackLimitationNotice")
|
|
||||||
println(numberOfLimitedStatuses)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStallWarning(warning: StallWarning?) {
|
|
||||||
println("onStallWarning")
|
|
||||||
println(warning?.message)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onException(ex: Exception?) {
|
|
||||||
println("onException")
|
|
||||||
ex?.printStackTrace()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDeletionNotice(statusDeletionNotice: StatusDeletionNotice?) {
|
|
||||||
println("onDeletionNotice")
|
|
||||||
println(statusDeletionNotice?.statusId)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStatus(status: Status?) {
|
|
||||||
println("onStatus")
|
|
||||||
println(status?.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onScrubGeo(userId: Long, upToStatusId: Long) {
|
|
||||||
println("onScrubGeo")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val twitterStream = TwitterStreamFactory(cb.build()).instance
|
|
||||||
|
|
||||||
addTwitterStreamListener(twitterStream, listener)
|
|
||||||
|
|
||||||
twitterStream.sample()
|
|
||||||
}
|
|
|
@ -1,82 +0,0 @@
|
||||||
package de.kif.backend.route
|
|
||||||
|
|
||||||
import de.kif.backend.Configuration
|
|
||||||
import de.kif.backend.repository.PostRepository
|
|
||||||
import de.kif.backend.repository.ScheduleRepository
|
|
||||||
import de.kif.backend.view.respondMain
|
|
||||||
import de.kif.common.formatDateTime
|
|
||||||
import de.kif.common.model.Schedule
|
|
||||||
import io.ktor.routing.Route
|
|
||||||
import io.ktor.routing.get
|
|
||||||
import kotlinx.css.CSSBuilder
|
|
||||||
import kotlinx.css.Color
|
|
||||||
import kotlinx.html.div
|
|
||||||
import kotlinx.html.span
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
fun Route.board() {
|
|
||||||
get("/board") {
|
|
||||||
val postList = PostRepository.all().asReversed()
|
|
||||||
val scheduleList = ScheduleRepository.all().map {
|
|
||||||
it to it.getAbsoluteStartTime() * 60
|
|
||||||
}.sortedBy { it.second }
|
|
||||||
|
|
||||||
val referenceTime = Configuration.Schedule.referenceDate.time / 1000
|
|
||||||
val now = referenceTime - (Date().time / 1000)
|
|
||||||
|
|
||||||
respondMain(true, true) {
|
|
||||||
content {
|
|
||||||
div("board-header") {
|
|
||||||
div {
|
|
||||||
+"KIF 47.0"
|
|
||||||
}
|
|
||||||
div("board-header-date") {
|
|
||||||
+formatDateTime(Date().time)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div("board") {
|
|
||||||
div("board-schedules") {
|
|
||||||
attributes["data-reference"] = referenceTime.toString()
|
|
||||||
|
|
||||||
for ((schedule, time) in scheduleList) {
|
|
||||||
div("board-schedule") {
|
|
||||||
attributes["data-id"] = schedule.id.toString()
|
|
||||||
|
|
||||||
span("board-schedule-room") {
|
|
||||||
+schedule.room.name
|
|
||||||
}
|
|
||||||
span("board-schedule-time") {
|
|
||||||
attributes["data-time"] = time.toString()
|
|
||||||
attributes["data-duration"] = schedule.workGroup.length.toString()
|
|
||||||
|
|
||||||
+Schedule.timeDifferenceToString(time + now)
|
|
||||||
}
|
|
||||||
span("board-schedule-color") {
|
|
||||||
attributes["style"] = CSSBuilder().apply {
|
|
||||||
val c = schedule.workGroup.track?.color
|
|
||||||
if (c != null) {
|
|
||||||
backgroundColor = Color(c.toString())
|
|
||||||
}
|
|
||||||
}.toString()
|
|
||||||
}
|
|
||||||
span("board-schedule-name") {
|
|
||||||
+schedule.workGroup.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div("board-posts") {
|
|
||||||
for (post in postList) {
|
|
||||||
createPost(post, false, "board-post overview-post")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div("board-twitter") {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -21,7 +21,6 @@ import kotlinx.css.Color
|
||||||
import kotlinx.css.pct
|
import kotlinx.css.pct
|
||||||
import kotlinx.css.rem
|
import kotlinx.css.rem
|
||||||
import kotlinx.html.*
|
import kotlinx.html.*
|
||||||
import java.util.*
|
|
||||||
import kotlin.collections.component1
|
import kotlin.collections.component1
|
||||||
import kotlin.collections.component2
|
import kotlin.collections.component2
|
||||||
import kotlin.collections.set
|
import kotlin.collections.set
|
||||||
|
@ -68,9 +67,6 @@ private fun DIV.renderCalendar(
|
||||||
val gridLabelWidth = 60
|
val gridLabelWidth = 60
|
||||||
val minutesOfDay = to - from
|
val minutesOfDay = to - from
|
||||||
|
|
||||||
val now = Calendar.getInstance()
|
|
||||||
val currentTime = now.get(Calendar.HOUR_OF_DAY) * 60 + now.get(Calendar.MINUTE)
|
|
||||||
|
|
||||||
div("calendar-table-box ${orientation.name.toLowerCase().replace("_", "-")}") {
|
div("calendar-table-box ${orientation.name.toLowerCase().replace("_", "-")}") {
|
||||||
div("calendar-header") {
|
div("calendar-header") {
|
||||||
div("calendar-cell") {
|
div("calendar-cell") {
|
||||||
|
@ -99,14 +95,7 @@ private fun DIV.renderCalendar(
|
||||||
val start = i * CALENDAR_GRID_WIDTH + from
|
val start = i * CALENDAR_GRID_WIDTH + from
|
||||||
val end = (i + 1) * CALENDAR_GRID_WIDTH + from - 1
|
val end = (i + 1) * CALENDAR_GRID_WIDTH + from - 1
|
||||||
|
|
||||||
var rowClass = "calendar-row"
|
div("calendar-row") {
|
||||||
|
|
||||||
if (currentTime in start..end) {
|
|
||||||
rowClass += " calendar-now calendar-now-${currentTime - start}"
|
|
||||||
}
|
|
||||||
|
|
||||||
div(rowClass) {
|
|
||||||
|
|
||||||
div("calendar-cell") {
|
div("calendar-cell") {
|
||||||
if (time % gridLabelWidth == 0) {
|
if (time % gridLabelWidth == 0) {
|
||||||
span {
|
span {
|
||||||
|
|
|
@ -9,11 +9,7 @@ import io.ktor.response.respondRedirect
|
||||||
import io.ktor.util.pipeline.PipelineContext
|
import io.ktor.util.pipeline.PipelineContext
|
||||||
import kotlinx.html.*
|
import kotlinx.html.*
|
||||||
|
|
||||||
class MainTemplate(
|
class MainTemplate(private val theme: Theme) : Template<HTML> {
|
||||||
private val theme: Theme,
|
|
||||||
private val noMenu: Boolean,
|
|
||||||
private val stretch: Boolean
|
|
||||||
) : Template<HTML> {
|
|
||||||
val content = Placeholder<HtmlBlockTag>()
|
val content = Placeholder<HtmlBlockTag>()
|
||||||
val menuTemplate = TemplatePlaceholder<MenuTemplate>()
|
val menuTemplate = TemplatePlaceholder<MenuTemplate>()
|
||||||
|
|
||||||
|
@ -40,9 +36,6 @@ class MainTemplate(
|
||||||
Theme.DARK -> {
|
Theme.DARK -> {
|
||||||
link(href = "/static/style/dark.css", type = LinkType.textCss, rel = LinkRel.stylesheet)
|
link(href = "/static/style/dark.css", type = LinkType.textCss, rel = LinkRel.stylesheet)
|
||||||
}
|
}
|
||||||
Theme.PRINCESS -> {
|
|
||||||
link(href = "/static/style/princess.css", type = LinkType.textCss, rel = LinkRel.stylesheet)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
script(src = "/static/require.min.js") {}
|
script(src = "/static/require.min.js") {}
|
||||||
|
@ -55,29 +48,23 @@ class MainTemplate(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
if (!noMenu) {
|
insert(MenuTemplate(), menuTemplate)
|
||||||
insert(MenuTemplate(), menuTemplate)
|
div("container") {
|
||||||
}
|
|
||||||
|
|
||||||
val containerClasses = if (stretch) "container-full" else "container"
|
|
||||||
div(containerClasses) {
|
|
||||||
div("main") {
|
div("main") {
|
||||||
insert(content)
|
insert(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noMenu) {
|
div("footer") {
|
||||||
div("footer") {
|
div("container") {
|
||||||
div("container") {
|
div("footer-credit") {
|
||||||
div("footer-credit") {
|
}
|
||||||
}
|
div("footer-theme") {
|
||||||
div("footer-theme") {
|
for (it in Theme.values()) {
|
||||||
for (it in Theme.values()) {
|
val name = it.name.toLowerCase()
|
||||||
val name = it.name.toLowerCase()
|
a("?theme=${it.name}", classes = if (theme == it) "selected" else "") {
|
||||||
a("?theme=${it.name}", classes = if (theme == it) "selected" else "") {
|
id = "theme-$name"
|
||||||
id = "theme-$name"
|
+name.capitalize()
|
||||||
+name.capitalize()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,18 +75,14 @@ class MainTemplate(
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Theme {
|
enum class Theme {
|
||||||
LIGHT, DARK, PRINCESS
|
LIGHT, DARK
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String?.toTheme() = this?.let { str ->
|
private fun String?.toTheme() = this?.let { str ->
|
||||||
Theme.values().find { str == it.name }
|
Theme.values().find { str == it.name }
|
||||||
} ?: Theme.LIGHT
|
} ?: Theme.LIGHT
|
||||||
|
|
||||||
suspend fun PipelineContext<Unit, ApplicationCall>.respondMain(
|
suspend fun PipelineContext<Unit, ApplicationCall>.respondMain(body: MainTemplate.() -> Unit) {
|
||||||
noMenu: Boolean = false,
|
|
||||||
stretch: Boolean = false,
|
|
||||||
body: MainTemplate.() -> Unit
|
|
||||||
) {
|
|
||||||
val param = call.request.queryParameters["theme"]
|
val param = call.request.queryParameters["theme"]
|
||||||
|
|
||||||
if (param != null) {
|
if (param != null) {
|
||||||
|
@ -113,9 +96,7 @@ suspend fun PipelineContext<Unit, ApplicationCall>.respondMain(
|
||||||
} else {
|
} else {
|
||||||
call.respondHtmlTemplate(
|
call.respondHtmlTemplate(
|
||||||
MainTemplate(
|
MainTemplate(
|
||||||
call.request.cookies["theme"].toTheme(),
|
call.request.cookies["theme"].toTheme()
|
||||||
noMenu,
|
|
||||||
stretch
|
|
||||||
),
|
),
|
||||||
body = body
|
body = body
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
package twitter4j
|
|
||||||
|
|
||||||
fun addTwitterStreamListener(stream: TwitterStream, listener: StatusListener) {
|
|
||||||
stream.addListener(listener)
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>KIF Portal</title>
|
|
||||||
<link href="/static/external/material-icons.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/external/font/Montserrat.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Bungee|Oswald" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/style/style.css" rel="Stylesheet" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<div class="main">
|
|
||||||
<div class="main-error">
|
|
||||||
<span>Their was an error without an error...</span>
|
|
||||||
<span>How did you do that?</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,22 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>KIF Portal</title>
|
|
||||||
<link href="/static/external/material-icons.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/external/font/Montserrat.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Bungee|Oswald" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/style/style.css" rel="Stylesheet" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<div class="main">
|
|
||||||
<div class="main-error">
|
|
||||||
<span>Their was a 404.</span>
|
|
||||||
<span>It seems you lost the game.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,22 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>KIF Portal</title>
|
|
||||||
<link href="/static/external/material-icons.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/external/font/Montserrat.css" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Bungee|Oswald" rel="Stylesheet" type="text/css">
|
|
||||||
<link href="/static/style/style.css" rel="Stylesheet" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<div class="main">
|
|
||||||
<div class="main-error">
|
|
||||||
<span>Their was a 500.</span>
|
|
||||||
<span>It seems we lost the game.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -18,7 +18,3 @@ sign_key = "d1 20 23 8c 01 f8 f0 0d 9d 7c ff 68 21 97 75 31 38 3f fb 91 20 3a 8d
|
||||||
[general]
|
[general]
|
||||||
allowed_upload_extensions = "png, jpg, jpeg"
|
allowed_upload_extensions = "png, jpg, jpeg"
|
||||||
wiki_url = ""
|
wiki_url = ""
|
||||||
|
|
||||||
[twitter]
|
|
||||||
username = ""
|
|
||||||
password = ""
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue