Skip to content

Commit

Permalink
add displaying field add_comment for rejected fields;
Browse files Browse the repository at this point in the history
 add new button Save comments #1798
  • Loading branch information
user committed Oct 16, 2024
1 parent 61213f9 commit a2443c7
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions dataedit/templates/dataedit/opr_contributor.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span class="suggestion">{{ reviewer_suggestions.item.field }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span> <br>
<span class="additional-comment suggestion--additional-comment">{{ item.additional_comment }} </span>

{% endif %}
</p>
</div>
Expand All @@ -146,7 +148,8 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span class="suggestion">{{ reviewer_suggestions.item.field }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span> <br>
<span class="additional-comment suggestion--additional-comment">{{ item.additional_comment }}</span>
{% endif %}
</p>
</div>
Expand All @@ -162,7 +165,8 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<span class="key">{{item.field}}</span>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span> <br>
<span class="additional-comment suggestion--additional-comment">{{ item.additional_comment }}</span>
{% endif %}
</p>
</div>
Expand All @@ -181,7 +185,8 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<span class="key">{{item.field}}</span>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span> <br>
<span class="additional-comment suggestion--additional-comment">{{ item.additional_comment }}</span>
{% endif %}
</p>
</div>
Expand All @@ -200,7 +205,8 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<span class="key">{{item.field}}</span>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span> <br>
<span class="additional-comment suggestion--additional-comment">{{ item.additional_comment }}</span>
{% endif %}
</p>
</div>
Expand Down Expand Up @@ -279,6 +285,13 @@ <h2 id="review-field-name" style="display:none"></h2>
</div>
<button type="button" class="btn btn-warning review__field-save" id="submitButton">Save comment/new value</button>
</div>
<div class="d-none review__comments" id="reviewer_comments">
<div class="review__field review__field--nolabel" id="field-comment">
<label for="comments" class="form-label"></label>
<textarea class="form-control" id="comments" rows="2" placeholder="Comment here if you want to explain your suggestion"></textarea>
</div>
<button type="button" class="btn btn-warning review__field-save" id="submitCommentButton">Save comment</button>
</div>
</div>
</div>
<div class="review__infos">
Expand Down Expand Up @@ -322,17 +335,16 @@ <h2 id="review-field-name" style="display:none"></h2>

window.onload = function() {
var suggestions = document.querySelectorAll('.suggestion--highlight');


suggestions.forEach(function(suggestion) {
var field = suggestion.id.split('_')[1];
initialReviewerSuggestions[field] = suggestion.innerText;
});
}

}
</script>



{% compress js %}
<script src="/static/peer_review/opr_contributor.js"></script>
{% endcompress %}
Expand Down

0 comments on commit a2443c7

Please sign in to comment.