[A] added base.html for timer
This commit is contained in:
parent
e0bb8e78d6
commit
10103c1ab8
@ -24,4 +24,4 @@ class OfficeHours(models.Model):
|
||||
|
||||
@property
|
||||
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>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<title>Office Hour</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>office hour ends at: {{ today_oh.get_ends_at_str }}</h1>
|
||||
</body>
|
||||
</html>
|
||||
<div>
|
||||
<h2>office hour ends at: </h2>
|
||||
<h1>{{ today_oh.get_ends_at_str }}</h1>
|
||||
</div>
|
||||
|
||||
<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,)
|
||||
|
||||
queryset = timer.models.OfficeHours.objects.all()
|
||||
# serializer_class = timer.serializers.GroupSerializer
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
begins_at = request.data.get('begins_at')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user