Created
November 8, 2015 03:07
-
-
Save shubham90/1e01789eb033042578ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block title %} | |
New Contest | |
{% endblock %} | |
{% block extracss %} | |
<style type="text/css"> | |
.checkbox { | |
margin-bottom: 20px; | |
} | |
.upload-box { | |
border-style: dashed; | |
border-width: 2px; | |
} | |
.upload-body { | |
min-height: 200px; | |
text-align: center; | |
vertical-align: middle; | |
} | |
.template-upload td, .template-download td { | |
padding: 10px !important; | |
height: 106px !important; | |
} | |
.short-field { | |
max-width: 500px; | |
} | |
.form-submit-button { | |
width: 150px; | |
height: 50px; | |
line-height: 1.5em; | |
} | |
</style> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
{% endblock %} | |
{% block content %} | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<h1>Create New Contest</h1> | |
<hr/> | |
<form id="contest-form" action="success/" method="post">{% csrf_token %} | |
<div class="form-group"> | |
<input type="text" value="{{ contest.users.name }}" class="form-control short-field" | |
id="user-name" | |
name="user-name" placeholder="Enter name" required> | |
</div> | |
<div class="form-group"> | |
<input type="email" value="{{ contest.users.email }}" class="form-control short-field" | |
id="user-email" | |
name="user-email" placeholder="Enter email" required> | |
</div> | |
<div class="form-group"> | |
<input type="text" value="{{ contest.title }}" class="form-control" id="contest-title" | |
name="contest-title" placeholder="Enter Contest title" required> | |
</div> | |
<div class="form-group"> | |
<textarea class="form-control" id="contest-description" name="contest-description" | |
placeholder="Enter Contest description" required>{{ contest.description }}</textarea> | |
</div> | |
<div id="datetimepicker" class="input-append date"> | |
<input type="text" value="{{ contest.started_at }}" class="form-control" id="contest-started_at" | |
name="contest-started_at" placeholder="Enter Start Date" required> | |
<span class="add-on"> | |
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> | |
</span> | |
</div><br/> | |
<div id="datetimepicker1" class="input-append date"> | |
<input type="text" value="{{ contest.ending_at }}" class="form-control" id="contest-ending_at" | |
name="contest-ending_at" placeholder="Enter End Date" required> | |
<span class="add-on"> | |
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> | |
</span> | |
</div> | |
<div class="form-group"> | |
<input type="text" value="{{ contest.url }}" class="form-control" id="contest-url" | |
name="contest-url" placeholder="Enter URL for detailed description"> | |
</div> | |
<div class="col-lg-7"> | |
<input type="submit" value="submit" class="form-submit-button"> | |
<!-- <a href="#" id="start-upload-link" class="btn btn-lg btn-primary form-submit-button"> | |
<i class="glyphicon glyphicon-send"></i> | |
<span>Submit</span> | |
</a>--> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
{% endblock %} | |
{% block extrajs %} | |
<script> | |
$(function () { | |
'use strict'; | |
var contest_id; | |
$('#start-upload-link').click(function (e) { | |
e.preventDefault(); | |
if ($('#contest-form').valid()) { | |
$.post("{% url 'contest_success' %}", { | |
'user-name': $('#user-name').val(), | |
'user-email': $('#user-email').val(), | |
'contest-title': $('#contest-title').val(), | |
'contest-description': $('#contest-description').val(), | |
'contest-url': $('#contest-url').val(), | |
'csrfmiddlewaretoken': '{{ csrf_token }}' | |
}, function (response) { | |
contest_id = response.id; | |
}, "json"); | |
} | |
}); | |
}); | |
</script> | |
<script src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js"></script> | |
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script> | |
<script type="text/javascript"> | |
var date = new Date(); | |
date.setDate(date.getDate()-1); | |
$('#datetimepicker').datetimepicker({ | |
format: 'yyyy-MM-dd hh:mm' , | |
startDate: date | |
}); | |
</script> | |
<script type="text/javascript"> | |
var date = new Date(); | |
date.setDate(date.getDate()-1); | |
$('#datetimepicker1').datetimepicker({ | |
format: 'yyyy-MM-dd hh:mm' , | |
startDate: date | |
}); | |
</script> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment