Add a calendar to schedule a recipe to a chosen date (WIP)
This commit is contained in:
parent
d9449de02b
commit
9d3f9e9c60
15 changed files with 441 additions and 62 deletions
|
|
@ -1,6 +1,8 @@
|
|||
mod calendar;
|
||||
mod modal_dialog;
|
||||
mod on_click;
|
||||
mod recipe_edit;
|
||||
mod recipe_view;
|
||||
mod request;
|
||||
mod toast;
|
||||
mod utils;
|
||||
|
|
@ -20,16 +22,24 @@ pub fn main() -> Result<(), JsValue> {
|
|||
let location = window().location().pathname()?;
|
||||
let path: Vec<&str> = location.split('/').skip(1).collect();
|
||||
|
||||
if let ["recipe", "edit", id] = path[..] {
|
||||
let id = id.parse::<i64>().unwrap(); // TODO: remove unwrap.
|
||||
if let Err(error) = recipe_edit::setup_page(id) {
|
||||
log!(error);
|
||||
// if let ["recipe", "edit", id] = path[..] {
|
||||
match path[..] {
|
||||
["recipe", "edit", id] => {
|
||||
let id = id.parse::<i64>().unwrap(); // TODO: remove unwrap.
|
||||
if let Err(error) = recipe_edit::setup_page(id) {
|
||||
log!(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Disable: user editing data are now submitted as classic form data.
|
||||
// ["user", "edit"] => {
|
||||
// handles::user_edit(document)?;
|
||||
// }
|
||||
["recipe", "view", id] => {
|
||||
let id = id.parse::<i64>().unwrap(); // TODO: remove unwrap.
|
||||
if let Err(error) = recipe_view::setup_page(id) {
|
||||
log!(error);
|
||||
}
|
||||
}
|
||||
_ => (), // Disable: user editing data are now submitted as classic form data.
|
||||
// ["user", "edit"] => {
|
||||
// handles::user_edit(document)?;
|
||||
// }
|
||||
}
|
||||
|
||||
let select_language: HtmlSelectElement = by_id("select-website-language");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue