Explorar o código

Implemented Badge Section and Developer Badge and Resolves #56, #57

Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
4adae64aa1

+ 4 - 3
models/user.go

@@ -86,9 +86,10 @@ type User struct {
 	Suspended        bool
 
 	// Badges
-	IsVerified  bool
-	IsMaker     bool
-	IsBugHunter bool
+	IsVerified      bool
+	IsMaker         bool
+	IsBugHunter     bool
+	GitoteDeveloper bool
 
 	// Social
 	Twitter       string

+ 1 - 0
pkg/form/admin.go

@@ -50,6 +50,7 @@ type AdminEditUser struct {
 	IsVerified       bool
 	IsMaker          bool
 	IsBugHunter      bool
+	GitoteDeveloper  bool
 	IsBeta           bool
 	IsStaff          bool
 	IsIntern         bool

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
public/css/gitote.min.css


+ 5 - 0
public/less/_user.less

@@ -183,6 +183,11 @@
 	color: #00bcd4;
 }
 
+.gitotedeveloper {
+	font-size: 16px;
+	color: #21ba45;
+}
+
 .bughunter {
 	font-size: 16px;
 	color: #ff0000;

+ 1 - 0
routes/admin/users.go

@@ -216,6 +216,7 @@ func EditUserPost(c *context.Context, f form.AdminEditUser) {
 	u.IsVerified = f.IsVerified
 	u.IsMaker = f.IsMaker
 	u.IsBugHunter = f.IsBugHunter
+	u.GitoteDeveloper = f.GitoteDeveloper
 	u.IsBeta = f.IsBeta
 	u.IsStaff = f.IsStaff
 	u.IsIntern = f.IsIntern

+ 6 - 0
templates/admin/user/edit.tmpl

@@ -157,6 +157,12 @@
 								<input name="is_bug_hunter" type="checkbox" {{if .User.IsBugHunter}}checked{{end}}>
 							</div>
 						</div>
+						<div class="inline field">
+							<div class="ui checkbox">
+								<label><strong>This user is Gitote Developer</strong></label>
+								<input name="gitote_developer" type="checkbox" {{if .User.GitoteDeveloper}}checked{{end}}>
+							</div>
+						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
 								<label><strong>This account is Beta Member</strong> <i class="developer octicon octicon-circuit-board"></i></label>

+ 1 - 0
templates/admin/user/list.tmpl

@@ -41,6 +41,7 @@
 										{{if .IsBeta}}<i class="admin-badge developer octicon octicon-circuit-board"></i>{{end}}
 										{{if .IsStaff}}<i class="admin-badge isstaff octicon octicon-tools"></i>{{end}}
 										{{if .IsIntern}}<i class="admin-badge isintern octicon octicon-mortar-board"></i>{{end}}
+										{{if .GitoteDeveloper}}<i class="admin-badge gitotedeveloper octicon octicon-jersey"></i>{{end}}
 									</td>
 									<td><span class="text truncate email">{{.Email}}</span></td>
 									<td>{{.NumRepos}}</td>

+ 0 - 2
templates/org/member/members.tmpl

@@ -21,8 +21,6 @@
 						<div class="meta">
 							{{.FullName}}
 							{{if .IsVerified}}<a class="poping up" target="_blank" href="/verified" data-content="Verified" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
-							{{if .IsMaker}}<a class="poping up" target="_blank" href="/maker" data-content="Maker" data-variation="inverted tiny" data-position="right center"><i class="maker octicon octicon-paintcan"></i></a>{{end}}
-							{{if .IsBugHunter}}<a class="poping up" target="_blank" href="/security" data-content="Bug Hunter" data-variation="inverted tiny" data-position="right center"><i class="bughunter octicon octicon-gist-secret"></i></a>{{end}}
 						</div>	
 					</div>
 					<div class="ui five wide column center">

+ 0 - 3
templates/user/dashboard/dashboard.tmpl

@@ -58,9 +58,6 @@
 								<a style="color:#212121" href="{{AppSubURL}}/{{.LoggedUser.Name}}">
 									{{.Owner.FullName}}
 									{{if .Owner.IsVerified}}<a class="poping up" target="_blank" href="/verified" data-content="Verified" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
-									{{if .Owner.IsMaker}}<a class="poping up" target="_blank" href="/maker" data-content="Maker" data-variation="inverted tiny" data-position="right center"><i class="maker octicon octicon-paintcan"></i></a>{{end}}
-									{{if .Owner.IsBugHunter}}<a class="poping up" target="_blank" href="/security" data-content="Bug Hunter" data-variation="inverted tiny" data-position="right center"><i class="bughunter octicon octicon-gist-secret"></i></a>{{end}}
-									{{if .Owner.IsBeta}}<a class="poping up" target="_blank" href="/developer" data-content="Beta Member" data-variation="inverted tiny" data-position="right center"><i class="developer octicon octicon-circuit-board"></i></a>{{end}}
 									{{if .Owner.IsStaff}}<a class="poping up" target="_blank" href="/jobs" data-content="Staff" data-variation="inverted tiny" data-position="right center"><i class="isstaff octicon octicon-tools"></i></a>{{end}}
 								</a>
 							</div>

+ 2 - 5
templates/user/profile.tmpl

@@ -11,9 +11,6 @@
 		{{if .Owner.FullName}}
 			<span class="mobile-name">{{.Owner.FullName}}</span>
 			{{if .Owner.IsVerified}}<a class="poping up" target="_blank" href="/verified" data-content="Verified" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
-			{{if .Owner.IsMaker}}<a class="poping up" target="_blank" href="/maker" data-content="Maker" data-variation="inverted tiny" data-position="right center"><i class="maker octicon octicon-paintcan"></i></a>{{end}}
-			{{if .Owner.IsBugHunter}}<a class="poping up" target="_blank" href="/security" data-content="Bug Hunter" data-variation="inverted tiny" data-position="right center"><i class="bughunter octicon octicon-gist-secret"></i></a>{{end}}
-			{{if .Owner.IsBeta}}<a class="poping up" target="_blank" href="/developer" data-content="Beta Member" data-variation="inverted tiny" data-position="right center"><i class="developer octicon octicon-circuit-board"></i></a>{{end}}
 			{{if .Owner.IsStaff}}<a class="poping up" target="_blank" href="/jobs" data-content="Staff" data-variation="inverted tiny" data-position="right center"><i class="isstaff octicon octicon-tools"></i></a>{{end}}
 		{{end}}
 		</div>
@@ -187,10 +184,10 @@
 									{{.Owner.NumFollowing}} {{.i18n.Tr "user.following"}}
 								</a>
 							</li>
-							{{if or .Owner.IsBeta .Owner.IsMaker .Owner.IsBugHunter}}
+							{{if or .Owner.GitoteDeveloper .Owner.IsBeta .Owner.IsMaker .Owner.IsBugHunter}}
 								<li>
 									<div class="ui tiny images">
-										{{if .Owner.IsBugHunter}}<img class="ui image" src="https://cdn.jsdelivr.net/npm/gitote@1.2.2/logo.png">{{end}}
+										{{if .Owner.GitoteDeveloper}}<img class="ui image" src="https://stickershop.line-scdn.net/stickershop/v1/product/1349132/LINEStorePC/main@2x.png">{{end}}
 										{{if .Owner.IsBeta}}<img class="ui image" src="http://www.leapfrogbuilders.com/images/documents/139/Enterprise%20Tech%20&%20Digital%20Strategy%20Development.svg">{{end}}
 										{{if .Owner.IsMaker}}<img class="ui image" src="https://images.vexels.com/media/users/3/144262/isolated/preview/009c23b836c5f0abc17fb76b9e49396e-test-tube-lab-by-vexels.png">{{end}}
 										{{if .Owner.IsBugHunter}}<img class="ui image" src="https://www.svgrepo.com/show/231994/ladybug-bug.svg">{{end}}