-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add login page Co-authored-by: Iain Wood <iain.wood@flexiana.com> * Fix header margin Co-authored-by: Iain Wood <iain.wood@flexiana.com> --------- Co-authored-by: Iain Wood <iain.wood@flexiana.com>
- Loading branch information
1 parent
b724a06
commit e66efda
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
resources/flexiana/xiana_unstable/build/src/backend/app_name/controllers/auth.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns {{main/ns}}.controllers.auth | ||
(:require | ||
[ring.util.response :refer [response]])) | ||
|
||
;;; TODO | ||
;;; Authenticate fn is just a placeholder you need to implement the logic to handle the login data sent from the login page | ||
|
||
(defn authenticate | ||
[state] | ||
(let [req-form-params (get-in state [:request :form-params])] | ||
(assoc state :response (response (str req-form-params))))) |
39 changes: 39 additions & 0 deletions
39
resources/flexiana/xiana_unstable/build/src/backend/app_name/controllers/login.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(ns {{main/ns}}.controllers.login | ||
(:require | ||
[ring.util.response :refer [response]] | ||
[hiccup.page :as hp])) | ||
|
||
(defn page | ||
[] | ||
(hp/html5 | ||
[:body {:style {:height "400px"}} | ||
[:div {:style {:height "100%" | ||
:display "flex" | ||
:align-items "center" | ||
:justify-content "center" | ||
:flex-direction "column"}} | ||
[:h1 {:style {:margin-bottom "80px"}} | ||
(str "{{main/ns}}")] | ||
[:form {:action "/auth" | ||
:method "post"} | ||
[:div {:style {:display "flex" | ||
:flex-direction "column"}} | ||
[:label "Username"] | ||
[:input {:type "text" | ||
:id "username" | ||
:name "username" | ||
:placeholder "Username"}]] | ||
|
||
[:div {:style {:display "flex" | ||
:flex-direction "column"}} | ||
[:label "Password"] | ||
[:input {:type "password" | ||
:id "password" | ||
:name "password" | ||
:placeholder "Password"}]] | ||
[:input {:type "submit" | ||
:value (str "Login")}]]]])) | ||
|
||
(defn login-page | ||
[state] | ||
(assoc state :response (response (page)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters