Skip to content

Commit

Permalink
Tito connect ticket tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
plexus committed Aug 20, 2024
1 parent e2619a7 commit 885c4ab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
<logger name="datomic.kv-cluster" level="WARN" />
<logger name="datomic.peer" level="WARN" />
<logger name="datomic.log" level="WARN" />
<logger name="co.gaiwan.compass.db" level="DEBUG" />

</configuration>
26 changes: 16 additions & 10 deletions src/co/gaiwan/compass/routes/ticket.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@

(defn GET-connect-ticket-form
[{:keys [identity] :as req}]
{:html/body
[:div
[:h2 "Ticket Connection"]
[:p "Connect your tito ticket to your compass account here by entering the reference code and your email address!"]
[:form {:method "post"}
[:label {:for "reference"} "The ticket reference code:"] [:br]
[:input {:type "text" :required true :name "reference" :maxlength 4 :placeholder "QUTU"}] [:br]
[:label {:for "email"} "The email address assigned to the ticket:"] [:br]
[:input {:type "email" :required true :name "email" :value (:discord/email identity)}] [:br]
[:input {:type "submit" :value "Connect"}]]]})
(if-let [ticket (first (:tito.ticket/_assigned-to identity))]
{:html/body
[:div
[:h2 "Ticket Connection"]
[:p "Your ti.to ticket is already connected! You're all set!"]
[:p "Your ticket reference is " [:strong (:tito.ticket/reference ticket)] "."]]}
{:html/body
[:div
[:h2 "Ticket Connection"]
[:p "Connect your tito ticket to your compass account here by entering the reference code and your email address!"]
[:form {:method "post"}
[:label {:for "reference"} "The ticket reference code:"] [:br]
[:input {:type "text" :required true :name "reference" :maxlength 4 :placeholder "QUTU"}] [:br]
[:label {:for "email"} "The email address assigned to the ticket:"] [:br]
[:input {:type "email" :required true :name "email" :value (:discord/email identity)}] [:br]
[:input {:type "submit" :value "Connect"}]]]}))

(defn POST-connect-ticket-form
[{:keys [identity]
Expand Down
4 changes: 3 additions & 1 deletion src/co/gaiwan/compass/services/tito.clj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
[?ticket :tito.ticket/registration ?reg]
[?ticket :tito.ticket/email ?email]
(not [?ticket :tito.ticket/assigned-to _])]
(db/db) reference email))
(db/db)
reference
email))

(defmethod ig/init-key :tito/sync [_ {:keys [interval-seconds]}]
(log/info :tito/starting-sync-loop {:interval-seconds interval-seconds})
Expand Down

0 comments on commit 885c4ab

Please sign in to comment.