Private
Public Access
1
0

alertowners

This commit is contained in:
Sander Roosendaal
2019-10-02 17:25:05 +02:00
parent 20f2d2cbe0
commit 2631419265
5 changed files with 52 additions and 4 deletions

View File

@@ -53,9 +53,11 @@
</li>
</ul>
</form>
{% endblock %}
{% block scripts %}
<!-- Include formset plugin - including jQuery dependency -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="/static/js/jquery.formset.js"></script>
<script>
$('.fav-formset').formset({
@@ -64,9 +66,30 @@
});
</script>
<script>
$( document ).ready(function() {
$('#id_workouttype').on('change', function(){
if (
$(this).val() == 'water'
|| $(this).val() == 'coastal'
|| $(this).val() == 'c-boat'
|| $(this).val() == 'churchboat'
) {
$('#id_boattype').toggle(true);
} else {
$('#id_boattype').toggle(false);
$('#id_boattype').val('1x');
}
});
$('#id_workouttype').change();
});
</script>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -29,6 +29,7 @@
<ul class="main-content">
<li class="grid_2">
<h2>Alert {{ alert.name }} for {{ alert.rower.user.first_name }}</h2>
<p>Alert managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
<p>
{{ formset.management_form }}
{% csrf_token %}
@@ -51,9 +52,11 @@
</li>
</ul>
</form>
{% endblock %}
{% block scripts %}
<!-- Include formset plugin - including jQuery dependency -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="/static/js/jquery.formset.js"></script>
<script>
$('.fav-formset').formset({
@@ -61,10 +64,29 @@
deleteText: '<div><p>&nbsp;</p></div><div>remove</div>'
});
</script>
<script>
$( document ).ready(function() {
$('#id_workouttype').on('change', function(){
if (
$(this).val() == 'water'
|| $(this).val() == 'coastal'
|| $(this).val() == 'c-boat'
|| $(this).val() == 'churchboat'
) {
$('#id_boattype').toggle(true);
} else {
$('#id_boattype').toggle(false);
$('#id_boattype').val('1x');
}
});
$('#id_workouttype').change();
});
</script>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -22,6 +22,7 @@
<h2>{{ alert.name }}</h2>
<p>{{ alert }}</p>
<p>{{ alert.description }}</p>
<p>Managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
</li>
<li class="rounder">
<h2>Score</h2>

View File

@@ -15,9 +15,11 @@
{% for alert in alerts %}
<li class="rounder" id="alert_{{ alert.id }}">
<h2>{{ alert.name }}</h2>
{% if alert.manager == request.user %}
<a class="small" href="/rowers/alerts/{{ alert.id }}/edit/" title="Edit">
<i class="fas fa-pencil-alt fa-fw"></i>
</a>
{% endif %}
<a class="small" href="/rowers/alerts/{{ alert.id }}/delete/"
title="Delete">
<i class="fas fa-trash-alt fa-fw"></i>

View File

@@ -21,7 +21,7 @@
<script>
$( document ).ready(function() {
$('#id_workouttype').on('change', function(){
$('#id_workouttype').on('change', function(){
if (
$(this).val() == 'water'
|| $(this).val() == 'coastal'