Pārlūkot izejas kodu

Remove Interns and Closes #22

Yoginth 6 gadi atpakaļ
vecāks
revīzija
051c344e2d

+ 0 - 4
cmd/web.go

@@ -321,10 +321,6 @@ func runWeb(c *cli.Context) error {
 		m.Get("/repos", ignSignIn, admin.RepoSitemap)
 	})
 
-	// ***** START: Misc *****
-	m.Get("/certificate/:username", ignSignIn, user.InternCertificate)
-	// ***** END: Misc *****
-
 	// ***** START: Embed *****
 	m.Get("/embed/user/:username", ignSignIn, user.Embed)
 	// ***** END: Embed *****

+ 0 - 5
models/user.go

@@ -92,7 +92,6 @@ type User struct {
 	PrivateProfile   bool
 	IsBeta           bool
 	IsStaff          bool
-	IsIntern         bool
 	IsAdmin          bool
 	AllowGitHook     bool
 	AllowImportLocal bool // Allow migrate repository by local path
@@ -135,10 +134,6 @@ type User struct {
 	// For Admins
 	StaffNotes string
 
-	// Certificate
-	Recognized string
-	Certified  string
-
 	// Misc
 	ShowAds bool
 }

+ 0 - 1
pkg/context/context.go

@@ -322,7 +322,6 @@ func Contexter() macaron.Handler {
 			c.Data["LoggedUserName"] = c.User.Name
 			c.Data["IsAdmin"] = c.User.IsAdmin
 			c.Data["IsStaff"] = c.User.IsStaff
-			c.Data["IsIntern"] = c.User.IsIntern
 			c.Data["IsBeta"] = c.User.IsBeta
 		} else {
 			c.Data["LoggedUserID"] = 0

+ 0 - 3
pkg/form/admin.go

@@ -48,8 +48,6 @@ type AdminEditUser struct {
 	Telegram         string `binding:"MaxSize(50)"`
 	Codepen          string `binding:"MaxSize(50)"`
 	Gitlab           string `binding:"MaxSize(50)"`
-	Recognized       string
-	Certified        string
 	MaxRepoCreation  int
 	Active           bool
 	Admin            bool
@@ -63,7 +61,6 @@ type AdminEditUser struct {
 	PrivateProfile   bool
 	IsBeta           bool
 	IsStaff          bool
-	IsIntern         bool
 }
 
 // Validate validates form fields

+ 0 - 3
routes/admin/users.go

@@ -236,9 +236,6 @@ func EditUserPost(c *context.Context, f form.AdminEditUser) {
 	u.IsBeta = f.IsBeta
 	u.PrivateProfile = f.PrivateProfile
 	u.IsStaff = f.IsStaff
-	u.IsIntern = f.IsIntern
-	u.Recognized = f.Recognized
-	u.Certified = f.Certified
 	u.Twitter = f.Twitter
 	u.Linkedin = f.Linkedin
 	u.Github = f.Github

+ 0 - 25
routes/user/certificate.go

@@ -1,25 +0,0 @@
-// Copyright 2015 - Present, The Gogs Authors. All rights reserved.
-// Copyright 2018 - Present, Gitote. All rights reserved.
-//
-// This source code is licensed under the MIT license found in the
-// LICENSE file in the root directory of this source tree.
-
-package user
-
-import (
-	"gitote/gitote/pkg/context"
-	"strings"
-)
-
-const (
-	// InterCertificateTPL page template
-	InterCertificateTPL = "misc/internscert"
-)
-
-// InternCertificate returns user details for the certificate
-func InternCertificate(c *context.Context) {
-	ctxUser := GetUserByName(c, strings.TrimSuffix(c.Params(":username"), ""))
-	c.Data["Owner"] = ctxUser
-
-	c.HTML(200, InterCertificateTPL)
-}

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

@@ -145,18 +145,6 @@
 								<input name="is_staff" type="checkbox" {{if .User.IsStaff}}checked{{end}}>
 							</div>
 						</div>
-						<div class="inline field">
-							<div class="ui checkbox">
-								<label><strong>This account is intern</strong></label>
-								<input name="is_intern" type="checkbox" {{if .User.IsIntern}}checked{{end}}>
-							</div>
-						</div>
-						<div class="field">
-							<input id="recognized" name="recognized" value="{{.User.Recognized}}" placeholder="Recognized As">
-						</div>
-						<div class="field">
-							<input id="certified" name="certified" value="{{.User.Certified}}" placeholder="Date" type="date">
-						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
 								<label><strong>This user is Bug Hunter</strong> <i class="bughunter octicon octicon-gist-secret"></i></label>

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

@@ -41,7 +41,6 @@
 										{{if .IsBugHunter}}<i class="admin-badge bughunter octicon octicon-gist-secret"></i>{{end}}
 										{{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>

+ 3 - 3
templates/base/info_bar.tmpl

@@ -2,7 +2,7 @@
     <div class="ui grid">
         <div class="column">
             <div class="ui left floated header infobar text">
-                {{if or .IsAdmin .IsStaff .IsIntern}}
+                {{if or .IsAdmin .IsStaff}}
                     <span class="infobar admin-align hide-mobile">
                         Version <span class="infobar embed">{{AppVer}}</span>
                     </span>
@@ -23,7 +23,7 @@
                 </span>
             </div>
             <div class="ui right floated header infobar text">
-                {{if or .IsAdmin .IsStaff .IsIntern}}
+                {{if or .IsAdmin .IsStaff}}
                     <div class="ui dropdown">
                         {{if .Lab}}<i class="octicon octicon-pulse"></i>
                         {{else}}<i class="octicon octicon-squirrel"></i>
@@ -37,7 +37,7 @@
 
                     <span class="infobar hide-mobile">{{GoVer}}</span>
                 {{end}}
-                {{if or .IsBeta .IsAdmin .IsStaff .IsIntern}}
+                {{if or .IsBeta .IsAdmin .IsStaff}}
                     <span class="infobar embed">Beta</span>
                 {{end}}
                 <a href="{{AppURL}}about">

+ 0 - 192
templates/misc/internscert.tmpl

@@ -1,192 +0,0 @@
-{{if .Owner.IsIntern}}
-    <div class="page" size="A4" layout="portrait">
-	<div class="margin">
-		<div class="container">
-
-			<div class="box a">
-				<div class="cert-to">
-					<h3>Certified To</h3>
-				</div>
-				<div class="cert-name">
-					<h1>{{.Owner.FullName}}</h1>
-				</div>
-				<div class="cert-p">
-					<p class="w230">Certificate of Completion and Is Globally Recognized As:</p>
-				</div>
-				<div class="cert-type">
-					<h2>{{.Owner.Recognized}}</h2>
-				</div>
-				<div class="cert-url">
-					<p><strong>Certification Authenticity Validation:</strong>
-                    <span>https://gitote.in/certificate/{{.Owner.Name}}</span></p>
-				</div>
-				<div class="cert-legal">
-					<p class="legal-copy"><b>© 2018 - Present, Gitote all rights reserved.</b> This documentation and its intellectual property belongs to Gitote. Any unauthorized use, reproduction, preparation of other works based on this document, dissemination or representation
-						of software presented in this document without the express written permission of Gitote is strictly prohibited. Gitote and Gitote branding are owned by Gitote. Other brands, services and business names belong to their
-						respective companies.</p>
-				</div>
-
-			</div>
-
-			<div class="box b">
-				<div class="align-center">
-					<div class="cert-logo">
-						<p><img style="height:100px; margin-bottom:20px" src="https://gitote-cdn.netlify.com/logoblack.svg"><br>
-                        <span class="cert-slogan">Software version control made simple!</span></p>
-					</div>
-					<div class="cert-signature signature-1"><img src="https://gitote-cdn.netlify.com/img/sign.jpg">
-						<p><b>Yoginth</b><br> <span class="position">Founder and CEO</span></p>
-					</div>
-				</div>
-				<div class="certificate-data">
-					<div class="certificate-dates">
-						<div>
-							<p><span class="label">Certification Date:</span><br><span class="date">{{.Owner.Certified}}</span></p>
-						</div>
-					</div>
-					<div class="certificate-qr">
-						<div class="cert-qr"><img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=http://gitote.local/interns/certificate/{{.Owner.Name}}&choe=UTF-8" alt="QR Code"></div>
-						<div>
-							<p style="text-transform:uppercase"><b>OTE{{.Owner.Name}}{{.Owner.ID}}</b></p>
-						</div>
-					</div>
-				</div>
-
-			</div>
-		</div>
-	</div>
-
-    <style>
-    @import url('https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i');
-
-    body {
-        margin: 40px;
-        /*background: rgb(204, 204, 204);*/
-        background:#443b63;
-        font-family: 'Noto Sans';
-        font-size:10pt;
-    }
-
-    h1,h2,h3,h4,h5,h6 {
-        margin:0;
-        display: inline-block;
-        font-weight:normal;
-    }
-
-    div,p,span,h1,h2,h3,h4,h5,h6 { color: #625b7c; }
-
-    h1, h2 { font-size:24pt; letter-spacing:-.38px; }
-
-    .page {
-        background: white;
-        display: block;
-        margin: 0px auto;
-    }
-
-    .margin {
-        width:10in;
-        height:6.0in;
-        border:2px solid red;
-        position: relative;
-        top:.4in;
-        left:.45in;
-        border: 2px solid #625b7c;
-        border-radius: 0.09in;
-        padding:3px;
-    }
-    .container {
-        display: grid;
-        grid-gap: 0;
-        grid-template-columns: 7.2in 2.8in;
-        background-color: #fff;
-        color: #444;
-    }
-
-    .a {
-        grid-column: 1 / 2;
-        grid-row: 1;
-    }
-    .b {
-        grid-column: 2;
-        grid-row: 1;
-        /*background:cyan;*/
-    }
-
-    .certificate-data {
-        display: grid;
-        grid-gap: 0;
-        grid-template-columns: 50% 50%;
-        position:absolute;
-        width:2.8in;
-        margin-top:3.25em;
-    }
-
-    .cert-to, .cert-name, .cert-p,
-    .cert-type, .cert-url,
-    .cert-legal {
-        position:relative;
-        padding-left:26pt;
-        padding-right:26pt;
-    }
-
-    .cert-to 				{ height:44pt; margin-bottom:20pt; }
-    .cert-to h3 		{ position:absolute; bottom:0; }
-    .cert-name 			{ height:82pt; }
-    .cert-name h1		{ font-weight:bold; }
-    .cert-p .w230 	{ min-height:40pt; }
-    .cert-type			{ min-height:50pt; margin-bottom:30pt; }
-    .cert-type h2 	{ font-weight:normal; }
-    .cert-url				{ font-size:7pt;margin-top:17.25em; }
-
-    .cert-logo			{ width:130pt; height:130pt; 
-                                        padding-top:20pt; padding-bottom:50pt; }
-    .cert-logo p 		{ line-height:1; }
-    .cert-slogan		{ font-size:7pt; font-weight:bold; line-height:1.2;}
-    .cert-logo .cert-slogan { display:inline-block; width:80%; }
-
-    .cert-signature { font-size:7pt; padding-bottom:15pt; }
-    .cert-signature p { border-top: 2px solid #ddd; width:60%; padding-top:1em; /*top:-10pt; position:relative;*/ }
-    .cert-signature img { max-width:160pt; height:5em; margin-bottom:4px; }
-    .cert-signature .position { color: #7a7a7a; }
-
-    .certificate-dates .label { font-size:8pt; color:#7a7a7a;}
-    .certificate-dates .date { font-weight:bold; }
-    .certificate-dates { margin-top: 7em; }
-
-    .cert-qr img { width: 80pt; height:80pt; }
-    /*
-    Utilities
-    */
-
-    .w230 				{ width: 230pt; }
-    .legal-copy 	{ font-size:6pt; }
-    .align-center * { text-align:center; margin: 0 auto; }
-
-
-
-    div.page[size="A4"] {
-    width: 8.2in;
-    height: 11in;
-    }
-
-    div.page[size="A4"][layout="portrait"] {
-    width: 11in;
-    height: 6.9in;
-    }
-
-    @page {
-        size: A4 landscape;
-    }
-    </style>
-{{else}}
-    <div class="pages bg">
-        {{template "base/head" .}}
-        <div class="pages body">
-            <div class="ui center">
-                <img class="ui centered medium image" src="https://gitote-cdn.netlify.com/img/svg/certificate.svg">
-                <h1>You don't have any certificate yet!</h1>
-            </div>
-        </div>
-        {{template "base/footer" .}}
-    </div>
-{{end}}