Exemplo n.º 1
0
Arquivo: text.py Projeto: Xeon2003/vi
    def __init__(self,
                 moduleName,
                 boneName,
                 readOnly,
                 isPlainText,
                 languages=None,
                 descrHint=None,
                 *args,
                 **kwargs):
        super(TextEditBone, self).__init__(*args, **kwargs)
        self.boneName = boneName
        self.readOnly = readOnly
        self.selectedLang = False
        self.isPlainText = isPlainText
        self.languages = languages
        self.descrHint = descrHint
        self.currentEditor = None
        self.valuesdict = dict()

        ##multilangbone
        if self.languages:
            if "currentlanguage" in conf and conf[
                    "currentlanguage"] in self.languages:
                self.selectedLang = conf["currentlanguage"]
            elif len(self.languages) > 0:
                self.selectedLang = self.languages[0]

            self.langButContainer = html5.Div()
            self.langButContainer["class"].append("languagebuttons")

            for lang in self.languages:
                abut = html5.ext.Button(lang, self.changeLang)
                abut["value"] = lang
                self.langButContainer.appendChild(abut)

            self.appendChild(self.langButContainer)
            self.refreshLangButContainer()

        self.input = html5.Textarea()
        self.appendChild(self.input)
        self.previewDiv = html5.Div()
        self.previewDiv["class"].append("preview")
        self.appendChild(self.previewDiv)

        if self.isPlainText:
            self.previewDiv["style"]["display"] = "none"
        else:
            self.input["style"]["display"] = "none"

        if readOnly:
            self.input["readonly"] = True

        elif not readOnly and not self.isPlainText:
            openEditorBtn = html5.ext.Button(translate("Edit Text"),
                                             self.openTxt)
            openEditorBtn["class"].append("textedit")
            openEditorBtn["class"].append("icon")
            self.appendChild(openEditorBtn)

        self.sinkEvent("onClick")
Exemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super(LoginScreen, self).__init__(*args, **kwargs)
        self.addClass("vi-login")

        # --- Surrounding Dialog ---
        self.dialog = html5.Div()
        self.dialog.addClass("vi-login-dialog")
        self.appendChild(self.dialog)

        # --- Header ---
        header = html5.Div()
        header.addClass("vi-login-header")
        self.dialog.appendChild(header)

        # Login
        h1 = html5.H1()
        h1.addClass("vi-login-headline")
        h1.appendChild(html5.TextNode(translate("vi.login.title")))
        header.appendChild(h1)

        # Logo
        img = html5.Img()
        img.addClass("vi-login-logo")
        img["src"] = "login-logo.png"
        header.appendChild(img)

        # --- Dialog ---

        self.loginMethodSelector = html5.Ul()
        self.loginMethodSelector.addClass("vi-login-method")
        self.dialog.appendChild(self.loginMethodSelector)

        self.haveLoginHandlers = False
Exemplo n.º 3
0
    def __init__(self, loginScreen, *args, **kwargs):
        super(UserPasswordLoginHandler, self).__init__(loginScreen, *args,
                                                       **kwargs)

        # Standard Login Form
        self.pwform = html5.Form()
        self.mask.appendChild(self.pwform)

        self.username = LoginInputField(self)
        self.username["name"] = "username"
        self.username["placeholder"] = translate("Username")
        self.pwform.appendChild(self.username)

        self.password = LoginInputField(self)
        self.password["type"] = "password"
        self.password["name"] = "password"
        self.password["placeholder"] = translate("Password")
        self.pwform.appendChild(self.password)

        self.loginBtn = html5.ext.Button(translate("Login"),
                                         callback=self.onLoginClick)
        self.loginBtn.addClass("vi-login-btn")
        self.pwform.appendChild(self.loginBtn)

        # One Time Password
        self.otpform = html5.Form()
        self.otpform.hide()
        self.mask.appendChild(self.otpform)

        self.otp = LoginInputField(self)
        self.otp["name"] = "otp"
        self.otp["placeholder"] = translate("One Time Password")
        self.otpform.appendChild(self.otp)

        self.verifyBtn = html5.ext.Button(translate("Verify"),
                                          callback=self.onVerifyClick)
        self.otpform.appendChild(self.verifyBtn)

        # Universal edit widget
        self.editform = html5.Div()
        self.editform.hide()
        self.mask.appendChild(self.editform)

        self.edit = html5.Div()
        self.editform.appendChild(self.edit)

        self.editskey = self.editaction = self.editwidget = None

        self.sendBtn = html5.ext.Button(translate("Send"),
                                        callback=self.onSendClick)
        self.editform.appendChild(self.sendBtn)
Exemplo n.º 4
0
	def __init__(self, view, modul, embed=False, *args, **kwargs ):
		super( CompoundFilter, self ).__init__( *args, **kwargs)

		self["class"].append("compoundfilter")
		self.view = view
		self.module = modul
		self.embed = embed

		if embed:
			self["class"].append("embed")
			self["class"].append("expanded")
		else:
			self["class"].append("standalone")
			self["class"].append("collapsed")

		if "name" in view.keys():
			h2 = html5.H2()
			h2.appendChild( html5.TextNode( view["name"] ) )
			self.appendChild( h2 )

		self.extendedFilters = []

		for extension in (view["extendedFilters"] if "extendedFilters" in view.keys() else []):
			wdg = extendedSearchWidgetSelector.select( extension, view, modul)

			if wdg is not None:
				container = html5.Div()
				container["class"].append("extendedfilter")
				wdg = wdg( extension, view, modul )
				container.appendChild( wdg )
				self.appendChild( container )
				self.extendedFilters.append( wdg )
				wdg.filterChangedEvent.register( self )
Exemplo n.º 5
0
    def __init__(self):
        #DOM.setAttribute( self.element, "class", "vi_topbar")
        super(TopBarWidget, self).__init__()

        self["class"] = "vi_topbar"
        anav = html5.Nav()
        anav["class"].append("iconnav")
        self.iconnav = html5.Ul()

        #self.logoContainer = html5.Div()
        #self.logoContainer["class"].append("logo")
        #self.appendChild( self.logoContainer )

        self.sinkEvent("onClick")

        self.modulH1 = html5.H1()
        self.modulH1._setClass("module")
        self.appendChild(self.modulH1)

        self.modulContainer = html5.Div()
        self.modulContainer["class"].append("currentmodul")
        self.appendChild(self.modulContainer)

        self.modulImg = html5.Label()
        self.modulContainer.appendChild(self.modulImg)

        self.moduleName = html5.Span()
        self.modulContainer.appendChild(self.moduleName)

        anav.appendChild(self.iconnav)
        self.appendChild(anav)

        DeferredCall(self.setTitle, _delay=500)
