ソースを参照

Added Certificate Completely

Yoginth 7 年 前
コミット
4f8ae4a41f

+ 4 - 0
models/user.go

@@ -118,6 +118,10 @@ type User struct {
 
 	// For Admins
 	StaffNotes string
+
+	// Certificate
+	Recognized string
+	Certified  string
 }
 
 func (u *User) BeforeInsert() {

+ 2 - 0
pkg/form/admin.go

@@ -38,6 +38,8 @@ type AdminEditUser struct {
 	Reddit           string `binding:"MaxSize(50)"`
 	Telegram         string `binding:"MaxSize(50)"`
 	Codepen          string `binding:"MaxSize(50)"`
+	Recognized       string
+	Certified        string
 	MaxRepoCreation  int
 	Active           bool
 	Admin            bool

+ 2 - 0
routes/admin/users.go

@@ -219,6 +219,8 @@ func EditUserPost(c *context.Context, f form.AdminEditUser) {
 	u.IsBeta = f.IsBeta
 	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

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

@@ -145,6 +145,12 @@
 								<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>

+ 24 - 29
templates/misc/internscert.tmpl

@@ -15,11 +15,11 @@
 					<p class="w230">Certificate of Completion and Is Globally Recognized As:</p>
 				</div>
 				<div class="cert-type">
-					<h2>Software Developer Intern</h2>
+					<h2>{{.Owner.Recognized}}</h2>
 				</div>
-				<div class="cert-image"><img src="https://www.issabel.com/wp-content/uploads/2018/07/cert-image-ica.svg" alt="ISSABEL MAP IMAGE"></div>
 				<div class="cert-url">
-					<p><strong>Certification Authenticity Validation:</strong> <span>https://gitote.in/certificate/{{.Owner.Name}}</span></p>
+					<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
@@ -33,7 +33,7 @@
 			<div class="box b">
 				<div class="align-center">
 					<div class="cert-logo">
-						<p><img style="height:100px; margin-bottom:20px" src="https://cdn.jsdelivr.net/npm/gitote@1.1.9/logo.png" alt="ISSABEL LOGO"><br>
+						<p><img style="height:100px; margin-bottom:20px" src="https://cdn.jsdelivr.net/npm/gitote@1.1.9/logo.png"><br>
                         <span class="cert-slogan">Software version control made simple!</span></p>
 					</div>
 					<!-- Signature 2 -->
@@ -46,14 +46,14 @@
 					<!-- Dates -->
 					<div class="certificate-dates">
 						<div>
-							<p><span class="label">Certification Date:</span><br><span class="date">March 15, 2020</span></p>
+							<p><span class="label">Certification Date:</span><br><span class="date">{{.Owner.Certified}}</span></p>
 						</div>
 					</div>
 					<!-- QR -->
 					<div class="certificate-qr">
-						<div class="cert-qr"><img src="https://www.issabel.com/wp-content/uploads/2018/07/cert-sample-qr.svg" alt="QR Code"></div>
+						<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><b>ICA031804A008</b></p>
+							<p style="text-transform:uppercase"><b>OTE{{.Owner.Name}}{{.Owner.ID}}</b></p>
 						</div>
 					</div>
 				</div>
@@ -84,21 +84,20 @@
     h1, h2 { font-size:24pt; letter-spacing:-.38px; }
 
     .page {
-    background: white;
-    display: block;
-    margin: 1in auto;
-    box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
+        background: white;
+        display: block;
+        margin: 0px 10%;
     }
 
     .margin {
-            width:10in;
-            height: 7.2in;
-            border:2px solid red;
-            position: relative;
-            top:.5in;
-            left:.5in;
+        width:10in;
+        height:6.0in;
+        border:2px solid red;
+        position: relative;
+        top:.4in;
+        left:.45in;
         border: 2px solid #625b7c;
-    border-radius: 0.09in;
+        border-radius: 0.09in;
         padding:3px;
     }
     .container {
@@ -107,7 +106,6 @@
         grid-template-columns: 7.2in 2.8in;
         background-color: #fff;
         color: #444;
-        min-height:7.2in;
     }
 
     .a {
@@ -126,12 +124,11 @@
         grid-template-columns: 50% 50%;
         position:absolute;
         width:2.8in;
-        bottom:3px;
-        /*background-color:yellow;*/
+        margin-top:3.25em;
     }
 
     .cert-to, .cert-name, .cert-p,
-    .cert-type, .cert-image, .cert-url,
+    .cert-type, .cert-url,
     .cert-legal {
         position:relative;
         padding-left:26pt;
@@ -145,9 +142,7 @@
     .cert-p .w230 	{ min-height:40pt; }
     .cert-type			{ min-height:50pt; margin-bottom:30pt; }
     .cert-type h2 	{ font-weight:normal; }
-    .cert-image img	{ max-width:100%; }
-    .cert-url				{ font-size:7pt; }
-    .cert-legal .legal-copy { margin-top:.25in;  }
+    .cert-url				{ font-size:7pt;margin-top:17.25em; }
 
     .cert-logo			{ width:130pt; height:130pt; 
                                         padding-top:20pt; padding-bottom:50pt; }
@@ -157,11 +152,12 @@
 
     .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:auto; }
+    .cert-signature img { max-width:160pt; height:5em; margin-left: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; }
     /*
@@ -181,12 +177,11 @@
 
     div.page[size="A4"][layout="portrait"] {
     width: 11in;
-    height: 8.2in;
+    height: 6.9in;
     }
 
     @page {
-    size: A4 landscape;
-    /*margin: .5in;*/
+        size: A4 landscape;
     }
     </style>
 {{else}}