Skip to content

Commit

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

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

{{define "webhookNew" }}
{{define "notificationEmail" }}

New Webhook
notification email

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

{{define "webhookNew" }}
{{define "notificationList" }}

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}}
4 changes: 2 additions & 2 deletions views/components/notification/message.gohtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{template "base" . }}

{{define "webhookNew" }}
{{define "notificationMessage" }}

New Webhook
notification Message

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

{{define "webhookNew" }}
{{define "notificationNew" }}

New Webhook
notification new

{{end}}
48 changes: 4 additions & 44 deletions views/pages/notification.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,16 @@
</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 "notificationList" .}}{{end}}
</div>
<div class="tab-pane fade" id="emails" role="tabpanel">
emails
{{block "notificationEmail" .}}{{end}}
</div>
<div class="tab-pane fade" id="messages" role="tabpanel">
messages
{{block "notificationMessage" .}}{{end}}
</div>
<div class="tab-pane fade" id="new" role="tabpanel">
def
{{block "notificationNew" .}}{{end}}
</div>
</div>
</div>
Expand Down

0 comments on commit 9b5bfbf

Please sign in to comment.