Skip to content

Commit e888dae

Browse files
format templates
1 parent 90f394a commit e888dae

File tree

5 files changed

+77
-94
lines changed

5 files changed

+77
-94
lines changed

templates/group/header.tmpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<div class="flex-item-title tw-text-18">
66
<a class="muted tw-font-normal" href="{{.Group.Owner.HomeLink}}">{{.Group.Owner.Name}}</a>
77
{{- range .Breadcrumbs -}}
8-
/<a class="muted{{if eq .ID $.Group.ID}} tw-font-bold active{{else}} tw-font-normal{{end}}"
9-
href="{{.GroupLink}}">{{.Name}}</a>
8+
/<a class="muted{{if eq .ID $.Group.ID}} tw-font-bold active{{else}} tw-font-normal{{end}}"
9+
href="{{.GroupLink}}">{{.Name}}</a>
1010
{{- end -}}
1111
</div>
1212
</div>
@@ -33,15 +33,14 @@
3333
</span>
3434
<span class="tw-flex tw-items-center tw-gap-1 tw-ml-auto tw-text-16 tw-whitespace-nowrap">
3535
{{if .EnableFeed}}
36-
<a class="ui basic label button tw-mr-0" href="{{.Group.GroupLink}}.rss"
37-
data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
36+
<a class="ui basic label button tw-mr-0" href="{{.Group.GroupLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
3837
{{svg "octicon-rss" 24}}
3938
</a>
4039
{{end}}
4140
</span>
4241
</div>
4342
{{if .RenderedDescription}}
44-
<div class="render-content markup tw-break-anywhere">{{.RenderedDescription}}</div>
43+
<div class="render-content markup tw-break-anywhere">{{.RenderedDescription}}</div>
4544
{{end}}
4645
</div>
4746
</div>

templates/group/settings/options.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<label for="group_name">
1010
{{ctx.Locale.Tr "group.group_name_holder"}}
1111
</label>
12-
<input id="group_name" name="name" value="{{.Group.Name}}" data-group-name="{{.Group.Name}}" autofocus required
13-
maxlength="40">
12+
<input id="group_name" name="name" value="{{.Group.Name}}" data-group-name="{{.Group.Name}}" autofocus required maxlength="40">
1413
</div>
1514
<div class="divider"></div>
1615
<div class="field" id="visibility_box">
@@ -49,7 +48,8 @@
4948

5049
<div class="field">
5150
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
52-
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
51+
<button class="ui red button link-action"
52+
data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
5353
</div>
5454
</form>
5555
</div>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{{$item := (call (index $.root "AsGroupItem") .item)}}
22
{{$parent := $item.Parent}}
33
<li class="expandable-menu-item item tw-px-0" {{if $item.IsGroup}} data-is-group="true"{{end}}
4-
data-sort-id="{{if $item.IsGroup}}group{{else}}repo{{end}}-{{$item.ID}}-{{$item.Sort}}"
4+
data-sort-id="{{if $item.IsGroup}}group{{else}}repo{{end}}-{{$item.ID}}-{{$item.Sort}}"
55
data-id="{{$item.ID}}">
66
<label class="tw-gap-2{{if $item.HasChildren $.root.Doer}} has-children{{end}}">
77
{{$active := (and $item.IsGroup (call $.root.GroupIsCurrent $item.ID))}}
88
{{$childContains := (call $.root.GroupHasChild $item)}}
9-
<input type="checkbox"
10-
class="toggle tw-h-0 tw-w-0 tw-overflow-hidden tw-opacity-0 tw-absolute"{{if or $active $childContains}} checked{{end}}>
9+
<input type="checkbox" class="toggle tw-h-0 tw-w-0 tw-overflow-hidden tw-opacity-0 tw-absolute"{{if or $active $childContains}} checked{{end}}>
1110
{{svg "octicon-chevron-right" 16 "collapse-icon"}}
1211
<a href="{{$item.Link}}" class="{{if $active}}active tw-font-bold{{end}}">
1312
{{$item.Title}}
1413
</a>
1514
</label>
16-
<div class="menu-expandable-content">
17-
<div class="menu-expandable-content-inner">
18-
<ul class="tw-list-none tw-ps-5"{{if .root.IsOrganizationMember}} data-url="{{ctx.RootData.Org.HomeLink}}/groups"{{end}}>
19-
{{- range $i, $childItem := $item.Children $.root.Doer -}}
20-
{{- template "group/sidebar/sidebar_item" dict "item" $childItem "root" $.root -}}
21-
{{- end -}}
22-
</ul>
23-
</div>
15+
<div class="menu-expandable-content">
16+
<div class="menu-expandable-content-inner">
17+
<ul class="tw-list-none tw-ps-5"{{if .root.IsOrganizationMember}}
18+
data-url="{{ctx.RootData.Org.HomeLink}}/groups"{{end}}>
19+
{{- range $i, $childItem := $item.Children $.root.Doer -}}
20+
{{- template "group/sidebar/sidebar_item" dict "item" $childItem "root" $.root -}}
21+
{{- end -}}
22+
</ul>
2423
</div>
24+
</div>
2525
</li>

