From 56822a36440efed6faac19af8ad05250216a5843 Mon Sep 17 00:00:00 2001 From: darksnake Date: Thu, 26 May 2022 11:55:50 +0300 Subject: [PATCH] Refactor masters --- data/magprog/content/mentors/Dolgonosov.md | 2 +- data/magprog/content/mentors/Gertsenberger.md | 2 +- data/magprog/content/mentors/Grinis.md | 2 +- data/magprog/content/mentors/Kalashev.md | 2 +- data/magprog/content/mentors/Khokhriakov.md | 2 +- data/magprog/content/mentors/Klimai.md | 2 +- data/magprog/content/mentors/Kostunin.md | 2 +- data/magprog/content/mentors/Nozik.md | 2 +- data/magprog/content/mentors/Oliinychenko.md | 2 +- data/magprog/content/mentors/Pantuev.md | 2 +- data/magprog/content/mentors/Pshenichnov.md | 2 +- data/magprog/content/mentors/Shagalov.md | 2 +- data/magprog/content/mentors/Skasyrskaya.md | 2 +- data/magprog/content/mentors/Usmanov.md | 2 +- data/magprog/content/mentors/Zinoviev.md | 2 +- data/magprog/content/mentors/kharuk.md | 2 +- data/magprog/content/mentors/kondratov.md | 4 +- data/magprog/content/mentors/nizovtseva.md | 2 +- data/magprog/content/mentors/svetlichny.md | 2 +- data/magprog/content/mentors/template.md | 2 +- data/magprog/content/team/Aivazov.md | 2 +- data/magprog/content/team/Muhina.md | 2 +- data/magprog/content/team/Nozik.md | 2 +- data/magprog/content/team/Svetlichnii.md | 2 +- .../kotlin/html5up/hyperspace/elements.kt | 659 ++++++++++++++++++ src/main/kotlin/ru/mipt/spc/master.kt | 34 +- 26 files changed, 703 insertions(+), 40 deletions(-) create mode 100644 src/main/kotlin/html5up/hyperspace/elements.kt diff --git a/data/magprog/content/mentors/Dolgonosov.md b/data/magprog/content/mentors/Dolgonosov.md index f0e4c16..175264c 100644 --- a/data/magprog/content/mentors/Dolgonosov.md +++ b/data/magprog/content/mentors/Dolgonosov.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Максим Сергеевич Долгоносов id: Dolgonosov -photo: images/mentors/Dolgonosov.jpg +image: images/mentors/Dolgonosov.jpg language: ru --- diff --git a/data/magprog/content/mentors/Gertsenberger.md b/data/magprog/content/mentors/Gertsenberger.md index 6d29fdf..4e56967 100644 --- a/data/magprog/content/mentors/Gertsenberger.md +++ b/data/magprog/content/mentors/Gertsenberger.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Константин Викторович Герценбергер id: Gertsenberger -photo: images/mentors/Gertsenberger.jpg +image: images/mentors/Gertsenberger.jpg language: ru --- #### Организация diff --git a/data/magprog/content/mentors/Grinis.md b/data/magprog/content/mentors/Grinis.md index c983ea7..919101b 100644 --- a/data/magprog/content/mentors/Grinis.md +++ b/data/magprog/content/mentors/Grinis.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Roland Grinis id: Grinis -photo: images/mentors/Grinis.jpg +image: images/mentors/Grinis.jpg language: ru --- diff --git a/data/magprog/content/mentors/Kalashev.md b/data/magprog/content/mentors/Kalashev.md index b91cc23..d14a2c1 100644 --- a/data/magprog/content/mentors/Kalashev.md +++ b/data/magprog/content/mentors/Kalashev.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Олег Евгеньевич Калашев id: Kalashev -photo: images/mentors/Kalashev.jpg +image: images/mentors/Kalashev.jpg language: ru --- diff --git a/data/magprog/content/mentors/Khokhriakov.md b/data/magprog/content/mentors/Khokhriakov.md index abb72f4..51bdca0 100644 --- a/data/magprog/content/mentors/Khokhriakov.md +++ b/data/magprog/content/mentors/Khokhriakov.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Igor Khokhriakov id: Khokhriakov -photo: images/mentors/Khokhriakov.jpg +image: images/mentors/Khokhriakov.jpg language: ru --- diff --git a/data/magprog/content/mentors/Klimai.md b/data/magprog/content/mentors/Klimai.md index 671aff9..766b314 100644 --- a/data/magprog/content/mentors/Klimai.md +++ b/data/magprog/content/mentors/Klimai.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Петр Климай id: Klimai -photo: images/mentors/Klimai.jpg +image: images/mentors/Klimai.jpg language: ru --- diff --git a/data/magprog/content/mentors/Kostunin.md b/data/magprog/content/mentors/Kostunin.md index 080eb62..1a79e62 100644 --- a/data/magprog/content/mentors/Kostunin.md +++ b/data/magprog/content/mentors/Kostunin.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Dmitriy Kostunin id: Kostunin -photo: images/mentors/Kostunin.jpg +image: images/mentors/Kostunin.jpg language: ru published: false --- diff --git a/data/magprog/content/mentors/Nozik.md b/data/magprog/content/mentors/Nozik.md index 66ffd8a..c7f62ff 100644 --- a/data/magprog/content/mentors/Nozik.md +++ b/data/magprog/content/mentors/Nozik.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Александр Нозик id: Nozik -photo: images/mentors/Nozik.jpg +image: images/mentors/Nozik.jpg language: ru --- diff --git a/data/magprog/content/mentors/Oliinychenko.md b/data/magprog/content/mentors/Oliinychenko.md index e66ecf8..74e8be3 100644 --- a/data/magprog/content/mentors/Oliinychenko.md +++ b/data/magprog/content/mentors/Oliinychenko.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Дмитрий Робертович Олийниченко id: Oliinychenko -photo: images/mentors/Oliinychenko.jpg +image: images/mentors/Oliinychenko.jpg language: ru published: false --- diff --git a/data/magprog/content/mentors/Pantuev.md b/data/magprog/content/mentors/Pantuev.md index 9ae7a0b..331845a 100644 --- a/data/magprog/content/mentors/Pantuev.md +++ b/data/magprog/content/mentors/Pantuev.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Владислав Сергеевич Пантуев id: Pantuev -photo: images/mentors/Pantuev.jpg +image: images/mentors/Pantuev.jpg language: ru --- diff --git a/data/magprog/content/mentors/Pshenichnov.md b/data/magprog/content/mentors/Pshenichnov.md index 526f1e2..8fc82b7 100644 --- a/data/magprog/content/mentors/Pshenichnov.md +++ b/data/magprog/content/mentors/Pshenichnov.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Игорь Анатольевич Пшеничнов id: Pshenichnov -photo: images/mentors/Pshenichnov.jpg +image: images/mentors/Pshenichnov.jpg language: ru --- diff --git a/data/magprog/content/mentors/Shagalov.md b/data/magprog/content/mentors/Shagalov.md index dd1bb56..fd53027 100644 --- a/data/magprog/content/mentors/Shagalov.md +++ b/data/magprog/content/mentors/Shagalov.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Лев Михайлович Шагалов id: Shagalov -photo: images/mentors/Shagalov.jpg +image: images/mentors/Shagalov.jpg language: ru --- diff --git a/data/magprog/content/mentors/Skasyrskaya.md b/data/magprog/content/mentors/Skasyrskaya.md index 6a78856..796c614 100644 --- a/data/magprog/content/mentors/Skasyrskaya.md +++ b/data/magprog/content/mentors/Skasyrskaya.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Айно Константиновна Скасырская id: Skasyrskaya -photo: images/mentors/Skasyrskaya.jpg +image: images/mentors/Skasyrskaya.jpg language: ru --- diff --git a/data/magprog/content/mentors/Usmanov.md b/data/magprog/content/mentors/Usmanov.md index c6b1f9f..ffe5fa2 100644 --- a/data/magprog/content/mentors/Usmanov.md +++ b/data/magprog/content/mentors/Usmanov.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Ильмир Усманов id: Usmanov -photo: images/mentors/Usmanov.jpg +image: images/mentors/Usmanov.jpg language: ru --- diff --git a/data/magprog/content/mentors/Zinoviev.md b/data/magprog/content/mentors/Zinoviev.md index 0ef7ad6..4116357 100644 --- a/data/magprog/content/mentors/Zinoviev.md +++ b/data/magprog/content/mentors/Zinoviev.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Алексей Викторович Зиновьев id: Zinoviev -photo: images/mentors/Zinoviev.jpg +image: images/mentors/Zinoviev.jpg language: ru --- #### Организация diff --git a/data/magprog/content/mentors/kharuk.md b/data/magprog/content/mentors/kharuk.md index 4ea92cf..583e612 100644 --- a/data/magprog/content/mentors/kharuk.md +++ b/data/magprog/content/mentors/kharuk.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Иван Харук id: Kharuk -photo: images/mentors/Kharuk.jpg +image: images/mentors/Kharuk.jpg language: ru --- diff --git a/data/magprog/content/mentors/kondratov.md b/data/magprog/content/mentors/kondratov.md index fe057d0..04d6dd2 100644 --- a/data/magprog/content/mentors/kondratov.md +++ b/data/magprog/content/mentors/kondratov.md @@ -2,7 +2,9 @@ content_type: magprog_mentor name: Виталий Кондратов id: Kondratov -photo: images/mentors/Kondratov.jpg +image: + path: images/mentors/Kondratov.jpg + position: right language: ru --- diff --git a/data/magprog/content/mentors/nizovtseva.md b/data/magprog/content/mentors/nizovtseva.md index 4a1b63c..9120929 100644 --- a/data/magprog/content/mentors/nizovtseva.md +++ b/data/magprog/content/mentors/nizovtseva.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Ирина Геннадьевна Низовцева id: Nizovtseva -photo: images/mentors/Nizovtseva.jpg +image: images/mentors/Nizovtseva.jpg language: ru --- #### Биография diff --git a/data/magprog/content/mentors/svetlichny.md b/data/magprog/content/mentors/svetlichny.md index 4dd4237..039d550 100644 --- a/data/magprog/content/mentors/svetlichny.md +++ b/data/magprog/content/mentors/svetlichny.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Александр Светличный id: Svetlichny -photo: images/mentors/Svetlichny.jpg +image: images/mentors/Svetlichny.jpg language: ru --- #### Организация diff --git a/data/magprog/content/mentors/template.md b/data/magprog/content/mentors/template.md index a9c99fe..af3f79d 100644 --- a/data/magprog/content/mentors/template.md +++ b/data/magprog/content/mentors/template.md @@ -2,7 +2,7 @@ content_type: magprog_mentor name: Полиграф Шариков id: template -photo: images/mentors/Template.jpg +image: images/mentors/Template.jpg published: false language: ru --- diff --git a/data/magprog/content/team/Aivazov.md b/data/magprog/content/team/Aivazov.md index fba4a54..8d8ab0b 100644 --- a/data/magprog/content/team/Aivazov.md +++ b/data/magprog/content/team/Aivazov.md @@ -3,7 +3,7 @@ content_type: magprog_team name: Денис Айвазов id: Aivazov order: 4 -photo: images/team/Aivazov.jpg +image: images/team/Aivazov.jpg language: ru --- Консультант от ФПМИ diff --git a/data/magprog/content/team/Muhina.md b/data/magprog/content/team/Muhina.md index 850458d..b0edb37 100644 --- a/data/magprog/content/team/Muhina.md +++ b/data/magprog/content/team/Muhina.md @@ -3,7 +3,7 @@ content_type: magprog_team name: Татьяна Мухина id: muhina order: 3 -photo: images/team/muhina.jpg +image: images/team/muhina.jpg language: ru --- diff --git a/data/magprog/content/team/Nozik.md b/data/magprog/content/team/Nozik.md index 1fbe7ce..11ca7a0 100644 --- a/data/magprog/content/team/Nozik.md +++ b/data/magprog/content/team/Nozik.md @@ -3,7 +3,7 @@ content_type: magprog_team name: Александр Нозик id: nozik order: 1 -photo: images/mentors/Nozik.jpg +image: images/mentors/Nozik.jpg language: ru --- **Руководитель программы** diff --git a/data/magprog/content/team/Svetlichnii.md b/data/magprog/content/team/Svetlichnii.md index 96bc56b..62b3d9a 100644 --- a/data/magprog/content/team/Svetlichnii.md +++ b/data/magprog/content/team/Svetlichnii.md @@ -3,7 +3,7 @@ content_type: magprog_team name: Александр Светличный id: svetlichnii order: 2 -photo: images/team/svetlichny.jpeg +image: images/team/svetlichny.jpeg language: ru --- diff --git a/src/main/kotlin/html5up/hyperspace/elements.kt b/src/main/kotlin/html5up/hyperspace/elements.kt new file mode 100644 index 0000000..06d244b --- /dev/null +++ b/src/main/kotlin/html5up/hyperspace/elements.kt @@ -0,0 +1,659 @@ +package html5up.hyperspace + +import kotlinx.html.* + +fun FlowContent.elements() { + h1("major") { +"""Elements""" } + +"""""" + section { + h2 { +"""Text""" } + p { + +"""This is""" + b { +"""bold""" } + +"""and this is""" + strong { +"""strong""" } + +""". This is""" + i { +"""italic""" } + +"""and this is""" + em { +"""emphasized""" } + +""". + This is""" + sup { +"""superscript""" } + +"""text and this is""" + sub { +"""subscript""" } + +"""text. + This is""" + // u { +"""underlined""" } + +"""and this is code:""" + code { +"""for (;;) { ... }""" } + +""". Finally,""" + a { + href = "#" + +"""this is a link""" + } + +""".""" + } + hr { + } + p { +"""Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.""" } + hr { + } + h2 { +"""Heading Level 2""" } + h3 { +"""Heading Level 3""" } + h4 { +"""Heading Level 4""" } + hr { + } + h3 { +"""Blockquote""" } + blockQuote { +"""Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan faucibus. Vestibulum ante ipsum primis in faucibus lorem ipsum dolor sit amet nullam adipiscing eu felis.""" } + h3 { +"""Preformatted""" } + pre { + code { + +"""i = 0; + +while (!deck.isInOrder()) { + print 'Iteration ' + i; + deck.shuffle(); + i++; +} + +print 'It took ' + i + ' iterations to sort the deck.';""" + } + } + } + +"""""" + section { + h2 { +"""Lists""" } + div("row") { + div("col-6 col-12-medium") { + h3 { +"""Unordered""" } + ul { + li { +"""Dolor pulvinar etiam.""" } + li { +"""Sagittis adipiscing.""" } + li { +"""Felis enim feugiat.""" } + } + h3 { +"""Alternate""" } + ul("alt") { + li { +"""Dolor pulvinar etiam.""" } + li { +"""Sagittis adipiscing.""" } + li { +"""Felis enim feugiat.""" } + } + } + div("col-6 col-12-medium") { + h3 { +"""Ordered""" } + ol { + li { +"""Dolor pulvinar etiam.""" } + li { +"""Etiam vel felis viverra.""" } + li { +"""Felis enim feugiat.""" } + li { +"""Dolor pulvinar etiam.""" } + li { +"""Etiam vel felis lorem.""" } + li { +"""Felis enim et feugiat.""" } + } + h3 { +"""Icons""" } + ul("icons") { + li { + a(classes = "icon brands fa-twitter") { + href = "#" + span("label") { +"""Twitter""" } + } + } + li { + a(classes = "icon brands fa-facebook-f") { + href = "#" + span("label") { +"""Facebook""" } + } + } + li { + a(classes = "icon brands fa-instagram") { + href = "#" + span("label") { +"""Instagram""" } + } + } + li { + a(classes = "icon brands fa-github") { + href = "#" + span("label") { +"""Github""" } + } + } + } + } + } + h2 { +"""Actions""" } + div("row") { + div("col-6 col-12-medium") { + ul("actions") { + li { + a(classes = "button primary") { + href = "#" + +"""Default""" + } + } + li { + a(classes = "button") { + href = "#" + +"""Default""" + } + } + } + ul("actions small") { + li { + a(classes = "button primary small") { + href = "#" + +"""Small""" + } + } + li { + a(classes = "button small") { + href = "#" + +"""Small""" + } + } + } + ul("actions stacked") { + li { + a(classes = "button primary") { + href = "#" + +"""Default""" + } + } + li { + a(classes = "button") { + href = "#" + +"""Default""" + } + } + } + ul("actions stacked") { + li { + a(classes = "button primary small") { + href = "#" + +"""Small""" + } + } + li { + a(classes = "button small") { + href = "#" + +"""Small""" + } + } + } + } + div("col-6 col-12-medium") { + ul("actions stacked") { + li { + a(classes = "button primary fit") { + href = "#" + +"""Default""" + } + } + li { + a(classes = "button fit") { + href = "#" + +"""Default""" + } + } + } + ul("actions stacked") { + li { + a(classes = "button primary small fit") { + href = "#" + +"""Small""" + } + } + li { + a(classes = "button small fit") { + href = "#" + +"""Small""" + } + } + } + } + } + } + +"""""" + section { + h2 { +"""Table""" } + h3 { +"""Default""" } + div("table-wrapper") { + table { + thead { + tr { + th { +"""Name""" } + th { +"""Description""" } + th { +"""Price""" } + } + } + tbody { + tr { + td { +"""Item One""" } + td { +"""Ante turpis integer aliquet porttitor.""" } + td { +"""29.99""" } + } + tr { + td { +"""Item Two""" } + td { +"""Vis ac commodo adipiscing arcu aliquet.""" } + td { +"""19.99""" } + } + tr { + td { +"""Item Three""" } + td { +"""Morbi faucibus arcu accumsan lorem.""" } + td { +"""29.99""" } + } + tr { + td { +"""Item Four""" } + td { +"""Vitae integer tempus condimentum.""" } + td { +"""19.99""" } + } + tr { + td { +"""Item Five""" } + td { +"""Ante turpis integer aliquet porttitor.""" } + td { +"""29.99""" } + } + } + tfoot { + tr { + td { + colSpan = "2" + } + td { +"""100.00""" } + } + } + } + } + h3 { +"""Alternate""" } + div("table-wrapper") { + table("alt") { + thead { + tr { + th { +"""Name""" } + th { +"""Description""" } + th { +"""Price""" } + } + } + tbody { + tr { + td { +"""Item One""" } + td { +"""Ante turpis integer aliquet porttitor.""" } + td { +"""29.99""" } + } + tr { + td { +"""Item Two""" } + td { +"""Vis ac commodo adipiscing arcu aliquet.""" } + td { +"""19.99""" } + } + tr { + td { +"""Item Three""" } + td { +"""Morbi faucibus arcu accumsan lorem.""" } + td { +"""29.99""" } + } + tr { + td { +"""Item Four""" } + td { +"""Vitae integer tempus condimentum.""" } + td { +"""19.99""" } + } + tr { + td { +"""Item Five""" } + td { +"""Ante turpis integer aliquet porttitor.""" } + td { +"""29.99""" } + } + } + tfoot { + tr { + td { + colSpan = "2" + } + td { +"""100.00""" } + } + } + } + } + } + +"""""" + section { + h3 { +"""Buttons""" } + ul("actions") { + li { + a(classes = "button primary") { + href = "#" + +"""Primary""" + } + } + li { + a(classes = "button") { + href = "#" + +"""Default""" + } + } + } + ul("actions") { + li { + a(classes = "button large") { + href = "#" + +"""Large""" + } + } + li { + a(classes = "button") { + href = "#" + +"""Default""" + } + } + li { + a(classes = "button small") { + href = "#" + +"""Small""" + } + } + } + ul("actions fit") { + li { + a(classes = "button primary fit") { + href = "#" + +"""Fit""" + } + } + li { + a(classes = "button fit") { + href = "#" + +"""Fit""" + } + } + li { + a(classes = "button fit") { + href = "#" + +"""Fit""" + } + } + } + ul("actions fit small") { + li { + a(classes = "button primary fit small") { + href = "#" + +"""Fit + Small""" + } + } + li { + a(classes = "button fit small") { + href = "#" + +"""Fit + Small""" + } + } + li { + a(classes = "button fit small") { + href = "#" + +"""Fit + Small""" + } + } + } + ul("actions") { + li { + a(classes = "button primary icon solid fa-download") { + href = "#" + +"""Icon""" + } + } + li { + a(classes = "button icon solid fa-upload") { + href = "#" + +"""Icon""" + } + } + li { + a(classes = "button icon solid fa-save") { + href = "#" + +"""Icon""" + } + } + } + ul("actions") { + li { + span("button primary disabled") { +"""Disabled""" } + } + li { + span("button disabled") { +"""Disabled""" } + } + } + } + +"""""" + section { + h2 { +"""Form""" } + form { + method = FormMethod.post + action = "#" + div("row gtr-uniform") { + div("col-6 col-12-xsmall") { + input { + type = InputType.text + name = "demo-name" + id = "demo-name" + value = "" + placeholder = "Name" + } + } + div("col-6 col-12-xsmall") { + input { + type = InputType.email + name = "demo-email" + id = "demo-email" + value = "" + placeholder = "Email" + } + } + div("col-12") { + select { + name = "demo-category" + id = "demo-category" + option { + value = "" + +"""- Category -""" + } + option { + value = "1" + +"""Manufacturing""" + } + option { + value = "1" + +"""Shipping""" + } + option { + value = "1" + +"""Administration""" + } + option { + value = "1" + +"""Human Resources""" + } + } + } + div("col-4 col-12-small") { + input { + type = InputType.radio + id = "demo-priority-low" + name = "demo-priority" + checked = true + } + label { + htmlFor = "demo-priority-low" + +"""Low""" + } + } + div("col-4 col-12-small") { + input { + type = InputType.radio + id = "demo-priority-normal" + name = "demo-priority" + } + label { + htmlFor = "demo-priority-normal" + +"""Normal""" + } + } + div("col-4 col-12-small") { + input { + type = InputType.radio + id = "demo-priority-high" + name = "demo-priority" + } + label { + htmlFor = "demo-priority-high" + +"""High""" + } + } + div("col-6 col-12-small") { + input { + type = InputType.checkBox + id = "demo-copy" + name = "demo-copy" + } + label { + htmlFor = "demo-copy" + +"""Email me a copy""" + } + } + div("col-6 col-12-small") { + input { + type = InputType.checkBox + id = "demo-human" + name = "demo-human" + checked = true + } + label { + htmlFor = "demo-human" + +"""Not a robot""" + } + } + div("col-12") { + textArea { + name = "demo-message" + id = "demo-message" + placeholder = "Enter your message" + rows = "6" + } + } + div("col-12") { + ul("actions") { + li { + input(classes = "primary") { + type = InputType.submit + value = "Send Message" + } + } + li { + input { + type = InputType.reset + value = "Reset" + } + } + } + } + } + } + } + +"""""" + section { + h2 { +"""Image""" } + h3 { +"""Fit""" } + div("box alt") { + div("row gtr-uniform") { + div("col-12") { + span("image fit") { + img { + src = "images/pic04.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic01.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic02.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic03.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic03.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic01.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic02.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic02.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic03.jpg" + alt = "" + } + } + } + div("col-4") { + span("image fit") { + img { + src = "images/pic01.jpg" + alt = "" + } + } + } + } + } + h3 { +"""Left & Right""" } + p { + span("image left") { + img { + src = "images/pic05.jpg" + alt = "" + } + } + +"""Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.""" + } + p { + span("image right") { + img { + src = "images/pic06.jpg" + alt = "" + } + } + +"""Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.""" + } + } +} diff --git a/src/main/kotlin/ru/mipt/spc/master.kt b/src/main/kotlin/ru/mipt/spc/master.kt index abcae5f..0a2b704 100644 --- a/src/main/kotlin/ru/mipt/spc/master.kt +++ b/src/main/kotlin/ru/mipt/spc/master.kt @@ -41,6 +41,9 @@ import kotlin.collections.set // } //} +private val HtmlData.imagePath: String? get() = meta["image"]?.string ?: meta["image.path"].string +private val HtmlData.name: String get() = meta["name"].string ?: error("Name not found") + class MagProgSection( val id: String, val title: String, @@ -119,13 +122,13 @@ context(PageContext) private fun FlowContent.partners() { } } -class Person(val data: HtmlData) : HtmlData by data { - val name: String by meta.string { error("Mentor name is not defined") } - val photo: String? by meta.string() -} +//class Person(val data: HtmlData) : HtmlData by data { +// val name: String by meta.string { error("Mentor name is not defined") } +// val photo: String? by meta.string() +//} context(PageContext) private fun FlowContent.team() { - val team = findByType("magprog_team").map { Person(it.value) }.sortedBy { it.order } + val team = findByType("magprog_team").values.sortedBy { it.order } div("inner") { h2 { +"Команда" } @@ -133,14 +136,14 @@ context(PageContext) private fun FlowContent.team() { team.forEach { member -> section { a { - val imagePath = member.photo?.let { resolveRef(it) } + val imagePath = member.imagePath?.let { resolveRef(it) } img( classes = "icon major", src = imagePath, alt = imagePath ) { h3 { +member.name } - htmlData(member.data) + htmlData(member) } } } @@ -180,7 +183,7 @@ context(PageContext) private fun FlowContent.team() { } context(PageContext) private fun FlowContent.mentors() { - val mentors = findByType("magprog_mentor").mapValues { Person(it.value) }.entries.sortedBy { it.value.id } + val mentors = findByType("magprog_mentor").entries.sortedBy { it.value.id } div("inner") { h2 { @@ -191,7 +194,7 @@ context(PageContext) private fun FlowContent.mentors() { section { id = mentor.id a(classes = "image", href = resolveRef("mentor-${mentor.id}")) { - mentor.photo?.let { photoPath -> + mentor.imagePath?.let { photoPath -> img( src = resolveRef(photoPath), alt = mentor.name @@ -287,7 +290,7 @@ context(PageContext) internal fun BODY.magProgFooter() { } } -internal val Person.mentorPageId get() = "mentor-${id}" +private val HtmlData.mentorPageId get() = "mentor-${id}" internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: String = "/magprog") { @@ -371,9 +374,7 @@ internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: Str } } - val mentors = findByType("magprog_mentor").map { - Person(it.value) - }.sortedBy { + val mentors = findByType("magprog_mentor").values.sortedBy { it.order } @@ -388,7 +389,7 @@ internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: Str href = "$homeRef#mentors" +"Научные руководители" } - nav{ + nav { ul { mentors.forEach { li { @@ -407,8 +408,9 @@ internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: Str id = "main" div("inner") { h1("major") { +mentor.name } - span("image left") { - mentor.photo?.let { photoPath -> + val imageClass = mentor.meta["image.position"].string ?: "left" + span("image $imageClass") { + mentor.imagePath?.let { photoPath -> img( src = resolveRef(photoPath), alt = mentor.name