Skip to content

Commit

Permalink
Merge branch 'hotfix/0.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbelesky committed Apr 4, 2016
2 parents 5bfba96 + 785a155 commit ec44c62
Show file tree
Hide file tree
Showing 158 changed files with 7,349 additions and 6,705 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Change Log
==========

0.8.3
-----
- Restored and reworking printing functionality for scoresheets/feedback
- Restored Edit Venues and Edit Matchups on the draw pages
- Improved Dashboard and Feedback graphs
- Add seperate Pro-speakers tab
- Various bug fixes, optimistions, and documentation edits


0.8.2
-----
- Fixed issue where scores from individual ballots would be deleted when any other panel in the round was edited
Expand Down
4 changes: 1 addition & 3 deletions actionlog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
from . import views

urlpatterns = [
url(r'^update/$',
views.action_log_update,
name='action_log_update'),
url(r'^latest_actions/$', views.latest_actions, name='latest_actions'),
]
23 changes: 8 additions & 15 deletions actionlog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,23 @@
import json

from .models import ActionLogEntry

from utils.views import *

import datetime

@login_required
@tournament_view
def action_log_update(request, t):

actions = ActionLogEntry.objects.filter(
tournament=t).order_by('-id')[:20].select_related('user', 'debate',
'ballot_submission')

import datetime
now = datetime.datetime.now()
def latest_actions(request, t):
action_objects = []
actions = ActionLogEntry.objects.filter(tournament=t).order_by(
'-timestamp')[:15].select_related('user', 'debate', 'ballot_submission')

timestamp_template = Template("{% load humanize %}{{ t|naturaltime }}")
for a in actions:
action = {
action_objects.append({
'user': a.user.username if a.user else a.ip_address or "anonymous",
'type': a.get_type_display(),
'param': a.get_parameters_display(),
'timestamp':
timestamp_template.render(Context({'t': a.timestamp})),
}
action_objects.append(action)
'timestamp': timestamp_template.render(Context({'t': a.timestamp})),
})

return HttpResponse(json.dumps(action_objects), content_type="text/json")
2 changes: 2 additions & 0 deletions adjfeedback/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def _make_question_field(self, question):
elif question.answer_type == question.ANSWER_TYPE_MULTIPLE_SELECT:
field = AdjudicatorFeedbackCheckboxSelectMultipleField(choices=question.choices_for_field)
field.label = question.text
if question.required:
field.label += "*"
field.required = self._enforce_required and question.required
return field

Expand Down
6 changes: 6 additions & 0 deletions adjfeedback/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ def answer_type_class(self):
def choices_for_field(self):
return tuple((x, x) for x in self.choices.split(self.CHOICE_SEPARATOR))

@property
def choices_for_number_scale(self):
step = max((int(self.max_value) - int(self.min_value)) / 10, 1)
options = list(range(int(self.min_value), int(self.max_value + 1), int(step)))
return options


class AdjudicatorFeedback(Submission):
adjudicator = models.ForeignKey('participants.Adjudicator', db_index=True)
Expand Down
9 changes: 2 additions & 7 deletions adjfeedback/templates/adjudicator_source_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ <h4>From Adjudicators</h4>

{% block extra-js %}

<script src="{% static 'js/vendor/vue.js' %}"></script>
{% include "vue/table.js" %}
{% include "vue/import-vue.html" %}
{% include "vue/table.vue" %}
<script>
Vue.config.delimiters = ["[[", "]]"];
// bootstrap the demo
var fromTeamsTable = new Vue({
el: '#fromTeamsTable',
data: {
Expand Down Expand Up @@ -106,11 +104,8 @@ <h4>From Adjudicators</h4>
})
}
})

</script>

{{ block.super }}
<script>
</script>

{% endblock extra-js %}
116 changes: 26 additions & 90 deletions adjfeedback/templates/feedback_overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{% block sub-title %}
<span id="breaking_count">{{ breaking_count }}</span> marked as breaking
{% endblock %}
{% block body-id %}feedbackOverview{% endblock %}

