Changeset 3f852f in indico


Ignore:
Timestamp:
06/15/12 13:59:50 (11 months ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
06b456
Parents:
83d955
git-author:
Alberto Resco Perez <alberto.resco.perez@…> (06/13/12 15:27:36)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (06/15/12 13:59:50)
Message:

[IMP] Add connect button event display

Location:
indico
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/plugins/Collaboration/tpls/EventDetailBanner.tpl

    rf61ffa r3f852f  
    6161    <!-- <span style="margin-left:20px;"></span>  --> 
    6262 
     63        % if bookingInfo: 
     64        <span class="collaborationDisplayMoreInfo">More Info</span> 
     65        % endif 
     66 
     67        % if bookingInfo and launchInfo: 
     68        <span style="margin-left:3px;margin-right:3px;">|</span> 
     69        % endif 
     70 
    6371        % if launchInfo: 
    6472        <a target="_blank" href="${launchInfo['launchLink']}" class="bookingLaunchLink" data-id="${bookingId}"> 
     
    6977        </script> 
    7078        % endif 
    71  
    72         % if bookingInfo and launchInfo: 
     79        % if (bookingInfo or launchInfo) and booking.canBeConnected() and self_._rh._getUser() and (conf.canModify(self_._rh._aw) or booking.getOwner()["id"] == self_._rh._getUser().getId()): 
    7380        <span style="margin-left:3px;margin-right:3px;">|</span> 
     81        <script type="text/javascript"> 
     82        var booking${booking.getId()} = ${jsonEncode(fossilize(booking))}; 
     83        </script> 
     84        <a href="#" style="font-size:12px; font-weight: bold" onClick="connectBookingRoom(booking${booking.getId()},'${conf.getId()}')">${_("Connect")} ${booking.getLinkVideoRoomLocation()}</a> 
     85        <span style="display:inline; vertical-align:middle" id="connectProgress${booking.getId()}"></span> 
    7486        % endif 
    7587 
    76         % if bookingInfo: 
    77     <span class="collaborationDisplayMoreInfo">More Info</span> 
    78         % endif 
    7988    </span> 
    8089 
  • indico/MaKaC/services/implementation/collaboration.py

    r9aa0693 r3f852f  
    194194    """ Performs server-side actions when a booking is connected 
    195195    """ 
     196 
     197    def _checkProtection(self): 
     198        booking = self._CSBookingManager.getBooking(self._bookingId) 
     199        if not hasattr(booking, "getOwnerObject") or booking.getOwnerObject() != self.getAW().getUser(): 
     200            CollaborationBookingModifBase._checkProtection(self) 
     201 
    196202    def _getAnswer(self): 
    197203        return fossilize(self._CSBookingManager.connectBooking(self._bookingId), 
  • indico/MaKaC/webinterface/pages/collaboration.py

    r9aa0693 r3f852f  
    403403 
    404404    def getJSFiles(self): 
    405         return WPConferenceDefaultDisplayBase.getJSFiles(self) + self._includeJSPackage('Collaboration') 
     405        return WPConferenceDefaultDisplayBase.getJSFiles(self) + self._includeJSPackage('Display') + self._includeJSPackage('Collaboration') 
    406406 
    407407    def _defineSectionMenu(self): 
     
    445445        vars["ScheduledBookings"] = scheduledBookings 
    446446        vars["Timezone"] = self._tz 
     447        vars["conf"] = self._conf 
    447448 
    448449        return vars 
  • indico/MaKaC/webinterface/tpls/BookingDisplay.tpl

    r335540 r3f852f  
    9393        </script> 
    9494    % endif 
     95 
     96    % if displayInfo and Booking.canBeConnected() and self_._rh._getUser() and (conf.canModify(self_._rh._aw) or Booking.getOwner()["id"] == self_._rh._getUser().getId()): 
     97        <span style="margin-left:3px;margin-right:3px;">|</span> 
     98        <script type="text/javascript"> 
     99            var booking${Booking.getId()} = ${jsonEncode(fossilize(Booking))}; 
     100        </script> 
     101        <a href="#" style="font-size:12px" onClick="connectBookingRoom(booking${Booking.getId()},'${conf.getId()}')">${_("Connect")} ${Booking.getLinkVideoRoomLocation()}</a> 
     102        <div style="display:inline; vertical-align:middle" id="connectProgress${Booking.getId()}"></div> 
     103        % endif 
     104 
    95105    </div> 
    96106 
  • indico/MaKaC/webinterface/tpls/events/include/VideoService.tpl

    r842982 r3f852f  
    1010            <!--${launchInfo['launchText']}--> 
    1111        </a> 
     12        % if video.canBeConnected() and self_._rh._getUser() and (conf.canModify(self_._rh._aw) or video.getOwner()["id"] == self_._rh._getUser().getId()): 
     13        <span style="margin-left:3px;margin-right:3px;">|</span> 
     14        <script type="text/javascript"> 
     15            var booking${video.getId()} = ${jsonEncode(fossilize(video))}; 
     16        </script> 
     17        <a href="#" style="font-size:12px" onClick="connectBookingRoom(booking${video.getId()},'${conf.getId()}')">${_("Connect")} ${video.getLinkVideoRoomLocation()}</a> 
     18        <span style="display:inline; vertical-align:middle" id="connectProgress${video.getId()}"></span> 
     19        % endif 
     20 
    1221    </span> 
    1322</span> 
  • indico/htdocs/js/indico/Collaboration/Collaboration.js

    r1ed8d2 r3f852f  
    19061906}; 
    19071907 
     1908var connectBookingRoom = function(booking, confId) { 
     1909    $E("connectProgress"+booking["id"]).set(progressIndicator(true,true)); 
     1910    jsonRpc(Indico.Urls.JsonRpcService, "collaboration.connectCSBooking", 
     1911            { confId: confId, 
     1912              bookingId: booking.id }, 
     1913            function(result, error){ 
     1914                  $E("connectProgress"+booking["id"]).set(""); 
     1915                  if (!error) { 
     1916                      if (result.error){ 
     1917                          new WarningPopup($T("Cannot be connected"), result.userMessage).open(); 
     1918                      } 
     1919                      else { 
     1920                          new AlertPopup($T("Success"), $T("The room ") + booking.linkVideoRoomLocation  + $T(" has been conected to the Vidyo room.") ).open(); 
     1921                      } 
     1922                  } else { 
     1923                      IndicoUtil.errorReport(error); 
     1924                  } 
     1925    }); 
     1926}; 
     1927 
    19081928var drawBookingPopup = function (videoInformation, confId, bookingId, displayModeratorLink) { 
    19091929    var divWrapper = Html.div({className:"videoServiceInlinePopup"}); 
Note: See TracChangeset for help on using the changeset viewer.