Rework manage review request page some more, make more space for the
actions, clear up some confusing wording - Legacy-Id: 11842
This commit is contained in:
parent
0c189cfa84
commit
90617c2b8e
|
@ -483,6 +483,21 @@ form.complete-review .mail-archive-search .results .list-group {
|
|||
|
||||
form.review-requests .reviewer-controls, form.review-requests .close-controls {
|
||||
display: none;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
form.review-requests .assign-action, form.review-requests .close-action {
|
||||
display: inline-block;
|
||||
min-width: 11em;
|
||||
}
|
||||
|
||||
form.review-requests .deadline {
|
||||
padding-top: 0.45em;
|
||||
}
|
||||
|
||||
form.review-requests label {
|
||||
font-weight: normal;
|
||||
padding-right: 0.3em;
|
||||
}
|
||||
|
||||
/* Profile */
|
||||
|
|
|
@ -1,7 +1,25 @@
|
|||
$(document).ready(function () {
|
||||
var form = $("form.review-requests");
|
||||
|
||||
form.find(".reviewer-action").on("click", function () {
|
||||
function setControlDisplay(row) {
|
||||
var action = row.find("[name$=\"-action\"]").val();
|
||||
if (action == "assign") {
|
||||
row.find(".reviewer-controls").show();
|
||||
row.find(".close-controls").hide();
|
||||
row.find(".assign-action,.close-action").hide();
|
||||
}
|
||||
else if (action == "close") {
|
||||
row.find(".reviewer-controls").hide();
|
||||
row.find(".close-controls").show();
|
||||
row.find(".assign-action,.close-action").hide();
|
||||
}
|
||||
else {
|
||||
row.find(".reviewer-controls,.close-controls").hide();
|
||||
row.find(".assign-action,.close-action").show();
|
||||
}
|
||||
}
|
||||
|
||||
form.find(".assign-action button").on("click", function () {
|
||||
var row = $(this).closest("tr");
|
||||
|
||||
var select = row.find(".reviewer-controls [name$=\"-reviewer\"]");
|
||||
|
@ -40,33 +58,27 @@ $(document).ready(function () {
|
|||
select.val(found);
|
||||
}
|
||||
|
||||
row.find(".close-controls .undo").click();
|
||||
row.find("[name$=\"-action\"]").val("assign");
|
||||
row.find(".reviewer-action").hide();
|
||||
row.find(".reviewer-controls").show();
|
||||
setControlDisplay(row);
|
||||
});
|
||||
|
||||
form.find(".reviewer-controls .undo").on("click", function () {
|
||||
var row = $(this).closest("tr");
|
||||
row.find(".reviewer-controls").hide();
|
||||
row.find(".reviewer-action").show();
|
||||
row.find("[name$=\"-action\"]").val("");
|
||||
row.find("[name$=\"-reviewer\"]").val($(this).data("initial"));
|
||||
setControlDisplay(row);
|
||||
});
|
||||
|
||||
form.find(".close-action").on("click", function () {
|
||||
form.find(".close-action button").on("click", function () {
|
||||
var row = $(this).closest("tr");
|
||||
row.find(".reviewer-controls .undo").click();
|
||||
row.find("[name$=\"-action\"]").val("close");
|
||||
row.find(".close-action").hide();
|
||||
row.find(".close-controls").show();
|
||||
setControlDisplay(row);
|
||||
});
|
||||
|
||||
form.find(".close-controls .undo").on("click", function () {
|
||||
var row = $(this).closest("tr");
|
||||
row.find("[name$=\"-action\"]").val("");
|
||||
row.find(".close-controls").hide();
|
||||
row.find(".close-action").show();
|
||||
setControlDisplay(row);
|
||||
});
|
||||
|
||||
form.find("[name$=\"-action\"]").each(function () {
|
||||
|
@ -75,14 +87,6 @@ $(document).ready(function () {
|
|||
return;
|
||||
|
||||
var row = $(this).closest("tr");
|
||||
|
||||
if (v == "assign") {
|
||||
row.find(".reviewer-action").hide();
|
||||
row.find(".reviewer-controls").show();
|
||||
}
|
||||
else if (v == "close") {
|
||||
row.find(".close-action").hide();
|
||||
row.find(".close-controls").show();
|
||||
}
|
||||
setControlDisplay(row);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
<tr>
|
||||
<th>Document</th>
|
||||
<th>Deadline</th>
|
||||
<th style="min-width:45%">Reviewer</th>
|
||||
<th style="min-width:22%">Close as...</th>
|
||||
<th style="min-width:65%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -52,7 +51,7 @@
|
|||
|
||||
<div>
|
||||
<small>
|
||||
<a href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}">R: {% if r.time %}{{ r.time|date:"Y-m-d" }}{% else %}<em>auto-suggested</em>{% endif %} - {{ r.type.name }}</a>
|
||||
<a {% if r.pk != None %}href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}"{% endif %}>{% if r.time %}Req: {{ r.time|date:"Y-m-d" }}{% else %}<em>auto-suggested</em>{% endif %} - {{ r.type.name }}</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
|
@ -75,7 +74,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="deadline">
|
||||
{{ r.deadline|date:"Y-m-d" }}
|
||||
{% if r.due %}<span class="label label-warning">{{ r.due }} day{{ r.due|pluralize }}</span>{% endif %}
|
||||
</td>
|
||||
|
@ -83,40 +82,41 @@
|
|||
<input type="hidden" name="reviewrequest" value="{{ r.pk }}">
|
||||
<input type="hidden" name="{{ r.form.prefix }}-existing_reviewer" value="{{ r.reviewer_id|default:"" }}">
|
||||
|
||||
{% if r.reviewer %}
|
||||
<button type="button" class="btn btn-default btn-sm reviewer-action" title="Click to reassign request">{{ r.reviewer.person }} {% if r.state_id == "accepted" %}<span class="label label-default">accp</span>{% endif %}</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-default btn-sm reviewer-action" title="Click to assign request"><em>not yet assigned</em></button>
|
||||
{% endif %}
|
||||
<span class="assign-action">
|
||||
{% if r.reviewer %}
|
||||
<button type="button" class="btn btn-default btn-sm" title="Click to reassign reviewer">{{ r.reviewer.person }}{% if r.state_id == "accepted" %} <span class="label label-default">accp</span>{% endif %}</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-default btn-sm" title="Click to assign reviewer"><em>not yet assigned</em></button>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
{{ r.form.action }}
|
||||
|
||||
<span class="reviewer-controls form-inline">
|
||||
{% spaceless %}
|
||||
{{ r.form.reviewer }}
|
||||
<button type="button" class="btn btn-default btn-sm undo fa fa-times" title="Undo assignment" data-initial="{{ r.form.fields.reviewer.initial|default:"" }}"></button>
|
||||
{% if r.form.reviewer.errors %}
|
||||
<div class="alert alert-danger">
|
||||
{% for e in r.form.reviewer.errors %}
|
||||
{{ e }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
<label for="{{ r.form.reviewer.id_for_label }}">Assign:</label>
|
||||
{{ r.form.reviewer }}
|
||||
<button type="button" class="btn btn-default btn-sm undo" title="Cancel assignment" data-initial="{{ r.form.fields.reviewer.initial|default:"" }}">Cancel</button>
|
||||
{% if r.form.reviewer.errors %}
|
||||
<div class="alert alert-danger">
|
||||
{% for e in r.form.reviewer.errors %}
|
||||
{{ e }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<span class="close-action">
|
||||
<button type="button" class="btn btn-default btn-sm">Close...</button>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-default btn-sm close-action">Close...</button>
|
||||
|
||||
<span class="close-controls form-inline">
|
||||
{% spaceless %}
|
||||
{{ r.form.close }}
|
||||
<button type="button" class="btn btn-default btn-sm undo" title="Undo closing"><span class="fa fa-times"></span></button>
|
||||
{% if r.form.close.errors %}
|
||||
<br>
|
||||
{{ r.form.close.errors }}
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
<label for="{{ r.form.reviewer.id_for_label }}">Close:</label>
|
||||
{{ r.form.close }}
|
||||
<button type="button" class="btn btn-default btn-sm undo" title="Cancel closing">Cancel</button>
|
||||
{% if r.form.close.errors %}
|
||||
<br>
|
||||
{{ r.form.close.errors }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue