source: indico/indico/MaKaC/webinterface/tpls/GiveAdvice.tpl @ 6e9e95

burotelhello-world-walkthroughipv6v0.98-seriesv0.98.2v0.98.3v0.98b1v0.98b2v0.99v1.0v1.1
Last change on this file since 6e9e95 was 6e9e95, checked in by Jose Benito <jose.benito.gonzalez@…>, 2 years ago

[IMP] Refactoring ConferenceReview? code

  • This class has changed the name
  • Property mode set to 100644
File size: 8.0 KB
Line 
1<% from MaKaC.reviewing import ConferencePaperReview %>
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"><%= _("Comments")%></span></td>
42        <td>
43            <div id="inPlaceEditComments"></div>
44        </td>
45    </tr>
46    <tr>
47        <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("Judgement")%></span></td>
48        <td>
49            <div id="inPlaceEditJudgement"><%= Advice.getJudgement() %></div>
50            <div id="commentsMessage">
51                <%= _("The comments and 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
66var 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    var initialValue = '<%= Advice.getComments() %>';
76    if (initialValue == '') {
77        initialValue = 'No comments';
78    }
79
80    $E('inPlaceEditComments').set(new TextAreaEditWidget('reviewing.contribution.changeComments',
81            {conference: '<%= Contribution.getConference().getId() %>',
82             contribution: '<%= Contribution.getId() %>',
83             current: 'reviewerJudgement'},initialValue).draw());
84
85
86    <% if len (ConfReview.getReviewingQuestions()) == 0 : %>
87        $E('questionListDisplay').set("No reviewing questions proposed for this conference.");
88    <% end %>
89    <% else: %>
90        $E("questionListDisplay").set('');
91        <% for q in ConfReview.getReviewingQuestions(): %>
92            var newDiv = Html.div({style:{borderLeft:'1px solid #777777', paddingLeft:'5px', marginLeft:'10px'}});
93
94            newDiv.append(Html.span(null,"<%=q%>"));
95            newDiv.append(Html.br());
96
97            if (firstLoad) {
98                var initialValue = "<%= Advice.getAnswer(q) %>";
99            } else {
100                var initialValue = false;
101            }
102
103            newDiv.append(new IndicoUI.Widgets.Generic.radioButtonField(
104                                                    null,
105                                                    'horizontal2',
106                                                    <%= str(range(len(ConfReview.reviewingQuestionsAnswers))) %>,
107                                                    <%= str(ConfReview.reviewingQuestionsLabels) %>,
108                                                    initialValue,
109                                                    'reviewing.contribution.changeCriteria',
110                                                    {conference: '<%= Contribution.getConference().getId() %>',
111                                                    contribution: '<%= Contribution.getId() %>',
112                                                    criterion: '<%= q %>',
113                                                    current: 'reviewerJudgement'
114                                                    }));
115
116            $E("questionListDisplay").append(newDiv);
117            $E("questionListDisplay").append(Html.br());
118
119        <% end %>
120    <% end %>
121}
122
123var showValues = function() {
124    indicoRequest('reviewing.contribution.changeComments',
125            {
126                conference: '<%= Contribution.getConference().getId() %>',
127                contribution: '<%= Contribution.getId() %>',
128                current: 'reviewerJudgement'
129            },
130            function(result, error){
131                if (!error) {
132                    if(result.length == 0){
133                        $E('inPlaceEditComments').set($T('No comments given.'));
134                    } else {
135                        $E('inPlaceEditComments').set(result)
136                    }
137                }
138            }
139        )
140    indicoRequest('reviewing.contribution.changeJudgement',
141            {
142                conference: '<%= Contribution.getConference().getId() %>',
143                contribution: '<%= Contribution.getId() %>',
144                current: 'reviewerJudgement'
145            },
146            function(result, error){
147                if (!error) {
148                    $E('inPlaceEditJudgement').set(result)
149                }
150            }
151        )
152
153    indicoRequest('reviewing.contribution.getCriteria',
154            {
155                conference: '<%= Contribution.getConference().getId() %>',
156                contribution: '<%= Contribution.getId() %>',
157                current: 'reviewerJudgement'
158            },
159            function(result, error){
160                if (!error) {
161                    if (result.length == 0) {
162                        $E('questionListDisplay').set('No reviewing questions proposed for this conference.');
163                    } else {
164                        $E('questionListDisplay').set('');
165                        for (var i = 0; i<result.length; i++) {
166                            $E('questionListDisplay').append(result[i]);
167                            $E('questionListDisplay').append(Html.br());
168                        }
169                    }
170                }
171            }
172        )
173}
174
175
176
177<% if Advice.isSubmitted():%>
178    var submitted = true;
179<% end %>
180<% else: %>
181    var submitted = false;
182<% end %>
183
184var updatePage = function (firstLoad){
185    if (submitted) {
186        submitButton.set($T('Undo sending'));
187        $E('submittedmessage').set($T('Judgement has been sent'));
188        showValues();
189    } else {
190        submitButton.set('Mark as submitted');
191        $E('submittedmessage').set('Judgement not submitted yet');
192        showWidgets(firstLoad);
193    }
194}
195
196var submitButton = new IndicoUI.Widgets.Generic.simpleButton($E('submitbutton'), 'reviewing.contribution.setSubmitted',
197        {
198            conference: '<%= Contribution.getConference().getId() %>',
199            contribution: '<%= Contribution.getId() %>',
200            current: 'reviewerJudgement',
201            value: true
202        },
203        function(result, error){
204            if (!error) {
205                submitted = !submitted;
206                updatePage(false)
207            } else {
208                alert (error)
209            }
210        },
211        ''
212);
213
214updatePage(true);
215
216</script>
Note: See TracBrowser for help on using the repository browser.