| 1 | <% from MaKaC.reviewing import ConferenceReview %> |
|---|
| 2 | <% import MaKaC.webinterface.urlHandlers as urlHandlers %> |
|---|
| 3 | |
|---|
| 4 | <% if not Review.isAuthorSubmitted(): %> |
|---|
| 5 | <table width="90%%" align="center" border="0" style="margin-bottom: 1em"> |
|---|
| 6 | <% if len(Review.getReviewManager().getVersioning()) == 1: %> |
|---|
| 7 | <tr> |
|---|
| 8 | <td> |
|---|
| 9 | <p style="padding-left: 25px;"><font color="gray"> |
|---|
| 10 | <%= _("Warning: the author(s) of this contribution have still not marked their initial materials as submitted.")%><br> |
|---|
| 11 | <%= _("You must wait until then to start the reviewing process.")%> |
|---|
| 12 | </font></p> |
|---|
| 13 | </td> |
|---|
| 14 | </tr> |
|---|
| 15 | <% end %> |
|---|
| 16 | <% else: %> |
|---|
| 17 | <tr> |
|---|
| 18 | <td> |
|---|
| 19 | <p style="padding-left: 25px;"><font color="gray"> |
|---|
| 20 | <%= _("Warning: since this contribution was marked 'To be corrected', the author(s) has not submitted new materials.")%><br> |
|---|
| 21 | <%= _("You must wait until then to restart the reviewing process.")%><br> |
|---|
| 22 | </font></p> |
|---|
| 23 | </td> |
|---|
| 24 | </tr> |
|---|
| 25 | <% end %> |
|---|
| 26 | </table> |
|---|
| 27 | <% end %> |
|---|
| 28 | <% else: %> |
|---|
| 29 | <table width="90%%" align="center" border="0" style="padding-top: 15px;"> |
|---|
| 30 | <tr> |
|---|
| 31 | <td colspan="5" class="groupTitle" style="border: none"><%= _("Give opinion on the content of a contribution")%> |
|---|
| 32 | <% inlineContextHelp(_('Here is displayed the judgement given by the Content Reviewers<br/>Only the Content Reviewers of this contribution can change their respective judgements.')) %> |
|---|
| 33 | </td> |
|---|
| 34 | </tr> |
|---|
| 35 | <tr> |
|---|
| 36 | <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("Reviewing questions")%></span></td> |
|---|
| 37 | <td width="60%%" id="questionListDisplay"> |
|---|
| 38 | </td> |
|---|
| 39 | </tr> |
|---|
| 40 | <tr> |
|---|
| 41 | <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("Judgement")%></span></td> |
|---|
| 42 | <td> |
|---|
| 43 | <div id="inPlaceEditJudgement"><%= Advice.getJudgement() %></div> |
|---|
| 44 | </td> |
|---|
| 45 | </tr> |
|---|
| 46 | <tr> |
|---|
| 47 | <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("Comments")%></span></td> |
|---|
| 48 | <td> |
|---|
| 49 | <div id="inPlaceEditComments"></div> |
|---|
| 50 | <div id="commentsMessage"> |
|---|
| 51 | <%= _("These comments, along with your judgement, will be sent by e-mail to the author(s)")%> |
|---|
| 52 | </div> |
|---|
| 53 | </td> |
|---|
| 54 | </tr> |
|---|
| 55 | <tr> |
|---|
| 56 | <td colspan="10"> |
|---|
| 57 | <span id="submitbutton"></span> |
|---|
| 58 | <span id="submittedmessage"></span> |
|---|
| 59 | </td> |
|---|
| 60 | </tr> |
|---|
| 61 | </table> |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | <script type="text/javascript"> |
|---|
| 65 | |
|---|
| 66 | var showWidgets = function(firstLoad) { |
|---|
| 67 | |
|---|
| 68 | new IndicoUI.Widgets.Generic.selectionField($E('inPlaceEditJudgement'), |
|---|
| 69 | 'reviewing.contribution.changeJudgement', |
|---|
| 70 | {conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 71 | contribution: '<%= Contribution.getId() %>', |
|---|
| 72 | current: 'reviewerJudgement' |
|---|
| 73 | }, <%= ConfReview.getAllStates() %>); |
|---|
| 74 | |
|---|
| 75 | new IndicoUI.Widgets.Generic.richTextField($E('inPlaceEditComments'), |
|---|
| 76 | 'reviewing.contribution.changeComments', |
|---|
| 77 | {conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 78 | contribution: '<%= Contribution.getId() %>', |
|---|
| 79 | current: 'reviewerJudgement' |
|---|
| 80 | },400,200); |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | <% if len (ConfReview.getReviewingQuestions()) == 0 : %> |
|---|
| 85 | $E('questionListDisplay').set("No reviewing questions proposed for this conference."); |
|---|
| 86 | <% end %> |
|---|
| 87 | <% else: %> |
|---|
| 88 | $E("questionListDisplay").set(''); |
|---|
| 89 | <% for q in ConfReview.getReviewingQuestions(): %> |
|---|
| 90 | var newDiv = Html.div({style:{borderLeft:'1px solid #777777', paddingLeft:'5px', marginLeft:'10px'}}); |
|---|
| 91 | |
|---|
| 92 | newDiv.append(Html.span(null,"<%=q%>")); |
|---|
| 93 | newDiv.append(Html.br()); |
|---|
| 94 | |
|---|
| 95 | if (firstLoad) { |
|---|
| 96 | var initialValue = "<%= Advice.getAnswer(q) %>"; |
|---|
| 97 | } else { |
|---|
| 98 | var initialValue = false; |
|---|
| 99 | } |
|---|
| 100 | |
|---|
| 101 | newDiv.append(new IndicoUI.Widgets.Generic.radioButtonField( |
|---|
| 102 | null, |
|---|
| 103 | 'horizontal2', |
|---|
| 104 | <%= str(range(len(ConfReview.reviewingQuestionsAnswers))) %>, |
|---|
| 105 | <%= str(ConfReview.reviewingQuestionsLabels) %>, |
|---|
| 106 | initialValue, |
|---|
| 107 | 'reviewing.contribution.changeCriteria', |
|---|
| 108 | {conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 109 | contribution: '<%= Contribution.getId() %>', |
|---|
| 110 | criterion: '<%= q %>', |
|---|
| 111 | current: 'reviewerJudgement' |
|---|
| 112 | })); |
|---|
| 113 | |
|---|
| 114 | $E("questionListDisplay").append(newDiv); |
|---|
| 115 | $E("questionListDisplay").append(Html.br()); |
|---|
| 116 | |
|---|
| 117 | <% end %> |
|---|
| 118 | <% end %> |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | var showValues = function() { |
|---|
| 122 | indicoRequest('reviewing.contribution.changeComments', |
|---|
| 123 | { |
|---|
| 124 | conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 125 | contribution: '<%= Contribution.getId() %>', |
|---|
| 126 | current: 'reviewerJudgement' |
|---|
| 127 | }, |
|---|
| 128 | function(result, error){ |
|---|
| 129 | if (!error) { |
|---|
| 130 | if(result.length == 0){ |
|---|
| 131 | $E('inPlaceEditComments').set($T('No comments given.')); |
|---|
| 132 | } else { |
|---|
| 133 | $E('inPlaceEditComments').set(result) |
|---|
| 134 | } |
|---|
| 135 | } |
|---|
| 136 | } |
|---|
| 137 | ) |
|---|
| 138 | indicoRequest('reviewing.contribution.changeJudgement', |
|---|
| 139 | { |
|---|
| 140 | conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 141 | contribution: '<%= Contribution.getId() %>', |
|---|
| 142 | current: 'reviewerJudgement' |
|---|
| 143 | }, |
|---|
| 144 | function(result, error){ |
|---|
| 145 | if (!error) { |
|---|
| 146 | $E('inPlaceEditJudgement').set(result) |
|---|
| 147 | } |
|---|
| 148 | } |
|---|
| 149 | ) |
|---|
| 150 | |
|---|
| 151 | indicoRequest('reviewing.contribution.getCriteria', |
|---|
| 152 | { |
|---|
| 153 | conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 154 | contribution: '<%= Contribution.getId() %>', |
|---|
| 155 | current: 'reviewerJudgement' |
|---|
| 156 | }, |
|---|
| 157 | function(result, error){ |
|---|
| 158 | if (!error) { |
|---|
| 159 | if (result.length == 0) { |
|---|
| 160 | $E('questionListDisplay').set('No reviewing questions proposed for this conference.'); |
|---|
| 161 | } else { |
|---|
| 162 | $E('questionListDisplay').set(''); |
|---|
| 163 | for (var i = 0; i<result.length; i++) { |
|---|
| 164 | $E('questionListDisplay').append(result[i]); |
|---|
| 165 | $E('questionListDisplay').append(Html.br()); |
|---|
| 166 | } |
|---|
| 167 | } |
|---|
| 168 | } |
|---|
| 169 | } |
|---|
| 170 | ) |
|---|
| 171 | } |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | <% if Advice.isSubmitted():%> |
|---|
| 176 | var submitted = true; |
|---|
| 177 | <% end %> |
|---|
| 178 | <% else: %> |
|---|
| 179 | var submitted = false; |
|---|
| 180 | <% end %> |
|---|
| 181 | |
|---|
| 182 | var updatePage = function (firstLoad){ |
|---|
| 183 | if (submitted) { |
|---|
| 184 | submitButton.set($T('Undo sending')); |
|---|
| 185 | $E('submittedmessage').set($T('Judgement has been sent')); |
|---|
| 186 | showValues(); |
|---|
| 187 | } else { |
|---|
| 188 | submitButton.set('Mark as submitted'); |
|---|
| 189 | $E('submittedmessage').set('Judgement not submitted yet'); |
|---|
| 190 | showWidgets(firstLoad); |
|---|
| 191 | } |
|---|
| 192 | } |
|---|
| 193 | |
|---|
| 194 | var submitButton = new IndicoUI.Widgets.Generic.simpleButton($E('submitbutton'), 'reviewing.contribution.setSubmitted', |
|---|
| 195 | { |
|---|
| 196 | conference: '<%= Contribution.getConference().getId() %>', |
|---|
| 197 | contribution: '<%= Contribution.getId() %>', |
|---|
| 198 | current: 'reviewerJudgement', |
|---|
| 199 | value: true |
|---|
| 200 | }, |
|---|
| 201 | function(result, error){ |
|---|
| 202 | if (!error) { |
|---|
| 203 | submitted = !submitted; |
|---|
| 204 | updatePage(false) |
|---|
| 205 | } else { |
|---|
| 206 | alert (error) |
|---|
| 207 | } |
|---|
| 208 | }, |
|---|
| 209 | '' |
|---|
| 210 | ); |
|---|
| 211 | |
|---|
| 212 | updatePage(true); |
|---|
| 213 | |
|---|
| 214 | </script> |
|---|