Exemplo n.º 6
0
    def __init__(self, moduleName, boneName, readOnly, using, *args, **kwargs):
        super(RecordMultiBone, self).__init__(*args, **kwargs)

        self.addClass("recordbone", "recordbone-multi")

        self.moduleName = moduleName
        self.boneName = boneName
        self.readOnly = readOnly
        self.using = using

        self.changeEvent = EventDispatcher("boneChange")

        self.entries = []
        self.extendedErrorInformation = {}
        self.currentDrag = None
        self.currentOver = None

        self.itemsDiv = html5.Div()
        self.itemsDiv.addClass("recordbone-entries")
        self.appendChild(self.itemsDiv)

        self.addBtn = html5.ext.Button("Add", self.onAddBtnClick)
        self.addBtn.addClass("icon", "add")
        self.appendChild(self.addBtn)

        if self.readOnly:
            self["disabled"] = True

        self.sinkEvent("onDragOver")
Exemplo n.º 7
0
 def __init__(self, urls, entry, modul, *args, **kwargs):
     super(Preview, self).__init__(*args, **kwargs)
     self.urls = urls
     self.entry = entry
     self.module = modul
     containerDiv = html5.Div()
     containerDiv["class"].append("actionbar")
     self.appendChild(containerDiv)
     self.urlCb = html5.Select()
     containerDiv.appendChild(self.urlCb)
     self.previewFrame = html5.Iframe()
     self.appendChild(self.previewFrame)
     btnClose = html5.ext.Button("Close", callback=self.doClose)
     btnClose["class"].append("icon close")
     containerDiv.appendChild(btnClose)
     currentUrl = None
     for name, url in urls.items():
         o = html5.Option()
         o["value"] = url
         o.appendChild(html5.TextNode(name))
         self.urlCb.appendChild(o)
         if currentUrl is None:
             currentUrl = url
     self.setUrl(currentUrl)
     self.sinkEvent("onChange")
     self["class"].append("preview")
Exemplo n.º 8
0
    def __init__(self):
        super(Log, self).__init__()

        self["class"].append("vi_messenger")
        openLink = html5.ext.Button(translate("Open message center"),
                                    self.toggleMsgCenter)
        self.appendChild(openLink)

        self.logUL = html5.Ul()
        self.logUL["id"] = "statuslist"
        self.logUL["class"].append("statuslist")
        self.appendChild(self.logUL)

        versionDiv = html5.Div()
        versionDiv["class"].append("versiondiv")

        # Server name and version number
        name = conf["vi.viur"]
        if name:
            versionspan = html5.Span()
            versionspan.appendChild(
                "%s v%s" %
                (name, ".".join([str(x) for x in conf["server.version"]])))
            versionspan["class"].append("serverspan")
            versionDiv.appendChild(versionspan)

        # Vi name and version number
        name = conf["vi.name"]
        if name:
            versionspan = html5.Span()
            versionspan.appendChild(
                "%s v%s%s" %
                (name, ".".join([str(x) for x in conf["vi.version"]]),
                 ("-" + conf["vi.version.appendix"])
                 if conf["vi.version.appendix"] else ""))

            versionspan["class"].append("versionspan")
            versionDiv.appendChild(versionspan)

            #Try loading the revision and build date
            try:
                from version import builddate, revision

                revspan = html5.Span()
                revspan.appendChild(html5.TextNode("Rev %s" % revision))
                revspan["class"].append("revisionspan")

                datespan = html5.Span()
                datespan.appendChild(html5.TextNode("Built %s" % builddate))
                datespan["class"].append("datespan")

                versionDiv.appendChild(revspan)
                versionDiv.appendChild(datespan)

            except:
                pass

        if versionDiv.children():
            self.appendChild(versionDiv)
Exemplo n.º 9
0
    def render(self, data, field):
        if field in data.keys():
            can = html5.Div()
            can["style"]["width"] = "60px"
            adiv = html5.Div()
            adiv["style"]["width"] = "10px"
            adiv["style"]["height"] = "10px"
            adiv["style"]["background-Color"] = str(data[field])
            adiv["style"]["float"] = "left"
            adiv["style"]["margin-top"] = "6px"
            adiv["style"]["margin-right"] = "3px"

            lbl = html5.Label(str(data[field]))
            can.appendChild(adiv)
            can.appendChild(lbl)
            return (can)
        return (html5.Label(conf["empty_value"]))
Exemplo n.º 10
0
	def __init__(self, listWdg, *args, **kwargs):
		if not listWdg._structure:
			return

		super( SelectFieldsPopup, self ).__init__( title=translate("Select fields"), *args, **kwargs )

		self["class"].append("selectfields")
		self.listWdg = listWdg
		self.checkboxes = []

		ul = html5.Ul()
		self.appendChild( ul )

		for key, bone in self.listWdg._structure:
			li = html5.Li()
			ul.appendChild( li )

			chkBox = html5.Input()
			chkBox["type"] = "checkbox"
			chkBox["value"] = key

			li.appendChild(chkBox)
			self.checkboxes.append( chkBox )

			if key in self.listWdg.getFields():
				chkBox["checked"] = True
			lbl = html5.Label(bone["descr"],forElem=chkBox)
			li.appendChild(lbl)

		# Functions for Selection
		div = html5.Div()
		div[ "class" ].append( "selectiontools" )

		self.appendChild( div )

		self.selectAllBtn =  html5.ext.Button( translate( "Select all" ), callback=self.doSelectAll )
		self.selectAllBtn[ "class" ].append( "icon" )
		self.selectAllBtn[ "class" ].append( "selectall" )
		self.unselectAllBtn =  html5.ext.Button( translate( "Unselect all" ), callback=self.doUnselectAll )
		self.unselectAllBtn[ "class" ].append( "icon" )
		self.unselectAllBtn[ "class" ].append( "unselectall" )
		self.invertSelectionBtn =  html5.ext.Button( translate( "Invert selection" ), callback=self.doInvertSelection )
		self.invertSelectionBtn[ "class" ].append( "icon" )
		self.invertSelectionBtn[ "class" ].append( "selectinvert" )

		div.appendChild(self.selectAllBtn)
		div.appendChild(self.unselectAllBtn)
		div.appendChild(self.invertSelectionBtn)

		# Function for Commit
		self.cancelBtn = html5.ext.Button( translate( "Cancel" ), callback=self.doCancel)
		self.cancelBtn["class"].append("btn_no")

		self.applyBtn = html5.ext.Button( translate( "Apply" ), callback=self.doApply)
		self.applyBtn["class"].append("btn_yes")

		self.appendChild(self.applyBtn)
		self.appendChild(self.cancelBtn)
