}
}
+pub struct AbbrevPresentationLayout(pub PresentationLayout);
+
+impl<'r> FromParam<'r> for AbbrevPresentationLayout {
+ type Error = ();
+ #[throws(Self::Error)]
+ fn from_param(param: &'r RawStr) -> Self {
+ AbbrevPresentationLayout(match param.as_str() {
+ "p "=> PL::Portrait,
+ "l" => PL::Landscape,
+ _ => throw!(())
+ })
+ }
+}
+
#[derive(Debug,Serialize,Deserialize)]
struct ApiPiece<O : ApiPieceOp> {
ctoken : RawToken,
loading(PresentationLayout::Portrait, ptoken)?
}
// xxx also do p, make it an account/player property
-#[get("/l")]
+#[get("/<layout>")]
#[throws(OE)]
-fn loading_l(ptoken: WholeQueryString) -> Template {
- loading(PresentationLayout::Landscape, ptoken)?
+fn loading_l(layout: AbbrevPresentationLayout, ptoken: WholeQueryString)
+ -> Template {
+ loading(layout.0, ptoken)?
}
#[throws(OE)]
pub use crate::cmdlistener::*;
pub use crate::mgmtchannel::*;
pub use crate::api::{Lens,TransparentLens,ApiPieceOpError};
-pub use crate::api::{PresentationLayout};
+pub use crate::api::{PresentationLayout,AbbrevPresentationLayout};
pub use crate::utils::*;
pub use crate::spec::*;
pub use crate::debugreader::DebugReader;