Skip to content

Commit a1092ca

Browse files
committed
UI changed
1 parent 89ca22e commit a1092ca

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

oshc/main/templates/contests.html

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
11
{% extends 'base.html' %}
22
{% load static %}
33
{% block content %}
4+
<style>
5+
h3 {
6+
text-align: center;
7+
}
8+
span
9+
{
10+
display: block;
11+
}
12+
</style>
413
<section class="main-section">
514
<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 %}
1930
</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>
2235
</div>
2336
</section>
2437
{% endblock %}

oshc/main/views.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
from django.shortcuts import render
22
from django.http import HttpResponseRedirect
3-
43
from main.models import chatSession, Contest
5-
64
from datetime import datetime
7-
85
from django.shortcuts import render_to_response
9-
106
from django.template import RequestContext
117

128

@@ -31,19 +27,15 @@ def contest_new(request):
3127

3228

3329
def add_contest(request):
34-
3530
contest = Contest()
3631
contest.name = request.POST.get("name", "null")
3732
contest.link = request.POST.get("link", "null")
3833
start_date = request.POST.get("start_date", "null")
3934
end_date = request.POST.get("end_date", "null")
4035
contest.description = request.POST.get("desc", "null")
41-
4236
contest.end_date = datetime.strptime(end_date, '%Y-%m-%d').date()
4337
contest.start_date = datetime.strptime(start_date, '%Y-%m-%d').date()
44-
4538
contest.save()
46-
4739
return HttpResponseRedirect("/contests/")
4840

4941

0 commit comments

Comments
 (0)