Exemplo n.º 11
0
    def __init__(self, *args, **kwargs):
        super(AdminScreen, self).__init__(*args, **kwargs)

        self["id"] = "CoreWindow"
        conf["mainWindow"] = self

        self.topBar = TopBarWidget()
        self.appendChild(self.topBar)

        self.workSpace = html5.Div()
        self.workSpace["class"] = "vi_workspace"
        self.appendChild(self.workSpace)

        self.moduleMgr = html5.Div()
        self.moduleMgr["class"] = "vi_wm"
        self.appendChild(self.moduleMgr)

        self.moduleList = html5.Nav()
        self.moduleList["class"] = "vi_manager"
        self.moduleMgr.appendChild(self.moduleList)

        self.moduleListUl = html5.Ul()
        self.moduleListUl["class"] = "modullist"
        self.moduleList.appendChild(self.moduleListUl)

        self.viewport = html5.Div()
        self.viewport["class"] = "vi_viewer"
        self.workSpace.appendChild(self.viewport)

        self.logWdg = Log()
        self.appendChild(self.logWdg)

        self.currentPane = None
        self.nextPane = None  # Which pane gains focus once the deferred call fires
        self.panes = [
        ]  # List of known panes. The ordering represents the order in which the user visited them.

        self.userLoggedOutMsg = None

        # Register the error-handling for this iframe
        le = eval("window.top.logError")
        w = eval("window")
        w.onerror = le
        w = eval("window.top")
        w.onerror = le
Exemplo n.º 12
0
	def cloneComplete(self, request):
		logDiv = html5.Div()
		logDiv["class"].append("msg")
		spanMsg = html5.Span()
		spanMsg.appendChild( html5.TextNode( translate( u"The hierarchy will be cloned in the background." ) ) )
		spanMsg["class"].append("msgspan")
		logDiv.appendChild(spanMsg)

		conf["mainWindow"].log("success",logDiv)
		self.closeOrContinue()
Exemplo n.º 13
0
Arquivo: file.py Projeto: Xeon2003/vi
    def render(self, data, field):
        assert field == self.boneName, "render() was called with field %s, expected %s" % (
            field, self.boneName)
        val = data.get(field, "")

        if isinstance(val, list):
            #MultiFileBone
            cell = html5.Div()

            for f in val:
                cell.appendChild(self.renderFileentry(f))

            return cell

        elif isinstance(val, dict):
            return self.renderFileentry(val)

        if val:
            return self.renderFileentry(val)

        return html5.Div()
Exemplo n.º 14
0
    def __init__(self):
        super(TaskSelectWidget,
              self).__init__(title=translate("Select a task"))
        self.sinkEvent("onChange")

        div = html5.Div()
        div["class"] = ["task-selector"]
        self.appendChild(div)

        self.select = html5.Select()
        div.appendChild(self.select)

        for type in ["server", "client"]:
            for i, task in enumerate(conf["tasks"][type]):
                if type == "client":
                    assert task[
                        "task"], "task-Attribute must be set for client-side tasks"

                if not "type" in task.keys():
                    task["type"] = type

                opt = html5.Option()
                opt.task = task

                opt.appendChild(html5.TextNode(task["name"]))

                if not self.select._children:
                    opt._setSelected(True)

                self.select.appendChild(opt)

        self.descr = html5.Div()
        self.descr["class"] = ["task-description"]
        self.appendChild(self.descr)

        self.appendChild(html5.ext.Button(translate("Cancel"), self.close))
        self.appendChild(html5.ext.Button(translate("Run"), self.invokeTask))

        # Init
        self.setActiveTask()
Exemplo n.º 15
0
    def __init__(self,
                 module,
                 rootNode=None,
                 node=None,
                 isSelector=False,
                 *args,
                 **kwargs):
        """
			@param modul: Name of the modul we shall handle. Must be a list application!
			@type modul: string
			@param rootNode: The rootNode we shall display. If None, we try to select one.
			@type rootNode: String or None
			@param node: The node we shall display at start. Must be a child of rootNode
			@type node: String or None
		"""
        super(TreeWidget, self).__init__()
        self["class"].append("tree")
        self.module = module
        self.rootNode = rootNode
        self.node = node or rootNode
        self.actionBar = ActionBar(module, "tree")
        self.appendChild(self.actionBar)
        self.pathList = html5.Div()
        self.pathList["class"].append("breadcrumb")
        self.appendChild(self.pathList)
        self.entryFrame = SelectableDiv(self.nodeWidget, self.leafWidget)
        self.appendChild(self.entryFrame)
        self.entryFrame.selectionActivatedEvent.register(self)
        self._batchSize = 99
        self._currentCursor = {"node": None, "leaf": None}
        self._currentRequests = []
        self.rootNodeChangedEvent = EventDispatcher("rootNodeChanged")
        self.nodeChangedEvent = EventDispatcher("nodeChanged")
        self.isSelector = isSelector
        if self.rootNode:
            self.reloadData()
        else:
            NetworkService.request(self.module,
                                   "listRootNodes",
                                   successHandler=self.onSetDefaultRootNode)
        self.path = []
        self.sinkEvent("onClick")
        #Proxy some events and functions of the original table
        for f in [
                "selectionChangedEvent", "selectionActivatedEvent",
                "cursorMovedEvent", "getCurrentSelection",
                "selectionReturnEvent"
        ]:
            setattr(self, f, getattr(self.entryFrame, f))
        self.actionBar.setActions(self.defaultActions +
                                  (["select", "close"] if isSelector else []))
Exemplo n.º 16
0
    def __init__(self,
                 moduleName,
                 boneName,
                 readOnly,
                 isPlainText,
                 languages=None,
                 descrHint=None,
                 *args,
                 **kwargs):
        super(TextEditBone, self).__init__(*args, **kwargs)
        self.moduleName = moduleName
        self.boneName = boneName
        self.readOnly = readOnly
        self.selectedLang = False
        self.isPlainText = isPlainText
        self.languages = languages
        self.descrHint = descrHint
        self.value = {}

        # multilangbone
        if self.languages:
            if "currentlanguage" in conf and conf[
                    "currentlanguage"] in self.languages:
                self.selectedLang = conf["currentlanguage"]
            elif len(self.languages) > 0:
                self.selectedLang = self.languages[0]

            self.langButContainer = html5.Div()
            self.langButContainer["class"].append("languagebuttons")

            for lang in self.languages:
                abut = html5.ext.Button(lang, self.changeLang)
                abut["value"] = lang
                self.langButContainer.appendChild(abut)

            self.appendChild(self.langButContainer)
            self._refreshBtnStates()

        if not readOnly and not self.isPlainText:
            self.input = HtmlEditor()
            self.input.boneName = self.boneName
        else:
            self.input = html5.Textarea()
            if readOnly:
                self.input["readonly"] = True

        self.appendChild(self.input)

        self.sinkEvent("onKeyUp")

        self.changeEvent = EventDispatcher("boneChange")
