mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
Update the _examples/mvc/login example - add a Path property at mvc.Response and add a context.Proceed helper function
Former-commit-id: b898901fe4a324e888a6e09c93530cf7a551cf2a
This commit is contained in:
15
_examples/mvc/login/web/views/shared/error.html
Normal file
15
_examples/mvc/login/web/views/shared/error.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<h1>Error.</h1>
|
||||
<h2>An error occurred while processing your request.</h2>
|
||||
|
||||
<h3>{{.Message}}</h3>
|
||||
|
||||
<footer>
|
||||
<h2>Sitemap</h2>
|
||||
<a href="http://localhost:8080/user/register">/user/register</a><br/>
|
||||
<a href="http://localhost:8080/user/login">/user/login</a><br/>
|
||||
<a href="http://localhost:8080/user/logout">/user/logout</a><br/>
|
||||
<a href="http://localhost:8080/user/me">/user/me</a><br/>
|
||||
<h3>requires authentication</h3><br/>
|
||||
<a href="http://localhost:8080/users">/users</a><br/>
|
||||
<a href="http://localhost:8080/users/1">/users/{id}</a><br/>
|
||||
</footer>
|
||||
12
_examples/mvc/login/web/views/shared/layout.html
Normal file
12
_examples/mvc/login/web/views/shared/layout.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{{.Title}}</title>
|
||||
<link rel="stylesheet" type="text/css" href="/public/css/site.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ yield }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
11
_examples/mvc/login/web/views/user/login.html
Normal file
11
_examples/mvc/login/web/views/user/login.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<form action="/user/login" method="POST">
|
||||
<div class="container">
|
||||
<label><b>Username</b></label>
|
||||
<input type="text" placeholder="Enter Username" name="username" required>
|
||||
|
||||
<label><b>Password</b></label>
|
||||
<input type="password" placeholder="Enter Password" name="password" required>
|
||||
|
||||
<button type="submit">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
3
_examples/mvc/login/web/views/user/me.html
Normal file
3
_examples/mvc/login/web/views/user/me.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
Welcome back <strong>{{.User.Firstname}}</strong>!
|
||||
</p>
|
||||
14
_examples/mvc/login/web/views/user/register.html
Normal file
14
_examples/mvc/login/web/views/user/register.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<form action="/user/register" method="POST">
|
||||
<div class="container">
|
||||
<label><b>Firstname</b></label>
|
||||
<input type="text" placeholder="Enter Firstname" name="firstname" required>
|
||||
|
||||
<label><b>Username</b></label>
|
||||
<input type="text" placeholder="Enter Username" name="username" required>
|
||||
|
||||
<label><b>Password</b></label>
|
||||
<input type="password" placeholder="Enter Password" name="password" required>
|
||||
|
||||
<button type="submit">Register</button>
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user