Add the ability to delete files #82
|
@ -137,11 +137,6 @@ impl Input {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_value(mut self, val: &str) -> Self {
|
|
||||||
self.value = Some(val.to_owned());
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn with_attributes<'a>(
|
pub fn with_attributes<'a>(
|
||||||
mut self,
|
mut self,
|
||||||
values: impl IntoIterator<Item = (&'a str, &'a str)>,
|
values: impl IntoIterator<Item = (&'a str, &'a str)>,
|
||||||
|
@ -156,31 +151,6 @@ impl Input {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub struct Label {
|
|
||||||
target: String,
|
|
||||||
text: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Label {
|
|
||||||
pub fn new(target: &str, text: &str) -> Self {
|
|
||||||
Self {
|
|
||||||
target: target.to_owned(),
|
|
||||||
text: text.to_owned(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Html for Label {
|
|
||||||
fn to_html_string(&self) -> String {
|
|
||||||
format!(
|
|
||||||
"<label for=\"{target}\">{text}</label>",
|
|
||||||
target = self.target,
|
|
||||||
text = self.text
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Button {
|
pub struct Button {
|
||||||
ty: Option<String>,
|
ty: Option<String>,
|
||||||
|
|
|
@ -92,7 +92,7 @@ pub fn thumbnail(info: &FileInfo) -> Container {
|
||||||
format!("/{}", *info.id),
|
format!("/{}", *info.id),
|
||||||
Container::default()
|
Container::default()
|
||||||
.with_attributes([("class", "thumbnail")])
|
.with_attributes([("class", "thumbnail")])
|
||||||
.with_image(&format!("{}/tn", *info.id), "test data")
|
.with_image(format!("{}/tn", *info.id), "test data")
|
||||||
.to_html_string(),
|
.to_html_string(),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue