aboutsummaryrefslogtreecommitdiff
path: root/module/html
diff options
context:
space:
mode:
Diffstat (limited to 'module/html')
-rw-r--r--module/html/config.scm4
-rw-r--r--module/html/vcomponent.scm15
2 files changed, 11 insertions, 8 deletions
diff --git a/module/html/config.scm b/module/html/config.scm
index 3ae0e1da..03e18db7 100644
--- a/module/html/config.scm
+++ b/module/html/config.scm
@@ -5,7 +5,7 @@
(define-public debug (make-parameter #f))
(define-config debug #f
- "Places the generated thingy in debug mode"
+ description: "Places the generated thingy in debug mode"
post: debug)
@@ -13,6 +13,6 @@
;;; but this works for the time being.
(define-public edit-mode (make-parameter #t))
(define-config edit-mode #t
- "Makes the document editable"
+ description: "Makes the document editable"
post: edit-mode)
diff --git a/module/html/vcomponent.scm b/module/html/vcomponent.scm
index 3fac17bb..fdaea217 100644
--- a/module/html/vcomponent.scm
+++ b/module/html/vcomponent.scm
@@ -5,6 +5,7 @@
:use-module (srfi srfi-41)
:use-module (datetime)
:use-module (html util)
+ :use-module ((html config) :select (edit-mode))
:use-module ((html components) :select (btn tabset))
:use-module ((output general) :select (calculate-fg-color))
:use-module ((vcomponent datetime output)
@@ -180,12 +181,14 @@
title: "Stäng"
onclick: "close_popup(document.getElementById(this.closest('.popup-container').id))"
class: '("close-tooltip"))
- ,(btn "🖊️"
- title: "Redigera"
- onclick: "place_in_edit_mode(document.getElementById(this.closest('.popup-container').id.substr(5)))")
- ,(btn "🗑"
- title: "Ta bort"
- onclick: "remove_event(document.getElementById(this.closest('.popup-container').id.substr(5)))"))
+ ,(when (edit-mode)
+ (list
+ (btn "🖊️"
+ title: "Redigera"
+ onclick: "place_in_edit_mode(document.getElementById(this.closest('.popup-container').id.substr(5)))")
+ (btn "🗑"
+ title: "Ta bort"
+ onclick: "remove_event(document.getElementById(this.closest('.popup-container').id.substr(5)))"))))
,(tabset
`(("📅" title: "Översikt"