aboutsummaryrefslogtreecommitdiffstats
path: root/templates/org/team
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
commit21a1b8e5a35c61bff30145ac3194ea893a9c6b68 (patch)
treeb218aedd0d64252d95725f12338a1ced1f155ba9 /templates/org/team
parente325c8499a102ba8a6a84236c02dd7951f46cec5 (diff)
downloadgitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.tar.gz
gitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.zip
Finish new edit team page, add member to team
Diffstat (limited to 'templates/org/team')
-rw-r--r--templates/org/team/members.tmpl29
-rw-r--r--templates/org/team/new.tmpl25
-rw-r--r--templates/org/team/sidebar.tmpl18
-rw-r--r--templates/org/team/teams.tmpl8
4 files changed, 65 insertions, 15 deletions
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
index 8faeb9ef31..d3176be152 100644
--- a/templates/org/team/members.tmpl
+++ b/templates/org/team/members.tmpl
@@ -2,7 +2,8 @@
{{template "ng/base/header" .}}
{{template "org/base/header" .}}
<div id="setting-wrapper" class="main-wrapper">
- <div id="org-setting" class="container clear">
+ <div id="team-members-list" class="container clear">
+ {{template "ng/base/alert" .}}
{{template "org/team/sidebar" .}}
<div class="grid-2-3 left">
<div class="setting-content">
@@ -10,6 +11,32 @@
<div class="panel-header">
{{.i18n.Tr "org.teams.members"}}
</div>
+ <ul class="panel-body setting-list" id="team-members-list">
+ {{if .IsOrganizationOwner}}
+ <li class="search">
+ <form class="form form-align" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/add" id="repo-collab-form">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="uid" value="{{.SignedUser.Id}}">
+ <input class="ipt ipt-large ipt-radius" id="org-team-members-add" name="uname" autocomplete="off" required />
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.teams.add_team_member"}}</button>
+ <div class="repo-user-list-block">
+ <ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="org-team-members-list"></ul>
+ </div>
+ </form>
+ </li>
+ {{end}}
+ {{range .Team.Members}}
+ <li class="collab">
+ {{if $.IsOrganizationOwner}}
+ <a class="btn btn-small btn-red btn-radius right" href="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/remove?uid={{.Id}}">{{$.i18n.Tr "org.members.remove"}}</a>
+ {{end}}
+ <a class="member" href="/{{.Name}}">
+ <img alt="{{.Name}}" class="pull-left avatar" src="{{.AvatarLink}}">
+ <strong>{{.FullName}}</strong> ({{.Name}})
+ </a>
+ </li>
+ {{end}}
+ </ul>
</div>
</div>
</div>
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index f02512e052..ce8c15236b 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -2,16 +2,21 @@
{{template "ng/base/header" .}}
{{template "org/base/header" .}}
<div id="repo-wrapper">
- <form id="team-create-form" class="form form-align panel panel-radius" action="{{.OrgLink}}/teams/new" method="post">
+ <form id="team-create-form" class="form form-align panel panel-radius" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName}}/delete" method="post">
{{.CsrfTokenHtml}}
<div class="panel-header">
- <h2>{{.i18n.Tr "org.create_new_team"}}</h2>
+ <h2>
+ {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}}
+ </h2>
</div>
<div class="panel-content">
{{template "ng/base/alert" .}}
<div class="field">
<label class="req" for="team-name">{{.i18n.Tr "org.team_name"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_TeamName}}ipt-error{{end}}" id="team-name" name="team_name" value="{{.team_name}}" required />
+ {{if eq .Team.LowerName "owners"}}
+ <input type="hidden" name="team_name" value="{{.team_name}}">
+ {{end}}
+ <input class="ipt ipt-large ipt-radius {{if .Err_TeamName}}ipt-error{{end}}" id="team-name" name="team_name" value="{{.team_name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} />
<span class="form-label"></span>
<span class="help">{{.i18n.Tr "org.team_name_helper"}}</span>
</div>
@@ -21,6 +26,7 @@
<span class="form-label"></span>
<span class="help">{{.i18n.Tr "org.team_desc_helper"}}</span>
</div>
+ {{if not (eq .Team.LowerName "owners")}}
<div class="field">
<h4 class="text-center">{{.i18n.Tr "org.team_permission_desc"}}</h4>
<label></label>
@@ -37,10 +43,19 @@
<p class="text-grey note">{{.i18n.Tr "org.teams.admin_access_helper"}}</p>
</div>
<hr>
+ {{end}}
<div class="field">
<label></label>
- <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_new_team"}}</button>
- <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="{{.OrgLink}}/teams"><strong>{{.i18n.Tr "cancel"}}</strong></a>
+ {{if .PageIsOrgTeamsNew}}
+ <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_new_team"}}</button>
+ <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="{{.OrgLink}}/teams"><strong>{{.i18n.Tr "cancel"}}</strong></a>
+ {{else}}
+ <button class="btn btn-large btn-green btn-radius">{{.i18n.Tr "org.teams.update_settings"}}</button>
+ {{if not (eq .Team.LowerName "owners")}}
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ <button class="btn btn-large btn-red btn-radius" id="org-team-delete">{{.i18n.Tr "org.teams.delete_team"}}</button>
+ {{end}}
+ {{end}}
</div>
</div>
</form>
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
index 1ab24e9aac..b760e002fc 100644
--- a/templates/org/team/sidebar.tmpl
+++ b/templates/org/team/sidebar.tmpl
@@ -1,9 +1,9 @@
<div class="grid-1-3 panel panel-radius left" id="org-team-card">
<div class="panel-header">
{{if .Team.IsMember $.SignedUser.Id}}
- <a class="btn btn-small btn-red btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?page=team">{{$.i18n.Tr "org.teams.leave"}}</a>
- {{else}}
- <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?page=team">{{$.i18n.Tr "org.teams.join"}}</a>
+ <a class="btn btn-small btn-red btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?uid={{$.SignedUser.Id}}&page=team">{{$.i18n.Tr "org.teams.leave"}}</a>
+ {{else if .IsOrganizationOwner}}
+ <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?uid={{$.SignedUser.Id}}&page=team">{{$.i18n.Tr "org.teams.join"}}</a>
{{end}}
<strong>{{.Team.Name}}</strong>
</div>
@@ -11,16 +11,24 @@
<p class="desc">{{if .Team.Description}}{{.Team.Description}}{{else}}{{.i18n.Tr "org.teams.no_desc"}}{{end}}</p>
<hr>
<div class="team-stats">
- <a class="text-black"><strong>{{.Team.NumMembers}}</strong> {{$.i18n.Tr "org.lower_members"}}</a> ·
- <a class="text-black"><strong>{{.Team.NumRepos}}</strong> {{$.i18n.Tr "org.lower_repositories"}}</a>
+ <a class="text-black" href="{{.OrgLink}}/teams/{{.Team.LowerName}}"><strong>{{.Team.NumMembers}}</strong> {{$.i18n.Tr "org.lower_members"}}</a> ·
+ <a class="text-black" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/repositories"><strong>{{.Team.NumRepos}}</strong> {{$.i18n.Tr "org.lower_repositories"}}</a>
</div>
<p class="desc">
{{if eq .Team.LowerName "owners"}}
{{.i18n.Tr "org.teams.owners_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 1)}}
+ {{.i18n.Tr "org.teams.read_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 2)}}
+ {{.i18n.Tr "org.teams.write_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 3)}}
+ {{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}}
{{end}}
</p>
</div>
+ {{if .IsOrganizationOwner}}
<div class="panel-footer">
<a class="btn btn-medium btn-green btn-link btn-radius" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/edit"><span class="octicon octicon-gear"></span> {{$.i18n.Tr "org.teams.settings"}}</a>
</div>
+ {{end}}
</div> \ No newline at end of file
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
index 3e0846d652..9c47cb5a41 100644
--- a/templates/org/team/teams.tmpl
+++ b/templates/org/team/teams.tmpl
@@ -6,7 +6,7 @@
{{template "ng/base/alert" .}}
</div>
<div class="org-toolbar clear">
- {{if .IsAdminTeam}}
+ {{if .IsOrganizationOwner}}
<a class="btn btn-green btn-large btn-link btn-radius right" href="{{.OrgLink}}/teams/new"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "org.create_new_team"}}</a>
{{end}}
</div>
@@ -16,9 +16,9 @@
<div class="panel panel-radius">
<div class="panel-header">
{{if .IsMember $.SignedUser.Id}}
- <a class="btn btn-small btn-red btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave">{{$.i18n.Tr "org.teams.leave"}}</a>
- {{else}}
- <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/join">{{$.i18n.Tr "org.teams.join"}}</a>
+ <a class="btn btn-small btn-red btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave?uid={{$.SignedUser.Id}}">{{$.i18n.Tr "org.teams.leave"}}</a>
+ {{else if $.IsOrganizationOwner}}
+ <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/join?uid={{$.SignedUser.Id}}">{{$.i18n.Tr "org.teams.join"}}</a>
{{end}}
<a class="text-black" href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a>
</div>