summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-23 20:24:02 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-23 20:24:02 +0800
commitfa60502a70de62bb83c2ba083de923d5d08bdbf9 (patch)
treea89580ba336b2e57e30236bab9eb0064c49f35bb
parenta60edbe88c62f6f5b8c1d74fdd295a2492ef30e9 (diff)
downloadgitea-fa60502a70de62bb83c2ba083de923d5d08bdbf9.tar.gz
gitea-fa60502a70de62bb83c2ba083de923d5d08bdbf9.zip
Working on organization pages
-rw-r--r--conf/locale/locale_en-US.ini4
-rw-r--r--conf/locale/locale_zh-CN.ini4
-rw-r--r--public/ng/css/gogs.css12
-rw-r--r--public/ng/less/gogs/organization.less14
-rw-r--r--routers/org/teams.go10
-rw-r--r--templates/org/settings/delete.tmpl2
-rw-r--r--templates/org/settings/options.tmpl2
-rw-r--r--templates/org/team/members.tmpl18
-rw-r--r--templates/org/team/repositories.tmpl0
-rw-r--r--templates/org/team/sidebar.tmpl26
10 files changed, 86 insertions, 6 deletions
diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini
index 4e191dca40..b9e7966c2f 100644
--- a/conf/locale/locale_en-US.ini
+++ b/conf/locale/locale_en-US.ini
@@ -279,6 +279,10 @@ teams.write_access = Write Access
teams.write_access_helper = This team will be able to read its repositories, as well as push to them.
teams.admin_access = Admin Access
teams.admin_access_helper = This team will be able to push/pull to its repositories, as well as add other collaborators to them.
+teams.no_desc = This team has no description
+teams.settings = Settings
+teams.owners_permission_desc = Owners have full access to <strong>all repositories</strong> and have <strong>admin rights</strong> to the organization.
+teams.members = Team Members
[action]
create_repo = created repository <a href="/%s">%s</a>
diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini
index e3607d8e6e..7e5ac6486e 100644
--- a/conf/locale/locale_zh-CN.ini
+++ b/conf/locale/locale_zh-CN.ini
@@ -279,6 +279,10 @@ teams.write_access = 写入权限
teams.write_access_helper = 这个团队将拥有查看、克隆和推送所属仓库的权限。
teams.admin_access = 管理权限
teams.admin_access_helper = 这个团队将拥有查看、克隆、推送和添加其他组织成员到团队的权限。
+teams.no_desc = 该团队暂无描述
+teams.settings = 团队设置
+teams.owners_permission_desc = 管理员团队对 <strong>所有仓库</strong> 具有操作权限,且对组织具有 <strong>管理员权限</strong>。
+teams.members = 团队成员
[action]
create_repo = 创建了仓库 <a href="/%s">%s</a>
diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css
index 3d784fab21..9aa7206bdf 100644
--- a/public/ng/css/gogs.css
+++ b/public/ng/css/gogs.css
@@ -1859,3 +1859,15 @@ textarea#issue-add-content {
#team-create-form .note {
margin-left: 153px;
}
+#org-team-card .desc {
+ font-size: 14px;
+ padding: 10px 20px;
+}
+#org-team-card .team-stats {
+ padding: 0 20px 10px 20px;
+ text-transform: uppercase;
+ border-bottom: 1px solid #dddddd;
+}
+#org-team-card .panel-footer {
+ padding: 10px 20px;
+}
diff --git a/public/ng/less/gogs/organization.less b/public/ng/less/gogs/organization.less
index e8063f2328..58039d90b3 100644
--- a/public/ng/less/gogs/organization.less
+++ b/public/ng/less/gogs/organization.less
@@ -182,4 +182,18 @@
.note {
margin-left: 153px;
}
+}
+#org-team-card {
+ .desc {
+ font-size: 14px;
+ padding: 10px 20px;
+ }
+ .team-stats {
+ padding: 0 20px 10px 20px;
+ text-transform: uppercase;
+ border-bottom: 1px solid #dddddd;
+ }
+ .panel-footer {
+ padding: 10px 20px;
+ }
} \ No newline at end of file
diff --git a/routers/org/teams.go b/routers/org/teams.go
index d082576cc8..8eb86c49fd 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -13,8 +13,9 @@ import (
)
const (
- TEAMS base.TplName = "org/team/teams"
- TEAM_NEW base.TplName = "org/team/new"
+ TEAMS base.TplName = "org/team/teams"
+ TEAM_NEW base.TplName = "org/team/new"
+ TEAM_MEMBERS base.TplName = "org/team/members"
)
func Teams(ctx *middleware.Context) {
@@ -121,6 +122,7 @@ func EditTeam(ctx *middleware.Context) {
}
func SingleTeam(ctx *middleware.Context) {
- ctx.Data["Title"] = "single-team" + ctx.Params(":org")
- ctx.HTML(200, "org/team")
+ ctx.Data["Title"] = ctx.Org.Team.Name
+ ctx.Data["PageIsOrgTeams"] = true
+ ctx.HTML(200, TEAM_MEMBERS)
}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
index 828389d6ff..ea9853d919 100644
--- a/templates/org/settings/delete.tmpl
+++ b/templates/org/settings/delete.tmpl
@@ -1,6 +1,6 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
-{{template "org/header" .}}
+{{template "org/base/header" .}}
<div id="setting-wrapper" class="main-wrapper">
<div id="org-setting" class="container clear">
{{template "org/settings/nav" .}}
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
index c5c6a7e221..ae225a9ca4 100644
--- a/templates/org/settings/options.tmpl
+++ b/templates/org/settings/options.tmpl
@@ -1,6 +1,6 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
-{{template "org/header" .}}
+{{template "org/base/header" .}}
<div id="setting-wrapper" class="main-wrapper">
<div id="org-setting" class="container clear">
{{template "org/settings/nav" .}}
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
new file mode 100644
index 0000000000..8faeb9ef31
--- /dev/null
+++ b/templates/org/team/members.tmpl
@@ -0,0 +1,18 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="org-setting" class="container clear">
+ {{template "org/team/sidebar" .}}
+ <div class="grid-2-3 left">
+ <div class="setting-content">
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{.i18n.Tr "org.teams.members"}}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/templates/org/team/repositories.tmpl
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
new file mode 100644
index 0000000000..1ab24e9aac
--- /dev/null
+++ b/templates/org/team/sidebar.tmpl
@@ -0,0 +1,26 @@
+<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>
+ {{end}}
+ <strong>{{.Team.Name}}</strong>
+ </div>
+ <div class="panel-body">
+ <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>
+ </div>
+ <p class="desc">
+ {{if eq .Team.LowerName "owners"}}
+ {{.i18n.Tr "org.teams.owners_permission_desc" | Str2html}}
+ {{end}}
+ </p>
+ </div>
+ <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>
+</div> \ No newline at end of file