diff --git a/fields/pod.py b/fields/pod.py index 2a08eee..92e64c6 100644 --- a/fields/pod.py +++ b/fields/pod.py @@ -32,7 +32,7 @@ class Pod(Field): from data contained in Appy class and linked objects or anything you want to put in it. It is the way gen uses pod.''' # Layout for rendering a POD field for exporting query results. - rLayouts = {'view': Table('fl', width=None)} + rLayouts = {'view': 'l-f!'} allFormats = {'.odt': ('pdf', 'doc', 'odt'), '.ods': ('xls', 'ods')} POD_ERROR = 'An error occurred while generating the document. Please ' \ 'contact the system administrator.' @@ -103,7 +103,11 @@ class Pod(Field): - :field.getTemplateName(obj, info.template) + + :field.getTemplateName(obj, info.template) @@ -232,20 +236,20 @@ class Pod(Field): def getVisibleTemplates(self, obj): '''Returns, among self.template, the template(s) that can be shown.''' - isManager = obj.user.has_role('Manager') + res = [] if not self.showTemplate: # Show them all in any format. - res = [] for template in self.template: res.append(Object(template=template, formats=self.getAllFormats(template), freezeFormats=self.getFreezeFormats(obj, template))) - res = [] - for template in self.template: - formats = isManager and self.getAllFormats(template) or \ - self.showTemplate(obj, template) - if formats: - res.append(Object(template=template, formats=formats, + else: + isManager = obj.user.has_role('Manager') + for template in self.template: + formats = isManager and self.getAllFormats(template) or \ + self.showTemplate(obj, template) + if formats: + res.append(Object(template=template, formats=formats, freezeFormats=self.getFreezeFormats(obj, template))) return res diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 5422d28..5a4927e 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -95,9 +95,6 @@ input.button { border-width: 0 !important; color: #666666; height: 24px; .inputSearch { height: 15px; width: 132px; margin: 3px 3px 2px 3px !important } td.search { padding-top: 8px } .content { padding: 14px 14px 9px 15px; background-color: #f1f1f1 } -.grey { display: none; position: absolute; left: 0px; top: 0px; z-index:2; - background:grey; opacity:0.5; -moz-opacity:0.5; -khtml-opacity:0.5; - filter:alpha(Opacity=50) } .popup { display: none; position: absolute; top: 30%; left: 35%; width: 350px; z-index : 100; background: white; padding: 8px; border: 1px solid grey } diff --git a/gen/ui/appy.js b/gen/ui/appy.js index 7bb0d20..31376fd 100644 --- a/gen/ui/appy.js +++ b/gen/ui/appy.js @@ -42,6 +42,11 @@ function showLoginForm() { } function goto(url) { window.location = url } +function len(dict) { + var res = 0; + for (var key in dict) res += 1; + return res; +} function switchLanguage(selectWidget) { var language = selectWidget.options[selectWidget.selectedIndex].value; @@ -92,7 +97,8 @@ function injectChunk(elem, content){ a temporary DOM element. */ var temp = document.createElement('div'); temp.innerHTML = content; - elem.replaceChild(temp.firstChild, elem.firstChild); + temp.firstChild.id = elem.id; + elem.parentNode.replaceChild(temp.firstChild, elem); } } } @@ -550,7 +556,7 @@ function onLinkMany(action, id) { // Get the array semantics var semantics = node['_appy_' + elems[2] + '_sem']; // Show an error messagge if non element is selected. - if ((semantics == 'checked') && (Object.keys(statuses).length == 0)) { + if ((semantics == 'checked') && (len(statuses) == 0)) { openPopup('alertPopup', no_elem_selected); return; } @@ -678,24 +684,15 @@ function openPopup(popupId, msg) { // Open the popup var popup = document.getElementById(popupId); // Put it at the right place on the screen - var scrollTop = document.body.scrollTop || window.pageYOffset || 0; + var scrollTop = document.documentElement.scrollTop || window.pageYOffset || 0; popup.style.top = (scrollTop + 150) + 'px'; - popup.style.display = "block"; - // Show the greyed zone - var greyed = document.getElementById('grey'); - greyed.style.top = scrollTop + 'px'; - greyed.style.display = "block"; - greyed.style.height = document.body.clientHeight; - greyed.style.width = document.body.clientWidth; + popup.style.display = 'block'; } function closePopup(popupId) { // Close the popup var popup = document.getElementById(popupId); - popup.style.display = "none"; - // Hide the greyed zone - var greyed = document.getElementById('grey'); - greyed.style.display = "none"; + popup.style.display = 'none'; } // Function triggered when an action needs to be confirmed by the user diff --git a/gen/wrappers/ToolWrapper.py b/gen/wrappers/ToolWrapper.py index c209dee..af6b3fa 100644 --- a/gen/wrappers/ToolWrapper.py +++ b/gen/wrappers/ToolWrapper.py @@ -442,7 +442,7 @@ class ToolWrapper(AbstractWrapper):

- :uiSearch.translated (:totalNumber) + :uiSearch.translated (:totalNumber)  —  :_('search_new') diff --git a/gen/wrappers/__init__.py b/gen/wrappers/__init__.py index a507d79..02efa72 100644 --- a/gen/wrappers/__init__.py +++ b/gen/wrappers/__init__.py @@ -101,9 +101,6 @@ class AbstractWrapper(object): - -

-