ggdgsdbsdbbb / templates / layout / repo_menu.html
63 lines · 60 sloc · 5.82 KB · 1fbadcea1b606763dc692b8ffd2f84b3648759cf
Raw
1<div class="repo-title-bar">
2 @if repo.user_name != ''
3 <a class="repo-author" href='/@repo.user_name'>@repo.user_name</a>
4 <p class="slash">/</p>
5 @end
6 <a class="repo-name" href='/@repo.user_name/@repo.name'>@repo.name</a>
7
8 @if ctx.is_tree && ctx.path_split.len > 1
9 @for idx, segment in ctx.path_split
10 @if idx > 0
11 <p class="slash">/</p>
12 <a class="repo-name" href='/@repo.user_name/@{ctx.make_path(ctx.branch, idx)}'>@segment</a>
13 @end
14 @end
15 @else
16 @if repo.is_public
17 <span class="repo-visibility">Public</span>
18 @else
19 <span class="repo-visibility repo-visibility--private">Private</span>
20 @end
21 @end
22
23 @if repo.user_id == ctx.user.id
24 <a class='repo-settings-link' href="/@repo.user_name/@repo.name/settings">
25 Settings
26 </a>
27 @end
28</div>
29
30<div class='repo-stats'>
31 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/@repo.primary_branch/commits/0'>
32 <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 255.531c.253 136.64-111.18 248.372-247.82 248.468-59.015.042-113.223-20.53-155.822-54.911-11.077-8.94-11.905-25.541-1.839-35.607l11.267-11.267c8.609-8.609 22.353-9.551 31.891-1.984C173.062 425.135 212.781 440 256 440c101.705 0 184-82.311 184-184 0-101.705-82.311-184-184-184-48.814 0-93.149 18.969-126.068 49.932l50.754 50.754c10.08 10.08 2.941 27.314-11.313 27.314H24c-8.837 0-16-7.163-16-16V38.627c0-14.254 17.234-21.393 27.314-11.314l49.372 49.372C129.209 34.136 189.552 8 256 8c136.81 0 247.747 110.78 248 247.531zm-180.912 78.784l9.823-12.63c8.138-10.463 6.253-25.542-4.21-33.679L288 256.349V152c0-13.255-10.745-24-24-24h-16c-13.255 0-24 10.745-24 24v135.651l65.409 50.874c10.463 8.137 25.541 6.253 33.679-4.21z"></path></svg>
33 @{app.format_commits_count(repo, repo.primary_branch, ctx.lang)}
34 </a>
35 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/issues'>
36 <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="exclamation-circle" class="svg-inline--fa fa-exclamation-circle fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>
37 @repo.format_nr_open_issues(ctx.lang)
38 </a>
39 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/pulls'>
40 <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M384 144c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 36.4 24.3 67.1 57.5 76.8-.6 16.1-4.2 28.5-11 36.9-15.4 19.2-49.3 22.4-85.2 25.7-28.2 2.6-57.4 5.4-81.3 16.9v-144c32.5-10.2 56-40.5 56-76.3 0-44.2-35.8-80-80-80S0 35.8 0 80c0 35.8 23.5 66.1 56 76.3v199.3C23.5 365.9 0 396.2 0 432c0 44.2 35.8 80 80 80s80-35.8 80-80c0-34-21.2-63.1-51.2-74.6 3.1-5.2 7.8-9.8 14.9-13.4 16.2-8.2 40.4-10.4 66.1-12.8 42.2-3.9 90-8.4 118.2-43.4 14-17.4 21.1-39.8 21.6-67.9 31.6-10.8 54.4-40.7 54.4-75.9zM80 64c8.8 0 16 7.2 16 16s-7.2 16-16 16-16-7.2-16-16 7.2-16 16-16zm0 384c-8.8 0-16-7.2-16-16s7.2-16 16-16 16 7.2 16 16-7.2 16-16 16zm224-320c8.8 0 16 7.2 16 16s-7.2 16-16 16-16-7.2-16-16 7.2-16 16-16z"></path></svg>
41 @repo.format_nr_open_prs(ctx.lang)
42 </a>
43 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/contributors'>
44 <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z"></path></svg>
45 @repo.format_nr_contributors(ctx.lang)
46 </a>
47 @if repo.discussions_enabled()
48 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/discussions'>
49 <svg aria-hidden="true" focusable="false" viewBox="0 0 16 16"><path fill="currentColor" d="M1.5 2.75A.75.75 0 0 1 2.25 2h11.5a.75.75 0 0 1 .75.75v8.5a.75.75 0 0 1-.75.75H5.06l-2.573 2.573A.75.75 0 0 1 1.5 13.94Z"/></svg>
50 %discussions
51 </a>
52 @end
53 @if repo.projects_enabled()
54 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/projects'>
55 <svg aria-hidden="true" focusable="false" viewBox="0 0 16 16"><path fill="currentColor" d="M1.75 0A1.75 1.75 0 0 0 0 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0 0 16 14.25V1.75A1.75 1.75 0 0 0 14.25 0Zm12.5 1.5a.25.25 0 0 1 .25.25v12.5a.25.25 0 0 1-.25.25H1.75a.25.25 0 0 1-.25-.25V1.75a.25.25 0 0 1 .25-.25ZM5 3.75v8.5a.75.75 0 0 1-1.5 0v-8.5a.75.75 0 0 1 1.5 0Zm3.5 0v5.5a.75.75 0 0 1-1.5 0v-5.5a.75.75 0 0 1 1.5 0Zm3.5 0v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 1.5 0Z"/></svg>
56 %projects
57 </a>
58 @end
59 <a class='repo-stat-item' href='/@repo.user_name/@repo.name/ci'>
60 <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M488.2 383.8l-64.4-64.4c-12-12-28.3-18.7-45.3-18.7h-21.4l-64-128h37.7c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24H181.2c-13.3 0-24 10.7-24 24v60.7c0 13.3 10.7 24 24 24h37.7l-64 128h-21.4c-17 0-33.3 6.7-45.3 18.7l-64.4 64.4c-12 12-18.7 28.3-18.7 45.3V488c0 13.3 10.7 24 24 24h453.8c13.3 0 24-10.7 24-24v-58.9c0-17-6.7-33.3-18.7-45.3zM209.2 116h93.6v8.7h-93.6V116zm65.1 56.7l64 128H173.7l64-128h36.6z"></path></svg>
61 %ci_label
62 </a>
63</div>
64