Skip to content

Commit

Permalink
Some random improvements (#78)
Browse files Browse the repository at this point in the history
* some random improvements

* revert

* remove caption
  • Loading branch information
theianjones authored Sep 20, 2023
1 parent f656749 commit e88b3fa
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 36 deletions.
17 changes: 3 additions & 14 deletions src/com/spicy/home.clj
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
(ns com.spicy.home
(:require
[clj-http.client :as http]
[com.biffweb :as biff]
[com.spicy.middleware :as mid]
[com.spicy.settings :as settings]
[com.spicy.ui :as ui]
[rum.core :as rum]
[xtdb.api :as xt]))


(def email-disabled-notice
[:.text-sm.mt-3.bg-blue-100.p-2
"Until you add API keys for Postmark and reCAPTCHA, we'll print your sign-up "
"link to the console. See config.edn."])
[com.spicy.ui :as ui]))


(defn home-page
Expand Down Expand Up @@ -40,8 +31,7 @@
"Sign up"]]
[:.mt-2.text-sm "Already have an account? " [:a.text-black.hover:text-brand-pink.font-bold {:href "/signin"} "Sign in"] "."]
[:.h-3]
biff/recaptcha-disclosure
email-disabled-notice)]))
biff/recaptcha-disclosure)]))


(defn link-sent
Expand Down Expand Up @@ -117,8 +107,7 @@
"There was an error.")]])
[:.mt-2.text-sm "Don't have an account yet? " [:a.text-black.hover:text-brand-pink.font-bold {:href "/"} "Sign up"] "."]
[:.h-3]
biff/recaptcha-disclosure
email-disabled-notice)]))
biff/recaptcha-disclosure)]))


(defn enter-code-page
Expand Down
8 changes: 4 additions & 4 deletions src/com/spicy/movements/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@
[:h1.text-5xl.w-fit.self-center.mb-4.md:mb-0 "Movements"]
[:a {:class (str "btn bg-brand-teal w-full sm:w-fit self-center")
:href (str "/app/movements/new")} "Add Movement"]]
[:div.flex.flex-col.sm:flex-row.justify-end.gap-4
[:select.btn.text-base.w-full.md:w-96.h-12.teal-focus.hover:cursor-pointer {:name "type"
:onchange "window.open('?type=' + this.value,'_self')"}
[:div.flex.flex-col.sm:flex-row.justify-end.gap-4.w-full.max-w-3xl
[:select.btn.text-base.w-full.h-12.flex-1.teal-focus.hover:cursor-pointer {:name "type"
:onchange "window.open('?type=' + this.value,'_self')"}
[:option.text-base {:value :strength
:selected (or (= (:type params) "strength") (empty? (:type params)))} "Strength"]
[:option.text-base {:value :gymnastic
:selected (= (:type params) "gymnastic")} "Gymnastic"]
[:option.text-base {:value :monostructural
:selected (= (:type params) "monostructural")} "Cardio"]]
[:input.pink-input.teal-focus.w-full.h-full.md:w-96
[:input.pink-input.teal-focus.w-full.h-full.flex-1
{:name "search"
:type "search"
:id "search"
Expand Down
7 changes: 3 additions & 4 deletions src/com/spicy/results/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@
[:input.pink-input.teal-focus.mt-4.mx-auto
{:type "date"
:name "date"
:x-init (when-not (:result/date result)
"$el.valueAsDate = new Date();")
:value (when (:result/date result)
:value (if (:result/date result)
(biff/format-date
(:result/date result) "YYYY-MM-dd"))}]
(:result/date result) "YYYY-MM-dd")
(jt/format "YYYY-MM-dd" (jt/zoned-date-time (jt/zone-id "America/Boise"))))}]
[:textarea#notes
{:name "notes"
:placeholder "notes"
Expand Down
2 changes: 0 additions & 2 deletions src/com/spicy/results/score.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
{:time ["minutes" "seconds"]
:rounds-reps ["rounds" "reps"]
:reps ["reps"]
:time-with-cap ["reps"]
:pass-fail ["reps"]
:emom ["reps"]
:load ["reps"]
:calories ["reps"]
Expand Down
12 changes: 6 additions & 6 deletions src/com/spicy/results/ui.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[clojure.string :as string]
[com.biffweb :as biff]
[com.spicy.movements.core :refer [sets-n-reps]]
[com.spicy.workouts.ui :refer [display-summed-score]]))
[com.spicy.workouts.ui :refer [display-summed-score]]
[java-time.api :as jt]))


(defn normalized-result
Expand Down Expand Up @@ -127,7 +128,7 @@
[:input.w-full.pink-input.teal-focus {:type "number"
:name (str "reps-" identifier)
:id (str "id-" identifier)
:placeholder "Reps"
:placeholder (string/capitalize (name (:workout/scheme workout)))
:value score
:min 0
:required true}]))
Expand Down Expand Up @@ -170,11 +171,10 @@
[:input.pink-input.teal-focus
{:type "date"
:name "date"
:x-init (when-not (:result/date result)
"$el.valueAsDate = new Date();")
:value (when (:result/date result)
:value (if (:result/date result)
(biff/format-date
(:result/date result) "YYYY-MM-dd"))}]
(:result/date result) "YYYY-MM-dd")
(jt/format "YYYY-MM-dd" (jt/zoned-date-time (jt/zone-id "America/Boise"))))}]
[:div.flex.gap-2.items-center
[:div.flex-1.flex.gap-2.items-center
[:input#rx {:type "radio"
Expand Down
2 changes: 0 additions & 2 deletions src/com/spicy/ui.clj
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@
[scheme]
(case scheme
:time "For Time"
:time-with-cap "For Time"
:rounds-reps "Rounds + Reps"
:reps "Total Reps"
:pass-fail "Pass/Fail"
:load "Total Load"
:calories "Total Cals"
:meters "Total Meters"
Expand Down
4 changes: 0 additions & 4 deletions src/com/spicy/workouts/ui.clj
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@
[:option {:value "" :label "--Select a Workout Scheme--"}]
[:option {:value "time"
:label "time"}]
[:option {:value "time-with-cap"
:label "time-with-cap"}]
[:option {:value "pass-fail"
:label "pass-fail"}]
[:option {:value "rounds-reps"
:label "rounds-reps"}]
[:option {:value "reps"
Expand Down

0 comments on commit e88b3fa

Please sign in to comment.