{% block page-subnav-sections %}
<a class="btn btn-default active" href="{% tournament_url adjfeedback-overview %}">
Expand All @@ -22,7 +23,7 @@
<a class="btn btn-default submit-disable" href="{% tournament_url adjfeedback-view-by-source %}">
Find Feedback
</a>
{% if pref.public_ballots_randomised or pref.public_feedback_randomised %}
{% if pref.public_ballots_randomised or pref.public_feedback_randomised or pref.allocation_confirmations %}
<a class="btn btn-default submit-disable" href="{% tournament_url randomised-urls-view %}">
Randomised URLs
</a>
Expand All @@ -37,6 +38,7 @@
<a class="btn btn-success" href="{% tournament_url adjfeedback-add-index %}">Add Feedback</a>
{% endblock %}


{% block content %}

<div class="panel panel-default">
Expand All @@ -45,13 +47,10 @@
<thead>
<tr>
<th>Name</th>
{% if pref.show_institutions %}
<th>Institution</th>
{% endif %}
<th><span data-toggle="tooltip" title="Overall Score">Score</span></th>
<th><span data-toggle="tooltip" title="Test Score; click to edit">Test</span></th>
<th>Feedback</th>
<th>Trend</th>
<th>Trend (<span style="color: #3700A8">Chair</span>, <span style="color: #007FFF">Panellist</span>, <span style="color: #A0E6E5">Trainee</span>)</th>
{% if pref.show_unaccredited %}
<th><span class="glyphicon glyphicon-warning-sign" data-toggle="tooltip" title="If the Adj is a Trainee" ></span></th>
{% endif %}
Expand All @@ -69,22 +68,21 @@
{% for adj in adjudicators %}
<tr id="adj_{{ adj.id }}">
<td class="adj-name">
<span>{{ adj.name }}</span>
<span>{{ adj.name }}</span><br>
<em>{{ adj.institution.code }}</em>
</td>
{% if pref.show_institutions %}
<td>
{{ adj.institution.code }}
</td>
{% endif %}
<td>
{{ adj.score|stringformat:".2f" }}
</td>
<td class="adj-current-test-score">
<a data-toggle="modal" data-target="#edit-test-score" class="edit-test-score">{{ adj.test_score }}</a>
</td>
<td>{{ adj.feedback_score|stringformat:".2f" }}</td>
<td>
<div id="graph_{{ adj.id }}" style="width: 100%; min-width: 100px; height: 60px; margin: -10px 0 -10px -20px;"></div>
<td style="padding: 4px 0px 0px 0px;">
<feedback-trend :min-score="minScore" :max-score="maxScore"
:round-seq="roundSeq"
:graph-data="graphData[{{ adj.id }}]"
:id="{{ adj.id }}"></feedback-trend>
</td>
{% if pref.show_unaccredited %}
<td>
Expand All @@ -94,7 +92,7 @@
</td>
{% endif %}
<td>
<a data-toggle="modal" data-target="#adj-feedback" class="view-feedback">View Feedback</a>
<a data-toggle="modal" data-target="#adj-feedback" class="view-feedback">View<br>Feedback</a>
</td>
{% if pref.enable_adj_notes > 0 %}
<td>
Expand Down Expand Up @@ -217,8 +215,21 @@ <h3>Edit Note of <span id="modal-note-name"></span></h3>

{% block extra-js %}

<script src="{% static 'js/vendor/jquery.flot.min.js' %}"></script>
<script src="{% static 'js/vendor/d3.min.js' %}"></script>
{% include "vue/import-vue.html" %}
{% include "vue/feedback-trend.vue" %}

<script>
var vueData = {
graphData: {{ feedback_data|safe }},
minScore: {{ pref.adj_min_score }},
maxScore: {{ pref.adj_max_score }},
roundSeq: {{ current_round.seq }}
}
new Vue({
el: '#feedbackOverview',
data: vueData
})

$(document).ready( function() {

Expand Down Expand Up @@ -304,81 +315,6 @@ <h3>Edit Note of <span id="modal-note-name"></span></h3>
});
});

