use super::*;
#[derive(Boilerplate)]
pub(crate) struct InscriptionsHtml {
pub(crate) inscriptions: Vec<InscriptionId>,
pub(crate) prev: Option<usize>,
pub(crate) next: Option<usize>,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct InscriptionsJson {
pub inscriptions: Vec<InscriptionId>,
pub more: bool,
pub page_index: usize,
}
impl PageContent for InscriptionsHtml {
fn title(&self) -> String {
"Inscriptions".into()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn without_prev_and_next() {
assert_regex_match!(
InscriptionsHtml {
inscriptions: vec![inscription_id(1), inscription_id(2)],
prev: None,
next: None,
},
"
<h1>All Inscriptions</h1>
<div class=thumbnails>
<a href=/inscription/1{64}i1><iframe .* src=/preview/1{64}i1></iframe></a>
<a href=/inscription/2{64}i2><iframe .* src=/preview/2{64}i2></iframe></a>
</div>
.*
prev
next
.*
"