Skip to content

Commit

Permalink
request componenets
Browse files Browse the repository at this point in the history
  • Loading branch information
mstgnz committed Jun 20, 2024
1 parent 9b5bfbf commit a955fc0
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 88 deletions.
2 changes: 1 addition & 1 deletion handler/web/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import (
type RequestHandler struct{}

func (h *RequestHandler) HomeHandler(w http.ResponseWriter, r *http.Request) error {
return config.Render(w, "request", map[string]any{})
return config.Render(w, "request", map[string]any{}, "request/list", "request/header", "request/new")
}
44 changes: 42 additions & 2 deletions views/components/request/header.gohtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
{{template "base" . }}

{{define "webhookNew" }}
{{define "requestHeader" }}

New Webhook
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
<!-- Pagination -->
<div class="mt-4">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>

{{end}}
47 changes: 47 additions & 0 deletions views/components/request/list.gohtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{template "base" . }}

{{define "requestList" }}

<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
<!-- Pagination -->
<div class="mt-4">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>

{{end}}
4 changes: 2 additions & 2 deletions views/components/request/new.gohtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{template "base" . }}

{{define "webhookNew" }}
{{define "requestNew" }}

New Webhook
New request

{{end}}
86 changes: 3 additions & 83 deletions views/pages/request.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,93 +19,13 @@
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="lists" role="tabpanel">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
<!-- Pagination -->
<div class="mt-4">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>
{{block "requestList" .}}{{end}}
</div>
<div class="tab-pane fade" id="headers" role="tabpanel">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
<!-- Pagination -->
<div class="mt-4">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>
{{block "requestHeader" .}}{{end}}
</div>
<div class="tab-pane fade" id="new" role="tabpanel">
def
{{block "requestNew" .}}{{end}}
</div>
</div>
</div>
Expand Down

0 comments on commit a955fc0

Please sign in to comment.