Commit 9d0fcd43 authored by Joachim Schunk's avatar Joachim Schunk

Beautyfications and help-texts for show-view

parent 1493459b
......@@ -42,7 +42,7 @@
{:sign "Not" :subtext "properly configured"})))
(defn var-symbol [{:keys [sign subtext var-sign match-set]}]
[:div (when match-set
[:div.is-size-7 (when match-set
{:class (if (contains? match-set var-sign) "green lighten-4" "red lighten-4")})
[sign-with-subtext {:sign sign :subtext subtext}]])
......
......@@ -67,7 +67,8 @@
[:div.level
[:div.level-left
[:div.level-item
[:span (phrase-fn next-position)]]
[:span (phrase-fn next-position)]]]
[:div.level-right
[:div.level-item
[:a.button.is-info {:on-click #(on-click-fn next-position)}
[:span.icon [:i.fas.fa-arrow-right]]]]]]]))
......@@ -217,7 +218,6 @@
{:title (:title exercise)
:class (get-result-color-class result)}
[:div
#_[:span.card-title [:b (:title exercise)]]
[b-crumb {:positions positions
:current-position @current-position
:phrase-fn phrase-fn
......
......@@ -85,18 +85,16 @@
{:disabled last-step?
:on-click #(when-not last-step? ;;;disable event on disabled button
(step-delete change-fn path answer step-id))}
[:span.icon [:i.fas.fa-minus]]])]]]))
[:span.icon [:i.fas.fa-trash]]])]]]))
(defn answer-steps [{:keys [answer change-fn phrase-fn result description-id descriptions assocs params
assignments number-of-steps number-of-answer-steps modal-state-atom
selectable-units]}]
[:<>
(when description-id
[:div.row
[:div.col.s12
[default-task-description
(get-in descriptions [(name description-id) :content])]]])
[:table.table.is-fullwidth
[default-task-description
(get-in descriptions [(name description-id) :content])])
[:table.table.is-narrow.is-fullwidth
[:thead
[:tr
[:th (phrase-fn :assoc)]
......@@ -122,4 +120,7 @@
:selectable-units selectable-units}])
(range number-of-answer-steps))
(when (and (not result) (< number-of-answer-steps number-of-steps))
[step-add-tr {:add-fn #(change-fn [:steps] (conj answer (get-new-answer-step assocs)))}])]]])
[step-add-tr {:add-fn #(change-fn [:steps] (conj answer (get-new-answer-step assocs)))}])]]
(when (empty? answer)
[:div.has-text-grey
(str "Zum Hinzufügen von " (phrase-fn :steps) " auf die Linie mit dem '+' klicken ...")])])
......@@ -271,7 +271,7 @@
(reduce (fn [res category] (conj res (update category :id keyword)))
[] assignment-categories)))]
[:div.is-block
(when (not-empty var-ids)
(if (not-empty var-ids)
[:<>
[:h5 "Gewählte Größen:"]
[:table.table.is-fullwidth
......@@ -293,8 +293,9 @@
[:a.button.is-danger
{:on-click #(change-fn (conj path :vars) (vec-remove vars index)
(collats-fn))}
[:span.icon [:i.fas.fa-trash]]]]])) var-ids)]]])
(when (< number-of-selected-vars number-of-vars)
[:span.icon [:i.fas.fa-trash]]]]])) var-ids)]]]
[:div.has-text-grey.mb-4 "Größe auswählen durch anklicken ..."])
(if (< number-of-selected-vars number-of-vars)
[:<>
[:h5 "Wählbare Größen:"]
[:table.table.is-fullwidth
......@@ -326,7 +327,8 @@
:collats-fn collats-fn
:vars vars
:var-type :step}]])
relevant-categories)]]]])]))
relevant-categories)]]]]
[:div.has-text-grey.mb-3 "Maximale Anzahl von Größen gewählt ..."])]))
(defn formula-calculator [{:keys [id phys-val change-fn with-oom with-units formula formula-vec
var-mapping calc-mapping var-phys-val-map formula-change-fn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment