Changeset 3a480c6863bced8a371cf98dc08c61d536b1225b in indico


Ignore:
Timestamp:
02/01/12 18:02:46 (4 months ago)
Author:
Alberto Resco Perez <alberto.resco.perez@…>
Children:
007494c29b38a4e4c0224109cf058e6841a9bf24
Parents:
3c3d13056f085b142f851977dae17051b8e5f2db
git-author:
Alberto Resco Perez <alberto.resco.perez@…> (02/01/12 18:02:46)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (02/02/12 14:49:16)
Message:

[IMP] Show abstracts files in contribution list

  • Added new option in Call for abstracts setup.
  • Included in contribution list display and contribution display.
  • When getting the file do now check protection if the option is active.
  • Closes #981.
Location:
indico
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/review.py

    r025d21 r3a480c  
    701701        self._showSelectAsSpeaker= True 
    702702        self._selectSpeakerMandatory= True 
     703        self._showAttachedFilesContribList = False 
    703704 
    704705    def getMultipleTracks( self ): 
     
    751752    def setSelectSpeakerMandatory(self, selectSpeakerMandatory): 
    752753        self._selectSpeakerMandatory = selectSpeakerMandatory 
     754 
     755    def showAttachedFilesContribList(self): 
     756        try: 
     757            return self._showAttachedFilesContribList 
     758        except: 
     759            self._showAttachedFilesContribList= False 
     760            return self._showAttachedFilesContribList 
     761 
     762    def setSwitchShowAttachedFilesContribList(self, showshowAttachedFilesContribList): 
     763        self._showAttachedFilesContribList = showshowAttachedFilesContribList 
    753764 
    754765    def getAbstractFieldsMgr(self): 
  • indico/MaKaC/webinterface/pages/conferences.py

    r025d21 r3a480c  
    46894689        vars["showSelectAsSpeaker"] = abMgr.showSelectAsSpeaker() 
    46904690        vars["isSelectSpeakerMandatory"] = abMgr.isSelectSpeakerMandatory() 
     4691        vars["showAttachedFilesContribList"] = abMgr.showAttachedFilesContribList() 
    46914692 
    46924693        vars["multipleUrl"] = urlHandlers.UHConfCFASwitchMultipleTracks.getURL(self._conf) 
     
    46954696        vars["showSpeakerUrl"] = urlHandlers.UHConfCFAShowSelectAsSpeaker.getURL(self._conf) 
    46964697        vars["speakerMandatoryUrl"] = urlHandlers.UHConfCFASelectSpeakerMandatory.getURL(self._conf) 
     4698        vars["showAttachedFilesUrl"] = urlHandlers.UHConfCFAAttachedFilesContribList.getURL(self._conf) 
    46974699 
    46984700        vars["setStatusURL"]=urlHandlers.UHConfCFAChangeStatus.getURL(self._conf) 
     
    75187520                mat.append("<a href=%s>%s</a>" % ( quoteattr(str(url)),self._getMaterialIcon(Config.getInstance().getSystemIconURL( "paper" ), "Paper"))) 
    75197521        material = "".join(mat) 
     7522        abst = [] 
     7523        if self._conf.getAbstractMgr().showAttachedFilesContribList() and isinstance(contrib, conference.AcceptedContribution) and len(contrib.getAbstract().getAttachments()) > 0: 
     7524            for file in contrib.getAbstract().getAttachments().values(): 
     7525                abst.append("""<div style="padding-bottom:3px;"><a href="%s">%s</a></div>""" % (str(urlHandlers.UHAbstractAttachmentFileAccess.getURL(file)), file.getFileName())) 
     7526        abstracts = "".join(abst) 
    75207527        html = """ 
    75217528            <tr> 
     
    75297536                %s 
    75307537                <td class="abstractDataCell">%s</td> 
     7538                <td class="abstractDataCell">%s</td> 
    75317539            </tr> 
    75327540                """%(contrib.getId(), self.htmlText( contrib.getId() ), 
    75337541                    sdate or "&nbsp;", typeHTML, 
    75347542                    title or "&nbsp;", speaker or "&nbsp;", 
    7535                     session or "&nbsp;", trackHTML, material or "&nbsp;" ) 
     7543                    session or "&nbsp;", trackHTML, material or "&nbsp;", abstracts or "&nbsp;" ) 
    75367544        return html 
    75377545 
     
    75467554                mat.append(self._getMaterialIcon(Config.getInstance().getSystemIconURL( "paper" ), _("Paper"))) 
    75477555        material = "".join(mat) 
     7556        abst = [] 
     7557        if self._conf.getAbstractMgr().showAttachedFilesContribList() and isinstance(contrib, conference.AcceptedContribution) and len(contrib.getAbstract().getAttachments()) > 0: 
     7558            for file in contrib.getAbstract().getAttachments().values(): 
     7559                abst.append("""<div style="padding-bottom:3px;"><a href="%s">%s</a></div>""" % (str(urlHandlers.UHAbstractAttachmentFileAccess.getURL(file)), file.getFileName())) 
     7560        abstracts = "".join(abst) 
    75487561        trackHTML = typeHTML = "" 
    75497562        if self._displayTrackFilter: 
     
    75647577                %s 
    75657578                <td class="abstractDataCell">%s</td> 
     7579                <td class="abstractDataCell">%s</td> 
    75667580            </tr> 
    7567                 """%(self.htmlText( contrib.getId() ), "&nbsp;", "&nbsp;", typeHTML, title or "&nbsp;", "&nbsp;", "&nbsp;", trackHTML,  material or "&nbsp;" ) 
     7581                """%(self.htmlText( contrib.getId() ), "&nbsp;", "&nbsp;", typeHTML, title or "&nbsp;", "&nbsp;", "&nbsp;", trackHTML,  material or "&nbsp;", abstracts or "&nbsp;" ) 
    75687582        return html 
    75697583 
     
    77837797        vars["contribSelectionAction"]=quoteattr(str(urlHandlers.UHContributionListAction.getURL(self._conf))) 
    77847798        vars["contributionsPDFURL"]=quoteattr(str(urlHandlers.UHContributionListToPDF.getURL(self._conf))) 
     7799        vars["showAttachedFiles"] = self._conf.getAbstractMgr().showAttachedFilesContribList() 
    77857800 
    77867801        return vars 
  • indico/MaKaC/webinterface/pages/contributions.py

    r250e54 r3a480c  
    4040from pytz import timezone 
    4141import MaKaC.common.timezoneUtils as timezoneUtils 
    42  
     42from MaKaC.common.fossilize import fossilize 
     43from MaKaC.fossils.conference import ILocalFileAbstractMaterialFossil 
    4344 
    4445class WPContributionBase( WPMainBase, WPConferenceBase ): 
     
    306307        else: 
    307308            vars["hideInfo"] = False 
    308         return vars 
     309        vars["showAttachedFiles"] = self._contrib.getConference().getAbstractMgr().showAttachedFilesContribList() and isinstance(self._contrib, conference.AcceptedContribution) and len(self._contrib.getAbstract().getAttachments()) > 0 
     310        vars["abstractAttachments"] = fossilize(self._contrib.getAbstract().getAttachments().values(), ILocalFileAbstractMaterialFossil) if isinstance(self._contrib, conference.AcceptedContribution) else [] 
     311        return vars 
     312 
    309313 
    310314 
  • indico/MaKaC/webinterface/rh/CFADisplay.py

    rb69e00 r3a480c  
    510510 
    511511    def _checkProtection( self ): 
    512         # Same protection as the abstract 
    513         temptarget=self._target 
    514         self._target = self._target.getOwner() 
    515         RHFileAccess._checkProtection( self ) 
    516         self._target = temptarget 
     512        if not self._conf.getAbstractMgr().showAttachedFilesContribList(): 
     513            # Same protection as the abstract 
     514            temptarget=self._target 
     515            self._target = self._target.getOwner() 
     516            RHFileAccess._checkProtection( self ) 
     517            self._target = temptarget 
  • indico/MaKaC/webinterface/rh/conferenceModif.py

    r025d21 r3a480c  
    33963396        self._redirect( urlHandlers.UHConfModifCFA.getURL( self._conf ) ) 
    33973397 
     3398class RHConfModifCFASwitchShowAttachedFilesContribList( RHConfModifCFABase ): 
     3399 
     3400    def _process( self ): 
     3401        self._conf.getAbstractMgr().setSwitchShowAttachedFilesContribList(not self._conf.getAbstractMgr().showAttachedFilesContribList()) 
     3402        self._redirect( urlHandlers.UHConfModifCFA.getURL( self._conf ) ) 
     3403 
    33983404class RHCFAAddType( RHConfModifCFABase ): 
    33993405 
  • indico/MaKaC/webinterface/tpls/ConfContributionList.tpl

    r988cfe r3a480c  
    6565                    ${ trackHeader } 
    6666                    <td nowrap class="titleCellFormat" style="border-right:5px solid #FFFFFF;border-left:5px solid #FFFFFF;border-bottom: 1px solid #5294CC;"> ${ _("Files")}</td> 
     67                    % if showAttachedFiles: 
     68                        <td nowrap class="titleCellFormat" style="border-right:5px solid #FFFFFF;border-left:5px solid #FFFFFF;border-bottom: 1px solid #5294CC;"> ${ _("Abstracts")}</td> 
     69                    % endif 
     70 
    6771                </tr> 
    6872                <form action=${ contribSelectionAction } method="post" target="_blank"> 
  • indico/MaKaC/webinterface/tpls/ConfModifCFA.tpl

    r025d21 r3a480c  
    7979                <br/><img src="${ iconDisabled }" border="0"> <span id="makePresenterMandatory" style="color:#777"> ${makeMandSpk}</span> 
    8080            % endif 
     81            <br/><a href="${ showAttachedFilesUrl }" id="showAttachedFiles" data-active="${'yes' if showAttachedFilesContribList else 'no'}"><img src="${ iconEnabled if showAttachedFilesContribList else iconDisabled }" border="0"> ${ _("Show files attached to abstracts in the contribution list") }</a> 
    8182        </td> 
    8283    </tr> 
     
    108109IndicoUI.executeOnLoad(function(){ 
    109110    $('#makePresenterMandatory').qtip({content: "${_('This option is automatically disabled when the option \'Allow to choose the presenter(s) of the abstracts\' is also disabled')}", position: {my: 'top middle', at: 'bottom middle'}}); 
     111    $('#showAttachedFiles').click(function(){ 
     112        if(this.dataset.active=='no'){ 
     113            return confirm($T("Please, note that if you enable this option the files (attached to the abstracts) will be public and accessible by everybody. Are you sure to continue?")); 
     114        } 
     115        return true; 
     116 
     117    }) 
    110118}); 
    111119</script> 
  • indico/MaKaC/webinterface/tpls/ContributionDisplayFull.tpl

    r8ecf21 r3a480c  
    5656            ${ additionalFields } 
    5757                % endif 
     58        % if showAttachedFiles: 
     59            <tr> 
     60                <td align="right" valign="top" 
     61                    class="displayField"><b>${ _("Abstract files")}:</b></td> 
     62                <td> 
     63                % for file in abstractAttachments: 
     64                    <div style="padding-bottom:3px;"><a href=${ file["url"] }>${ file["file"]["fileName"] }</a></div> 
     65                % endfor 
     66                </td> 
     67            </tr> 
     68        % endif 
    5869        <tr> 
    5970          <td align="right" valign="top" class="displayField"><b>${ _("Id")}:</b></td> 
  • indico/MaKaC/webinterface/tpls/ContributionDisplayMin.tpl

    rc0de5a r3a480c  
    2020                                <td align="left" colspan="3"> 
    2121                                    <table width="95%" align="center" valign="top" border="0"> 
     22                                        % if showAttachedFiles: 
     23                                            <tr> 
     24                                                <td align="right" valign="top" 
     25                                                    class="displayField"><b>${ _("Abstract files")}:</b></td> 
     26                                                <td> 
     27                                                % for file in abstractAttachments: 
     28                                                    <div style="padding-bottom:3px;"><a href=${ file["url"] }>${ file["file"]["fileName"] }</a></div> 
     29                                                % endfor 
     30                                                </td> 
     31                                            </tr> 
     32                                        % endif 
    2233                                        <tr> 
    2334                                            <td align="right" valign="top" 
  • indico/MaKaC/webinterface/urlHandlers.py

    r025d21 r3a480c  
    734734class UHConfCFASelectSpeakerMandatory( URLHandler ): 
    735735    _relativeURL = "confModifCFA.py/switchSelectSpeakerMandatory" 
     736 
     737class UHConfCFAAttachedFilesContribList( URLHandler ): 
     738    _relativeURL = "confModifCFA.py/switchShowAttachedFiles" 
    736739 
    737740class UHCFAManagementAddType( URLHandler ): 
  • indico/htdocs/confModifCFA.py

    r025d21 r3a480c  
    9292def switchSelectSpeakerMandatory(req, **params): 
    9393    return conferenceModif.RHConfModifCFASwitchSelectSpeakerMandatory(req).process(params) 
     94 
     95def switchShowAttachedFiles(req, **params): 
     96    return conferenceModif.RHConfModifCFASwitchShowAttachedFilesContribList(req).process(params) 
Note: See TracChangeset for help on using the changeset viewer.