File tree Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Original file line number Diff line number Diff line change 1
1
{% extends 'base.html' %}
2
2
{% load static %}
3
3
{% block content %}
4
+ < style >
5
+ h3 {
6
+ text-align : center;
7
+ }
8
+ span
9
+ {
10
+ display : block;
11
+ }
12
+ </ style >
4
13
< section class ="main-section ">
5
14
< div class ="container ">
6
- < div class ="Button " align ="center ">
7
- < a href ="{% url 'contest_new' %} " class ="btn btn-default "> Submit a New Contest</ a >
8
- </ div >
9
- < h3 > List of Upcoming Contests:</ h3 >
10
-
11
- {% for contest in contest_list %}
12
- < div class ="panel panel-default ">
13
- < div class ="panel-heading "> < a href ="{{contest.link}} "> {{contest.name}}</ a > </ div >
14
- < div class ="panel-body ">
15
- < strong > Start Date:</ strong > {{contest.start_date}}< br >
16
- < strong > End Date:</ strong > {{contest.end_date}}< br >
17
- < strong > Description:</ strong > {{contest.description}}
18
- </ div >
15
+ < h3 > List of Upcoming Contests</ h3 >
16
+ < div class ="container-fluid ">
17
+ < div class ="row ">
18
+ {% for contest in contest_list %}
19
+ < div class ="col-lg-4 ">
20
+ < div class ="panel panel-default ">
21
+ < div class ="panel-heading " style ="background-color: #0275d8;color:white "> {{contest.name}}</ div >
22
+ < div class ="panel-body ">
23
+ < span > < span class ="glyphicon glyphicon-globe "> </ span > < a href ="{{contest.link}} "> {{contest.link}}</ a > </ span >
24
+ < span > < span class ="glyphicon glyphicon-time "> </ span > {{contest.start_date}}-{{contest.end_date}}</ span >
25
+ < span > < span class ="glyphicon glyphicon-info-sign "> </ span > {{contest.description}}</ span >
26
+ </ div >
27
+ </ div >
28
+ </ div >
29
+ {% endfor %}
19
30
</ div >
20
- {% endfor %}
21
-
31
+ </ div >
32
+ < div class ="Button " align ="center " style ="margin-bottom:70px; ">
33
+ < a href ="{% url 'contest_new' %} " class ="btn btn-default " style ="background-color:#0275d8;color:white; "> Submit a New Contest</ a >
34
+ </ div >
22
35
</ div >
23
36
</ section >
24
37
{% endblock %}
Original file line number Diff line number Diff line change 1
1
from django .shortcuts import render
2
2
from django .http import HttpResponseRedirect
3
-
4
3
from main .models import chatSession , Contest
5
-
6
4
from datetime import datetime
7
-
8
5
from django .shortcuts import render_to_response
9
-
10
6
from django .template import RequestContext
11
7
12
8
@@ -31,19 +27,15 @@ def contest_new(request):
31
27
32
28
33
29
def add_contest (request ):
34
-
35
30
contest = Contest ()
36
31
contest .name = request .POST .get ("name" , "null" )
37
32
contest .link = request .POST .get ("link" , "null" )
38
33
start_date = request .POST .get ("start_date" , "null" )
39
34
end_date = request .POST .get ("end_date" , "null" )
40
35
contest .description = request .POST .get ("desc" , "null" )
41
-
42
36
contest .end_date = datetime .strptime (end_date , '%Y-%m-%d' ).date ()
43
37
contest .start_date = datetime .strptime (start_date , '%Y-%m-%d' ).date ()
44
-
45
38
contest .save ()
46
-
47
39
return HttpResponseRedirect ("/contests/" )
48
40
49
41
You can’t perform that action at this time.
0 commit comments