addimage
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "newbase.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
@@ -15,36 +15,33 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block main %}
|
||||||
<div id="id_dropregion" class="grid_12 alpha watermark invisible">
|
<h1>Upload Image</h1>
|
||||||
<p>Drag and drop files here </p>
|
|
||||||
</div>
|
<ul class="main-content">
|
||||||
<div id="id_drop-files" class="grid_12 alpha drop-files">
|
<li class="grid_4">
|
||||||
<form id="file_form" enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
<div id="id_dropregion" class="watermark invisible">
|
||||||
<div id="left" class="grid_6 alpha">
|
<p>Drag and drop files here </p>
|
||||||
<h1>Upload Image</h1>
|
</div>
|
||||||
{% if form.errors %}
|
<div id="id_drop-files" class="drop-files">
|
||||||
<p style="color: red;">
|
<form id="file_form" enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
Please correct the error{{ form.errors|pluralize }} below.
|
{% if form.errors %}
|
||||||
|
<p style="color: red;">
|
||||||
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
|
<p>
|
||||||
<input class="button green" type="submit" value="Submit">
|
<input class="button green" type="submit" value="Submit">
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</form>
|
||||||
<div id="right" class="grid_6 omega">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
@@ -169,7 +166,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#id_drop-files").replaceWith(
|
$("#id_drop-files").replaceWith(
|
||||||
'<div id="id_waiting"><img src="/static/img/rowingtimer.gif" width="120" height="100">'
|
'<div id="id_waiting"><img src="/static/img/rowingtimer.gif" width="120" height="100" style="width:120px">'
|
||||||
);
|
);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: data,
|
data: data,
|
||||||
@@ -250,3 +247,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'menu_workout.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -102,6 +102,11 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<li id="chart-image">
|
||||||
|
<a href="/rowers/workout/{{ workout.id }}/image">
|
||||||
|
<i class="fas fa-file-image fa-fw"></i> Upload Image
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="has-children" id="export">
|
<li class="has-children" id="export">
|
||||||
|
|||||||
@@ -9275,6 +9275,22 @@ def workout_uploadimage_view(request,id):
|
|||||||
|
|
||||||
w = get_workout(id)
|
w = get_workout(id)
|
||||||
|
|
||||||
|
breadcrumbs = [
|
||||||
|
{
|
||||||
|
'url':'/rowers/list-workouts',
|
||||||
|
'name':'Workouts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':get_workout_default_page(request,id),
|
||||||
|
'name': str(w.id)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':reverse(workout_uploadimage_view,kwargs={'id':id}),
|
||||||
|
'name': 'Upload Image'
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
if not checkworkoutuser(request.user,w):
|
if not checkworkoutuser(request.user,w):
|
||||||
raise PermissionDenied("You are not allowed to edit this workout")
|
raise PermissionDenied("You are not allowed to edit this workout")
|
||||||
|
|
||||||
@@ -9342,6 +9358,9 @@ def workout_uploadimage_view(request,id):
|
|||||||
form = ImageForm()
|
form = ImageForm()
|
||||||
return render(request,'image_form.html',
|
return render(request,'image_form.html',
|
||||||
{'form':form,
|
{'form':form,
|
||||||
|
'rower':r,
|
||||||
|
'active':'nav-active',
|
||||||
|
'breadcrumbs':breadcrumbs,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'workout': w,
|
'workout': w,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user