-
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.
feat: profile page + longer review userpath (#7)
* feat: profile page + longer review userpath * minor: comment RunID in codereview
- Loading branch information
Showing
10 changed files
with
171 additions
and
45 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package controller | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/Gornak40/crosspawn/internal/alerts" | ||
"github.com/gin-contrib/sessions" | ||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
func (s *Server) ProfileGET(c *gin.Context) { | ||
session := sessions.Default(c) | ||
user := session.Get("user") | ||
|
||
c.HTML(http.StatusOK, "profile.html", gin.H{ | ||
"Title": "Profile GET", | ||
"User": user, | ||
"Flashes": alerts.Get(session), | ||
}) | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ template "header.html" . }} | ||
|
||
<div class="container mt-5"> | ||
<div class="row"> | ||
<div class="col-md-6 offset-md-3"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<form action="/logout" method="POST"> | ||
<legend class="mb-3">User Profile</legend> | ||
<div class="d-flex"> | ||
<h5> | ||
<span class="badge text-bg-info">{{ .User }}</span> | ||
</h5> | ||
</div> | ||
<div class="mb-3 d-flex"> | ||
<!-- TODO: add stats --> | ||
<h5> | ||
<span class="badge text-bg-success"> | ||
<i class="bi bi-patch-plus-fill"></i> 0 | ||
</span> | ||
</h5> | ||
<h5 class="ms-2"> | ||
<span class="badge text-bg-danger"> | ||
<i class="bi bi-patch-minus-fill"></i> 0 | ||
</span> | ||
</h5> | ||
</div> | ||
<button type="submit" class="btn btn-primary btn-lg">Logout</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{{ template "footer.html" . }} |