-
Notifications
You must be signed in to change notification settings - Fork 2
/
admin_ui.cljc
91 lines (71 loc) · 3.04 KB
/
admin_ui.cljc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
(ns sb.app.board.admin-ui
(:require [inside-out.forms :as io]
[sb.app.board.data :as data]
[sb.app.entity.ui :as entity.ui :refer [use-persisted-attr]]
[sb.app.views.header :as header]
[sb.app.views.radix :as radix]
[sb.app.views.ui :as ui]
[sb.i18n :refer [t]]
[sb.util :as u]
[yawn.hooks :as h]))
;; issue
;; desire is to create a toplevel board
(ui/defview settings
{:route "/b/:board-id/settings"}
[{:as params :keys [board-id]}]
(when-let [board (data/settings params)]
(let [colors (->> [(->> board :entity/member-tags (keep :tag/color))
(->> board :entity/member-fields (mapcat :field/options) (keep :field-option/color))
(->> board :entity/project-fields (mapcat :field/options) (keep :field-option/color))]
(apply concat)
(into #{}))
use-persisted (fn [attr & [props]]
(use-persisted-attr board attr (merge {:field/can-edit? true
:field/color-list colors} props)))]
[:<>
(header/entity board nil)
#_(for [color colors]
[:div.w-8.h-8.m-1.rounded {:key color :style {:background-color color}}])
[radix/accordion {:class "max-w-[600px] mx-auto my-6 flex-v gap-6"
:multiple true}
[:div.field-label (t :tr/basic-settings)]
[:div.flex-v.gap-4
(use-persisted :entity/title)
(use-persisted :entity/description)
(use-persisted :entity/domain-name)
(use-persisted :image/avatar {:field/label (t :tr/logo)})
(use-persisted :entity/member-tags)
]
[:div.field-label (t :tr/projects-and-members)]
[:div.flex-v.gap-4
(use-persisted :entity/member-fields)
(use-persisted :entity/project-fields)]
[:div.field-label (t :tr/registration)]
[:div.flex-v.gap-4
(use-persisted :board/registration-open?)
(use-persisted :board/registration-url-override)
(use-persisted :board/registration-page-message)
(use-persisted :board/invite-email-text)]
]
;; TODO
;; - :board/project-sharing-buttons
;; - :board/member-tags
;; Registration
;; - :board/registration-invitation-email-text
;; - :board/registration-newsletter-field?
;; - :board/registration-open?
;; - :board/registration-message
;; - :board/registration-url-override
;; - :board/registration-codes
;; Theming
;; - border radius
;; - headline font
;; - accent color
;; Sponsors
;; - logo area with tiered sizes/visibility
;; Sticky Notes
;; - schema: a new entity type (not a special kind of project)
;; - modify migration based on ^new schema
;; - color is picked per sticky note
;; - sticky notes can include images/videos
])))