Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
user-cube committed Apr 27, 2020
1 parent 934be32 commit 36b4820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
20 changes: 6 additions & 14 deletions Frontend/app/templates/calendar/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,21 @@
<div class="container">
<br>
<br>

{% for i in database %}
{{ i }}
{% endfor %}

<a href="{% url 'registertest' %}" class="btn btn-success">
<span class="glyphicon glyphicon-thumbs-up"></span>Register Test</a>

<div id="calendar"></div>
<div id="evoCalendar"></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="{% static 'evo-calendar/js/evo-calendar.js' %}"></script>

<script>
$('#calendar').evoCalendar({


$('#evoCalendar').evoCalendar({
theme: 'Royal Navy',
{% for i in database %}
calendarEvents: [ {
id: {{ i.t_id }},
name: {{ i.name }},
date: {{ i.data }},
type: {{ i.type }} }]
{% endfor %}
calendarEvents: {% autoescape off %} {{ database }}
{% endautoescape %}
})
</script>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Frontend/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,8 @@ def calendar(request):
t_id = test['id']
name = test['author'] + ' - ' + test['name']
data = test['begin_date']
tests.append({'name': name, 'data': data, 'id': str(t_id), 'type': 'event'})

tests.append({'name': name, 'date': data, 'id': str(t_id), 'type': 'event'})
print(tests)
return render(request, 'calendar/calendar.html', {'database': tests})
else:
return redirect('login')

0 comments on commit 36b4820

Please sign in to comment.