fix: pass english and japanese titles to watchlist dropdown
This commit is contained in:
@@ -206,7 +206,7 @@ func AnimeDetails(anime jikan.Anime, currentStatus string) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = WatchlistDropdown(anime.MalID, anime.Title, anime.ImageURL(), currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = WatchlistDropdown(anime.MalID, anime.Title, anime.TitleEnglish, anime.TitleJapanese, anime.ImageURL(), currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -477,7 +477,7 @@ func joinNames(entities []jikan.NamedEntity) string {
|
||||
return strings.Join(names, ", ")
|
||||
}
|
||||
|
||||
func WatchlistDropdown(animeID int, animeTitle string, animeImage string, currentStatus string) templ.Component {
|
||||
func WatchlistDropdown(animeID int, animeTitle string, animeTitleEnglish string, animeTitleJapanese string, animeImage string, currentStatus string) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
@@ -526,23 +526,23 @@ func WatchlistDropdown(animeID int, animeTitle string, animeImage string, curren
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeImage, "watching", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, "watching", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeImage, "completed", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, "completed", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeImage, "on_hold", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, "on_hold", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeImage, "dropped", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, "dropped", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeImage, "plan_to_watch", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = dropdownStatusOption(animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, "plan_to_watch", currentStatus).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -573,7 +573,7 @@ func WatchlistDropdown(animeID int, animeTitle string, animeImage string, curren
|
||||
})
|
||||
}
|
||||
|
||||
func dropdownStatusOption(animeID int, animeTitle string, animeImage string, status string, currentStatus string) templ.Component {
|
||||
func dropdownStatusOption(animeID int, animeTitle string, animeTitleEnglish string, animeTitleJapanese string, animeImage string, status string, currentStatus string) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
@@ -617,9 +617,9 @@ func dropdownStatusOption(animeID int, animeTitle string, animeImage string, sta
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var29 string
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf(`{"anime_id": "%d", "anime_title": "%s", "anime_image": "%s", "status": "%s"}`, animeID, animeTitle, animeImage, status))
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf(`{"anime_id": "%d", "anime_title": "%s", "anime_title_english": "%s", "anime_title_japanese": "%s", "anime_image": "%s", "status": "%s"}`, animeID, animeTitle, animeTitleEnglish, animeTitleJapanese, animeImage, status))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/anime.templ`, Line: 182, Col: 144}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/anime.templ`, Line: 182, Col: 242}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user