aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/Main.hs')
-rw-r--r--frontend/app/Main.hs63
1 files changed, 61 insertions, 2 deletions
diff --git a/frontend/app/Main.hs b/frontend/app/Main.hs
index e4729b4..eb05983 100644
--- a/frontend/app/Main.hs
+++ b/frontend/app/Main.hs
@@ -7,6 +7,7 @@ import Language.Javascript.JSaddle.Warp as JSaddle
#endif
import ACMS.API.REST as API.REST
+import Control.Monad (join)
import Control.Monad.Catch
import Control.Monad.Trans
import Data.Bifunctor
@@ -20,6 +21,7 @@ import NeatInterpolation qualified as Q
import Page (Page, initialPage, updatePage, viewPage)
import Page qualified as Page
import Route (parseURI)
+import Route qualified
import Version
data Model
@@ -189,7 +191,7 @@ header {
nav, main {
min-height: 100%; }
nav {
- flex: 0 0 200px; }
+ flex: 0 0 260px; }
main {
flex: 1 1 auto; }
@@ -236,6 +238,52 @@ table {
th, td {
border-top: 1px solid gray;
border-bottom: 1px solid gray; }
+
+/* menu */
+nav {
+ padding: 16px 0 0; }
+
+nav ol {
+ list-style-type: none;
+ line-height: 32px;
+ padding: 0;
+ margin: 0; }
+
+nav {
+ display: flex;
+ flex-flow: column nowrap;
+ height: calc(100vh - 64px); }
+
+nav section {
+ display: flex;
+ flex-flow: column nowrap; }
+
+nav section > span {
+ line-height: 32px;
+ padding-left: 8px; }
+
+nav section > span:not(:first-child) {
+ margin-top: 24px; }
+
+nav li {
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis; }
+
+nav li {
+ display: flex; }
+
+nav li a {
+ flex: 0 0 100%;
+ padding: 4px 8px 4px;
+ color: black;
+ text-decoration: none; }
+
+nav li a.active {
+ background-color: lightgray; }
+
+nav li a:hover, nav li a:active {
+ background-color: whitesmoke; }
|]
)
]
@@ -270,7 +318,18 @@ viewCollections s =
[ li_
[]
[ a_
- [href_ (toMisoString ("#collection/" <> collection))]
+ ( concat
+ [ [href_ (toMisoString ("#collection/" <> collection))],
+ if ( fmap Page.route
+ . join
+ . fmap (either (\_ -> Nothing) Just)
+ $ s.page
+ )
+ == Just (Route.ListCollection collection)
+ then [class_ "active"]
+ else []
+ ]
+ )
[text (toMisoString collection)]
]
| collection <- s.collections