forked from Shiloh/githaven
476a043a5f
Co-Author: @wxiaoguang
This PR is to fix
https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 .
The way to fix this in this PR is to use `delete_modal_actions.tmpl`
here both to fix this issue and keep ui consistency (as suggested by
[TODO
here](4299c3b7db/templates/projects/view.tmpl (L161)
))
And this PR also refactors `delete_modal_actions.tmpl` and its related
styles, and use the template for more modal actions:
1. Added template attributes:
* locale
* ModalButtonStyle: "yes" (default) or "confirm"
* ModalButtonCancelText
* ModalButtonOkText
2. Rename `delete_modal_actions.tmpl` template to
`modal_actions_confirm.tmpl` because it is not only used for action
modals deletion now.
3. Refactored css related to modals into `web_src/css/modules/modal.css`
and improved the styles.
4. Also use the template for PR deletion modal and remove issue
dependency modal.
5. Some modals should also use the template, but not sure how to open
them, so mark these modal actions by `{{/* TODO: Convert to
base/modal_actions_confirm */}}`
After (Also tested on arc green):
Hovering on the left buttons
<img width="711" alt="Screen Shot 2023-04-23 at 15 17 12"
src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png">
<img width="786" alt="Screen Shot 2023-04-23 at 15 17 21"
src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png">
Test for functionalities:
https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
77 lines
3.2 KiB
Handlebars
77 lines
3.2 KiB
Handlebars
{{template "base/head" .}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content organization teams">
|
|
{{template "org/header" .}}
|
|
<div class="ui container">
|
|
{{template "base/alert" .}}
|
|
<div class="ui grid">
|
|
{{template "org/team/sidebar" .}}
|
|
<div class="ui ten wide column">
|
|
{{template "org/team/navbar" .}}
|
|
{{if .IsOrganizationOwner}}
|
|
<div class="ui attached segment">
|
|
<form class="ui form ignore-dirty" id="add-member-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/add" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
|
|
<div class="inline field ui left">
|
|
<div id="search-user-box" class="ui search"{{if .IsEmailInviteEnabled}} data-allow-email="true" data-allow-email-description="{{.locale.Tr "org.teams.invite_team_member" $.Team.Name}}"{{end}}>
|
|
<div class="ui input">
|
|
<input class="prompt" name="uname" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<button class="ui green button">{{.locale.Tr "org.teams.add_team_member"}}</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
<div class="ui bottom attached table segment members">
|
|
{{range .Team.Members}}
|
|
<div class="item gt-df gt-ac gt-fw">
|
|
<a href="{{.HomeLink}}">{{avatar $.Context . 48 "gt-mr-3 gt-mb-0"}}</a>
|
|
<a class="gt-f1" href="{{.HomeLink}}">
|
|
<strong>{{.DisplayName}}</strong>
|
|
</a>
|
|
{{if and $.IsOrganizationOwner (not (and ($.Team.IsOwnerTeam) (eq (len $.Team.Members) 1)))}}
|
|
<form>
|
|
<button class="ui red button delete-button" data-modal-id="remove-team-member"
|
|
data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/remove" data-datauid="{{.ID}}"
|
|
data-name="{{.DisplayName}}"
|
|
data-data-team-name="{{$.Team.Name}}">{{$.locale.Tr "org.members.remove"}}</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<div class="item">
|
|
<span class="text grey italic">{{$.locale.Tr "org.teams.members.none"}}</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{if and .Invites $.IsOrganizationOwner}}
|
|
<h4 class="ui top attached header">{{$.locale.Tr "org.teams.invite_team_member.list"}}</h4>
|
|
<div class="ui bottom attached table segment members">
|
|
{{range .Invites}}
|
|
<div class="item">
|
|
<form action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/remove_invite" method="post">
|
|
{{$.CsrfTokenHtml}}
|
|
<input type="hidden" name="iid" value="{{.ID}}">
|
|
<button class="ui red button right">{{$.locale.Tr "org.members.remove"}}</button>
|
|
</form>
|
|
{{.Email}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ui gitea-confirm-modal delete modal" id="remove-team-member">
|
|
<div class="header">
|
|
{{$.locale.Tr "org.members.remove"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataTeamName"></span>` | Safe}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</div>
|
|
{{template "base/footer" .}}
|