root -> breadcrumb
This commit is contained in:
parent
5f6f7b7efe
commit
edf6f9f81a
|
@ -38,13 +38,13 @@ pub enum Entry {
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "git.html")]
|
#[template(path = "git.html")]
|
||||||
pub struct GitMainTemplate<TS, ROOT>
|
pub struct GitMainTemplate<TS, BREADCRUMB>
|
||||||
where for <'a> &'a TS : IntoIterator<Item = &'a Entry>,
|
where for <'a> &'a TS : IntoIterator<Item = &'a Entry>,
|
||||||
for <'a> &'a ROOT : IntoIterator<Item = &'a (String, String)>,
|
for <'a> &'a BREADCRUMB: IntoIterator<Item = &'a (String, String)>,
|
||||||
{
|
{
|
||||||
repo : Repository,
|
repo : Repository,
|
||||||
browse : TS,
|
browse : TS,
|
||||||
root : ROOT,
|
breadcrumb: BREADCRUMB,
|
||||||
user_opt : Option<User>,
|
user_opt : Option<User>,
|
||||||
revisions_nbr : u32,
|
revisions_nbr : u32,
|
||||||
branches_nbr : u32,
|
branches_nbr : u32,
|
||||||
|
@ -116,7 +116,7 @@ pub async fn git_main<T : AuthValidator>(
|
||||||
Ok(GitMainTemplate {
|
Ok(GitMainTemplate {
|
||||||
repo,
|
repo,
|
||||||
browse : entries,
|
browse : entries,
|
||||||
root : path,
|
breadcrumb: path,
|
||||||
user_opt : user,
|
user_opt : user,
|
||||||
revisions_nbr : gitrepo.get_revisions_nbr(),
|
revisions_nbr : gitrepo.get_revisions_nbr(),
|
||||||
branches_nbr : gitrepo.get_branches_nbr(),
|
branches_nbr : gitrepo.get_branches_nbr(),
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<div class="w3-cell">
|
<div class="w3-cell">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="#">{{repo.name}}</a></li>
|
<li><a href="#">{{repo.name}}</a></li>
|
||||||
{% for (dir, prev) in root %}
|
{% for (dir, prev) in breadcrumb %}
|
||||||
<li><a href="{{prev}}">{{dir}}</a></li>
|
<li><a href="{{prev}}">{{dir}}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue