[FIX] Fix internationalization Layout in more menu
[cds-indico.git] / indico / MaKaC / webinterface / tpls / HeaderMoreMenu.tpl
blob780540c6fc46e6542b362304d46cd0cf0fe4f82e
1 <%page args="viewoptions=None, SelectedStyle=None, pdfURL=None, showExportToICal=None, showExportToPDF=None, showDLMaterial=None, showLayout=None, displayURL=None"/>
3 <a><div id="moreMenu" class="dropDownMenuGrey" href="#">${ _("More") }</div><div class="leftCorner"></div></a>
6 <form id="layoutForm" action="${ displayURL }" style="margin: 0px; display: inline">
7     <input type="hidden" name="confId" value="${ confId }" />
8     <input id="layoutFormInput" type="hidden" name="view" value="standard" />
9 </form>
11 <script type="text/javascript">
13 var moreMenu = $E('moreMenu');
15 var layoutForm = $E('layoutForm');
16 var layoutFormInput = $E('layoutFormInput');
18 var layoutMenuItems = {};
19 % for item in viewoptions:
20 layoutMenuItems["${ item['name']}"] = function() {
21     layoutFormInput.setAttribute('value', '${ item['id'] }');
22     layoutForm.dom.submit();
24 % endfor
26 moreMenu.observeClick(function(e) {
27     var menuItems = {}
28     var menu = new PopupMenu(menuItems, [moreMenu], ${"'darkPopupList'" if dark else "null"});
30     % if showExportToICal:
31     menuItems["${ _('Export event to iCal') }"] = '${ urlHandlers.UHConferenceToiCal.getURL(self_._rh._conf, detailLevel = "top") }';
32     menuItems["${ _('Export timetable to iCal') }"] = '${ urlHandlers.UHConferenceToiCal.getURL(self_._rh._conf, detailLevel = "contributions") }';
33     % endif
34     % if showExportToPDF:
35     menuItems["${ _('Export to PDF') }"] = '${ pdfURL }';
36     % endif
37     % if showDLMaterial:
38     menuItems["${ _('Download material') }"] = '${ urlHandlers.UHConferenceDisplayMaterialPackage.getURL(self_._rh._conf) }';
39     % endif
40     % if showLayout:
41     menuItems["${ _('Layout') }"] = new PopupMenu(layoutMenuItems, [moreMenu, menu], ${"'darkPopupList'" if dark else "null"}, null, null, null, '${ SelectedStyle }');
42     % endif
44     var pos = moreMenu.getAbsolutePosition();
45     menu.open(pos.x - 8, pos.y + 20);
46     return false;
47 });
49 </script>