not_a_moodle/IndexHtml.hs

18 lines
680 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module IndexHtml where
import Lucid.Base
import Lucid.Html5
import qualified Data.Text as T
import Common (Students, layout)
index :: Students -> (Html())
index students = layout $ do
h1_ "Каждому по заслугам"
h2_ "Сервис записи работ студентов"
h3_ "Выберите студента"
form_ [method_ "GET", action_ "./student" ]$ do
input_ [type_ "search", name_ "student_id", list_ listId]
datalist_ [id_ listId] $ do
mapM_ (\x -> option_ [value_ $ fst x] (toHtml $ snd x)) students
input_ [type_ "submit"]
where listId = "students"