示例#1
0
    def get(self,arg):



        try:
            act = self.get_argument("action")
        except:
            act = "query"
            pass


        if act == "create":
            rootGrid = xaceGridNode(templatePath="") #do not show any content in root
            rootGrid = yield  rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        try:
            oid =  ObjectId(arg)
        except:
            act = "list"

        if act!="list" :
            rootGrid = yield xaceGridNode.objects.get(id=oid)


        if act == "add":
            isGroupNode=self.get_argument("isGroupNode")
            if isGroupNode.lower()=="true":
                isGroupNode = True
            else:
                isGroupNode = False
            rootGrid.addNode2Id(tag=self.get_argument("tag"),width= self.get_argument("width"),isGroupNode=isGroupNode)
            rootGrid = yield  rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        if act == "del":
            rootGrid.delNode(tag=self.get_argument("tag"))
            rootGrid = yield  rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        if rootGrid!=None:
            self.render("pageDesigner.html",content=rootGrid.mergeTemplates())
        else:
            self.write("No such Item")
            self.finish()
示例#2
0
    def get(self, arg):

        try:
            act = self.get_argument("action")
        except:
            act = "query"
            pass

        if act == "create":
            rootGrid = xaceGridNode(
                templatePath="")  #do not show any content in root
            rootGrid = yield rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        try:
            oid = ObjectId(arg)
        except:
            act = "list"

        if act != "list":
            rootGrid = yield xaceGridNode.objects.get(id=oid)

        if act == "add":
            isGroupNode = self.get_argument("isGroupNode")
            if isGroupNode.lower() == "true":
                isGroupNode = True
            else:
                isGroupNode = False
            rootGrid.addNode2Id(tag=self.get_argument("tag"),
                                width=self.get_argument("width"),
                                isGroupNode=isGroupNode)
            rootGrid = yield rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        if act == "del":
            rootGrid.delNode(tag=self.get_argument("tag"))
            rootGrid = yield rootGrid.save()
            self.redirect(str(rootGrid._id))
            return

        if rootGrid != None:
            self.render("pageDesigner.html", content=rootGrid.mergeTemplates())
        else:
            self.write("No such Item")
            self.finish()
示例#3
0
</div>
<div class="am-g">
  <div class="am-u-sm-1">1</div>
  <div class="am-u-sm-3 am-u-sm-offset-8">3, offset 8</div>
</div>
<div class="am-g">
  <div class="am-u-sm-1">1</div>
  <div class="am-u-sm-2 am-u-sm-offset-9">2, offset 9</div>
</div>
<div class="am-g">
  <div class="am-u-sm-1">1</div>
  <div class="am-u-sm-1 am-u-sm-offset-10">1, offset 10</div>
</div>
'''

root = xaceGridNode()
node1 = xaceGridNode(groupInGrid=False,styleDiv=4)
root.addNode(node1)
node1 = xaceGridNode(groupInGrid=False,styleDiv=4)
root.addNode(node1)
node1 = xaceGridNode(groupInGrid=False,styleDiv=4)
node1.templatePath=tmpstr
root.addNode(node1)
node2 = xaceGridNode()
root.addNode(node2)
node1 = xaceGridNode(groupInGrid=False,styleDiv=4)
root.addNode(node1)
node2 = xaceGridNode()
root.addNode(node2)
print root.to_son()
print root.mergeTemplates()