Exemplo n.º 17
0
Arquivo: list.py Projeto: Xeon2003/vi
    def showErrorMsg(self, req=None, code=None):
        """
			Removes all currently visible elements and displayes an error message
		"""
        self.actionBar["style"]["display"] = "none"
        self.table["style"]["display"] = "none"
        errorDiv = html5.Div()
        errorDiv["class"].append("error_msg")
        if code and (code == 401 or code == 403):
            txt = translate("Access denied!")
        else:
            txt = translate("An unknown error occurred!")
        errorDiv["class"].append("error_code_%s" % (code or 0))
        errorDiv.appendChild(html5.TextNode(txt))
        self.appendChild(errorDiv)
Exemplo n.º 18
0
    def addWidget(self, widget):
        """
			Adds a widget to this pane.
			Note: all widgets of a pane are visible at the same time!
			:param widget: The widget to add
			:type widget: Widget

		"""
        div = html5.Div()
        div["class"].append("vi_operator")
        div.appendChild(widget)

        for w in self.widgetsDomElm._children[:]:
            w["disabled"] = True

        self.widgetsDomElm.appendChild(div)
        self.rebuildChildrenClassInfo()
Exemplo n.º 19
0
    def __init__(self,
                 descr=None,
                 iconURL=None,
                 iconClasses=None,
                 closeable=False,
                 collapseable=True,
                 focusable=True,
                 path=None):
        super(Pane, self).__init__()

        self.parentPane = None
        self.sinkEvent("onClick")
        self.groupPrefix = None

        self.descr = descr
        self.iconURL = iconURL
        self.iconClasses = iconClasses
        self.collapseable = collapseable
        self.focusable = focusable
        self.path = path

        self.childPanes = []

        self.widgetsDomElm = html5.Div()
        self.widgetsDomElm["class"].append("has_no_child")
        self.childDomElem = None

        self.img = None
        self.label = html5.A()
        self.label["class"].append("button")
        self.appendChild(self.label)

        self.closeBtn = html5.ext.Button(translate("Close"),
                                         self.onBtnCloseReleased)
        self.closeBtn.addClass("closebtn")
        self.appendChild(self.closeBtn)

        if not closeable:
            self.closeBtn.hide()

        self.closeable = closeable
        self.isExpanded = False
        self.defaultImgSrc = self.iconURL

        DeferredCall(self.setText, _delay=250)
Exemplo n.º 20
0
    def __init__(self, view, module, embed=False, *args, **kwargs):
        super(CompoundFilter, self).__init__(*args, **kwargs)

        self["class"].append("compoundfilter")
        self.view = view
        self.module = module
        self.embed = embed

        if embed:
            self["class"].append("embed")
            self["class"].append("expanded")
        else:
            self["class"].append("standalone")
            self["class"].append("collapsed")

        if "name" in view.keys():
            h2 = html5.H2()
            h2.appendChild(html5.TextNode(view["name"]))
            self.appendChild(h2)

        self.extendedFilters = []
        self.mutualExclusiveFilters = {}

        for extension in (view["extendedFilters"]
                          if "extendedFilters" in view.keys() else []):
            wdg = extendedSearchWidgetSelector.select(extension, view, module)

            if wdg is not None:
                container = html5.Div()
                container["class"].append("extendedfilter")
                wdg = wdg(extension, view, module)
                container.appendChild(wdg)
                self.appendChild(container)
                self.extendedFilters.append(wdg)
                if hasattr(wdg, "mutualExclusiveGroupTarget"):
                    if not self.mutualExclusiveFilters.has_key(
                            "wdg.mutualExclusiveGroupTarget"):
                        self.mutualExclusiveFilters[
                            wdg.mutualExclusiveGroupTarget] = {}
                    self.mutualExclusiveFilters[
                        wdg.mutualExclusiveGroupTarget][
                            wdg.mutualExclusiveGroupKey] = wdg
                wdg.filterChangedEvent.register(self)
Exemplo n.º 21
0
	def __init__(self, loginScreen, *args, **kwargs):
		assert isinstance(loginScreen, LoginScreen)
		super(BaseLoginHandler, self).__init__(*args, **kwargs)

		self.loginScreen = loginScreen

		if not "cssname" in dir(self):
			self.cssname = self.__class__.__name__.lower()

		self.addClass("vi-login-handler")
		self.addClass("vi-login-handler-%s" % self.cssname)
		self.sinkEvent("onClick")

		self.loginScreen.loginMethodSelector.appendChild(self)

		self.appendChild(html5.TextNode(translate("vi.login.handler.%s" % self.cssname)))

		self.mask = html5.Div()
		self.mask.addClass("vi-login-mask")
		self.mask.addClass("vi-login-mask-%s" % self.cssname)
		loginScreen.dialog.appendChild(self.mask)
Exemplo n.º 22
0
    def __init__(self, title=None, id=None, className=None, *args, **kwargs):
        super(Popup, self).__init__(*args, **kwargs)

        self["class"] = "alertbox"
        if className is not None and len(className):
            self["class"].append(className)

        if title:
            lbl = html5.Span()
            lbl["class"].append("title")
            lbl.appendChild(html5.TextNode(title))
            self.appendChild(lbl)

        # id can be used to pass information to callbacks
        self.id = id

        self.frameDiv = html5.Div()
        self.frameDiv["class"] = "popup"

        self.frameDiv.appendChild(self)
        html5.Body().appendChild(self.frameDiv)
Exemplo n.º 23
0
    def __init__(self, preview, *args, **kwargs):
        super(FileImagePopup, self).__init__(title=preview.currentFile.get(
            "name", translate("Unnamed Image")),
                                             className="image-viewer",
                                             *args,
                                             **kwargs)
        self.sinkEvent("onClick")
        self.preview = preview

        img = html5.Img()
        img["src"] = utils.getImagePreview(preview.currentFile, size=None)
        self.appendChild(img)

        div = html5.Div()
        self.appendChild(div)

        btn = html5.ext.Button(translate("Download"), self.onDownloadBtnClick)
        btn.addClass("icon", "download")
        div.appendChild(btn)

        btn = html5.ext.Button(translate("Close"), self.onClick)
        btn.addClass("btn_no")
        div.appendChild(btn)
Exemplo n.º 24
0
Arquivo: file.py Projeto: Xeon2003/vi
    def renderFileentry(self, fileEntry):
        if not "dest" in fileEntry.keys():
            return None

        fileEntry = fileEntry["dest"]

        if not "name" in fileEntry.keys() and not "dlkey" in fileEntry.keys():
            return None

        adiv = html5.Div()
        if "mimetype" in fileEntry.keys():
            try:
                ftype, fformat = fileEntry["mimetype"].split("/")
                adiv["class"].append("type_%s" % ftype)
                adiv["class"].append("format_%s" % fformat)
            except:
                pass

        adiv.appendChild(FilePreviewImage(fileEntry))

        aspan = html5.Span()
        aspan.appendChild(html5.TextNode(str(fileEntry.get(
            "name", ""))))  #fixme: formatstring!
        adiv.appendChild(aspan)

        adiv["class"].append("fileBoneViewCell")
        #adiv["draggable"]=True
        #metamime="application/octet-stream"

        #if "mimetype" in fileEntry.keys():
        #   metamime=str(fileEntry["mimetype"])

        #adiv["download"]="%s:%s:/file/download/%s?download=1&fileName=%s" % (metamime, str(fileEntry["name"]),
        #                                                            str(fileEntry["dlkey"]), str(fileEntry["name"]))
        #adiv["href"]="/file/download/%s?download=1&fileName=%s" % (str(fileEntry["dlkey"]), str(fileEntry["name"]))
        return adiv
