There is NO WARRANTY. -->
{% for b in bundles %}
<div class="bundle">
-<a class="b_link" href=""><code class="b_id">{{ b.id }}</code></a>
+<a class="b_link" href="b.url"><code class="b_id">{{ b.id }}</code></a>
<span class="b_title">{{ b.title }}</span>
</div>
{% endfor %}
//---------- AccountScope and AccountName (ncl. string format) ----------
impl AccountScope {
- /// Return value is parseable and filesystem- and html-safe
+ /// Return value is parseable and filesystem- and url- and html-safe
#[throws(E)]
pub fn display_name<'out,
NS: IntoIterator<Item=&'out &'out str>,
AssetUrlToken(buf)
}
}
+hformat_as_display!{AssetUrlToken}
+
#[derive(Error,Debug,Copy,Clone,Serialize)]
pub struct BadAssetUrlToken;
display_as_debug!{BadAssetUrlToken}
#[derive(Serialize,Debug)]
struct RenderBundle {
id: Html,
+ url: Html,
title: Html,
}
let bundles = self.iter().filter_map(|(&id, state)| {
if_let!{ State::Loaded(Loaded { meta }) = state; else return None; }
let BundleMeta { title } = meta;
- let id = hformat!("{}", id);
let title = Html::from_txt(title);
- Some(RenderBundle { id, title })
+ let token = id.token(ig);
+ let url = hformat!("/_/bundle/{}/{}/{}", &*ig.name, &id, &token);
+ let id = hformat!("{}", id);
+ Some(RenderBundle { id, url, title })
}).collect();
Html::from_html_string(
)?
}
}
+hformat_as_display!{InstanceName}
fn link_a_href(k: &HtmlStr, v: &str) -> Html {
hformat!("<a href={}>{}</a>", v, k)