{% macro header(repo: Option<&Repository> = None, branches: Vec = Vec::new(), current_ref: Option<&Ref> = None) %} {% if let Some(repo) = repo && let Some(current_ref) = current_ref %} logo index : {{ repo.name }}
{{ repo.description }} {% else %} logo y2w8 Repos y2w8 git repositories, powered by rsgit {% endif %} {% endmacro %} {% macro repo_tabs(repo: Repository, current_ref: Ref, query: PageQuery, active: str) %} {% decl parameters %} {% if let Some(id) = query.id %} {% let parameters %}?id={{ id }}{% endlet %} about summary refs log tree commit diff {% else if let Some(head) = query.head %} {% let parameters %}?h={{ head }}{% endlet %} about summary refs log tree commit diff {% else %} about summary refs log tree commit diff {% endif %}
{% endmacro %} {% macro branches(branches, branches_has_more, has_prev, page, mode) %} Branch Commit message Author Age {% for branch in branches %} {{ branch.name }} {{ branch.last_commit.summary()? }} {{ branch.author.name }} {% let time = branch.author.time.format_relative() %} {{ time.0 }} {% endfor %} {% if mode == "heads" %} {% if has_prev %} {% let offset = offset.saturating_sub(PAGE_SIZE) %} {% if offset > 0 %} [prev] {% else %} [prev] {% endif %} {% endif %} {% if branches_has_more %} [next] {% endif %} {% else if branches_has_more %} [...] {% endif %} {% endmacro %} {% macro tags(tags, tags_has_more, has_prev, page, mode) %} Tag Download Author Age {% for tag in tags %} {{ tag.name }} {{ tag.name }}.tar.gz {% if let Some(tagger) = tag.tagger %} {{ tagger.name }} {% endif %} {% let time = tag.time.format_relative() %} {{ time.0 }} {% endfor %} {% if mode == "tags" %} {% if has_prev %} {% let offset = offset.saturating_sub(PAGE_SIZE) %} {% if offset > 0 %} [prev] {% else %} [prev] {% endif %} {% endif %} {% if tags_has_more %} [next] {% endif %} {% else if tags_has_more %} [...] {% endif %} {% endmacro %} {% macro commits(commits, commits_has_more, has_prev, page, mode) %} Age Commit message Author {% for commit in commits %} {% let time = commit.author.time.format_relative() %} {{ time.0 }} {{ commit.summary()? | truncate(80)}} {% if commit.is_head(repo)? %}HEAD{% endif %} {% for branch in commit.branch_tips(repo)? %} {{ branch }} {% endfor %} {{ commit.author.name }} {% endfor %} {% if mode == "log" %} {% if has_prev %} {% let offset = offset.saturating_sub(PAGE_SIZE) %} {% if offset > 0 %} [prev] {% else %} [prev] {% endif %} {% endif %} {% if commits_has_more %} [next] {% endif %} {% else if commits_has_more %} [...] {% endif %} {% endmacro %}