Exemplo n.º 25
0
    def __init__(self, widget, *args, **kwargs):
        super(ExportCsvStarter, self).__init__(title=translate("CSV Export"))

        self.widget = widget

        if "viur.defaultlangsvalues" in conf["server"].keys():
            self.langSelect = html5.Select()
            self.langSelect["id"] = "lang-select"

            lbl = html5.Label(translate("Language selection"))
            lbl["for"] = "lang-select"

            div = html5.Div()
            div.appendChild(lbl)
            div.appendChild(self.langSelect)
            div.addClass("bone")

            self.appendChild(div)

            for key, value in conf["server"]["viur.defaultlangsvalues"].items(
            ):
                opt = html5.Option()
                opt["value"] = key
                opt.appendChild(html5.TextNode(value))

                if key == conf["currentlanguage"]:
                    opt["selected"] = True

                self.langSelect.appendChild(opt)
        else:
            self.langSelect = None

        # Encoding
        self.encodingSelect = html5.Select()
        self.encodingSelect["id"] = "encoding-select"

        lbl = html5.Label(translate("Encoding"))
        lbl["for"] = "encoding-select"

        div = html5.Div()
        div.appendChild(lbl)
        div.appendChild(self.encodingSelect)
        div.addClass("bone")

        self.appendChild(div)

        for i, (k, v) in enumerate([("iso-8859-15", "ISO-8859-15"),
                                    ("utf-8", "UTF-8")]):
            opt = html5.Option()
            opt["value"] = k

            if i == 0:
                opt["selected"] = True

            opt.appendChild(html5.TextNode(v))
            self.encodingSelect.appendChild(opt)

        div = html5.Div()
        div.addClass("button-container")
        self.appendChild(div)

        self.cancelBtn = html5.ext.Button(translate("Cancel"), self.close)
        div.appendChild(self.cancelBtn)

        self.exportBtn = html5.ext.Button(translate("Export"),
                                          self.onExportBtnClick)
        div.appendChild(self.exportBtn)
Exemplo n.º 26
0
Arquivo: list.py Projeto: Xeon2003/vi
    def __init__(self,
                 module,
                 filter=None,
                 columns=None,
                 isSelector=False,
                 filterID=None,
                 filterDescr=None,
                 batchSize=None,
                 context=None,
                 autoload=True,
                 *args,
                 **kwargs):
        """
			@param module: Name of the modul we shall handle. Must be a list application!
			@type module: string
		"""
        if not module in conf["modules"].keys():
            conf["mainWindow"].log(
                "error",
                translate("The module '{module}' does not exist.",
                          module=module))
            assert module in conf["modules"].keys()

        super(ListWidget, self).__init__()
        self._batchSize = batchSize or conf[
            "batchSize"]  # How many rows do we fetch at once?
        self.isDetaching = False  #If set, this widget is beeing about to be removed - dont issue nextBatchNeeded requests
        self.module = module
        self.context = context

        self.actionBar = ActionBar(module, "list", currentAction="list")
        self.appendChild(self.actionBar)

        self.sideBar = SideBar()
        self.appendChild(self.sideBar)

        myView = None

        if filterID:
            if conf["modules"] and module in conf["modules"].keys():
                if "views" in conf["modules"][module].keys(
                ) and conf["modules"][module]["views"]:
                    for v in conf["modules"][module]["views"]:
                        if v["__id"] == filterID:
                            myView = v
                            break
            if myView and "extendedFilters" in myView.keys(
            ) and myView["extendedFilters"]:
                self.appendChild(CompoundFilter(myView, module, embed=True))

        checkboxes = (conf["modules"] and module in conf["modules"].keys() and
                      "checkboxSelection" in conf["modules"][module].keys()
                      and conf["modules"][module]["checkboxSelection"])
        indexes = (conf["modules"] and module in conf["modules"].keys()
                   and "indexes" in conf["modules"][module].keys()
                   and conf["modules"][module]["indexes"])

        self.table = DataTable(checkboxes=checkboxes,
                               indexes=indexes,
                               *args,
                               **kwargs)
        self.appendChild(self.table)
        self._currentCursor = None
        self._structure = None
        self._currentRequests = []
        self.columns = []

        if isSelector and filter is None and columns is None:
            #Try to select a reasonable set of cols / filter
            if conf["modules"] and module in conf["modules"].keys():
                tmpData = conf["modules"][module]
                if "columns" in tmpData.keys():
                    columns = tmpData["columns"]
                if "filter" in tmpData.keys():
                    filter = tmpData["filter"]

        self.table.setDataProvider(self)
        self.filter = filter.copy() if isinstance(filter, dict) else {}
        self.columns = columns[:] if isinstance(columns, list) else []
        self.filterID = filterID  #Hint for the sidebarwidgets which predefined filter is currently active
        self.filterDescr = filterDescr  #Human-readable description of the current filter
        self._tableHeaderIsValid = False
        self.isSelector = isSelector

        #Proxy some events and functions of the original table
        for f in [
                "selectionChangedEvent", "selectionActivatedEvent",
                "cursorMovedEvent", "tableChangedEvent", "getCurrentSelection"
        ]:
            setattr(self, f, getattr(self.table, f))

        self.actionBar.setActions(self.getDefaultActions(myView))

        if isSelector:
            self.selectionActivatedEvent.register(self)

        self.emptyNotificationDiv = html5.Div()
        self.emptyNotificationDiv.appendChild(
            html5.TextNode(translate("Currently no entries")))
        self.emptyNotificationDiv["class"].append("emptynotification")
        self.appendChild(self.emptyNotificationDiv)
        self.emptyNotificationDiv["style"]["display"] = "none"
        self.table["style"]["display"] = "none"
        self.filterDescriptionSpan = html5.Span()
        self.appendChild(self.filterDescriptionSpan)
        self.filterDescriptionSpan["class"].append("filterdescription")
        self.updateFilterDescription()

        if autoload:
            self.reloadData()
