1
0
forked from SPC/spc-site

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
name: Максим Сергеевич Долгоносов
id: Dolgonosov
photo: images/mentors/Dolgonosov.jpg
image: images/mentors/Dolgonosov.jpg
language: ru
---

View File

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

View File

@ -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
---

View File

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

View File

@ -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
---

View File

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

View File

@ -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
---

View File

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

View File

@ -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
---

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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
---

View File

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

View File

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

View File

@ -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
---

View File

@ -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
---
Консультант от ФПМИ

View File

@ -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
---

View File

@ -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
---
**Руководитель программы**

View File

@ -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
---

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(
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
}
@ -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