summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkomalsheth2862016-12-15 17:05:03 +0530
committerkomalsheth2862016-12-15 17:05:03 +0530
commita2f9752336c7dc4af76432bd4b717a60258403a3 (patch)
treeeebbf9f1ecebf149b1adb3559457342ce3d11d96
parenta7a6f1475bdd29d033aed39635e79fd8e2bd8f02 (diff)
downloadcertificate-generator-a2f9752336c7dc4af76432bd4b717a60258403a3.tar.gz
certificate-generator-a2f9752336c7dc4af76432bd4b717a60258403a3.tar.bz2
certificate-generator-a2f9752336c7dc4af76432bd4b717a60258403a3.zip
Change receiver email id
-rwxr-xr-xcertificate/scipy_template_2016/template_SPC2016Acertificate76
-rw-r--r--certificate/templates/scipy_download_2016.html34
-rwxr-xr-xcertificate/views.py19
3 files changed, 60 insertions, 69 deletions
diff --git a/certificate/scipy_template_2016/template_SPC2016Acertificate b/certificate/scipy_template_2016/template_SPC2016Acertificate
index 3c11489..081df5c 100755
--- a/certificate/scipy_template_2016/template_SPC2016Acertificate
+++ b/certificate/scipy_template_2016/template_SPC2016Acertificate
@@ -1,7 +1,6 @@
-%% Internship Certificate template
+%% Certificate template
\documentclass[landscape]{article}
\usepackage{wallpaper}
-\usepackage{niceframe}
\usepackage{xcolor}
\usepackage{ulem}
\usepackage{graphicx}
@@ -29,54 +28,45 @@
%% \END
%\TileWallPaper{4cm}{2cm}{aakash-logo.png}
-\TileWallPaper{cer_bg.png}
+\TileWallPaper{28cm}{22cm}{cer_bg.png}
\centering
-\scalebox{3}
-{
-\color{green!30!black!60}
+\scalebox{3}{\color{brown!30!brown!60}
\begin{minipage}{.33\textwidth}
-\font\border=umrandb
-{
-\begin{center}
-\vspace{2.3cm}
-{\scriptsize \color{black} \hspace{2cm} This is to certify that } \\
-{\small {\color{black}\hspace{2cm}{$name}} }\\
-{\tiny {\color{black} \hspace{2cm} from the Department of speaker,\\
-\hspace{2cm} speaker,\\
-\hspace{2cm}has successfully completed an internship from speaker \\
-\hspace{2cm} in the Sponsored Project, FOSSEE (Free and Open Source Software for Education) at IIT Bombay.\\
-\vspace{.1cm}
-\hspace{2cm} During this tenure, he/she had worked on \\
-\hspace{2cm} \color{red} speaker. \\ {\tiny{}}
-}}
-\end{center}
+{\centering
+
+%% logo - top
+\vspace{1.5cm}
+\textcolor{black}{\textsc{Certificate of Participation}}
+\hspace{10cm}
+\textcolor{black!100}{\scriptsize This is to certify that}\\
+{\textcolor{blue} {~~~~~~~~{$name}}~~~~~~~~}\\
+{\scriptsize {\color{black} Participated in SciPy India 2016\\
+organized by Indian Institute of Bombay \\
+on 10, 11 December 2016.}\\}
+
+\vspace{0.3cm}
+{\color{black!40!black}
+\scalebox{.7}{
+ \begin{tabular}{c c c c c}
+ \small{\includegraphics[height=0.6cm]{kannan-moudgalya-sign.png}} & \small{} & & &\small{\includegraphics[height=0.6cm]{kannan-moudgalya-sign.png}} \\
+ \small{Prof. Prabhu Ramachandran} & &\hspace{2.5cm} & & \small{~~~~~~~~Dr. Mr. S. Anand~~~~~~~~} \\
+ \vspace{0mm}
+ {\scriptsize Conference Co-Chair} & & & & \scriptsize {Keynote Speaker} \\
+ {\scriptsize FOSSEE, IIT Bombay.} & & & & \scriptsize {CEO Gramener} \\
-\vspace{.2cm}
-\begin{minipage}{.33\textwidth}
-{\color{blue!40!black} \vspace{.2cm}
-\scalebox{0.6}{
-\hspace{3cm}
- \begin{tabular}{c c c}
- \small{} & \small{\includegraphics[height=0.6cm]{kannan-moudgalya-sign.png}} &\\
- \small{} & \small{~~~~~~~~Prof. Kannan Moudgalya~~~~~~~~} &\\
- \small{} & \small{Project In-charge} &\\
\end{tabular}
-}
-}
-\end{minipage}
-\hfill
-\begin{minipage}{.33\textwidth}
-\begin{centering}
-\vspace{.2cm}
-%%\includegraphics[height=0.6cm]{fossee_logo.png}\hspace{22pt}
-%%\includegraphics[height=0.7cm]{iitb-logo.png}\hspace{22pt}
-\begin{pspicture}(0.1cm,0.1cm) \psbarcode{$qr_code}{eclevel=L width=0.25 height=0.25}{qrcode}\end{pspicture}\\
-\tiny{\texttt{$serial_key}}\\
-\end{centering}
-\end{minipage}
+
+}}
+\\
+\vspace{2mm}
+%%\includegraphics[height=0.6cm]{fossee-logo.png}\hspace{22pt}
+%%\includegraphics[height=0.7cm]{bottom_logo.png}\hspace{22pt}
+%%\includegraphics[height=0.7cm]{iitb-logo.png}\hspace{22pt}\\
+\hspace{6.7cm}\begin{pspicture}(0.1cm,0.1cm) \psbarcode{$qr_code}{eclevel=L width=0.25 height=0.25}{qrcode}\end{pspicture}\\
+\hspace{6.7cm}\tiny{\color{black}\texttt{$serial_key}}\\
}
diff --git a/certificate/templates/scipy_download_2016.html b/certificate/templates/scipy_download_2016.html
index 9be110d..21621da 100644
--- a/certificate/templates/scipy_download_2016.html
+++ b/certificate/templates/scipy_download_2016.html
@@ -38,24 +38,23 @@
<div class="input-group" style="width:340px;text-align:center;margin:0 auto;">
<input style="width:450;" class="form-control input-lg" placeholder="Enter the email address you used for registration" type="text" id="email" name=email>
<span class="input-group-btn"><button class="btn btn-lg btn-primary" type="submit" id = 'myBtn' data-toggle = "modal">Mail Certificate</button></span>
+
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Certificate Instructions</h4>
- </div>
- <div class="modal-body"><ol style="text-align:left"><li>Instructions to be added here</li>
+ </div>
+ <div class="modal-body"><ol style="text-align:left"><li>Instructions to be added here</li>
<li>Instructions regarding certificates</li>
<li>Add the contents</li>
</ol></div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button>
- </div>
- </div>
- </div>
- </form>
+ </div>
+ </div>
+
+ </form>
<center><h4>Problem in downloading the certificate? Write to us at <a href="mailto:certificates@fossee.in">certificates[at]fossee[dot]in</a></h4>
{% endblock %}
@@ -65,9 +64,13 @@
value = "{{ v }}"
email = ""
error = "{{ error }}"
+
if(error == "True"){
$("#invalidModal").modal();
}
+ if(error == "False"){
+ $("#myModal").modal();
+ }
if(value == "paper"){
$('#A').prop('checked', true)
email = "{{ user_papers.0.email }}";
@@ -82,11 +85,4 @@
});
});
</script>
-<script>
-$(document).ready(function () {
-
- $("#myBtn").click(function(){
- $('#myModal').modal('show');
- });
-});</script>
{% endblock %}
diff --git a/certificate/views.py b/certificate/views.py
index 8f0958f..5d07603 100755
--- a/certificate/views.py
+++ b/certificate/views.py
@@ -1813,6 +1813,8 @@ def scipy_download_2016(request):
user = user[0]
paper = user.paper
name = user.name
+ email = user.email
+ print ">>>>>>>>>>>>>>>>>>>>>>", email
purpose = user.purpose
year = '16'
id = int(user.id)
@@ -1826,13 +1828,14 @@ def scipy_download_2016(request):
try:
old_user = Certificate.objects.get(email=email, serial_no=serial_no)
qrcode = 'Verify at: http://fossee.in/certificates/verify/{0} '.format(old_user.short_key)
- details = {'name': name, 'serial_key': old_user.short_key}
+ details = {'name': name, 'serial_key': old_user.short_key, 'email' : email}
certificate = create_scipy_certificate_2016(certificate_path, details, qrcode, type, paper, workshop, file_name)
print "==========", certificate[1]
if not certificate[1]:
old_user.counter = old_user.counter + 1
old_user.save()
- return render(request, 'scipy_download_2016.html')
+ context['error'] = False
+ return render_to_response( 'scipy_download_2016.html', context)
except Certificate.DoesNotExist:
uniqueness = False
num = 5
@@ -1844,7 +1847,7 @@ def scipy_download_2016(request):
else:
num += 1
qrcode = 'Verify at: http://fossee.in/certificates/verify/{0} '.format(short_key)
- details = {'name': name, 'serial_key': short_key}
+ details = {'name': name, 'serial_key': short_key, 'email': email}
certificate = create_scipy_certificate_2016(certificate_path, details,
qrcode, type, paper, workshop, file_name)
if not certificate[1]:
@@ -1947,12 +1950,12 @@ def create_scipy_certificate_2016(certificate_path, name, qrcode, type, paper, w
if return_value == 0:
pdf = open('{0}{1}.pdf'.format(certificate_path, file_name) , 'r')
path = os.path.join(certificate_path, str(file_name)+ ".pdf")
- print "path-------------", path
+
try :
sender_name = "scipy"
- sender_email = "from_email@gmail.com"
+ sender_email = "scipy@fossee.in"
subject = "SciPy India 2016 - Certificate"
- to = ['inbox.komal@gmail.com',]
+ to = ['scipy@fossee.in', name['email'],]
message = """ Hello,
Sending plain mail for testing
@@ -1964,6 +1967,7 @@ def create_scipy_certificate_2016(certificate_path, name, qrcode, type, paper, w
headers={"Content-type":"text/html;charset=iso-8859-1"}
)
email.attach_alternative(message, "text/html")
+ email.attach_file(path)
email.send(fail_silently=True)
# subject = 'subject'
@@ -1971,11 +1975,12 @@ def create_scipy_certificate_2016(certificate_path, name, qrcode, type, paper, w
# to = ['inbox.komal@gmail.com',]
# message = path
# msg = EmailMultiAlternatives(subject, message, from_email, [to])
- # msg.attach_file(path)
+ # msg.attach_file(path)
# msg.content_subtype = "html"
# msg.send()
except Exception as e:
print "===============================", e
+ _clean_certificate_certificate(certificate_path, file_name)
return [None, False]
else:
error = True