templates/group/team/teams.tmpl

Lines changed: 50 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,64 @@
88
<div class="eleven wide column">
99
<div class="ui two column stackable grid">
1010
{{if or .IsGroupAdmin .IsGroupOwner}}
11-
12-
<div class="one column row">
13-
<div class="column">
14-
<form class="ui form ignore-dirty tw-flex tw-flex-wrap tw-gap-2" action="{{$.OrgGroupLink}}/teams/add"
15-
method="post">
16-
{{.CsrfTokenHtml}}
17-
<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
18-
<div id="search-team-box" data-search-url="{{$.OrgLink}}/-/search_team_candidates"
19-
class="ui search tw-mr-2 tw-flex-grow">
20-
<div class="ui input fluid">
21-
<input class="prompt" name="tname" placeholder="{{ctx.Locale.Tr "search.team_kind"}}"
22-
autocomplete="off" required>
23-
</div>
11+
<div class="one column row">
12+
<div class="column">
13+
<form class="ui form ignore-dirty tw-flex tw-flex-wrap tw-gap-2" action="{{$.OrgGroupLink}}/teams/add"
14+
method="post">
15+
{{.CsrfTokenHtml}}
16+
<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
17+
<div id="search-team-box" data-search-url="{{$.OrgLink}}/-/search_team_candidates" class="ui search tw-mr-2 tw-flex-grow">
18+
<div class="ui input fluid">
19+
<input class="prompt" name="tname" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" required>
2420
</div>
25-
<button class="ui primary button">{{ctx.Locale.Tr "group.teams.add"}}</button>
26-
</form>
27-
</div>
21+
</div>
22+
<button class="ui primary button">{{ctx.Locale.Tr "group.teams.add"}}</button>
23+
</form>
2824
</div>
25+
</div>
2926
{{end}}
3027
{{range .Teams}}
31-
<div class="column">
32-
<div class="ui top attached header">
33-
<a class="text black"
34-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a>
35-
<div class="ui right">
36-
<a class="ui primary tiny button"
37-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{ctx.Locale.Tr "view"}}</a>
38-
39-
{{if .IsMember ctx $.SignedUser.ID}}
40-
<form>
41-
<button class="ui red tiny button delete-button" data-modal-id="leave-team"
42-
data-url="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/leave"
43-
data-datauid="{{$.SignedUser.ID}}"
44-
data-name="{{.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button>
45-
</form>
46-
{{else if $.IsOrganizationOwner}}
47-
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/join">
48-
{{$.CsrfTokenHtml}}
49-
<button type="submit" class="ui primary tiny button" name="uid"
50-
value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button>
51-
</form>
52-
{{end}}
28+
<div class="column">
29+
<div class="ui top attached header">
30+
<a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a>
31+
<div class="ui right">
32+
<a class="ui primary tiny button" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{ctx.Locale.Tr "view"}}</a>
33+
{{if .IsMember ctx $.SignedUser.ID}}
34+
<form>
35+
<button class="ui red tiny button delete-button" data-modal-id="leave-team"
36+
data-url="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/leave"
37+
data-datauid="{{$.SignedUser.ID}}"
38+
data-name="{{.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button>
39+
</form>
40+
{{else if $.IsOrganizationOwner}}
41+
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/join">
42+
{{$.CsrfTokenHtml}}
43+
<button type="submit" class="ui primary tiny button" name="uid" value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button>
44+
</form>
45+
{{end}}
5346

