Пример #1
0
 def grid(self, table):
     name = 'vue%s' % str(uuid.uuid4())[:8]
     return DIV(self.mtable(table),
                TAG.SCRIPT(_src=URL('static/js/axios.min.js')),
                TAG.SCRIPT(_src=URL('static/js/vue.min.js')),
                TAG.SCRIPT(_src=URL('static/js/utils.js')),
                TAG.SCRIPT(_src=URL('static/components/mtable.js')),
                TAG.SCRIPT(
                    XML('var app=utils.app("%s"); app.start()' % name)),
                _id=name)
Пример #2
0
 def grid(self, table):
     name = "vue%s" % str(uuid.uuid4())[:8]
     return DIV(
         self.mtable(table),
         TAG.SCRIPT(_src=URL("static/js/axios.min.js")),
         TAG.SCRIPT(_src=URL("static/js/vue.min.js")),
         TAG.SCRIPT(_src=URL("static/js/utils.js")),
         TAG.SCRIPT(_src=URL("static/components/mtable.js")),
         TAG.SCRIPT(XML('var app={}; app.vue = new Vue({el:"#%s"});' %
                        name)),
         _id=name,
     )
Пример #3
0
 def button_maker(**data):
     onclick = (
         'Q.ajax("POST", "%s", "%s").then(function(res){if(res.data)Q.eval(res.data);});this.classList.add("clicked")'
         % get_link(**data))
     new_attributes = copy.copy(attributes)
     new_attributes["_onclick"] = onclick
     return TAG.BUTTON(*components, **new_attributes)
Пример #4
0
 def button_maker(**data):
     onclick = (
         'axios.post("%s", "%s");this.classList.add("clicked")' %
         get_link(**data))
     new_attributes = copy.copy(attributes)
     new_attributes["_onclick"] = onclick
     return TAG.BUTTON(*components, **new_attributes)
Пример #5
0
 def make_button(**data):        
     url = URL(path)
     onclick= 'axios.post("%s", %s);this.classList.add("clicked")' % (url, dumps(data))
     return TAG.BUTTON(self.text, _class=self._class, _onclick=onclick)