Skip to content

Commit

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

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

{{define "webhookList" }}

<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>
</div>

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

{{define "webhookNew" }}

New Webhook

{{end}}
44 changes: 2 additions & 42 deletions views/pages/webhook.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,10 @@
</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 "webhookList" .}}{{end}}
</div>
<div class="tab-pane fade" id="new" role="tabpanel"s>
def
{{block "webhookNew" .}}{{end}}
</div>
</div>
</div>
Expand Down

0 comments on commit c6d9256

Please sign in to comment.