Exemplo n.º 27
0
    def __init__(self,
                 moduleName,
                 boneName,
                 readOnly,
                 multiple=False,
                 languages=None,
                 multiLine=False,
                 *args,
                 **kwargs):
        super(StringEditBone, self).__init__(*args, **kwargs)
        self.moduleName = moduleName
        self.boneName = boneName
        self.readOnly = readOnly
        self.multiple = multiple
        self.languages = languages
        self.boneName = boneName
        self.currentTagToDrag = None
        self.currentLanguage = None

        if self.languages and self.multiple:
            self["class"].append("is_translated")
            self["class"].append("is_multiple")
            self.languagesContainer = html5.Div()
            self.appendChild(self.languagesContainer)
            self.buttonContainer = html5.Div()
            self.buttonContainer["class"] = "languagebuttons"
            self.appendChild(self.buttonContainer)
            self.langEdits = {}
            self.langBtns = {}

            for lang in self.languages:
                tagContainer = html5.Div()
                tagContainer["class"].append("lang_%s" % lang)
                tagContainer["class"].append("tagcontainer")
                tagContainer["style"]["display"] = "none"

                langBtn = html5.ext.Button(lang,
                                           callback=self.onLangBtnClicked)
                langBtn.lang = lang
                self.buttonContainer.appendChild(langBtn)

                if not self.readOnly:
                    addBtn = html5.ext.Button(translate("New"),
                                              callback=self.onBtnGenTag)
                    addBtn["class"].append("icon new tag")
                    addBtn.lang = lang
                    tagContainer.appendChild(addBtn)

                self.languagesContainer.appendChild(tagContainer)
                self.langEdits[lang] = tagContainer
                self.langBtns[lang] = langBtn

            self.setLang(self.languages[0])

        elif self.languages and not self.multiple:
            self["class"].append("is_translated")
            self.languagesContainer = html5.Div()
            self.appendChild(self.languagesContainer)
            self.buttonContainer = html5.Div()
            self.buttonContainer["class"] = "languagebuttons"
            self.appendChild(self.buttonContainer)
            self.langEdits = {}
            self.langBtns = {}

            for lang in self.languages:
                langBtn = html5.ext.Button(lang,
                                           callback=self.onLangBtnClicked)
                langBtn.lang = lang
                self.buttonContainer.appendChild(langBtn)

                if multiLine:
                    inputField = html5.Textarea()
                else:
                    inputField = html5.Input()
                    inputField["type"] = "text"

                inputField["style"]["display"] = "none"
                inputField["class"].append("lang_%s" % lang)

                if self.readOnly:
                    inputField["readonly"] = True

                self.languagesContainer.appendChild(inputField)
                self.langEdits[lang] = inputField
                self.langBtns[lang] = langBtn

            self.setLang(self.languages[0])

        elif not self.languages and self.multiple:
            self["class"].append("is_multiple")
            self.tagContainer = html5.Div()
            self.tagContainer["class"].append("tagcontainer")
            self.appendChild(self.tagContainer)

            if not self.readOnly:
                addBtn = html5.ext.Button(translate("New"),
                                          callback=self.onBtnGenTag)
                addBtn.lang = None
                addBtn["class"].append("icon new tag")

                self.tagContainer.appendChild(addBtn)

        else:  # not languages and not multiple:

            if multiLine:
                self.input = html5.Textarea()
            else:
                self.input = html5.Input()
                self.input["type"] = "text"

            self.appendChild(self.input)

            if self.readOnly:
                self.input["readonly"] = True
Exemplo n.º 28
0
	def setData( self, request=None, data=None, ignoreMissing=False ):
		"""
		Rebuilds the UI according to the skeleton received from server

		@param request: A finished NetworkService request
		@type request: NetworkService
		@type data: dict
		@param data: The data received
		"""
		assert (request or data)
		if request:
			data = NetworkService.decode( request )

		try:
			skelStructure = {k: v for k, v in data["structure"]}

		except AttributeError:
			NetworkService.notifyChange(self.module)
			conf["mainWindow"].removeWidget( self )
			return

		print
		print("data", data)
		print("action", data["action"])
		if "action" in data and (data["action"] in ["addSuccess", "editSuccess"]):
			NetworkService.notifyChange(self.module)
			logDiv = html5.Div()
			logDiv["class"].append("msg")
			spanMsg = html5.Span()
			spanMsg.appendChild( html5.TextNode( translate("Entry saved!") ))
			spanMsg["class"].append("msgspan")
			logDiv.appendChild(spanMsg)
			if self.module in conf["modules"].keys():
				spanMsg = html5.Span()
				spanMsg.appendChild( html5.TextNode( conf["modules"][self.module]["name"] ))
				spanMsg["class"].append("modulspan")
				logDiv.appendChild(spanMsg)
			if "values" in data.keys() and "name" in data["values"].keys():
				spanMsg = html5.Span()
				spanMsg.appendChild( html5.TextNode( str(data["values"]["name"]) ))
				spanMsg["class"].append("namespan")
				logDiv.appendChild(spanMsg)
			conf["mainWindow"].log("success",logDiv)
			if self.closeOnSuccess:
				conf["mainWindow"].removeWidget( self )
				return
			self.clear()
			# self.bones = {}
			self.reloadData()
			return

		self.clear()
		self.actionbar.resetLoadingState()
		self.dataCache = data

		fieldSets = {}
		cat = "byweek"
		fs = html5.Fieldset()
		fs["class"] = cat
		if cat=="byweek":
			fs["class"].append("active")

		fs["name"] = cat
		legend = html5.Legend()
		fshref = fieldset_A()
		fshref.appendChild(html5.TextNode(cat) )
		legend.appendChild( fshref )
		fs.appendChild(legend)
		section = html5.Section()
		fs.appendChild(section)
		fs._section = section
		fieldSets[ cat ] = fs

		self.dtstart = data["values"]["startdate"]
		startdateLabel = html5.Label("Termin")
		startdateLabel["class"].append("termin")
		startdateLabel["class"].append("date")
		startdate_id = "vi_%s_%s_edit_bn_%s" % ( self.editIdx, self.module, "repeatdate")
		startdateLabel["for"] = startdate_id
		startdate = date.DateViewBoneDelegate("termin", "startdate", skelStructure).render(data["values"], "startdate")
		startdate["id"] = startdate_id
		containerDiv = html5.Div()
		containerDiv.appendChild(startdateLabel)
		containerDiv.appendChild(startdate)
		containerDiv["class"].append("bone")
		containerDiv["class"].append("bone_startdate")
		containerDiv["class"].append("date")
		fieldSets[ cat ]._section.appendChild( containerDiv )

		countLabel = html5.Label("Wiederholungen")
		countLabel["class"].append("count")
		countLabel["class"].append("numeric")
		count_id = "vi_%s_%s_edit_bn_%s" % ( self.editIdx, self.module, "count")
		countLabel["for"] = count_id

		self.count = html5.Input()
		self.count["id"] = count_id
		containerDiv2 = html5.Div()
		containerDiv2["class"].append("bone")
		containerDiv2["class"].append("bone_count")
		containerDiv2["class"].append("date")
		containerDiv2.appendChild(countLabel)
		containerDiv2.appendChild(self.count)

		# containerDiv3 = html5.Div()
		# self.byweekday = list()
		# for key, value in [["MO", "Mo"], ["TU", "Di"], ["TH", "Mi"], ["WE", "Do"], ["FR", "Fr"], ["SA", "Sa"], ["SU", "So"]]:
		# 	alabel=html5.Label()
		# 	acheckbox=html5.Input()
		# 	acheckbox["type"]="checkbox"
		# 	acheckbox["name"]=key
		# 	alabel.appendChild(acheckbox)
		# 	aspan=html5.Span()
		# 	aspan.element.innerHTML=value
		# 	alabel.appendChild(aspan)
		# 	containerDiv3.appendChild(alabel)
		# 	containerDiv2["class"].append("bone")
		# 	containerDiv2["class"].append("bone_count")
		# 	containerDiv2["class"].append("byweekday")
		# 	self.byweekday.append(acheckbox)

		fieldSets[ cat ]._section.appendChild(containerDiv2)
		# fieldSets[ cat ]._section.appendChild(containerDiv3)
		for (k,v) in fieldSets.items():
			if not "active" in v["class"]:
				v["class"].append("active")
		tmpList = [(k,v) for (k,v) in fieldSets.items()]
		tmpList.sort( key=lambda x:x[0])
		for k,v in tmpList:
			self.form.appendChild( v )
			v._section = None
