Browse Source

Org action fixes and form cleanup (#10512)

* More org fixes

* Move form action query to inputs

Signed-off-by: jolheiser <john.olheiser@gmail.com>
mj
John Olheiser 3 years ago
committed by GitHub
parent
commit
15fbf509d3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      templates/org/member/members.tmpl
  2. 4
      templates/org/team/members.tmpl
  3. 4
      templates/org/team/repositories.tmpl
  4. 10
      templates/org/team/sidebar.tmpl
  5. 8
      templates/org/team/teams.tmpl
  6. 5
      templates/user/settings/organization.tmpl

10
templates/org/member/members.tmpl

@ -54,9 +54,15 @@
<div class="ui four wide column">
<div class="text right">
{{if eq $.SignedUser.ID .ID}}
<a class="ui red small button" href="{{$.OrgLink}}/members/action/leave?uid={{.ID}}">{{$.i18n.Tr "org.members.leave"}}</a>
<form method="post" action="{{$.OrgLink}}/members/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.leave"}}</button>
</form>
{{else if $.IsOrganizationOwner}}
<a class="ui red small button" href="{{$.OrgLink}}/members/action/remove?uid={{.ID}}">{{$.i18n.Tr "org.members.remove"}}</a>
<form method="post" action="{{$.OrgLink}}/members/action/remove">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.remove"}}</button>
</form>
{{end}}
</div>
</div>

4
templates/org/team/members.tmpl

@ -27,9 +27,9 @@
{{range .Team.Members}}
<div class="item">
{{if $.IsOrganizationOwner}}
<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/remove?uid={{.ID}}">
<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/remove">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button right" >{{$.i18n.Tr "org.members.remove"}}</button>
<button type="submit" class="ui red small button right" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.remove"}}</button>
</form>
{{end}}
<a href="{{.HomeLink}}">

4
templates/org/team/repositories.tmpl

@ -35,9 +35,9 @@
{{range .Team.Repos}}
<div class="item">
{{if $canAddRemove}}
<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/remove?repoid={{.ID}}">
<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/remove">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button right">{{$.i18n.Tr "remove"}}</button>
<button type="submit" class="ui red small button right" name="repoid" value="{{.ID}}">{{$.i18n.Tr "remove"}}</button>
</form>
{{end}}
<a class="member" href="{{AppSubUrl}}/{{$.Org.Name}}/{{.Name}}">

10
templates/org/team/sidebar.tmpl

@ -3,14 +3,16 @@
<strong>{{.Team.Name}}</strong>
<div class="ui right">
{{if .Team.IsMember $.SignedUser.ID}}
<form method="post" action="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?uid={{$.SignedUser.ID}}&page=home">
<form method="post" action="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red tiny button">{{$.i18n.Tr "org.teams.leave"}}</button>
<input type="hidden" name="page" value="home"/>
<button type="submit" class="ui red tiny button" name="uid" value="{{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.leave"}}</button>
</form>
{{else if .IsOrganizationOwner}}
<form method="post" action="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?uid={{$.SignedUser.ID}}&page=team">
<form method="post" action="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui blue tiny button">{{$.i18n.Tr "org.teams.join"}}</button>
<input type="hidden" name="page" value="team"/>
<button type="submit" class="ui blue tiny button" name="uid" value="{{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.join"}}</button>
</form>
{{end}}
</div>

8
templates/org/team/teams.tmpl

@ -17,14 +17,14 @@
<a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a>
<div class="ui right">
{{if .IsMember $.SignedUser.ID}}
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave?uid={{$.SignedUser.ID}}">
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button">{{$.i18n.Tr "org.teams.leave"}}</button>
<button type="submit" class="ui red small button" name="uid" value="{{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.leave"}}</button>
</form>
{{else if $.IsOrganizationOwner}}
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName}}/action/join?uid={{$.SignedUser.ID}}">
<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName}}/action/join">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui blue small button">{{$.i18n.Tr "org.teams.join"}}</button>
<button type="submit" class="ui blue small button" name="uid" value="{{$.SignedUser.ID}}">{{$.i18n.Tr "org.teams.join"}}</button>
</form>
{{end}}
</div>

5
templates/user/settings/organization.tmpl

@ -17,7 +17,10 @@
{{range .Orgs}}
<div class="item">
<div class="right floated content">
<a class="ui blue small button" href="{{AppSubUrl}}/org/{{.Name}}/members/action/leave?uid={{.ID}}">{{$.i18n.Tr "org.members.leave"}}</a>
<form method="post" action="{{AppSubUrl}}/org/{{.Name}}/members/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui blue small button" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.leave"}}</button>
</form>
</div>
<img class="ui mini image" src="{{.RelAvatarLink}}">
<div class="content">

Loading…
Cancel
Save