diff options
author | prathamesh | 2014-12-08 16:56:04 +0530 |
---|---|---|
committer | prathamesh | 2014-12-08 16:56:04 +0530 |
commit | 15e90ea25a7d7ba2075f69435acd0b9db2c9c8a5 (patch) | |
tree | 0da36755d1c69326df8139a902ef485b3da09b94 | |
parent | dfa18b5f1b8c811e7bf9a7154520bf4df96d1233 (diff) | |
download | certificate-generator-15e90ea25a7d7ba2075f69435acd0b9db2c9c8a5.tar.gz certificate-generator-15e90ea25a7d7ba2075f69435acd0b9db2c9c8a5.tar.bz2 certificate-generator-15e90ea25a7d7ba2075f69435acd0b9db2c9c8a5.zip |
modified UI
-rw-r--r-- | certificate/templates/download.html | 25 | ||||
-rw-r--r-- | certificate/templates/feedback.html | 15 | ||||
-rw-r--r-- | certificate/views.py | 10 |
3 files changed, 24 insertions, 26 deletions
diff --git a/certificate/templates/download.html b/certificate/templates/download.html index 9ba4acf..bd0a2ac 100644 --- a/certificate/templates/download.html +++ b/certificate/templates/download.html @@ -6,7 +6,7 @@ <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> - <h4 class="modal-title" id="invalidModalLabel">Invalid Caategory</h4> + <h4 class="modal-title" id="invalidModalLabel">Invalid Category</h4> </div> <div class="modal-body"> The requested certificate is unavailable for your email address. Please select the appropriate category and retry. @@ -17,37 +17,36 @@ <form class="col-lg-12" action="{% url 'certificate:download' %}" method="post"> {% csrf_token %} {{ message }} - <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">Get Certificate</button></span> - </div> <hr> <p>Please choose the appropriate category</p> <input type="radio" name="type" id="P" value="P" checked="True">Participant <input type="radio" name="type" id="A" value="A">Speaker <input type="radio" name="type" id="W" value="W">Workshop <hr> - <br> <center> {% if user_papers %} - <br><br> <span><h3>Papers presented</h3><span> + <div style="padding-left:350px;text-align:left"> {% for user in user_papers %} - <br> - <input type="radio" name="paper" value="{{ user.paper }}">{{ user.paper }} + <input type="radio" name="paper" value="{{ user.paper }}">{{ user.paper }}<br> {% endfor %} + </div> {% endif %} {% if workshops %} - <br><br> <span><h3>Workshop Attended</h3><span> + <div style="text-align:left"> {% for user in workshops %} - <br> - <input type="radio" name="workshop" value="{{ user.workshops }}">{{ user.workshops }} + <input type="radio" name="workshop" value="{{ user.workshops }}">{{ user.workshops }}<br> {% endfor %} + </div> {% endif %} </center> + <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">Download Certificate</button></span> + </div> </form> - <center><h4>Problem in downloading certificate ? write to us at <a href="mailto:info@fossee.in">info[at]fossee[dot]in</a></h4> + <center><h4>Problem in downloading the certificate? Write to us at <a href="mailto:info@fossee.in">info[at]fossee[dot]in</a></h4> {% endblock %} {% block javascript %} diff --git a/certificate/templates/feedback.html b/certificate/templates/feedback.html index 2c1f6b7..e5c2183 100644 --- a/certificate/templates/feedback.html +++ b/certificate/templates/feedback.html @@ -3,24 +3,23 @@ {% block content %} <form action="{% url 'certificate:feedback' %}" method="post" style="width:1000px"> - <div class="input-group" style="padding-left:100px;width:940px;text-align:center;margin:0 auto;"> - <div align=center style="padding-left:250px"> <h1> Feedback </h1> - <p>Please fill in the feedback form. This will greatly enable us to do better.</p> + <div style="padding-left:100px;width:940px;text-align:center;margin:0 auto;"> + <div align=center style="padding-left:200px"> <h1> Feedback </h1> + <p>Please fill the feedback form. This will greatly enable us to do better.</p> </div> {{ detail }} {% csrf_token %} - <div style="padding-left:300px;text-align:left;" > + <div style="padding-left:200px;text-align:left;" > <table class="table"> {{ form }} </table> {% for question in questions %} - <label>Q{{ forloop.counter }}. {{ question.question }} </label><br> + <label>{{ forloop.counter }}. {{ question.question }} </label><br> <textarea cols="80" class="form-control" id="{{ question.id }}" name="{{ question.id }}"></textarea><br> {% endfor %} - <br></br> - <span><button class="btn btn-lg btn-primary" type="submit">Submit</button></span> - <span><a href="{% url 'certificate:download' %}" >I have already submitted</a></span> + <span><button class="btn btn-primary" type="submit">Submit</button></span> + <span style="float:right"><a href="{% url 'certificate:download' %}" >I have already submitted</a></span> </div> </div> </form> diff --git a/certificate/views.py b/certificate/views.py index 4e509bd..5ab2910 100644 --- a/certificate/views.py +++ b/certificate/views.py @@ -156,12 +156,12 @@ def create_certificate(certificate_path, name, qrcode, type, paper, workshop, fi content = Template(template_file.read()) template_file.close() if type == 'P': - content_tex = content.safe_substitute(name=name, qr_code=qrcode) + content_tex = content.safe_substitute(name=name.title(), qr_code=qrcode) elif type == 'A': - content_tex = content.safe_substitute(name=name, qr_code=qrcode, + content_tex = content.safe_substitute(name=name.title(), qr_code=qrcode, paper=paper) elif type == 'W': - content_tex = content.safe_substitute(name=name, qr_code=qrcode, + content_tex = content.safe_substitute(name=name.title(), qr_code=qrcode, workshop=workshop) create_tex = open('{0}{1}.tex'.format\ (certificate_path, file_name), 'w') @@ -211,7 +211,7 @@ def feedback(request): data = form.cleaned_data try: FeedBack.objects.get(email=data['email'].strip(), purpose='SLC') - context['message'] = 'You have already submitted the feedback. You can download the certificate' + context['message'] = 'You have already submitted the feedback. You can download your certificate.' return render_to_response('download.html', context, ci) except FeedBack.DoesNotExist: feedback = FeedBack() @@ -234,7 +234,7 @@ def feedback(request): answer.save() feedback.answer.add(answer) feedback.save() - context['message'] = 'Thank you for the feedback. You can download the certificate' + context['message'] = 'Thank you for the feedback. You can download your certificate.' return render_to_response('download.html', context, ci) context['form'] = form |