Exemplo n.º 29
0
	def renderStructure(self, readOnly = False):
		self.bones = {}
		self.containers = {}

		tmpDict = {k: v for k, v in self.skelStructure}
		fieldSets = {}
		currRow = 0

		defaultCat = self.defaultCat
		firstCat = True

		for key, bone in self.skelStructure:

			#Enforcing readOnly mode
			if readOnly:
				tmpDict[key]["readonly"] = True

			cat = defaultCat

			if ("params" in bone.keys()
			    and isinstance(bone["params"],dict)
			    and "category" in bone["params"].keys()):
				cat = bone["params"]["category"]

			if cat is not None and not cat in fieldSets.keys():
				fs = html5.Fieldset()
				fs["class"] = cat

				if firstCat:
					fs["class"].append("active")
					firstCat = False

					if self.form is self:
						self.form = html5.Form()
						self.appendChild(self.form)

				fieldSets[cat] = EditWidgetFieldset(cat)

			wdgGen = editBoneSelector.select(self.module, key, tmpDict)
			widget = wdgGen.fromSkelStructure(self.module, key, tmpDict)
			widget["id"] = "vi_%s_%s_%s_%s_bn_%s" % (self.editIdx, None, "internal", cat or "empty", key)

			descrLbl = html5.Label(bone["descr"])
			descrLbl["class"].append(key)
			descrLbl["class"].append(bone["type"].replace(".","_"))
			descrLbl["for"] = "vi_%s_%s_%s_%s_bn_%s" % ( self.editIdx, None, "internal", cat or "empty", key)

			if bone["required"]:
				descrLbl["class"].append("is_required")

			if (bone["required"]
			    and (bone["error"] is not None
			            or (self.errorInformation and key in self.errorInformation.keys()))):
				descrLbl["class"].append("is_invalid")
				if bone["error"]:
					descrLbl["title"] = bone["error"]
				else:
					descrLbl["title"] = self.errorInformation[ key ]

				if fieldSets and cat in fieldSets:
					fieldSets[cat]["class"].append("is_incomplete")

			if bone["required"] and not (bone["error"] is not None or (self.errorInformation and key in self.errorInformation.keys())):
				descrLbl["class"].append("is_valid")

			if "params" in bone.keys() and isinstance(bone["params"], dict) and "tooltip" in bone["params"].keys():
				tmp = html5.Span()
				tmp.appendChild(descrLbl)
				tmp.appendChild( ToolTip(longText=bone["params"]["tooltip"]) )
				descrLbl = tmp

			self.containers[key] = html5.Div()
			self.containers[key].appendChild(descrLbl)
			self.containers[key].appendChild(widget)
			self.containers[key].addClass("bone", "bone_%s" % key, bone["type"].replace(".","_"))

			if "." in bone["type"]:
				for t in bone["type"].split("."):
					self.containers[key].addClass(t)

			if cat is not None:
				fieldSets[cat]._section.appendChild(self.containers[key])
			else:
				self.form.appendChild(self.containers[key])

			currRow += 1
			self.bones[key] = widget

			#Hide invisible bones
			if not bone["visible"]:
				self.containers[key].hide()

		if len(fieldSets)==1:
			for (k,v) in fieldSets.items():
				if not "active" in v["class"]:
					v["class"].append("active")

		tmpList = [(k,v) for (k,v) in fieldSets.items()]
		tmpList.sort( key=lambda x:x[0])

		for k,v in tmpList:
			self.form.appendChild( v )
			v._section = None
