diff --git a/internal/webserver/handler_lists.go b/internal/webserver/handler_lists.go index 6176d45..3f664e0 100644 --- a/internal/webserver/handler_lists.go +++ b/internal/webserver/handler_lists.go @@ -69,13 +69,25 @@ func (app *Application) ListDetailUsers(w http.ResponseWriter, r *http.Request) app.buffered_render_page(w, "tpl/list.tpl", PageGlobalData{TweetTrove: trove}, data) } +func (app *Application) ListDelete(w http.ResponseWriter, r *http.Request) { + list := get_list_from_context(r.Context()) + app.Profile.DeleteList(list.ID) + http.Redirect(w, r, "/lists", 302) +} + func (app *Application) ListDetail(w http.ResponseWriter, r *http.Request) { app.traceLog.Printf("'ListDetail' handler (path: %q)", r.URL.Path) parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/") if len(parts) == 1 && parts[0] == "" { - // No further path; just show the feed - app.ListDetailFeed(w, r) + switch r.Method { + case "DELETE": + app.ListDelete(w, r) + default: + // No further path; just show the feed + app.ListDetailFeed(w, r) + } + return } switch parts[0] { diff --git a/internal/webserver/static/styles.css b/internal/webserver/static/styles.css index cc7e102..8c5fdf7 100644 --- a/internal/webserver/static/styles.css +++ b/internal/webserver/static/styles.css @@ -693,30 +693,32 @@ ul.space-participants-list li { } .users-list-preview { - cursor: pointer; - display: flex; - font-size: 1.5em; + padding: 0.5em 1em; border-color: var(--color-twitter-off-white-dark); border-bottom-style: solid; border-width: 1px; - padding: 0.5em 1em; - align-items: center; } -.users-list-preview span.num-users { +.users-list-preview .list-info-container{ + display: flex; + align-items: center; + font-size: 1.5em; + cursor: pointer; +} +.users-list-preview .list-info-container span.num-users { margin-left: 1em; color: var(--color-twitter-text-gray); } -.users-list-preview .first-N-profile-images { +.users-list-preview .list-info-container .first-N-profile-images { display: flex; align-items: flex-end; margin-left: 1.5em; } -.users-list-preview .first-N-profile-images a { +.users-list-preview .list-info-container .first-N-profile-images a { margin-right: -1.2em; line-height: 0; /* TODO: This is duplicated from `.author-info a` and possibly others */ } -.users-list-preview .first-N-profile-images .ellipsis { +.users-list-preview .list-info-container .first-N-profile-images .ellipsis { margin-left: 1.5em; } diff --git a/internal/webserver/tpl/list_of_lists.tpl b/internal/webserver/tpl/list_of_lists.tpl index 0247458..37d5761 100644 --- a/internal/webserver/tpl/list_of_lists.tpl +++ b/internal/webserver/tpl/list_of_lists.tpl @@ -17,29 +17,35 @@