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)
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, )
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)
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)
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)