Refactor masters

This commit is contained in:
Alexander Nozik 2022-05-26 11:55:50 +03:00
parent a85322231e
commit 56822a3644
26 changed files with 703 additions and 40 deletions

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Максим Сергеевич Долгоносов name: Максим Сергеевич Долгоносов
id: Dolgonosov id: Dolgonosov
photo: images/mentors/Dolgonosov.jpg image: images/mentors/Dolgonosov.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Константин Викторович Герценбергер name: Константин Викторович Герценбергер
id: Gertsenberger id: Gertsenberger
photo: images/mentors/Gertsenberger.jpg image: images/mentors/Gertsenberger.jpg
language: ru language: ru
--- ---
#### Организация #### Организация

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Roland Grinis name: Roland Grinis
id: Grinis id: Grinis
photo: images/mentors/Grinis.jpg image: images/mentors/Grinis.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Олег Евгеньевич Калашев name: Олег Евгеньевич Калашев
id: Kalashev id: Kalashev
photo: images/mentors/Kalashev.jpg image: images/mentors/Kalashev.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Igor Khokhriakov name: Igor Khokhriakov
id: Khokhriakov id: Khokhriakov
photo: images/mentors/Khokhriakov.jpg image: images/mentors/Khokhriakov.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Петр Климай name: Петр Климай
id: Klimai id: Klimai
photo: images/mentors/Klimai.jpg image: images/mentors/Klimai.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Dmitriy Kostunin name: Dmitriy Kostunin
id: Kostunin id: Kostunin
photo: images/mentors/Kostunin.jpg image: images/mentors/Kostunin.jpg
language: ru language: ru
published: false published: false
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Александр Нозик name: Александр Нозик
id: Nozik id: Nozik
photo: images/mentors/Nozik.jpg image: images/mentors/Nozik.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Дмитрий Робертович Олийниченко name: Дмитрий Робертович Олийниченко
id: Oliinychenko id: Oliinychenko
photo: images/mentors/Oliinychenko.jpg image: images/mentors/Oliinychenko.jpg
language: ru language: ru
published: false published: false
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Владислав Сергеевич Пантуев name: Владислав Сергеевич Пантуев
id: Pantuev id: Pantuev
photo: images/mentors/Pantuev.jpg image: images/mentors/Pantuev.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Игорь Анатольевич Пшеничнов name: Игорь Анатольевич Пшеничнов
id: Pshenichnov id: Pshenichnov
photo: images/mentors/Pshenichnov.jpg image: images/mentors/Pshenichnov.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Лев Михайлович Шагалов name: Лев Михайлович Шагалов
id: Shagalov id: Shagalov
photo: images/mentors/Shagalov.jpg image: images/mentors/Shagalov.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Айно Константиновна Скасырская name: Айно Константиновна Скасырская
id: Skasyrskaya id: Skasyrskaya
photo: images/mentors/Skasyrskaya.jpg image: images/mentors/Skasyrskaya.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Ильмир Усманов name: Ильмир Усманов
id: Usmanov id: Usmanov
photo: images/mentors/Usmanov.jpg image: images/mentors/Usmanov.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Алексей Викторович Зиновьев name: Алексей Викторович Зиновьев
id: Zinoviev id: Zinoviev
photo: images/mentors/Zinoviev.jpg image: images/mentors/Zinoviev.jpg
language: ru language: ru
--- ---
#### Организация #### Организация

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Иван Харук name: Иван Харук
id: Kharuk id: Kharuk
photo: images/mentors/Kharuk.jpg image: images/mentors/Kharuk.jpg
language: ru language: ru
--- ---

View File

@ -2,7 +2,9 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Виталий Кондратов name: Виталий Кондратов
id: Kondratov id: Kondratov
photo: images/mentors/Kondratov.jpg image:
path: images/mentors/Kondratov.jpg
position: right
language: ru language: ru
--- ---

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Ирина Геннадьевна Низовцева name: Ирина Геннадьевна Низовцева
id: Nizovtseva id: Nizovtseva
photo: images/mentors/Nizovtseva.jpg image: images/mentors/Nizovtseva.jpg
language: ru language: ru
--- ---
#### Биография #### Биография

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Александр Светличный name: Александр Светличный
id: Svetlichny id: Svetlichny
photo: images/mentors/Svetlichny.jpg image: images/mentors/Svetlichny.jpg
language: ru language: ru
--- ---
#### Организация #### Организация

View File

@ -2,7 +2,7 @@
content_type: magprog_mentor content_type: magprog_mentor
name: Полиграф Шариков name: Полиграф Шариков
id: template id: template
photo: images/mentors/Template.jpg image: images/mentors/Template.jpg
published: false published: false
language: ru language: ru
--- ---

View File