Exemplo n.º 30
0
	def setData(self, request=None, data=None, ignoreMissing=False, askHierarchyCloning=True):
		"""
		Rebuilds the UI according to the skeleton received from server

		:param request: A finished NetworkService request
		:type request: NetworkService
		:type data: dict
		:param data: The data received
		"""
		assert (request or data)

		if request:
			data = NetworkService.decode(request)

		if "action" in data and (data["action"] == "addSuccess" or data["action"] == "editSuccess"):
			self.modified = False

			logDiv = html5.Div()
			logDiv["class"].append("msg")
			spanMsg = html5.Span()

			spanMsg.appendChild( html5.TextNode( translate( self.logaction ) ) )
			spanMsg["class"].append("msgspan")
			logDiv.appendChild(spanMsg)

			if self.module in conf["modules"].keys():
				spanMsg = html5.Span()
				if self.module.startswith( "_" ):
					spanMsg.appendChild( html5.TextNode( self.key ) )
				else:
					spanMsg.appendChild( html5.TextNode( conf["modules"][self.module]["name"] ))
				spanMsg["class"].append("modulespan")
				logDiv.appendChild(spanMsg)

			if "values" in data.keys() and "name" in data["values"].keys():
				spanMsg = html5.Span()

				name = data["values"].get("name") or data["values"].get("key", "")
				if isinstance(name, dict):
					if conf["currentlanguage"] in name.keys():
						name = name[conf["currentlanguage"]]
					else:
						name = name.values()

				if isinstance(name, list):
					name = ", ".join(name)

				spanMsg.appendChild(html5.TextNode(str(html5.utils.unescape(name))))
				spanMsg["class"].append("namespan")
				logDiv.appendChild(spanMsg)

			try:
				self.key = data["values"]["key"]
			except:
				self.key = None

			conf["mainWindow"].log("success",logDiv)

			if askHierarchyCloning and self.clone:
				# for lists, which are rootNode entries of hierarchies, ask to clone entire hierarchy
				if self.applicationType == EditWidget.appList and "rootNodeOf" in conf[ "modules" ][ self.module ]:
					YesNoDialog( translate( u"Do you want to clone the entire hierarchy?" ),
				                    yesCallback=self.doCloneHierarchy, noCallback=self.closeOrContinue )
					return
				# for cloning within a hierarchy, ask for cloning all subentries.
				elif self.applicationType == EditWidget.appHierarchy:
					YesNoDialog( translate( u"Do you want to clone all subentries of this item?" ),
				                    yesCallback=self.doCloneHierarchy, noCallback=self.closeOrContinue )
					return

			self.closeOrContinue()
			return

		#Clear the UI
		self.clear()
		self.bones = {}
		self.views = {}
		self.containers = {}
		self.actionbar.resetLoadingState()
		self.dataCache = data
		self.modified = False

		tmpDict = {k: v for k, v in data["structure"]}
		fieldSets = {}
		firstCat = None
		currRow = 0
		hasMissing = False
		defaultCat = conf["modules"][self.module].get("visibleName", self.module)

		contextVariable = conf["modules"][self.module].get("editContext")
		if self.mode == "edit" and contextVariable:
			if not self.context:
				self.context = {}

			if "=" in contextVariable:
				contextVariable, contextKey = contextVariable.split("=", 1)
			else:
				contextKey = "key"

			self.context.update({
				contextVariable: data["values"].get(contextKey)
			})

		for key, bone in data["structure"]:

			cat = defaultCat #meow!

			if ("params" in bone.keys()
			    and isinstance(bone["params"], dict)
			    and "category" in bone["params"].keys()):
				cat = bone["params"]["category"]

			if not cat in fieldSets.keys():
				fieldSets[cat] = EditWidgetFieldset(cat)

			wdgGen = editBoneSelector.select(self.module, key, tmpDict)
			widget = wdgGen.fromSkelStructure(self.module, key, tmpDict)
			widget["id"] = "vi_%s_%s_%s_%s_bn_%s" % (self.editIdx, self.module, self.mode, cat, key)

			if "setContext" in dir(widget) and callable(widget.setContext):
				widget.setContext(self.context)

			if "changeEvent" in dir(widget):
				widget.changeEvent.register(self)

			descrLbl = html5.Label(key if conf["showBoneNames"] else bone.get("descr", key))
			descrLbl["class"].append(key)
			descrLbl["class"].append(bone["type"].replace(".","_"))

			# Elements
			if ("params" in bone.keys()
			    and isinstance(bone["params"], dict)
			    and "elements.source" in bone["params"].keys()):
				descrLbl.addClass("elements-%s" % bone["params"]["elements.source"])

			descrLbl["for"] = "vi_%s_%s_%s_%s_bn_%s" % (self.editIdx, self.module, self.mode, cat, key)

			if bone["required"] or (bone.get("unique") and bone["error"]):
				descrLbl["class"].append("is_required")

				if bone["error"] is not None:
					descrLbl["class"].append("is_invalid")
					descrLbl["title"] = bone["error"]
					fieldSets[ cat ]["class"].append("is_incomplete")

					# Put info into message center
					conf["mainWindow"].log("info", "%s: %s" % (bone.get("descr", key), translate(bone["error"])))

					hasMissing = True

				elif bone["error"] is None and not self.wasInitialRequest:
					descrLbl["class"].append("is_valid")

			if isinstance(bone["error"], dict):
				widget.setExtendedErrorInformation(bone["error"])

			containerDiv = html5.Div()
			containerDiv.appendChild(descrLbl)
			containerDiv.appendChild(widget)

			if ("params" in bone.keys()
			    and isinstance(bone["params"], dict)
			    and "tooltip" in bone["params"].keys()):
				containerDiv.appendChild(ToolTip(longText=bone["params"]["tooltip"]))

			fieldSets[cat]._section.appendChild(containerDiv)
			containerDiv.addClass("bone", "bone_%s" % key, bone["type"].replace(".","_"))

			if "." in bone["type"]:
				for t in bone["type"].split("."):
					containerDiv["class"].append(t)

			currRow += 1
			self.bones[key] = widget
			self.containers[key] = containerDiv

			#Hide invisible bones or logic-flavored bones with their default desire
			if not bone["visible"] or (bone["params"] and bone["params"].get("logic.visibleIf")):
				self.containers[key].hide()
			elif bone["visible"] and not firstCat:
				firstCat = fieldSets[cat]

			# NO elif!
			if bone["params"] and bone["params"].get("logic.readonlyIf"):
				self.containers[key].disable()

		# Hide all fieldSets where all fields are invisible
		for fs in fieldSets.values():
			fs.checkVisibility()

		# Show default category
		if firstCat:
			firstCat.removeClass("inactive")
			firstCat.addClass("active")

		tmpList = [(k,v) for (k,v) in fieldSets.items()]
		tmpList.sort(key=lambda x:x[0])

		for k, v in tmpList:
			self.form.appendChild( v )
			v._section = None

		# Views
		views = conf["modules"][self.module].get("editViews")
		if self.mode == "edit" and isinstance(views, list):
			for view in views:
				vmodule = view.get("module")
				vvariable = view.get("context")
				vclass = view.get("class")
				vtitle = view.get("title")
				vcolumns = view.get("columns")
				vfilter = view.get("filter")
				vactions = view.get("actions")

				if not vmodule:
					print("Misconfiured view: %s" % view)
					continue

				if vmodule not in conf["modules"]:
					print("Module '%s' is not described." % vmodule)
					continue

				vdescr = conf["modules"][vmodule]

				fs = EditWidgetFieldset(vmodule, vtitle or vdescr.get("name", vmodule))
				fs.addClass("editview", "inactive")

				if vclass:
					fs.addClass(*vclass)

				fieldSets[vmodule] = EditWidgetFieldset(vmodule, vtitle or vdescr.get("name", vmodule))

				if vvariable:
					context = self.context.copy() if self.context else {}

					if "=" in vvariable:
						vkey, vvalue = vvariable.split("=", 1)
						if vvalue[0] == "$":
							vvalue = data["values"].get(vvalue[1:])
					else:
						vkey = vvariable
						vvalue = data["values"].get("key")

					context[vkey] = vvalue

				else:
					context = self.context

				self.views[vmodule] = ListWidget(
					vmodule,
					filter=vfilter or vdescr.get("filter", {}),
					columns=vcolumns or vdescr.get("columns"),
					context=context,
					actions=vactions
				)

				fs._section.appendChild(self.views[vmodule])
				self.form.appendChild(fs)

		self.unserialize(data["values"])

		if self._hashArgs: #Apply the default values (if any)
			self.unserialize(self._hashArgs)
			self._hashArgs = None

		self._lastData = data

		if hasMissing and not self.wasInitialRequest:
			conf["mainWindow"].log("warning",translate("Could not save entry!"))

		DeferredCall(self.performLogics)