Update dependencies
This commit is contained in:
30
src/main.rs
30
src/main.rs
@@ -43,17 +43,17 @@ async fn page<'r>(
|
||||
for (key, value) in query.segments() {
|
||||
if key == "action" {
|
||||
if value == "edit" {
|
||||
return PageResponder::Page(RawHtml(renderer.render_page_template("edit.html", &historian, &page, toml! {
|
||||
return PageResponder::Page(RawHtml(renderer.render_page_template("edit.html", &historian, &page, &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())))
|
||||
})))
|
||||
} else if value == "history" {
|
||||
return PageResponder::Page(RawHtml(renderer.template("history.html")
|
||||
.with_historian(&historian)
|
||||
.with_page(&page)
|
||||
.insert("revisions", &historian.get_history_of_page(&page))
|
||||
.insert("options", toml! {
|
||||
.insert("options", &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())
|
||||
})
|
||||
.render()))
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,9 @@ async fn page<'r>(
|
||||
.with_page(&page)
|
||||
.insert("revision", &revision)
|
||||
.insert("content", &historian.get_page_text_of_revision(&page, &revision).unwrap())
|
||||
.insert("options", toml! {
|
||||
.insert("options", &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())
|
||||
})
|
||||
.render()))
|
||||
}
|
||||
}
|
||||
@@ -77,9 +77,9 @@ async fn page<'r>(
|
||||
if page.is_directory && !origin.path().ends_with("/") {
|
||||
PageResponder::Redirect(Redirect::to(origin.path().as_str().to_owned() + "/"))
|
||||
} else {
|
||||
PageResponder::Page(RawHtml(renderer.render_page(&historian, &page, toml! {
|
||||
PageResponder::Page(RawHtml(renderer.render_page(&historian, &page, &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())))
|
||||
})))
|
||||
}
|
||||
}).or_else(|| {
|
||||
if let Some(query) = origin.query() {
|
||||
@@ -91,9 +91,9 @@ async fn page<'r>(
|
||||
.insert("page", &historian.start_page(path_str))
|
||||
.insert("content", "")
|
||||
.insert("ancestors", &Vec::<String>::with_capacity(0))
|
||||
.insert("options", toml! {
|
||||
.insert("options", &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())
|
||||
})
|
||||
.render())))
|
||||
}
|
||||
}
|
||||
@@ -135,9 +135,9 @@ fn action(
|
||||
.insert("subaction", action.subaction)
|
||||
.insert("summary", action.summary)
|
||||
.insert("author", action.author)
|
||||
.insert("options", toml! {
|
||||
.insert("options", &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())
|
||||
})
|
||||
.render()))
|
||||
} else {
|
||||
historian.submit_edit(&page, &Edit {
|
||||
@@ -159,12 +159,12 @@ fn action(
|
||||
}
|
||||
}
|
||||
|
||||
PageResponder::Page(RawHtml(renderer.render_template("message.html", &historian, toml! {
|
||||
PageResponder::Page(RawHtml(renderer.render_template("message.html", &historian, &toml! {
|
||||
header = "Invalid Action"
|
||||
message = "Action was invalid or misunderstood"
|
||||
}.as_table().unwrap(), toml! {
|
||||
}, &toml! {
|
||||
dynamic = true
|
||||
}.as_table().unwrap())))
|
||||
})))
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
|
||||
Reference in New Issue
Block a user