@ -3,7 +3,7 @@ content_type: magprog_team
name: Денис Айвазов name: Денис Айвазов
id: Aivazov id: Aivazov
order: 4 order: 4
photo: images/team/Aivazov.jpg image: images/team/Aivazov.jpg
language: ru language: ru
--- ---
Консультант от ФПМИ Консультант от ФПМИ

View File

@ -3,7 +3,7 @@ content_type: magprog_team
name: Татьяна Мухина name: Татьяна Мухина
id: muhina id: muhina
order: 3 order: 3
photo: images/team/muhina.jpg image: images/team/muhina.jpg
language: ru language: ru
--- ---

View File

@ -3,7 +3,7 @@ content_type: magprog_team
name: Александр Нозик name: Александр Нозик
id: nozik id: nozik
order: 1 order: 1
photo: images/mentors/Nozik.jpg image: images/mentors/Nozik.jpg
language: ru language: ru
--- ---
**Руководитель программы** **Руководитель программы**

View File

@ -3,7 +3,7 @@ content_type: magprog_team
name: Александр Светличный name: Александр Светличный
id: svetlichnii id: svetlichnii
order: 2 order: 2
photo: images/team/svetlichny.jpeg image: images/team/svetlichny.jpeg
language: ru language: ru
--- ---

View File

@ -0,0 +1,659 @@
package html5up.hyperspace
import kotlinx.html.*
fun FlowContent.elements() {
h1("major") { +"""Elements""" }
+"""<!-- Text -->"""
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.';"""
}
}
}
+"""<!-- Lists -->"""
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"""
}
}
}
}
}
}
+"""<!-- Table -->"""
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""" }
}
}
}
}
}
+"""<!-- Buttons -->"""
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""" }
}
}
}
+"""<!-- Form -->"""
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"
}
}
}
}
}
}
}
+"""<!-- Image -->"""
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 &amp; 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."""
}
}
}

View File

@ -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( class MagProgSection(
val id: String, val id: String,
val title: String, val title: String,
@ -119,13 +122,13 @@ context(PageContext) private fun FlowContent.partners() {
} }
} }
class Person(val data: HtmlData) : HtmlData by data { //class Person(val data: HtmlData) : HtmlData by data {
val name: String by meta.string { error("Mentor name is not defined") } // val name: String by meta.string { error("Mentor name is not defined") }
val photo: String? by meta.string() // val photo: String? by meta.string()
} //}
context(PageContext) private fun FlowContent.team() { 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") { div("inner") {
h2 { +"Команда" } h2 { +"Команда" }
@ -133,14 +136,14 @@ context(PageContext) private fun FlowContent.team() {
team.forEach { member -> team.forEach { member ->
section { section {
a { a {
val imagePath = member.photo?.let { resolveRef(it) } val imagePath = member.imagePath?.let { resolveRef(it) }
img( img(
classes = "icon major", classes = "icon major",
src = imagePath, src = imagePath,
alt = imagePath alt = imagePath
) { ) {
h3 { +member.name } h3 { +member.name }
htmlData(member.data) htmlData(member)
} }
} }
} }
@ -180,7 +183,7 @@ context(PageContext) private fun FlowContent.team() {
} }
context(PageContext) private fun FlowContent.mentors() { 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") { div("inner") {
h2 { h2 {
@ -191,7 +194,7 @@ context(PageContext) private fun FlowContent.mentors() {
section { section {
id = mentor.id id = mentor.id
a(classes = "image", href = resolveRef("mentor-${mentor.id}")) { a(classes = "image", href = resolveRef("mentor-${mentor.id}")) {
mentor.photo?.let { photoPath -> mentor.imagePath?.let { photoPath ->
img( img(
src = resolveRef(photoPath), src = resolveRef(photoPath),
alt = mentor.name 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") { 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 { val mentors = findByType("magprog_mentor").values.sortedBy {
Person(it.value)
}.sortedBy {
it.order it.order
} }
@ -388,7 +389,7 @@ internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: Str
href = "$homeRef#mentors" href = "$homeRef#mentors"
+"Научные руководители" +"Научные руководители"
} }
nav{ nav {
ul { ul {
mentors.forEach { mentors.forEach {
li { li {
@ -407,8 +408,9 @@ internal fun Application.spcMaster(context: Context, dataPath: Path, prefix: Str
id = "main" id = "main"
div("inner") { div("inner") {
h1("major") { +mentor.name } h1("major") { +mentor.name }
span("image left") { val imageClass = mentor.meta["image.position"].string ?: "left"
mentor.photo?.let { photoPath -> span("image $imageClass") {
mentor.imagePath?.let { photoPath ->
img( img(
src = resolveRef(photoPath), src = resolveRef(photoPath),
alt = mentor.name alt = mentor.name