| 1 | <% declareTemplate(newTemplateStyle=True) %> |
|---|
| 2 | |
|---|
| 3 | <% from MaKaC.plugins.helpers import WebLinkGenerator, DesktopLinkGenerator %> |
|---|
| 4 | <% from MaKaC.plugins.util import PluginFieldsWrapper %> |
|---|
| 5 | |
|---|
| 6 | <script type="text/javascript"> |
|---|
| 7 | var showDesktopLink = <%=jsonEncode( PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('joinDesktopClients') )%>; |
|---|
| 8 | var showWebLink = <%=jsonEncode( PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('joinWebClient') )%>; |
|---|
| 9 | </script> |
|---|
| 10 | |
|---|
| 11 | <table width="100%" align="center" border="0" cellpadding="5px"> |
|---|
| 12 | <tr> |
|---|
| 13 | <td colspan="10" class="groupTitle"> <%= _("Chat rooms for ")%> <%= Conference.getTitle()%></td> |
|---|
| 14 | </tr> |
|---|
| 15 | |
|---|
| 16 | <tr> |
|---|
| 17 | <td></td> |
|---|
| 18 | <td nowrap class="titleChat"> <%= _("Room")%></td> |
|---|
| 19 | <td nowrap class="titleChat"> <%= _("Server")%></td> |
|---|
| 20 | <td nowrap class="titleChat"> <%= _("Description")%></td> |
|---|
| 21 | <td nowrap class="titleChat"> <%= _("Requires password")%></td> |
|---|
| 22 | <td nowrap class="titleChat"> <%= _("Password")%></td> |
|---|
| 23 | </tr> |
|---|
| 24 | |
|---|
| 25 | <% for cr in Chatrooms: %> |
|---|
| 26 | <% if cr.getCreatedInLocalServer():%> |
|---|
| 27 | <% server = 'conference.' + cr.getHost() %> |
|---|
| 28 | <% end %> |
|---|
| 29 | <% else:%> |
|---|
| 30 | <% server = cr.getHost() %> |
|---|
| 31 | <% end %> |
|---|
| 32 | |
|---|
| 33 | <tr style="vertical-align: baseline;"> |
|---|
| 34 | <td></td> |
|---|
| 35 | <td> <%= cr.getTitle()%> </td> |
|---|
| 36 | |
|---|
| 37 | <td style="font-family:monospace;"> <%= server%></td> |
|---|
| 38 | |
|---|
| 39 | <td><div id='desc<%= cr.getId() %>'> <%= cr.getDescription()%></div></td> |
|---|
| 40 | |
|---|
| 41 | <td> <%= _('Yes') if len(cr.getPassword()) > 0 else _('No')%></td> |
|---|
| 42 | |
|---|
| 43 | <% if cr.getShowPass() and len(cr.getPassword()) > 0:%> |
|---|
| 44 | <td> <%= cr.getPassword()%> </td> |
|---|
| 45 | <% end %> |
|---|
| 46 | <% elif not cr.getShowPass() and len(cr.getPassword()) > 0:%> |
|---|
| 47 | <td style="font-style:italic;"> <%= _('Not displayed')%> </td> |
|---|
| 48 | <% end %> |
|---|
| 49 | <% else:%> |
|---|
| 50 | <td style="font-style:italic;"> - </td> |
|---|
| 51 | <% end %> |
|---|
| 52 | <% if PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('joinDesktopClients') or PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('joinWebClient'): %> |
|---|
| 53 | <td style="font-weight: bold;" nowrap><a id="joinLink" class="dropDownMenu highlight" href="#"><%= _("Join now!")%></a></td> |
|---|
| 54 | <% end %> |
|---|
| 55 | </tr> |
|---|
| 56 | <% end %> |
|---|
| 57 | </table> |
|---|
| 58 | |
|---|
| 59 | <%= PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('ckEditor') %> |
|---|
| 60 | |
|---|
| 61 | <script type="text/javascript"> |
|---|
| 62 | var joinLink = $E('joinLink'); |
|---|
| 63 | var joinMenu = null; |
|---|
| 64 | if(joinLink){ |
|---|
| 65 | joinLink.observeClick(function(e) { |
|---|
| 66 | // Close the menu if clicking the link when menu is open |
|---|
| 67 | if (joinMenu != null && joinMenu.isOpen()) { |
|---|
| 68 | joinMenu.close(); |
|---|
| 69 | joinMenu = null; |
|---|
| 70 | return; |
|---|
| 71 | } |
|---|
| 72 | var menuItems = {}; |
|---|
| 73 | if (showDesktopLink){ |
|---|
| 74 | menuItems['Using web client'] = <%=jsonEncode( DesktopLinkGenerator(cr).generate() )%>; |
|---|
| 75 | } |
|---|
| 76 | if (showWebLink){ |
|---|
| 77 | menuItems['Using your desktop client'] = <%=jsonEncode( WebLinkGenerator(cr).generate(True) )%>; |
|---|
| 78 | } |
|---|
| 79 | joinMenu = new PopupMenu(menuItems, [joinLink], 'categoryDisplayPopupList'); |
|---|
| 80 | var pos = joinLink.getAbsolutePosition(); |
|---|
| 81 | joinMenu.open(pos.x - 5, pos.y + joinLink.dom.offsetHeight + 2); |
|---|
| 82 | return false; |
|---|
| 83 | }); |
|---|
| 84 | } |
|---|
| 85 | </script> |
|---|