Login form
This commit is contained in:
@ -4,6 +4,23 @@
|
|||||||
|
|
||||||
{{ block mainContent() }}
|
{{ block mainContent() }}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<form class="mb-5 col-4 ms-auto me-auto" method="post" action="/">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Email address</label>
|
||||||
|
<input type="email" name="email" class="form-control" value="edkirin@gmail.com">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Password</label>
|
||||||
|
<input type="text" name="password" class="form-control" value="tralala">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-success">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="lead">
|
<div class="lead">
|
||||||
<p>Bacon ipsum dolor amet leberkas kevin meatball pork loin beef ribs prosciutto, turducken bacon bresaola tri-tip. Strip steak flank shankle, sirloin short ribs shoulder meatball pork chop kevin ribeye jowl ham pork belly turducken jerky. Flank tongue short loin ham hock brisket turducken tail filet mignon cupim. Pork capicola buffalo kevin jowl chicken. Filet mignon brisket pig, landjaeger sausage cow fatback drumstick chicken buffalo tenderloin spare ribs.</p>
|
<p>Bacon ipsum dolor amet leberkas kevin meatball pork loin beef ribs prosciutto, turducken bacon bresaola tri-tip. Strip steak flank shankle, sirloin short ribs shoulder meatball pork chop kevin ribeye jowl ham pork belly turducken jerky. Flank tongue short loin ham hock brisket turducken tail filet mignon cupim. Pork capicola buffalo kevin jowl chicken. Filet mignon brisket pig, landjaeger sausage cow fatback drumstick chicken buffalo tenderloin spare ribs.</p>
|
||||||
<p>Swine shankle porchetta pancetta. Buffalo chicken turducken ground round kevin shoulder, salami pig t-bone beef ribs tri-tip tongue pork belly doner. Landjaeger meatloaf short loin biltong. Alcatra tongue shankle, tri-tip pancetta porchetta tenderloin corned beef pastrami rump. Bresaola chislic beef kielbasa sausage, ball tip burgdoggen boudin capicola short loin tenderloin buffalo landjaeger.</p>
|
<p>Swine shankle porchetta pancetta. Buffalo chicken turducken ground round kevin shoulder, salami pig t-bone beef ribs tri-tip tongue pork belly doner. Landjaeger meatloaf short loin biltong. Alcatra tongue shankle, tri-tip pancetta porchetta tenderloin corned beef pastrami rump. Bresaola chislic beef kielbasa sausage, ball tip burgdoggen boudin capicola short loin tenderloin buffalo landjaeger.</p>
|
||||||
|
|||||||
@ -1,11 +1,33 @@
|
|||||||
package views
|
package views
|
||||||
|
|
||||||
import "github.com/kataras/iris/v12"
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/kataras/iris/v12"
|
||||||
|
)
|
||||||
|
|
||||||
func GetIndexPage(ctx iris.Context) {
|
func GetIndexPage(ctx iris.Context) {
|
||||||
params1 := []string{"param 1", "param 2", "param 3"}
|
if err := ctx.View("pages/index.jet"); err != nil {
|
||||||
ctx.ViewData("params1", params1)
|
showError(ctx, err)
|
||||||
ctx.ViewData("users", users)
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type loginForm struct {
|
||||||
|
Email string `form:"email"`
|
||||||
|
Password string `form:"password"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func PostIndexPage(ctx iris.Context) {
|
||||||
|
var form loginForm
|
||||||
|
err := ctx.ReadForm(&form)
|
||||||
|
if err != nil {
|
||||||
|
ctx.StopWithError(iris.StatusBadRequest, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("email:", form.Email)
|
||||||
|
fmt.Println("password:", form.Password)
|
||||||
|
|
||||||
if err := ctx.View("pages/index.jet"); err != nil {
|
if err := ctx.View("pages/index.jet"); err != nil {
|
||||||
showError(ctx, err)
|
showError(ctx, err)
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import "github.com/kataras/iris/v12"
|
|||||||
|
|
||||||
func CreateRouter(app *iris.Application) {
|
func CreateRouter(app *iris.Application) {
|
||||||
app.Get("/", GetIndexPage)
|
app.Get("/", GetIndexPage)
|
||||||
|
app.Post("/", PostIndexPage)
|
||||||
|
|
||||||
app.Get("/users", GetUsersPage)
|
app.Get("/users", GetUsersPage)
|
||||||
app.Get("/about", GetAboutPage)
|
app.Get("/about", GetAboutPage)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user