Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template changes and tweaks #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arc/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
1: 'first',
2: 'second',
3: 'third',
4: 'forth',
4: 'fourth',
5: 'fifth',
}

Expand Down
49 changes: 33 additions & 16 deletions arc/main/views.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
from django.shortcuts import render
from .models import *
from datetime import datetime,date
def refSemester():

year = date.today().year%2000
semtext = ("II/"+str(year-1)+"-"+str(year)) if date.today().month<7 else ("I/"+str(year)+"-"+str(year+1))
return semtext

def dateText():
dtext = datetime.now().strftime("%B")+" "+str(date.today().day)+", "+str(date.today().year)
return dtext

def printGraduating(request,id=None):

instance = Graduating.objects.get(id=id)
student = instance.student
context = {
"text" :instance.text,
"date" :date.today(),
"date" :dateText(),
"id" :id,
"student": student
"student": student,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -19,8 +30,9 @@ def printThesis(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -30,8 +42,9 @@ def printCGPA(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -41,9 +54,9 @@ def printCompletion(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"date" :dateText(),
"id" :id,
"student": instance.student,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -53,8 +66,9 @@ def printEnglish(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -64,8 +78,9 @@ def printContinuing(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -75,8 +90,9 @@ def printGraduated(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)

Expand All @@ -86,7 +102,8 @@ def printSem(request,id=None):
context = {
"student":instance.student,
"text" :instance.text,
"date" :date.today(),
"id" :id
"date" :dateText(),
"id" :id,
"reftext": refSemester()
}
return render(request,"print.html",context)
51 changes: 37 additions & 14 deletions arc/templates/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style type="text/css" media="print">
@page {
size: auto;
margin: 0px;
margin: 10px;
}
</style>
<style>
Expand All @@ -18,22 +18,31 @@
width: 800px;
}
.logo img {
width: 2.88cm;
height: 2.47cm;
width: 3cm;
height: 2.8cm;
float: left;
padding-left: 40px;
}
table {
width: 100%;
border-top: 1px solid black;
font-weight: bold;
padding-top: 20px;
border-collapse: collapse;
}
tr td:nth-of-type(1) {
text-align:left;
}
tr td:nth-of-type(2) {
text-align:right;
}
.blank-row{
height: 20px;
}
.cert-addr
{
padding-right: 60px;
}
.cert-heading {
text-decoration: underline black;
text-align: center;
Expand All @@ -46,12 +55,16 @@
font-weight: normal;
}
.cert-text {
font-size: 10px;
font-size: 22px;
}
#letterhead .content {
text-align: center;
font-size: 18px;
}
#letterhead .content h2{
margin-bottom: -12px;
padding-right: 60px;
}
#content {
padding: 0 40px;
}
Expand All @@ -68,7 +81,7 @@
#footer{
position:absolute;
bottom:0;
width: 835px;
width: 800px;
margin-left: auto;
margin-right: auto;
}
Expand All @@ -83,16 +96,21 @@
<body>
<div id="letterhead">
<div class="logo">
<br>
<img src="{% static 'img/logo.png' %}">
</div>
<div class="content">
<h2>Birla Institute of Technology and Science, Pilani
<h2>Birla Institute of Technology and Science-Pilani
<br>K. K. Birla Goa Campus</h2>
<p class="cert-addr">Zuarinagar, Goa, 403726, India</p>
<p class="cert-addr">Zuarinagar, Goa 403726, India</p>
</div>
</div>
<div id="content">
<table>
<tr class="blank-row">
<td colspan="2">
</td>
</tr>
<tr>
<td>
Prof. Neena Goveas
Expand All @@ -103,15 +121,15 @@ <h2>Birla Institute of Technology and Science, Pilani
</tr>
<tr>
<td>
Associate Dean,
Associate Dean
</td>
<td>
Phone: 91-832-2580403 (O)
</td>
</tr>
<tr>
<td>
Academic -
Academic-
</td>
<td>
91-832-2580336 (O)
Expand All @@ -129,31 +147,36 @@ <h2>Birla Institute of Technology and Science, Pilani
<tr>
<td>
<div class="cert-ref">
Ref. No. AUGSD/II/18-19/{{ student.bitsId }}
Ref. No. AUGSD/{{ reftext }}/{{ student.bitsId }}
</div>
</td>
<td>
<div class="cert-ref">
Dated: {{ date|date:"d-F-Y" }}
Dated: {{ date }}
</div>
</td>
</tr>
</table>
<br>
<div class="cert-heading">CERTIFICATE</div>
<p class="cert-text">
<div class = "cert-text">
<br>
<p>
{{ text | safe | linebreaks }}
</p>
<br><br><br>
<p>
<span style="float:left;">Signature of The Authority:</span>
<span style="float:left;">Signature of the Authority:</span>
<br><br><br><br><br><br>
<span style="float:left;">Office Seal:</span>
</p>
</div>
</div>
<div id="footer">
<p class="footer-text">
<br>
(BITS Pilani - A Deemed University established under section 3 of the UGC Act. 1956 <br>
under notification no. F.12-23/63.U-2 dated 18th June, 1964)
under notification no. F.12-23/63.U-2 dated 18<sup>th</sup> June, 1964)
</p>
</div>
</body>
Expand Down