-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Introduce flex-list & flex-item elements for Gitea UI
#25790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
001da67
650a226
607257a
86d9c11
62449e9
fd6cce3
cf3ef0d
759223c
e059aab
d731a23
1be2cbd
8159daf
792961e
82e436f
aea1437
147f7a4
6c490f5
6477d43
ca1618b
3798d8e
67b4fe8
f5e5aa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1 @@ | ||
| {{template "base/head" .}} | ||
| <div role="main" aria-label="{{.Title}}" class="page-content explore users"> | ||
| {{template "explore/navbar" .}} | ||
| <div class="ui container"> | ||
| {{template "explore/search" .}} | ||
|
|
||
| <div class="ui user list"> | ||
| {{range .Users}} | ||
| <div class="item"> | ||
| {{avatar $.Context .}} | ||
| <div class="content"> | ||
| <span class="header"> | ||
| <a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}} | ||
| {{if .Visibility.IsPrivate}} | ||
| <span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span> | ||
| {{end}} | ||
| </span> | ||
| <div class="description"> | ||
| {{if .Location}} | ||
| {{svg "octicon-location"}} {{.Location}} | ||
| {{end}} | ||
| {{if and .Website}} | ||
| {{svg "octicon-link"}} | ||
| <a href="{{.Website}}" rel="nofollow">{{.Website}}</a> | ||
| {{end}} | ||
| {{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {{else}} | ||
| <div>{{$.locale.Tr "explore.org_no_results"}}</div> | ||
| {{end}} | ||
| </div> | ||
|
|
||
| {{template "base/paginate" .}} | ||
| </div> | ||
| </div> | ||
| {{template "base/footer" .}} | ||
| {{template "explore/users" .}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,31 @@ | ||
| {{template "base/head" .}} | ||
| <div role="main" aria-label="{{.Title}}" class="page-content organization members"> | ||
| <div role="main" aria-label="{{.Title}}" class="page-content organization"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why to delete this "members" class?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any impact? of regression
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe they were depending on this class for customization. I wonder if there would be a better way to indicate the current page to CSS, like an data attribute that indicates the matching template file or router. We could make better stability guarantees for those then these flimsy classes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Although there is currently no impact. But there is no way to tell under Vanilla JS whether it is a "Members" page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In JS, you could check the URL which I guess is more stable than these classes. e.g. check if |
||
| {{template "org/header" .}} | ||
| <div class="ui container"> | ||
| {{template "base/alert" .}} | ||
|
|
||
| <div class="list"> | ||
| <div class="flex-list"> | ||
| {{range .Members}} | ||
| <div class="item ui grid"> | ||
| <div class="ui four wide column gt-df"> | ||
| {{$isPublic := index $.MembersIsPublicMember .ID}} | ||
| <div class="flex-card {{if $.PublicOnly}}flex-card-center{{end}}"> | ||
| <div class="flex-card-leading"> | ||
| <a href="{{.HomeLink}}">{{avatar $.Context . 48}}</a> | ||
| <div> | ||
| <div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div> | ||
| <div class="meta">{{.FullName}}</div> | ||
| </div> | ||
| </div> | ||
| <div class="ui four wide column center"> | ||
| <div class="meta"> | ||
| {{$.locale.Tr "org.members.membership_visibility"}} | ||
| </div> | ||
| <div class="meta"> | ||
| {{$isPublic := index $.MembersIsPublicMember .ID}} | ||
| {{if $isPublic}} | ||
| <strong>{{$.locale.Tr "org.members.public"}}</strong> | ||
| {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.locale.Tr "org.members.public_helper"}}</a>){{end}} | ||
| {{else}} | ||
| <strong>{{$.locale.Tr "org.members.private"}}</strong> | ||
| {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.locale.Tr "org.members.private_helper"}}</a>){{end}} | ||
| <div class="flex-card-main"> | ||
| <div class="flex-card-title"> | ||
| {{template "shared/user/name" .}} | ||
| {{if not $isPublic}} | ||
| <span class="ui basic tiny label">{{$.locale.Tr "org.members.private"}}</span> | ||
| {{end}} | ||
| </div> | ||
| </div> | ||
| {{if not $.PublicOnly}} | ||
| <div class="ui three wide column center"> | ||
| <div class="meta"> | ||
| {{if not $.PublicOnly}} | ||
| <div class="flex-card-body"> | ||
| {{$.locale.Tr "org.members.member_role"}} | ||
| <strong class="flex-text-inline">{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}}</strong> | ||
| </div> | ||
| <div class="meta"> | ||
| <strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}}</strong> | ||
| </div> | ||
| </div> | ||
| <div class="ui two wide column center"> | ||
| {{if $.IsOrganizationOwner}} | ||
| <div class="meta"> | ||
| <div class="flex-card-body"> | ||
| {{$.locale.Tr "admin.users.2fa"}} | ||
| </div> | ||
| <div class="meta"> | ||
| <strong> | ||
| {{if index $.MembersTwoFaStatus .ID}} | ||
| <span class="text green">{{svg "octicon-check"}}</span> | ||
|
|
@@ -53,26 +35,31 @@ | |
| </strong> | ||
| </div> | ||
| {{end}} | ||
| </div> | ||
| {{end}} | ||
| <div class="ui three wide column gt-df gt-ac gt-je"> | ||
| <div class="text right"> | ||
| {{if eq $.SignedUser.ID .ID}} | ||
| <form> | ||
| <button class="ui red small button delete-button" data-modal-id="leave-organization" | ||
| data-url="{{$.OrgLink}}/members/action/leave" data-datauid="{{.ID}}" | ||
| data-name="{{.DisplayName}}" | ||
| data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.leave"}}</button> | ||
| </form> | ||
| {{else if $.IsOrganizationOwner}} | ||
| <form> | ||
| <button class="ui red small button delete-button" data-modal-id="remove-organization-member" | ||
| data-url="{{$.OrgLink}}/members/action/remove" data-datauid="{{.ID}}" | ||
| data-name="{{.DisplayName}}" | ||
| data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.remove"}}</button> | ||
| </form> | ||
| {{end}} | ||
| </div> | ||
| <div class="flex-card-trailing"> | ||
| {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}} | ||
| {{if $isPublic}} | ||
| <a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{svg "octicon-eye-closed" 12 "icon"}}{{$.locale.Tr "org.members.public_helper"}}</a> | ||
| {{else}} | ||
| <a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{svg "octicon-eye" 12 "icon"}}{{$.locale.Tr "org.members.private_helper"}}</a> | ||
| {{end}} | ||
| </div> | ||
| {{end}} | ||
| {{if eq $.SignedUser.ID .ID}} | ||
| <form> | ||
| <button class="ui red tiny button delete-button" data-modal-id="leave-organization" | ||
| data-url="{{$.OrgLink}}/members/action/leave" data-datauid="{{.ID}}" | ||
| data-name="{{.DisplayName}}" | ||
| data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.leave"}}</button> | ||
| </form> | ||
| {{else if $.IsOrganizationOwner}} | ||
| <form> | ||
| <button class="ui red tiny button delete-button" data-modal-id="remove-organization-member" | ||
| data-url="{{$.OrgLink}}/members/action/remove" data-datauid="{{.ID}}" | ||
| data-name="{{.DisplayName}}" | ||
| data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.remove"}}</button> | ||
| </form> | ||
| {{end}} | ||
| </div> | ||
| </div> | ||
| {{end}} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.