$("<div id='tooltip'></div>").css({
position: "absolute",
display: "none",
border: "1px solid #fdd",
padding: "4px 8px 4px 16px",
color: "#FFF",
"background-color": "#000",
opacity: 0.80
}).appendTo("body");

function formatter(val, axis) {
return "";
}

{% for adj in adjudicators %}

function drawPoints{{ adj.id }}(ctx, x, y, radius, shadow) {
ctx.arc(x, y, radius, 0, null ? Math.PI : Math.PI * 2, false);
ctx.fillStyle = "#000";
ctx.strokeStyle = "#000";
if (adj_{{ adj.id }}[drawPoints.calls]) {
if (adj_{{ adj.id }}[drawPoints.calls][2] == "Chair") {
ctx.fillStyle = "#5cb85c";
ctx.strokeStyle = "#5cb85c";
} else if (adj_{{ adj.id }}[drawPoints.calls][2] == "Panellist") {
ctx.fillStyle = "#f0ad4e";
ctx.strokeStyle = "#f0ad4e";
} else if (adj_{{ adj.id }}[drawPoints.calls][2] == "Trainee") {
ctx.fillStyle = "#d9534f";
ctx.strokeStyle = "#d9534f";
} else if (adj_{{ adj.id }}[drawPoints.calls][2] == "Test Score") {
ctx.fillStyle = "#666";
ctx.strokeStyle = "#666";
}
}
drawPoints{{ adj.id }}.calls++;
}
drawPoints{{ adj.id }}.calls = 0;

var adj_{{ adj.id }}_data = [[0,{{ adj.test_score }},"Test Score"]{% for s in adj.rscores %}{% if s %},[{{ s.0 }},{{ s.1|floatformat:1 }},"{{ s.2 }}"]{% endif %}{% endfor %}]

$.plot("#graph_{{ adj.id }}", [ adj_{{ adj.id }}_data ], {
xaxis: {
min: 0, max: {{ current_round.seq }}, tickSize: 1, tickDecimals: 0, tickFormatter: formatter
},
yaxis: {
min: {{ pref.score_min }}, max: {{ pref.score_max }},
tickSize: 1, tickDecimals: 0, tickFormatter: formatter
},
grid: {
borderWidth: 0, hoverable: true,
},
series: {
lines: { show: true }, points: { show: true, symbol: drawPoints{{ adj.id }} }, shadowSize: 0, color: "#428bca"
},
});

$("#graph_{{ adj.id }}").bind("plothover", function (event, pos, item) {

if (item) {
var round = item.datapoint[0].toFixed(2),
score = item.datapoint[1].toFixed(2),
type = item.series.data[item.dataIndex][2];

$("#tooltip").html("R" + parseInt(round) + " received " + score + " as " + type)
.css({top: item.pageY+5, left: item.pageX+5})
.fadeIn(100);
} else {
$("#tooltip").hide();
}

});

{% endfor %}

});

</script>
Expand Down
8 changes: 2 additions & 6 deletions adjfeedback/templates/feedback_progress.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ <h4>From Adjudicators</h4>
<th><span class="glyphicon glyphicon-eye-open" data-toggle="tooltip" title="Percentage Returned"></span></th>
<th><span class="glyphicon glyphicon-remove" data-toggle="tooltip" title="Unsubmitted Feedbacks"></span></th>
<th><span class="glyphicon glyphicon-ok" data-toggle="tooltip" title="Submitted Feedbacks"></span></th>
<th>Team</th>
{% if pref.show_institutions %}
<th>Adjudicator</th>
{% endif %}
<th>Adjudicator</th>
<th>Instititution</th>
</tr>
</thead>
<tbody>
Expand All @@ -114,11 +112,9 @@ <h4>From Adjudicators</h4>
<td class="entity-name">
{{ entity.name }}
</td>
{% if pref.show_institutions %}
<td class="">
{{ entity.institution.name }} {{ entity.test }}
</td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
Expand Down
Loading

0 comments on commit ec44c62

Please sign in to comment.