Changeset 42c6b7 in indico


Ignore:
Timestamp:
10/04/10 17:17:57 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
Children:
843219
Parents:
2d4003
git-author:
csvetelina.angelova@…> (03/25/10 14:11:27)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (10/04/10 17:17:57)
Message:

[FTR] assign contr per track/session/type + others

  • assign contributions per... (tracks, types, sessions)
  • new dialogs
  • layout changes - new menus instead of buttons
  • task #335 - Assign Contribution: "Remove"/"Remove All" Content Reviewer - wrong behavior
  • wording corrections
  • if there is no paper reviewing type chosen for the conference - the creator now can assign only Paper Review Manager.
Location:
indico
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/services/implementation/reviewing.py

    rac1609 r42c6b7  
    430430 
    431431 
     432class ConferenceReviewingContributionsAttributeList(ListModificationBase, ConferenceReviewingPRMRefereeBase): 
     433    #Note: don't change the order of the inheritance here! 
     434    """ Class to return all the tracks or sessions or types of the conference 
     435    """ 
     436    def _checkParams(self): 
     437        ConferenceReviewingPRMRefereeBase._checkParams(self) 
     438        self._attribute = self._params.get("attribute", None) 
     439        if self._attribute is None: 
     440            raise ServiceError("ERR-REV5",_("No type/session/track specified")) 
     441         
     442    def _handleGet(self): 
     443        attributes = [] 
     444        for c in self._conf.getContributionList(): 
     445            if self._attribute == 'type': 
     446                if c.getType() is not None and c.getType() not in attributes: 
     447                    attributes.append(c.getType()) 
     448            elif self._attribute == 'track': 
     449                if c.getTrack() is not None and c.getTrack() not in attributes: 
     450                    attributes.append(c.getTrack()) 
     451            elif self._attribute == 'session': 
     452                if c.getSession() is not None and c.getSession() not in attributes: 
     453                    attributes.append(c.getSession()) 
     454            else: 
     455                raise ServiceError("ERR-REV5",_("No attribute specified"))      
     456         
     457        if self._attribute == 'type': 
     458            return [{"id": attribute.getId(), "title": attribute.getName()} 
     459                for attribute in attributes] 
     460        else: 
     461            return [{"id": attribute.getId(), "title": attribute.getTitle()} 
     462                for attribute in attributes] 
     463             
     464class ConferenceReviewingContributionsPerSelectedAttributeList(ListModificationBase, ConferenceReviewingPRMRefereeBase): 
     465    #Note: don't change the order of the inheritance here! 
     466    """ Class to return all the contributions ids for the selected track/session/type of the conference 
     467    """ 
     468    def _checkParams(self): 
     469        ConferenceReviewingPRMRefereeBase._checkParams(self) 
     470        self._attribute = self._params.get("attribute", None) 
     471        if self._attribute is None: 
     472            raise ServiceError("ERR-REV5",_("No type/session/track specified")) 
     473        self._selectedAttribute = self._params.get("selectedAttributes", None) 
     474        if self._selectedAttribute is None: 
     475            raise ServiceError("ERR-REV5",_("No attribute specified")) 
     476         
     477    def _handleGet(self): 
     478        contributionsPerSelectedAttribute = [] 
     479        for c in self._conf.getContributionList(): 
     480            for att in self._selectedAttribute: 
     481                if self._attribute == 'type': 
     482                    if c.getType() is not None and c.getId() not in contributionsPerSelectedAttribute: 
     483                        if c.getType().getId() == att: 
     484                            contributionsPerSelectedAttribute.append(c.getId()) 
     485                elif self._attribute == 'track': 
     486                    if c.getTrack() is not None and c.getId() not in contributionsPerSelectedAttribute: 
     487                        if c.getTrack().getId() == att: 
     488                            contributionsPerSelectedAttribute.append(c.getId()) 
     489                elif self._attribute == 'session': 
     490                    if c.getSession() is not None and c.getId() not in contributionsPerSelectedAttribute: 
     491                        if c.getSession().getId() == att: 
     492                            contributionsPerSelectedAttribute.append(c.getId()) 
     493                else: 
     494                    raise ServiceError("ERR-REV5",_("No attribute specified"))      
     495              
     496         
     497        return contributionsPerSelectedAttribute 
     498             
     499         
    432500class ConferenceReviewingUserCompetenceList(ListModificationBase, ConferenceReviewingPRMRefereeBase): 
    433501    #Note: don't change the order of the inheritance here! 
     
    849917    "conference.changeAbstractReviewerDefaultDueDate" : ConferenceAbstractReviewingDefaultDueDateModification, 
    850918    "conference.changeReviewableMaterials" : ConferenceReviewingReviewableMaterialsModification, 
     919    "conference.attributeList" : ConferenceReviewingContributionsAttributeList, 
     920    "conference.contributionsIdPerSelectedAttribute" : ConferenceReviewingContributionsPerSelectedAttributeList, 
    851921    "conference.userCompetencesList": ConferenceReviewingUserCompetenceList, 
    852922 
  • indico/MaKaC/webinterface/tpls/ConfModificationReviewingFrame.tpl

    r5b4690 r42c6b7  
    22<% from MaKaC.common.PickleJar import DictPickler %> 
    33 
    4 <% if ConfReview.hasReviewing(): %> 
     4 
    55<table width="85%%" align="center" border="0"> 
     6    <tr> 
    67        <td id="revControlRefereeEditorReviewerHelp"  colspan="3" class="groupTitle"  style="padding-top: 15px; padding-bottom: 15px;"> 
    78            <%= _("Step 2: Assign Reviewers")%> 
    89        </td> 
    910    </tr> 
     11    <% if not ConfReview.hasReviewing(): %> 
     12    <tr> 
     13        <td> 
     14            <p style="padding-left: 25px;"><font color="gray"><%= _("Type of reviewing has not been chosen yet.")%></font></p> 
     15        </td> 
     16    </tr> 
     17    <% end %> 
     18    <% else: %> 
    1019    <tr> 
    1120        <td> 
    1221            <% if ConfReview.getEnableRefereeEmailNotif() or ConfReview.getEnableEditorEmailNotif() or ConfReview.getEnableReviewerEmailNotif(): %> 
    1322                <div style="padding-top: 10px; padding-bottom: 15px;"> 
    14                     <em><%=_("An automatically generated e-mail will be send to the Reviewers you will assign")%></em><br> 
    15                     <em><%= _("You  can  modify this from the Paper Reviewing Setup")%></em> 
     23                    <em><%=_("An automatically generated e-mail will be sent to newly assigned Reviewers.")%></em><br> 
     24                    <em><%= _("You  can  modify this from the Paper Reviewing Setup.")%></em> 
    1625                </div> 
    1726            <% end %> 
  • indico/MaKaC/webinterface/tpls/ConfModificationReviewingFramePRM.tpl

    rac1609 r42c6b7  
    22<% from MaKaC.common.PickleJar import DictPickler %> 
    33 
    4 <% if not ConfReview.hasReviewing(): %> 
    5 <p style="padding-left: 25px;"><font color="gray"><%= _("Type of reviewing has not been chosen yet")%></font></p> 
    6 <% end %> 
    7 <%else:%> 
     4 
    85<br> 
    96<table width="85%%" align="center" border="0"> 
     
    1512            <% if ConfReview.getEnablePRMEmailNotif(): %> 
    1613                <div style="padding-top: 10px; padding-bottom: 15px;"> 
    17                     <em><%=_("An automatically generated e-mail will be send to the Paper Review Managers you will assign")%></em><br> 
    18                     <em><%= _("You  can  modify this from the Paper Reviewing Setup")%></em> 
     14                    <em><%=_("An automatically generated e-mail will be sent to newly assigned Paper Review Managers.")%></em><br> 
     15                    <em><%= _("You  can  modify this from the Paper Reviewing Setup.")%></em> 
    1916                </div> 
    2017            <% end %> 
     
    7269                        $E('PRMList').set(uf.draw()) 
    7370</script> 
    74 <% end %> 
  • indico/MaKaC/webinterface/tpls/ConfModificationReviewingSettings.tpl

    rff41f72 r42c6b7  
    1111        </td> 
    1212    </tr> 
    13         <em><%= _("Please, follow the steps to set up the Paper Reviewing Module")%></em>  
     13        <em><%= _("Please, follow these steps to set up the Paper Reviewing Module")%></em>  
    1414</table> 
    1515         
  • indico/MaKaC/webinterface/tpls/ConfReviewingAssignContributions.tpl

    r2cc959 r42c6b7  
    111111        <td><%= _("Referee")%>:</td> 
    112112        <td id="assignRefereeHelp"> 
    113             <input id="assignRefereeButton_top" type="button" class="popUpButton" value="Assign"> 
    114             <input id="removeRefereeButton_top" type="button" class="popUpButton" value="Remove"> 
     113            <a id="assignRefereeButton_top" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     114            <span id="assignMenu_referee_top" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     115                <a id="assignRefereePerTrackButton_top" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     116                </a> 
     117            </span>| 
     118            <a id="removeRefereeButton_top" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a> 
    115119        </td> 
    116120    </tr> 
     
    120124        <td><%= _("Layout Reviewer")%>:</td> 
    121125        <td id="assignEditorHelp"> 
    122             <input id="assignEditorButton_top" type="button" class="popUpButton" value="Assign"> 
    123             <input id="removeEditorButton_top" type="button" class="popUpButton" value="Remove"> 
     126            <a id="assignEditorButton_top" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     127            <span id="assignMenu_editor_top" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     128                <a id="assignEditorPerTrackButton_top" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     129                </a> 
     130            </span>| 
     131            <a id="removeEditorButton_top" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a> 
    124132        </td> 
    125133    </tr> 
     
    129137        <td><%= _("Content Reviewers")%>:</td> 
    130138        <td id="assignReviewerHelp"> 
    131             <input id="addReviewerButton_top" type="button" class="popUpButton" value="Assign"> 
    132             <input id="removeReviewerButton_top" type="button" class="popUpButton" value="Remove"> 
    133             <input id="removeAllReviewersButton_top" type="button" class="popUpButton" value="Remove All"> 
     139            <a id="addReviewerButton_top" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     140            <span id="assignMenu_reviewer_top" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     141                <a id="assignReviewerPerTrackButton_top" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     142                </a> 
     143            </span>| 
     144            <a id="removeReviewerButton_top" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a>| 
     145            <a id="removeAllReviewersButton_top" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove All")%> 
    134146        </td> 
    135147    </tr> 
     
    284296        <td><%= _("Referee")%>:</td> 
    285297        <td id="assignRefereeHelp"> 
    286             <input id="assignRefereeButton_bottom" type="button" class="popUpButton" value="Assign"> 
    287             <input id="removeRefereeButton_bottom" type="button" class="popUpButton" value="Remove"> 
     298            <a id="assignRefereeButton_bottom" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     299            <span id="assignMenu_referee_bottom" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     300                <a id="assignRefereePerTrackButton_top" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     301                </a> 
     302            </span>| 
     303            <a id="removeRefereeButton_bottom" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a> 
    288304        </td> 
    289305    </tr> 
    290306    <% end %> 
    291     <% if not (ConfReview.getChoice() == 2 or ConfReview.getChoice() == 1): %> 
     307    <%if not (ConfReview.getChoice() == 2 or ConfReview.getChoice() == 1):%> 
    292308    <tr> 
    293309        <td><%= _("Layout Reviewer")%>:</td> 
    294310        <td id="assignEditorHelp"> 
    295             <input id="assignEditorButton_bottom" type="button" class="popUpButton" value="Assign"> 
    296             <input id="removeEditorButton_bottom" type="button" class="popUpButton" value="Remove"> 
     311            <a id="assignEditorButton_bottom" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     312            <span id="assignMenu_editor_bottom" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     313                <a id="assignEditorPerTrackButton_bottom" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     314                </a> 
     315            </span>| 
     316            <a id="removeEditorButton_bottom" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a> 
    297317        </td> 
    298318    </tr> 
     
    302322        <td><%= _("Content Reviewers")%>:</td> 
    303323        <td id="assignReviewerHelp"> 
    304             <input id="addReviewerButton_bottom" type="button" class="popUpButton" value="Assign"> 
    305             <input id="removeReviewerButton_bottom" type="button" class="popUpButton" value="Remove"> 
    306             <input id="removeAllReviewersButton_bottom" type="button" class="popUpButton" value="Remove All"> 
     324            <a id="addReviewerButton_bottom" class="fakeLink" style="margin-left: 15px; margin-right: 15px"><%= _("Assign")%></a>| 
     325            <span id="assignMenu_reviewer_bottom" onmouseover="this.className = 'mouseover'" onmouseout="this.className = ''"> 
     326                <a id="assignReviewerPerTrackButton_bottom" class="dropDownMenu fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Assign per ...")%> 
     327                </a> 
     328            </span>| 
     329            <a id="removeReviewerButton_bottom" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove")%></a>| 
     330            <a id="removeAllReviewersButton_bottom" class="fakeLink"  style="margin-left: 15px; margin-right: 15px"><%= _("Remove All")%> 
    307331        </td> 
    308332    </tr> 
    309     <% end %> 
     333   <% end %> 
    310334</table> 
    311335 
     
    320344 
    321345<script type="text/javascript"> 
     346var assignPerTrackMenus = function(role, place){ 
     347    var assignMenu = $E('assignMenu'+'_'+role+'_'+place); 
     348    var order = 'assign'; 
     349    if(role=='reviewer'){ 
     350       order = 'add'; 
     351    }  
     352    assignMenu.observeClick(function(e) { 
     353        var menuItems = {}; 
     354     
     355        menuItems[$T('Track')] = function(){ fetchUsersPerAttribute(order, role, 'track'); }; 
     356        menuItems[$T('Session')] = function(){ fetchUsersPerAttribute(order, role, 'session'); }; 
     357        menuItems[$T('Type')] = function(){ fetchUsersPerAttribute(order, role, 'type'); }; 
     358     
     359        var menu = new PopupMenu(menuItems, [assignMenu], "popupList"); 
     360        var pos = assignMenu.getAbsolutePosition(); 
     361        menu.open(pos.x, pos.y + 20); 
     362        return false; 
     363    }); 
     364} 
    322365 
    323366var contributions = $L(); // watchlist of contribution objects, pickled from Indico Contribution objects 
     
    390433 */ 
    391434var backgroundColorOver = function() { 
    392     IndicoUI.Widgets.Generic.tooltip(this.style.backgroundColor='#ECECEC'); 
     435    IndicoUI.Widgets.Generic.tooltip(this.style.backgroundColor='#FFF6DF'); 
    393436} 
    394437 
     
    396439    IndicoUI.Widgets.Generic.tooltip(this.style.backgroundColor='transparent'); 
    397440} 
     441 
     442var backgroundColorOnClick = function() { 
     443    IndicoUI.Widgets.Generic.tooltip(this.style.backgroundColor='#CDEB8B'); 
     444} 
     445 
    398446 
    399447var contributionTemplate = function(contribution) { 
     
    423471    var checkbox = Html.input('checkbox', {id: id, name:name}); 
    424472    checkbox.dom.value = contribution.id; 
    425     cell1.set(checkbox); 
     473     cell1.set(checkbox); 
    426474     
    427475    row.append(cell1); 
     
    659707 * @param {Object} role 
    660708 */ 
    661 var checkAllHaveReferee = function(contributions, order, role) { 
     709var checkAllHaveReferee = function(contributions, order, role, assignPerAttribute) { 
    662710    var contributionsWithoutReferee = [] 
    663711    for (i in contributions) { 
     
    670718    if (contributionsWithoutReferee.length == contributions.length) { 
    671719        alert($T("None of the contributions you checked have a Referee.") + 
    672             $T("You can only add an editor or a reviewer if the contribution has a referee.") 
     720            $T("You can only add a layout reviewer or a content reviewer if the contribution has a referee.") 
    673721        ); 
    674722        return false; 
     
    676724     
    677725    if (contributionsWithoutReferee.length > 0) { 
     726         
     727        if(assignPerAttribute){ 
     728            alert($T("Some of the contributions you checked have a Referee.") + 
     729            $T("You can only add a layout reviewer or a content reviewer if the contribution has a referee.")); 
     730            return false; 
     731        } else { 
    678732        title =$T('Contributions without referee');     
    679733             
     
    704758        return false; 
    705759    } 
     760    } 
    706761    return true; 
    707762} 
     
    732787    } 
    733788     
    734     contributionsWithoutEditor = [] 
     789    /*contributionsWithoutEditor = [] 
    735790    for (i in contributions) { 
    736791        contributionId = contributions[i] 
     
    745800        ); 
    746801        return false; 
    747     }  
     802    } */ 
    748803     
    749804    if (contributionsWithoutReviewers.length > 0) { 
     
    874929 * @param {Object} user The user that has been clicked. 
    875930 */ 
    876 var userSelected = function(user){ 
     931var userSelected = function(user, contrPerAttribute){ 
    877932     
    878933    var checkedContributions = getCheckedContributions() 
    879  
    880     if (checkedContributions.length > 0) { 
     934     
     935        
     936    if (checkedContributions.length > 0){ 
     937        var params = {conference: '<%= Conference.getId() %>',contributions: checkedContributions, user: user.id} 
     938      }  
     939     
    881940         
    882         var params = {conference: '<%= Conference.getId() %>',contributions: checkedContributions, user: user.id} 
     941    if(checkedContributions.length == 0 && contrPerAttribute.length > 0){ 
     942        var params = {conference: '<%= Conference.getId() %>',contributions: contrPerAttribute, user: user.id} 
     943        var checkedContributions = contrPerAttribute; 
     944    } 
     945        
     946    if (checkedContributions.length > 0 || (checkedContributions.length == 0 && contrPerAttribute.length > 0)) { 
     947         
     948        
    883949         
    884950        switch(action) { 
     
    10531119    if ((order == 'assign' && role == 'editor') || (order == 'add' && role == 'reviewer')) { 
    10541120        <% if not (ConfReview.getChoice() == 3 or ConfReview.getChoice() == 1): %> 
    1055                 if (!checkAllHaveReferee(checkedContributions, order, role)) { 
    1056                     return; 
    1057                 }  
    1058             <% end %> 
     1121            if (!checkAllHaveReferee(checkedContributions, order, role, false)) { 
     1122                return; 
     1123            }  
     1124        <% end %> 
    10591125   } 
    10601126    
     
    11491215} 
    11501216 
     1217var fetchUsersPerAttribute = function(order, role, attribute) { 
     1218     
     1219    var checkedContributions = getCheckedContributions(); 
     1220    if (checkedContributions.length > 0) {         
     1221        deselectAll('selectedContributions');         
     1222    }          
     1223     
     1224             
     1225    indicoRequest( 
     1226        'reviewing.conference.userCompetencesList', 
     1227        {conference: '<%= Conference.getId() %>', role: role}, 
     1228        function(result,error) { 
     1229            if (!error) {                
     1230                 
     1231                action = order + '_' + role; 
     1232                 
     1233                var title = '';  
     1234                if (role == 'editor') { 
     1235                    title = $T('Follow the steps to ') + order + $T(' a layout reviewer:'); 
     1236                }  
     1237                if (role == 'reviewer') { 
     1238                    title = $T('Follow the steps to ') + order + $T(' a content reviewer:'); 
     1239                }  
     1240                if (role == 'referee') { 
     1241                    title = $T('Follow the steps to ') + order + ' a ' + role + ':'; 
     1242                }  
     1243                 
     1244                var popup = new ExclusivePopup(title, function(){popup.close();}); 
     1245                 
     1246                popup.draw = function(){ 
     1247                 
     1248                     var AttributeDiv = Html.div(); 
     1249                      
     1250                     var attributeList = function () { 
     1251                        indicoRequest( 
     1252                        'reviewing.conference.attributeList', 
     1253                        {conference: '<%= Conference.getId()%>', attribute: attribute}, 
     1254                        function(result, error){ 
     1255                            if(!error){ 
     1256                                    var attributes = $L(); 
     1257                                    var attributeTemplate = function(att){ 
     1258                                                var li = Html.li({style:{listStyleType:"none", paddingBottom:'3px'}}); 
     1259                                                var id = (att.id); 
     1260                                                var name = ("selected"+attribute); 
     1261                                                var checkbox = Html.input('checkbox', {id: id, name: name}); 
     1262                                                var attributeName = Html.span({style:{marginLeft:'5px', fontSize: '13px'}}, att.title); 
     1263                                                     
     1264                                                li.set(Widget.inline([checkbox, attributeName])); 
     1265                                                     
     1266                                                return li; 
     1267                                    } 
     1268                                        var step1 = Html.span({style:{fontSize:'18px'}, className:'groupTitle groupTitleNoBorder'}, 'Step 1: Choose a '+ attribute);                                 
     1269                                        var attList = Html.ul(); 
     1270                                        bind.element(attList, attributes, attributeTemplate); 
     1271                                        for (i in result) { 
     1272                                        attributes.append(result[i]); 
     1273                                        }                             
     1274                                    AttributeDiv.set(Widget.block([step1,attList])); 
     1275                            } else { 
     1276                                    IndicoUtil.errorReport(error); 
     1277                            } 
     1278                        } 
     1279                        );  
     1280                     } 
     1281                     var getCheckedAttributes = function() {     
     1282                            var checkBoxes = document.getElementsByName("selected"+attribute); 
     1283                            var checkedAttributes = [] 
     1284                            for (var i=0; i<checkBoxes.length; i++) { 
     1285                                var cb = checkBoxes[i]; 
     1286                                if (cb.checked) { 
     1287                                    checkedAttributes.push(cb.id) 
     1288                                } 
     1289                            } 
     1290                            return checkedAttributes; 
     1291                     } 
     1292                     var assignButton = Html.button({style:{marginLeft:pixels(5)}}, $T("Assign")); 
     1293                       
     1294                     var users = $L();  
     1295                     var contrPerAttribute = []; 
     1296                                            
     1297                     var contributionsIdList = function (user, chAtt){ 
     1298                                    indicoRequest( 
     1299                                        'reviewing.conference.contributionsIdPerSelectedAttribute', 
     1300                                        {conference: '<%= Conference.getId()%>', attribute: attribute, selectedAttributes:chAtt }, 
     1301                                        function(result, error){ 
     1302                                            if(!error){ 
     1303                                                    for (i in result) { 
     1304                                                          contrPerAttribute.push(result[i]); 
     1305                                                    } 
     1306                                                    if ((order == 'assign' && role == 'editor') || (order == 'add' && role == 'reviewer')) { 
     1307                                                                                                                <% if not (ConfReview.getChoice() == 3 or ConfReview.getChoice() == 1): %> 
     1308                                                                                                                    if (!checkAllHaveReferee(contrPerAttribute, order, role, true)) { 
     1309                                                                                                                        return; 
     1310                                                                                                                    }  
     1311                                                                                                                <% end %> 
     1312                                                                                                           } 
     1313                                                    userSelected(user, contrPerAttribute); 
     1314                                            }                                                            
     1315                                            else { 
     1316                                                IndicoUtil.errorReport(error); 
     1317                                            } 
     1318                                        } 
     1319                                   ); 
     1320                                } 
     1321                     var userTemplate = function(user) { 
     1322                            var li = Html.li({style:{listStyleType:"none", paddingBottom:'3px'}}); 
     1323                            var name = ("radioBtn"); 
     1324                            var radioButton = Html.input('radio', {id: user.id, name: name});   
     1325                            var userName = Html.label({style:{fontWeight: 'normal'}}, user.name);  
     1326                         
     1327                            var userCompetences = Html.span({style:{marginLeft:'5px', fontSize: '11px'}}, 
     1328                                user.competences.length == 0 ? $T('(no competences defined)') : $T('(competences: ') + user.competences.join(', ') + ')' 
     1329                            ); 
     1330                             
     1331                            li.set(Widget.inline([radioButton, userName, userCompetences])); 
     1332                            return li; 
     1333                     } 
     1334                     var step2 = Html.span({style:{fontSize:'18px'}, className:'groupTitle groupTitleNoBorder'}, 'Step 2: Click on a user name to assign a '+ role);                     
     1335                     var userList = Html.ul(); 
     1336                     bind.element(userList, users, userTemplate); 
     1337                         
     1338                     for (i in result) { 
     1339                        users.append(result[i]); 
     1340                     } 
     1341                         
     1342                     attributeList();  
     1343                                            
     1344                     assignButton.observeClick(function(){ 
     1345                                var chAtt = getCheckedAttributes(); 
     1346                                if(chAtt.length == 0){ 
     1347                                    alert($T('You must select at least one attribute.')); 
     1348                                } else { 
     1349                                        var checkedBtn = function(){ 
     1350                                                var allBtn = document.getElementsByName('radioBtn'); 
     1351                                                    for (var i=0; i<allBtn.length; i++) { 
     1352                                                        var cb = allBtn[i]; 
     1353                                                        if (cb.checked) { 
     1354                                                           return cb.id   
     1355                                                        } 
     1356                                                    } 
     1357                                           } 
     1358                                           var checkedBtnId = checkedBtn(); 
     1359                                           if(checkedBtnId == null){ 
     1360                                               alert($T('You must select at least one user.')); 
     1361                                           } else { 
     1362                                                                           for (var i=0; i < users.length.get(); i++) { 
     1363                                                                               user = users.item(i); 
     1364                                                                               if (user.id == checkedBtnId) { 
     1365                                                                                   contributionsIdList(user, chAtt); 
     1366                                                                               } 
     1367                                                                           } 
     1368                                               var killProgress = IndicoUI.Dialogs.Util.progress() 
     1369                                               popup.close(); 
     1370                                               killProgress(); 
     1371                                       } 
     1372                                } 
     1373                            });   
     1374                              
     1375                     var cancelButton = Html.button({style:{marginLeft:pixels(5)}}, $T("Cancel")); 
     1376                          cancelButton.observeClick(function(){ 
     1377                          popup.close(); 
     1378                     }); 
     1379                       
     1380                     return this.ExclusivePopup.prototype.draw.call(this, Html.div({style: {height: 'auto', width: 'auto'}},Widget.block([AttributeDiv, step2, userList, assignButton, cancelButton])));   
     1381                }; 
     1382              popup.open(); 
     1383               
     1384              } else { 
     1385                  IndicoUtil.errorReport(error); 
     1386              } 
     1387        } 
     1388    ); 
     1389} 
     1390 
    11511391/** 
    11521392 * Removes the referee, the editor, or all the reviewers from the contributions that are selected. 
     
    12521492<% if not IsOnlyReferee and not (ConfReview.getChoice() == 3 or ConfReview.getChoice() == 1): %> 
    12531493$E('assignRefereeButton_top').observeClick(function(){ fetchUsers('assign', 'referee'); }); 
     1494assignPerTrackMenus('referee', 'top'); 
     1495assignPerTrackMenus('referee', 'bottom'); 
    12541496$E('assignRefereeButton_bottom').observeClick(function(){ fetchUsers('assign', 'referee'); }); 
    12551497$E('removeRefereeButton_top').observeClick(function(){ removeUser('referee') }); 
     
    12591501<% if not (ConfReview.getChoice() == 2 or ConfReview.getChoice() == 1): %> 
    12601502$E('assignEditorButton_top').observeClick(function(){ fetchUsers('assign', 'editor'); }); 
     1503assignPerTrackMenus('editor', 'top'); 
     1504assignPerTrackMenus('editor', 'bottom'); 
    12611505$E('assignEditorButton_bottom').observeClick(function(){ fetchUsers('assign', 'editor'); }); 
    12621506$E('removeEditorButton_top').observeClick(function(){ removeUser('editor') }); 
     
    12661510<% if not (ConfReview.getChoice() == 3 or ConfReview.getChoice() == 1): %> 
    12671511$E('addReviewerButton_top').observeClick(function(){ fetchUsers('add', 'reviewer'); }); 
     1512assignPerTrackMenus('reviewer', 'top'); 
     1513assignPerTrackMenus('reviewer', 'bottom'); 
    12681514$E('addReviewerButton_bottom').observeClick(function(){ fetchUsers('add', 'reviewer'); }); 
    12691515$E('removeReviewerButton_top').observeClick(function(){ fetchUsers('remove', 'reviewer'); }); 
     
    12731519<% end %> 
    12741520 
    1275  
    12761521fetchContributions(); 
    12771522     
  • indico/htdocs/js/indico/Core/Dialogs/Popup.js

    r27b220 r42c6b7  
    162162        // dialog is displayed. 
    163163        var contentHeight = this._calculateContentHeight(); 
    164         this.contentWrapper.setStyle('height', pixels(contentHeight)); 
     164        //this.contentWrapper.setStyle('height', pixels(contentHeight)); 
    165165        //this.contentWrapper.setStyle('marginTop', pixels((this.closeHandler && !this.title) ? 30 : 10)); 
    166166        this.contentWrapper.setStyle('overflowY', 'auto'); 
Note: See TracChangeset for help on using the changeset viewer.