This improves the design of the session view a lot. However, several things still need to be done: 1. The rules section is not styled. 2. The session list is not styled. 3. The design is not responsive yet. This will take longer, as the base view will need to be overhauled substantially to take advantage of wider screens. 4. A light mode needs to be added.
38 lines
981 B
JavaScript
38 lines
981 B
JavaScript
"use strict";
|
|
|
|
import Session from "/models/session.js";
|
|
|
|
export default class SessionList {
|
|
/** @param {{ attrs: { models: Session[] } }} param The sessions to show. */
|
|
view({attrs: { models, onSelect } }) {
|
|
return m("section", [
|
|
m(m.route.Link, {
|
|
href: "/",
|
|
selector: "button",
|
|
options: {
|
|
state: { newSession: true },
|
|
},
|
|
}, "Neie Session"),
|
|
m("ol", [
|
|
models.map((s) => m("li", [
|
|
m(
|
|
m.route.Link,
|
|
{
|
|
href: "/",
|
|
selector: "button",
|
|
params: { session: s.id },
|
|
onclick: () => onSelect(s),
|
|
},
|
|
[
|
|
m("p", "•".repeat(s.result.theirPoints)),
|
|
m("p", s.theirTeam !== "" ? s.theirTeam : "Se"),
|
|
m("p", s.ourTeam !== "" ? s.ourTeam : "Mia"),
|
|
m("p", "•".repeat(s.result.ourPoints)),
|
|
],
|
|
),
|
|
]))
|
|
])
|
|
]);
|
|
}
|
|
}
|