Skip to content

Commit

Permalink
don't show bogus date for users without memberTo
Browse files Browse the repository at this point in the history
  • Loading branch information
foodelevator committed Nov 13, 2024
1 parent 9751058 commit 550fe94
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 55 deletions.
5 changes: 3 additions & 2 deletions handlers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ func adminUsersForm(s *service.Service, w http.ResponseWriter, r *http.Request)
if err != nil && offsetStr != "" {
return httputil.BadRequest("Invalid int for offset")
}
users, err := s.DB.ListUsers(r.Context(), database.ListUsersParams{
us, err := s.DB.ListUsers(r.Context(), database.ListUsersParams{
Search: search,
Limit: 21,
Offset: int32(offset),
Year: year,
})
users := service.DBUsersToModel(us)
if err != nil {
return err
}
Expand All @@ -110,7 +111,7 @@ func adminUsersForm(s *service.Service, w http.ResponseWriter, r *http.Request)
if err != nil {
return err
}
return templates.MemberList(service.DBUsersToModel(users), search, int(offset), more, years, year)
return templates.MemberList(users, search, int(offset), more, years, year)
}

func invites(s *service.Service, w http.ResponseWriter, r *http.Request) httputil.ToResponse {
Expand Down
41 changes: 2 additions & 39 deletions pkg/static/public/style.dist.css
Original file line number Diff line number Diff line change
Expand Up @@ -688,24 +688,12 @@ html {
grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-cols-subgrid {
grid-template-columns: subgrid;
}

.grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-5 {
grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-cols-\[repeat\(4\2c auto\)\] {
grid-template-columns: repeat(4,auto);
}

.grid-rows-subgrid {
grid-template-rows: subgrid;
.grid-cols-subgrid {
grid-template-columns: subgrid;
}

.flex-col {
Expand Down Expand Up @@ -752,24 +740,11 @@ html {
gap: 2rem;
}

.gap-x-1 {
-moz-column-gap: 0.25rem;
column-gap: 0.25rem;
}

.gap-y-2 {
row-gap: 0.5rem;
}

.gap-x-2 {
-moz-column-gap: 0.5rem;
column-gap: 0.5rem;
}

.gap-y-1 {
row-gap: 0.25rem;
}

.overflow-auto {
overflow: auto;
}
Expand Down Expand Up @@ -1105,18 +1080,6 @@ html {
}
}

.\[\&\>\*\]\:h-4>* {
height: 1rem;
}

.\[\&\>\*\]\:h-6>* {
height: 1.5rem;
}

.\[\&\>\*\]\:h-8>* {
height: 2rem;
}

.\[\&\>\*\]\:h-7>* {
height: 1.75rem;
}
Expand Down
6 changes: 5 additions & 1 deletion templates/admin.templ
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ templ MemberList(users []models.User, search string, offset int, more bool, year
<span>{ user.KTHID }</span>
<span>{ user.FirstName } { user.FamilyName }</span>
<span>{ user.YearTag }</span>
<span>{ user.MemberTo.Format(time.DateOnly) }</span>
<span>
if user.MemberTo != (time.Time{}) {
{ user.MemberTo.Format(time.DateOnly) }
}
</span>
</div>
}
for i := len(users); i < 20; i++ {
Expand Down
28 changes: 15 additions & 13 deletions templates/admin_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 550fe94

Please sign in to comment.