فهرست منبع

Implemented Verified Organization and Closes #5

Yoginth 7 سال پیش
والد
کامیت
083fbe6347
4فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 1 0
      pkg/form/org.go
  2. 1 0
      routes/org/setting.go
  3. 6 1
      templates/org/home.tmpl
  4. 9 0
      templates/org/settings/options.tmpl

+ 1 - 0
pkg/form/org.go

@@ -19,6 +19,7 @@ type UpdateOrgSetting struct {
 	Description     string `binding:"MaxSize(255)"`
 	Website         string `binding:"Url;MaxSize(100)"`
 	Location        string `binding:"MaxSize(50)"`
+	IsVerified      bool
 	MaxRepoCreation int
 }
 

+ 1 - 0
routes/org/setting.go

@@ -73,6 +73,7 @@ func SettingsPost(c *context.Context, f form.UpdateOrgSetting) {
 	org.Description = f.Description
 	org.Website = f.Website
 	org.Location = f.Location
+	org.IsVerified = f.IsVerified
 	if err := models.UpdateUser(org); err != nil {
 		c.Handle(500, "UpdateUser", err)
 		return

+ 6 - 1
templates/org/home.tmpl

@@ -10,7 +10,9 @@
 				<div id="org-info">
 					<div class="ui header">
 						{{.Org.DisplayName}}
-						{{if .IsOrganizationOwner}}<a class="text grey" href="{{.OrgLink}}/settings"><span class="octicon octicon-gear"></span></a>{{end}}
+						{{if .Org.IsVerified}}
+							<span style="padding:3px" class="ui green basic label tiny">Verified</span>
+						{{end}}
 					</div>
 					{{if .Org.Description}}
 						<p class="desc">{{.Org.Description}}</p>
@@ -34,6 +36,9 @@
 			<div class="ui eleven wide column">
 				{{if .IsOrganizationOwner}}
 					<div class="text right">
+						{{if .IsOrganizationOwner}}
+							<a class="ui blue basic button" href="{{.OrgLink}}/settings"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "settings"}}</a>
+						{{end}}
 						<a class="ui green button" href="{{AppSubURL}}/repo/create?org={{.Org.ID}}"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "new_repo"}}</a>
 					</div>
 					<div class="ui divider"></div>

+ 9 - 0
templates/org/settings/options.tmpl

@@ -41,6 +41,15 @@
 							<input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.Org.MaxRepoCreation}}">
 							<p class="help">(Set -1 to use global default limit)</p>
 						</div>
+						
+						<div class="ui divider"></div>
+
+						<div class="inline field">
+							<div class="ui checkbox">
+								<label><strong>This organization is verified</strong>  <span style="padding:3px" class="ui green basic label tiny">Verified</span></label>
+								<input name="is_verified" type="checkbox" {{if .Org.IsVerified}}checked{{end}}>
+							</div>
+						</div>
 						{{end}}
 
 						<div class="field">