Last active
September 15, 2023 19:32
-
-
Save rober-m/f4b414ec050c928c64db328037a7734e to your computer and use it in GitHub Desktop.
Login view for blogging project of Haskell Web lesson
This file contains hidden or 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
module Web.View.Sessions.New where | |
import IHP.AuthSupport.View.Sessions.New | |
import Web.View.Prelude | |
instance View (NewView User) where | |
html NewView { .. } = [hsx| | |
<div class="h-100" id="sessions-new"> | |
<div class="d-flex align-items-center"> | |
<div class="w-100"> | |
<div style="max-width: 400px" class="mx-auto mb-5"> | |
<h2 class="mb-3">Please login</h2> | |
{renderForm user} | |
</div> | |
</div> | |
</div> | |
</div> | |
|] | |
renderForm :: User -> Html | |
renderForm user = [hsx| | |
<form method="POST" action={CreateSessionAction}> | |
<div class="form-group mb-2"> | |
<input name="email" value={user.email} type="email" class="form-control" placeholder="E-Mail" required="required" autofocus="autofocus" /> | |
</div> | |
<div class="form-group mb-3"> | |
<input name="password" type="password" class="form-control" placeholder="Password"/> | |
</div> | |
<button type="submit" class="btn btn-primary btn-block">Login</button> | |
</form> | |
|] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment