2012-09-07 02:36:40 +00:00
|
|
|
{% extends "reviews/base.html" %}
|
|
|
|
|
|
|
|
{% load i18n %}
|
|
|
|
|
|
|
|
{% block extra_style %}
|
|
|
|
<style type="text/css">
|
|
|
|
.table-striped tbody tr.selected td {
|
|
|
|
background-color: #F7F4E6;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block body %}
|
2012-09-08 23:21:16 +00:00
|
|
|
|
|
|
|
<ul class="nav nav-pills">
|
|
|
|
<li{% if status == 'accepted' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'accepted' %}">accepted</a>
|
|
|
|
<li{% if status == 'rejected' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'rejected' %}">rejected</a>
|
|
|
|
<li{% if status == 'standby' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'standby' %}">standby</a>
|
|
|
|
</ul>
|
|
|
|
|
2012-09-07 02:36:40 +00:00
|
|
|
<h1>Result Notification</h1>
|
|
|
|
|
2012-09-08 00:11:43 +00:00
|
|
|
<form method="post" action="{% url result_notification_prepare section_slug status %}">
|
2012-09-07 02:36:40 +00:00
|
|
|
|
2012-09-08 00:11:43 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
|
2012-09-08 22:19:06 +00:00
|
|
|
<p>
|
|
|
|
Select one or more proposals (<span class="action-counter">0</span> currently selected)
|
|
|
|
<br/>
|
|
|
|
then pick an email template
|
2012-09-08 22:32:06 +00:00
|
|
|
<select name="notification_template">
|
|
|
|
<option value="">[blank]</option>
|
2012-09-08 22:19:06 +00:00
|
|
|
{% for template in notification_templates %}
|
|
|
|
<option value="{{ template.pk }}">{{ template.label }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
<br/>
|
2012-09-08 23:07:34 +00:00
|
|
|
<button id="next-button" type="submit" class="btn btn-primary" disabled>Next <i class="icon icon-chevron-right"></i></button>
|
2012-09-08 22:19:06 +00:00
|
|
|
</p>
|
|
|
|
|
2012-09-08 00:11:43 +00:00
|
|
|
<table class="table table-striped table-bordered">
|
|
|
|
<thead>
|
|
|
|
<th><input type="checkbox" id="action-toggle"></th>
|
|
|
|
<th>#</th>
|
|
|
|
<th>{% trans "Speaker / Title" %}</th>
|
|
|
|
<th>{% trans "Category" %}</th>
|
|
|
|
<th>{% trans "Status" %}</th>
|
|
|
|
<th>{% trans "Notified?" %}</th>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
{% for proposal in proposals %}
|
|
|
|
<tr>
|
|
|
|
<td><input class="action-select" type="checkbox" name="_selected_action" value="{{ proposal.pk }}"></td>
|
|
|
|
<td>{{ proposal.number }}</td>
|
|
|
|
<td>
|
|
|
|
<a href="{% url review_detail proposal.pk %}">
|
|
|
|
<small><strong>{{ proposal.speaker }}</strong></small>
|
|
|
|
<br />
|
|
|
|
{{ proposal.title }}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>{{ proposal.track }}</td>
|
|
|
|
<td>
|
|
|
|
{% with proposal.result.status as status %}
|
|
|
|
<div class="{{ status }}">
|
|
|
|
{% if status != "undecided" %}
|
|
|
|
<span>{{ status }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endwith %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2012-09-08 23:21:16 +00:00
|
|
|
{% if proposal.notifications.exists %}yes{% endif %}
|
2012-09-08 00:11:43 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
2012-09-07 02:36:40 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
(function($) {
|
|
|
|
$.fn.actions = function(opts) {
|
|
|
|
var options = $.extend({}, $.fn.actions.defaults, opts);
|
|
|
|
var actionCheckboxes = $(this);
|
|
|
|
checker = function(checked) {
|
2012-09-07 03:51:54 +00:00
|
|
|
$(actionCheckboxes).prop("checked", checked)
|
2012-09-07 02:36:40 +00:00
|
|
|
.parent().parent().toggleClass(options.selectedClass, checked);
|
|
|
|
}
|
|
|
|
updateCounter = function() {
|
|
|
|
var sel = $(actionCheckboxes).filter(":checked").length;
|
|
|
|
$(options.counterContainer).html(sel);
|
2012-09-07 03:51:54 +00:00
|
|
|
$(options.allToggle).prop("checked", function() {
|
2012-09-07 02:36:40 +00:00
|
|
|
if (sel == actionCheckboxes.length) {
|
|
|
|
value = true;
|
|
|
|
} else {
|
|
|
|
value = false;
|
|
|
|
}
|
|
|
|
return value;
|
|
|
|
});
|
2012-09-08 23:07:34 +00:00
|
|
|
if (sel == 0) {
|
|
|
|
$("#next-button").prop("disabled", true);
|
|
|
|
} else {
|
|
|
|
$("#next-button").prop("disabled", false);
|
|
|
|
}
|
2012-09-07 02:36:40 +00:00
|
|
|
}
|
|
|
|
// Check state of checkboxes and reinit state if needed
|
|
|
|
$(this).filter(":checked").each(function(i) {
|
|
|
|
$(this).parent().parent().toggleClass(options.selectedClass);
|
|
|
|
updateCounter();
|
|
|
|
});
|
2012-09-07 02:54:52 +00:00
|
|
|
$(options.allToggle).click(function() {
|
2012-09-07 03:51:54 +00:00
|
|
|
checker($(this).prop("checked"));
|
2012-09-07 02:36:40 +00:00
|
|
|
updateCounter();
|
|
|
|
});
|
|
|
|
lastChecked = null;
|
|
|
|
$(actionCheckboxes).click(function(event) {
|
|
|
|
if (!event) { var event = window.event; }
|
|
|
|
var target = event.target ? event.target : event.srcElement;
|
|
|
|
if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey == true) {
|
|
|
|
var inrange = false;
|
2012-09-07 03:51:54 +00:00
|
|
|
$(lastChecked).prop("checked", target.checked)
|
2012-09-07 02:36:40 +00:00
|
|
|
.parent().parent().toggleClass(options.selectedClass, target.checked);
|
|
|
|
$(actionCheckboxes).each(function() {
|
|
|
|
if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) {
|
|
|
|
inrange = (inrange) ? false : true;
|
|
|
|
}
|
|
|
|
if (inrange) {
|
2012-09-07 03:51:54 +00:00
|
|
|
$(this).prop("checked", target.checked)
|
2012-09-07 02:36:40 +00:00
|
|
|
.parent().parent().toggleClass(options.selectedClass, target.checked);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$(target).parent().parent().toggleClass(options.selectedClass, target.checked);
|
|
|
|
lastChecked = target;
|
|
|
|
updateCounter();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
/* Setup plugin defaults */
|
|
|
|
$.fn.actions.defaults = {
|
|
|
|
counterContainer: "span.action-counter",
|
|
|
|
allToggle: "#action-toggle",
|
|
|
|
selectedClass: "selected"
|
|
|
|
}
|
|
|
|
})($);
|
|
|
|
$(function() {
|
|
|
|
$("tr input.action-select").actions();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|