Skip to content

Commit

Permalink
Plan filter by group
Browse files Browse the repository at this point in the history
  • Loading branch information
aceberg committed Feb 20, 2024
1 parent a4d42b4 commit eaad6a0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ All notable changes to this project will be documented in this file.
- Add/Edit plan
- Button width in config
- Sort groups and tasks
- Layout toggle button
Binary file modified assets/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion internal/web/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ func planHandler(c *gin.Context) {

guiData.Config = appConfig

gr, ok := c.GetQuery("gr")

for i := range allPlans {
allPlans[i].ID = i + 1
if ok && (allPlans[i].Group == gr) {
guiData.Plans = append(guiData.Plans, allPlans[i])
}
}

guiData.Plans = allPlans
if !ok {
guiData.Plans = allPlans
}

c.HTML(http.StatusOK, "header.html", guiData)
c.HTML(http.StatusOK, "plan.html", guiData)
Expand Down
2 changes: 1 addition & 1 deletion internal/web/public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function genHTML(gr, checks) {
hcol = '<div class="col-md-auto">';
hdiv = '</div>';
}
let html = vcol + `<h5>${gr}</h5>`;
let html = vcol + `<a href="/plan/?gr=${gr}"><h5>${gr}</h5></a>`;
let len = checks.length;

for (let i = 0 ; i < len; i++) {
Expand Down
4 changes: 2 additions & 2 deletions internal/web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<div class="col-md"></div>
<div class="col-md">
<div class="gap-3 hstack">
<button onclick='setFormDate(-1)' class="btn tr-button"><i class="bi bi-arrow-left-square"></i></button>
<button onclick='setFormDate(-1)' class="btn tr-button"><i class="bi bi-arrow-left-square" title="Back"></i></button>
<input type="date" class="m-auto form-control" onchange='setFormDate()' id="realDate" style="width: 70%;">
<button onclick='setFormDate(+1)' class="btn tr-button"><i class="bi bi-arrow-right-square"></i></button>
<button onclick='setFormDate(+1)' class="btn tr-button"><i class="bi bi-arrow-right-square" title="Forward"></i></button>
<button onclick='updatePlan()' class="btn tr-button" title="Update plan">
<i class="bi bi-arrow-clockwise"></i>
</button>
Expand Down
3 changes: 3 additions & 0 deletions internal/web/templates/plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<body>
<div class="container-lg mt-3">
<div class="card border-primary">
<div class="card-header">
<h5>Plan</h5>
</div>
<div class="card-body table-responsive">
<table class="table table-striped table-hover">
<thead>
Expand Down

0 comments on commit eaad6a0

Please sign in to comment.