aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 04:03:20 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 04:03:20 +0200
commit68dd8120d735c6c8bb744048ccf0532b21ff31cc (patch)
tree912d571d7239781c1d61749862d03265305a2fe7
parentMinor cleanup. (diff)
downloadcalp-68dd8120d735c6c8bb744048ccf0532b21ff31cc.tar.gz
calp-68dd8120d735c6c8bb744048ccf0532b21ff31cc.tar.xz
Remove procedure tabset.
Tabset gave me a CSS-powered set of tabs. However, tabs are interactive, and I have moved most interaction to JavaScript. Making this procedure obsolete.
-rw-r--r--module/calp/html/components.scm33
-rw-r--r--module/calp/html/view/calendar/shared.scm2
2 files changed, 1 insertions, 34 deletions
diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm
index 2b7f58bd..33268721 100644
--- a/module/calp/html/components.scm
+++ b/module/calp/html/components.scm
@@ -6,7 +6,6 @@
:export (xhtml-doc
slider-input
btn
- tabset
include-css
include-alt-css
input-plus-minus
@@ -74,38 +73,6 @@
,body)))
-;; Creates a group of tabs from a given specification. The specification
-;; @var{elements} should be a list, where each element is a sublist on
-;; the form
-;; @example
-;; ("tab icon" arguments ... tab-body)
-;; @end example
-;; where arguments are zero or more pairs of keyword arguments. For example:
-;; @example
-;; ("📅" title: "Översikt" ,(fmt-single-event ev))
-;; @end example
-;; Creates a tab with an calendar emoji as icon, "Översikt" is sent as the
-;; extra argument #:title, and the body is the return from fmt-single-event.
-(define (tabset elements)
- (define tabgroup (symbol->string (gensym "tabgroup")))
-
- `(div (@ (class "tabgroup"))
- ,@(for (i (key args ... body)) in (enumerate elements)
- (define id (symbol->string (gensym "tab")))
- `(div (@ (class "tab"))
- (input (@ (type "radio") (id ,id) (name ,tabgroup)
- ,@(when (zero? i) '((checked)))))
- ;; It would be preferable to place the labels in a separate
- ;; div and set that to have fixed position, since we could
- ;; then just flow them. That hovever doesn't work since we
- ;; need a css-selector for the label to the selected radio
- ;; option.
- (label (@ ,@(assq-merge `((for ,id)
- (style "top: calc(var(--tab-size) * " ,i ")"))
- (kvlist->assq args)))
- ,key)
- (div (@ (class "content")) ,body)))))
-
(define ((set-attribute attr) el)
(match el
[(tagname ('@ params ...) inner-body ...)
diff --git a/module/calp/html/view/calendar/shared.scm b/module/calp/html/view/calendar/shared.scm
index 41d96171..cf930afc 100644
--- a/module/calp/html/view/calendar/shared.scm
+++ b/module/calp/html/view/calendar/shared.scm
@@ -10,7 +10,7 @@
:use-module (datetime)
:use-module (calp html config)
:use-module ((calp html components)
- :select (btn tabset))
+ :select (btn))
:use-module ((calp html vcomponent)
:select (make-block format-summary))
:use-module (ice-9 format)