From 21a1b8e5a35c61bff30145ac3194ea893a9c6b68 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 24 Aug 2014 21:09:05 +0800 Subject: Finish new edit team page, add member to team --- templates/.VERSION | 2 +- templates/org/home.tmpl | 12 ++++++++++-- templates/org/member/members.tmpl | 2 +- templates/org/team/members.tmpl | 29 ++++++++++++++++++++++++++++- templates/org/team/new.tmpl | 25 ++++++++++++++++++++----- templates/org/team/sidebar.tmpl | 18 +++++++++++++----- templates/org/team/teams.tmpl | 8 ++++---- 7 files changed, 77 insertions(+), 19 deletions(-) (limited to 'templates') diff --git a/templates/.VERSION b/templates/.VERSION index f152becda3..3e68f858b5 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.4.7.0823 Alpha \ No newline at end of file +0.4.7.0824 Alpha \ No newline at end of file diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index afd695ec7d..6f3078de50 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -18,6 +18,7 @@
+ {{$isMember := .Org.IsOrgMember $.SignedUser.Id}}
{{if .IsOrganizationOwner}} @@ -26,6 +27,7 @@
{{range .Repos}} + {{if or $isMember (not .IsPrivate)}}
  • {{.NumStars}}
  • @@ -35,6 +37,7 @@

    {{.Description}}

    {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}

+ {{end}} {{end}}
@@ -42,12 +45,16 @@
+ {{if $isMember}} {{.Org.NumMembers}} + {{end}} {{.i18n.Tr "org.people"}}
{{range .Members}} - + {{if or $isMember (.IsPublicMember $.Org.Id)}} + + {{end}} {{end}}
{{if .IsOrganizationOwner}} @@ -56,6 +63,7 @@
{{end}}
+ {{if $isMember}}
@@ -76,9 +84,9 @@ - {{end}}
+ {{end}}
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index 3ab92bbfc0..1c530982fb 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -6,7 +6,7 @@ {{template "ng/base/alert" .}}
- {{if .IsAdminTeam}} + {{if .IsOrganizationOwner}} {{.i18n.Tr "org.invite_someone"}} {{end}}
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" .}}
-
+
+ {{template "ng/base/alert" .}} {{template "org/team/sidebar" .}}
@@ -10,6 +11,32 @@
{{.i18n.Tr "org.teams.members"}}
+
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" .}}
-
+ {{.CsrfTokenHtml}}
-

{{.i18n.Tr "org.create_new_team"}}

+

+ {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}} +

{{template "ng/base/alert" .}}
- + {{if eq .Team.LowerName "owners"}} + + {{end}} + {{.i18n.Tr "org.team_name_helper"}}
@@ -21,6 +26,7 @@ {{.i18n.Tr "org.team_desc_helper"}}
+ {{if not (eq .Team.LowerName "owners")}}

{{.i18n.Tr "org.team_permission_desc"}}

@@ -37,10 +43,19 @@

{{.i18n.Tr "org.teams.admin_access_helper"}}


+ {{end}}
- - {{.i18n.Tr "cancel"}} + {{if .PageIsOrgTeamsNew}} + + {{.i18n.Tr "cancel"}} + {{else}} + + {{if not (eq .Team.LowerName "owners")}} +       + + {{end}} + {{end}}
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 @@
{{if .Team.IsMember $.SignedUser.Id}} - {{$.i18n.Tr "org.teams.leave"}} - {{else}} - {{$.i18n.Tr "org.teams.join"}} + {{$.i18n.Tr "org.teams.leave"}} + {{else if .IsOrganizationOwner}} + {{$.i18n.Tr "org.teams.join"}} {{end}} {{.Team.Name}}
@@ -11,16 +11,24 @@

{{if .Team.Description}}{{.Team.Description}}{{else}}{{.i18n.Tr "org.teams.no_desc"}}{{end}}


{{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}}

+ {{if .IsOrganizationOwner}} + {{end}}
\ 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" .}}
- {{if .IsAdminTeam}} + {{if .IsOrganizationOwner}} {{.i18n.Tr "org.create_new_team"}} {{end}}
@@ -16,9 +16,9 @@
{{if .IsMember $.SignedUser.Id}} - {{$.i18n.Tr "org.teams.leave"}} - {{else}} - {{$.i18n.Tr "org.teams.join"}} + {{$.i18n.Tr "org.teams.leave"}} + {{else if $.IsOrganizationOwner}} + {{$.i18n.Tr "org.teams.join"}} {{end}} {{.Name}}
-- cgit v1.2.3