@:text_input("title", Some("Collection Title"), Some(&collection.title), false) @:text_area("description", Some("Collection Description"), Some(&collection.description), false) @:button("Update Collection", ButtonKind::Submit) @:button_link("Delete Collection", &state.delete_collection_path(collection_id, token, false), ButtonKind::Outline)
@:image(entry, state) @:text_input("title", Some("Image Title"), entry.title.as_deref(), entry.file_parts().is_none()) @:text_area("description", Some("Image Description"), entry.description.as_deref(), entry.file_parts().is_none()) @:text_input("link", Some("Image Link"), entry.link.as_ref().map(|l| l.as_str()), entry.file_parts().is_none()) @if let Some(upload_id) = entry.upload_id() { @:button_link("Refresh", &state.edit_collection_path(collection_id, token), ButtonKind::Submit) } @if let Some((filename, delete_token)) = entry.file_parts() { @:button("Update Image", ButtonKind::Submit) @:button_link("Delete Image", &state.delete_entry_path(collection_id, *id, token, false), ButtonKind::Outline) } @if i != 0 { @:button_link("Move Up", &state.move_entry_path(collection_id, *id, token, Direction::Up), ButtonKind::Outline) } @if (i + 1) != entries.len() { @:button_link("Move Down", &state.move_entry_path(collection_id, *id, token, Direction::Down), ButtonKind::Outline) }
Add Image @:file_input("images[]", Some("Select Image"), Some(crate::accept()), false) @:button("Upload", ButtonKind::Submit)