[A] added base.html for timer
This commit is contained in:
parent
e0bb8e78d6
commit
10103c1ab8
@ -24,4 +24,4 @@ class OfficeHours(models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def get_ends_at_str(self):
|
def get_ends_at_str(self):
|
||||||
return localtime(self.ends_at).strftime('%Y-%m-%d %H:%M')
|
return localtime(self.ends_at).strftime('%H:%M')
|
||||||
|
|||||||
7
timer/templates/base.html
Normal file
7
timer/templates/base.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
@ -1,9 +1,20 @@
|
|||||||
<!DOCTYPE html>
|
{% extends 'base.html' %}
|
||||||
<html>
|
{% block content %}
|
||||||
<head>
|
|
||||||
<title>Office Hour</title>
|
<title>Office Hour</title>
|
||||||
</head>
|
<div>
|
||||||
<body>
|
<h2>office hour ends at: </h2>
|
||||||
<h1>office hour ends at: {{ today_oh.get_ends_at_str }}</h1>
|
<h1>{{ today_oh.get_ends_at_str }}</h1>
|
||||||
</body>
|
</div>
|
||||||
</html>
|
|
||||||
|
<form method="POST">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% for f in form %}
|
||||||
|
<div class="form-group " >
|
||||||
|
<label>
|
||||||
|
{{ f.name }}
|
||||||
|
</label>
|
||||||
|
<input type="" name={{ f.name }} class="form-control">
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</form>
|
||||||
|
{% endblock content %}
|
||||||
|
|||||||
@ -22,7 +22,6 @@ class OfficeHoursAPI(CreateAPIView):
|
|||||||
permission_classes = (permissions.IsAuthenticated,)
|
permission_classes = (permissions.IsAuthenticated,)
|
||||||
|
|
||||||
queryset = timer.models.OfficeHours.objects.all()
|
queryset = timer.models.OfficeHours.objects.all()
|
||||||
# serializer_class = timer.serializers.GroupSerializer
|
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
def create(self, request, *args, **kwargs):
|
||||||
begins_at = request.data.get('begins_at')
|
begins_at = request.data.get('begins_at')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user