Type toggle targets artist row
This commit is contained in:
@@ -100,7 +100,10 @@ public class ArtistResource {
|
||||
@FormParam("enabled") boolean enabled) {
|
||||
artistService.setTypeEnabled(mbid, primaryType, enabled);
|
||||
CompletableFuture.runAsync(() -> syncService.resyncArtist(mbid));
|
||||
return feedFragment(0, true);
|
||||
FollowedArtist artist = artistService.findArtist(mbid);
|
||||
List<ArtistTypeSetting> settings = artist != null ? artistService.settingsFor(artist) : List.of();
|
||||
return fragments_artist_row.data("artist", artist)
|
||||
.data("settings", settings);
|
||||
}
|
||||
|
||||
private TemplateInstance feedFragment(int offset, boolean autoRefresh) {
|
||||
|
||||
@@ -39,7 +39,11 @@
|
||||
</div>
|
||||
{#else}
|
||||
{#for artist in artists}
|
||||
<div hx-get="/artists/{artist.mbid}/row" hx-trigger="revealed" hx-swap="innerHTML">
|
||||
<div id="artist-{artist.mbid}"
|
||||
hx-get="/artists/{artist.mbid}/row"
|
||||
hx-trigger="revealed"
|
||||
hx-target="this"
|
||||
hx-swap="innerHTML">
|
||||
<div class="loading loading-spinner loading-sm"></div>
|
||||
</div>
|
||||
{/for}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<button class="btn btn-ghost btn-xs text-error"
|
||||
hx-delete="/artists/{artist.mbid}"
|
||||
hx-target="closest div.space-y-3"
|
||||
hx-target="#artist-{artist.mbid}"
|
||||
hx-swap="outerHTML"
|
||||
hx-on::after-request="DiscDrop.refreshFeed()">
|
||||
Unfollow
|
||||
@@ -27,7 +27,7 @@
|
||||
hx-post="/artists/{artist.mbid}/types"
|
||||
hx-vals='{"primaryType":"{s.primaryType}"}'
|
||||
hx-include="this"
|
||||
hx-target="#feed-list"
|
||||
hx-target="#artist-{artist.mbid}"
|
||||
hx-swap="innerHTML"
|
||||
hx-on::after-request="DiscDrop.refreshFeed()"/>
|
||||
<span class="text-xs">{s.primaryType}</span>
|
||||
|
||||
Reference in New Issue
Block a user