54-
{{if and (or $.IsGroupAdmin $.IsGroupOwner) (not .IsOwnerTeam)}}
55-
<form>
56-
<button class="ui red tiny button delete-button" data-modal-id="remove-team"
57-
data-url="{{$.OrgGroupLink}}/teams/{{.LowerName | PathEscape}}/remove"
58-
data-datauid="{{$.SignedUser.ID}}"
59-
data-name="{{.Name}}">{{ctx.Locale.Tr "group.teams.remove"}}</button>
60-
</form>
61-
{{end}}
62-
</div>
63-
</div>
64-
<div class="ui attached segment members">
65-
{{range .Members}}
66-
{{template "shared/user/avatarlink" dict "user" .}}
47+
{{if and (or $.IsGroupAdmin $.IsGroupOwner) (not .IsOwnerTeam)}}
48+
<form>
49+
<button class="ui red tiny button delete-button" data-modal-id="remove-team"
50+
data-url="{{$.OrgGroupLink}}/teams/{{.LowerName | PathEscape}}/remove"
51+
data-datauid="{{$.SignedUser.ID}}"
52+
data-name="{{.Name}}">{{ctx.Locale.Tr "group.teams.remove"}}</button>
53+
</form>
6754
{{end}}
6855
</div>
69-
<div class="ui bottom attached header">
70-
<p class="team-meta"><a class="muted"
71-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{.NumMembers}} {{ctx.Locale.Tr "org.lower_members"}}</a>
72-
· <a class="muted"
73-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories">{{.NumRepos}} {{ctx.Locale.Tr "org.lower_repositories"}}</a>
74-
</p>
75-
</div>
7656
</div>
57+
<div class="ui attached segment members">
58+
{{range .Members}}
59+
{{template "shared/user/avatarlink" dict "user" .}}
60+
{{end}}
61+
</div>
62+
<div class="ui bottom attached header">
63+
<p class="team-meta"><a class="muted"
64+
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{.NumMembers}} {{ctx.Locale.Tr "org.lower_members"}}</a>
65+
· <a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories">{{.NumRepos}} {{ctx.Locale.Tr "org.lower_repositories"}}</a>
66+
</p>
67+
</div>
68+
</div>
7769
{{end}}
7870
</div>
7971
</div>

templates/org/home.tmpl

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<div class="ui mobile reversed stackable grid">
77
<div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column">
88
{{if .ProfileReadmeContent}}
9-
<div id="readme_profile" class="render-content markup"
10-
data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
9+
<div id="readme_profile" class="render-content markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
1110
{{end}}
1211
{{template "shared/repo/search" .}}
1312
{{template "shared/repo/list" .}}
@@ -18,11 +17,9 @@
1817
<div class="ui five wide column">
1918
{{if .CanCreateOrgRepo}}
2019
<div class="tw-flex tw-flex-wrap tw-justify-center tw-gap-x-1 tw-gap-y-2 tw-mb-4">
21-
<a class="ui primary button tw-grow"
22-
href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
20+
<a class="ui primary button tw-grow" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
2321
{{if not .DisableNewPullMirrors}}
24-
<a class="ui primary button tw-grow"
25-
href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
22+
<a class="ui primary button tw-grow" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
2623
{{end}}
2724
</div>
2825
<div class="divider"></div>
@@ -56,35 +53,30 @@
5653
{{if .NumMembers}}
5754
<h4 class="ui top attached header tw-flex">
5855
<strong class="tw-flex-1">{{ctx.Locale.Tr "org.members"}}</strong>
59-
<a class="text grey tw-flex tw-items-center"
60-
href="{{.OrgLink}}/members"><span>{{.NumMembers}}</span> {{svg "octicon-chevron-right"}}</a>
56+
<a class="text grey tw-flex tw-items-center" href="{{.OrgLink}}/members"><span>{{.NumMembers}}</span> {{svg "octicon-chevron-right"}}</a>
6157
</h4>
6258
<div class="ui attached segment members">
6359
{{$isMember := .IsOrganizationMember}}
6460
{{range .Members}}
6561
{{if or $isMember (call $.IsPublicMember .ID)}}
66-
<a href="{{.HomeLink}}"
67-
title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
62+
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
6863
{{end}}
6964
{{end}}
7065
</div>
7166
{{end}}
7267
{{if .IsOrganizationMember}}
7368
<div class="ui top attached header tw-flex">
7469
<strong class="tw-flex-1">{{ctx.Locale.Tr "org.teams"}}</strong>
75-
<a class="text grey tw-flex tw-items-center"
76-
href="{{.OrgLink}}/teams"><span>{{.Org.NumTeams}}</span> {{svg "octicon-chevron-right"}}</a>
70+
<a class="text grey tw-flex tw-items-center" href="{{.OrgLink}}/teams"><span>{{.Org.NumTeams}}</span> {{svg "octicon-chevron-right"}}</a>
7771
</div>
7872
<div class="ui attached table segment teams">
7973
{{range .Teams}}
8074
<div class="item">
8175
<a href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong class="team-name">{{.Name}}</strong></a>
8276
<p class="text grey">
83-
<a class="muted"
84-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.NumMembers}}</strong> {{ctx.Locale.Tr "org.lower_members"}}
77+
<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.NumMembers}}</strong> {{ctx.Locale.Tr "org.lower_members"}}
8578
</a> ·
86-
<a class="muted"
87-
href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories"><strong>{{.NumRepos}}</strong> {{ctx.Locale.Tr "org.lower_repositories"}}
79+
<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories"><strong>{{.NumRepos}}</strong> {{ctx.Locale.Tr "org.lower_repositories"}}
8880
</a>
8981
</p>
9082
</div>
@@ -96,7 +88,7 @@
9688
</div>
9789
{{end}}
9890
{{end}}
99-
{{end}}
91+
{{end}}
10092
</div>
10193
</div>
10294
</div>

0 commit comments

Comments
 (0)