@:text_input_html("title", Some("Collection Title"), Some(&collection.title), false) @:text_area_html("description", Some("Collection Description"), Some(&collection.description), false) @:button_html("Update Collection", ButtonKind::Submit) @:button_link_html("Delete Collection", &state.delete_collection_path(collection_id, token, false), ButtonKind::Outline)
@:image_html(*id, entry, state) @:text_input_html("title", Some("Image Title"), entry.title.as_deref(), entry.file_parts().is_none()) @:text_area_html("description", Some("Image Description"), entry.description.as_deref(), entry.file_parts().is_none()) @:text_input_html("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_html("Refresh", "javascript:window.location.reload(true);", ButtonKind::Submit) } @if let Some((filename, delete_token)) = entry.file_parts() { @:button_html("Update Image", ButtonKind::Submit) @:button_link_html("Delete Image", &state.delete_entry_path(collection_id, *id, token, false), ButtonKind::Outline) } @if i != 0 { @:button_link_html("Move Up", &state.move_entry_path(collection_id, *id, token, Direction::Up), ButtonKind::Outline) } @if (i + 1) != entries.len() { @:button_link_html("Move Down", &state.move_entry_path(collection_id, *id, token, Direction::Down), ButtonKind::Outline) }
Add Image @:file_input_html("images[]", Some("Select Image"), Some(crate::accept()), false) @:button_html("Upload", ButtonKind::Submit)