def render_Login(self, h, comp, *args): favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link( rel="shortcut icon", type="image/x-icon", href=favicon_url) h.head << h.head.title(self.app_title) with h.body(class_='body-login slots%s' % len(self.logins)): h << self.header with h.div(class_='title'): title = _(u'Sign in') for login in self.logins: if login().alt_title: title = login().alt_title break h << h.h2(title) for login in self.logins: if login().error_message: h << h.small(login().error_message, class_='error') login().error_message = u'' with h.div(class_='container'): for index, login in enumerate(self.logins, 1): h << login.on_answer(comp.answer) with h.div(class_='message'): h << h.parse_htmlstring( self.disclaimer) if self.disclaimer else u'' with h.div(class_='credits'): h << h.a(self.app_title, href='http://www.kansha.org', target='_blank') << (u' v%s - \u00a9 ' % VERSION) h << h.a('Net-ng', href='http://www.net-ng.com', target='_blank') << (' %d' % datetime.date.today().year) return h.root
def render_Login(self, h, comp, *args): favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=favicon_url) h.head << h.head.title(self.app_title) with h.body(class_='body-login slots%s' % len(self.logins)): h << self.header with h.div(class_='title'): title = _(u'Sign in') for login in self.logins: if login().alt_title: title = login().alt_title break h << h.h2(title) for login in self.logins: if login().error_message: h << h.small(login().error_message, class_='error') login().error_message = u'' with h.div(class_='container'): for index, login in enumerate(self.logins, 1): h << login.on_answer(comp.answer) with h.div(class_='message'): h << h.parse_htmlstring(self.disclaimer) if self.disclaimer else u'' with h.div(class_='credits'): h << h.span(u'%s v%s - \u00a9 Net-ng %d' % (self.app_title, VERSION, datetime.date.today().year)) return h.root
def render_kansha(self, h, comp, *args): """Main renderer""" favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=favicon_url) h << comp.render(h, model='yui-deps') h.head << h.head.meta( name='viewport', content='width=device-width, initial-scale=1.0') h.head.css_url('css/knacss.css') h.head.css_url('css/themes/fonts.css') h.head.css_url('css/themes/kansha.css') h.head.css_url('css/themes/%s/kansha.css' % self.theme) h.head.javascript_url('js/jquery-2.1.3.min.js') h.head.javascript_url('js/jquery-ui-1.11.2.custom/jquery-ui.js') h.head.javascript_url("js/jquery-linkify/jquery.linkify.min.js") h.head.javascript_url('js/dnd.js') h.head.javascript_url('js/kansha.js') h.head.javascript_url('js/autocomplete.js') h.head.javascript_url('js/ckeditor-4.5.3/ckeditor.js') if self.selected == 'board': with h.body(class_='yui-skin-sam'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') h << self.content.on_answer(self.handle_event) else: h.head << h.head.title(self.app_title) with h.body(class_='yui-skin-sam'): with h.div(class_='wrap'): with h.div(class_='container'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') with h.div(class_='home'), h.div(class_='grid-2'): h << comp.render(h, 'home_menu') with h.div(class_='boards'): h << self.content.on_answer(self.select_board).render(h.AsyncRenderer()) with h.div(class_='credits'): with h.div(class_='container'): h << h.a(self.app_title, href='http://www.kansha.org', target='_blank') << (u' v%s - \u00a9 ' % VERSION) h << h.a('Net-ng', href='http://www.net-ng.com', target='_blank') << (' %d' % datetime.date.today().year) h.head.javascript_url('js/nagare.js') return h.root
def render_kansha(self, h, comp, *args): """Main renderer""" favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=favicon_url) h << comp.render(h, model='yui-deps') h.head << h.head.meta( name='viewport', content='width=device-width, initial-scale=1.0') h.head.css_url('css/knacss.css') h.head.css_url('css/themes/fonts.css') h.head.css_url('css/themes/kansha.css') h.head.css_url('css/themes/%s/kansha.css' % self.theme) h.head.javascript_url('js/jquery-2.1.3.min.js') h.head.javascript_url('js/jquery-ui-1.11.2.custom/jquery-ui.js') h.head.javascript_url("js/jquery-linkify/jquery.linkify.min.js") h.head.javascript_url('js/dnd.js') h.head.javascript_url('js/kansha.js') h.head.javascript_url('js/autocomplete.js') h.head.javascript_url('js/ckeditor-4.5.3/ckeditor.js') if self.selected == 'board': with h.body(class_='yui-skin-sam'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') h << self.content.on_answer(self.handle_event) else: h.head << h.head.title(self.app_title) with h.body(class_='yui-skin-sam'): with h.div(class_='wrap'): with h.div(class_='container'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') with h.div(class_='home'), h.div(class_='grid-2'): h << comp.render(h, 'home_menu') with h.div(class_='boards'): h << self.content.on_answer(self.select_board).render(h.AsyncRenderer()) with h.div(class_='credits'): with h.div(class_='container'): h << h.span(u'%s v%s - \u00a9 Net-ng %d' % (self.app_title, VERSION, datetime.date.today().year)) h.head.javascript_url('js/nagare.js') return h.root
def render_app(self, h, comp, *args): favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=favicon_url) h << self.task if False: h << comp.render(h, "debug") return h.root
def add_child(self, child): """Add child and attributes """ super(Source, self).add_child(child) # If this is a relative URL, it's relative to the statics directory # of the application src = self.get('src') if src is not None: self.set('src', xhtml.absolute_url(src, self.renderer.head.static_url))
def render_app(self, h, comp, *args): favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link( rel="shortcut icon", type="image/x-icon", href=favicon_url) h << self.task if False: h << comp.render(h, "debug") return h.root
def render_shell_head(self, h, comp, *args): html_conf = self.configuration['html'] # title h.head << h.head.title(APP_TITLE) # rss feed h.head << h.head.link(href=get_url_service().expand_url(['rss', 'ideas.rss']), rel='', type='application/rss+xml', title=_('Ideas')) # favicon h.head << h.head.link(rel="icon", type="image/png", href=h.head.static_url + "favicon.png") h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=h.head.static_url + "favicon.ico") # prevent indexing by robots h.head << h.head.meta(name='robots', content='noindex,nofollow') # additional meta information h.head << h.head.meta({'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8'}) h.head << h.head.meta({'http-equiv': 'Content-Script-Type', 'content': 'text/javascript'}) css_files = [YUI_PREFIX + 'assets/skins/sam/skin.css', 'css/base.css', 'css/design.css', 'css/layout.css', 'css/fonts.css'] for css_file in css_files: h.head.css_url(css_file, media='all') js_files = ['js/vendor/html5shiv.js', 'js/vendor/nwmatcher-1.2.5-min.js', 'js/vendor/selectivizr-min.js'] ie_js = """[if (gte IE 6)&(lte IE 8)]> <script src="%s"></script> <script src="%s"></script> <script src="%s"></script> <![endif]""" % tuple( xhtml.absolute_url(u, h.head.static_url) for u in js_files) h.head << h.head.comment(ie_js) # Javascript if html_conf['use_combined_js']: js_files = ('js/desktop-combined.js',) else: js_files = ( YUI_PREFIX + 'utilities/utilities.js', YUI_PREFIX + 'element/element-min.js', YUI_PREFIX + 'datasource/datasource-min.js', YUI_PREFIX + 'datatable/datatable-min.js', YUI_PREFIX + 'autocomplete/autocomplete-min.js', YUI_PREFIX + 'container/container-min.js', YUI_PREFIX + 'menu/menu-min.js', YUI_PREFIX + 'button/button-min.js', YUI_PREFIX + 'editor/editor-min.js', YUI_PREFIX + 'calendar/calendar-min.js', 'js/notification.js', 'js/rte.js', 'js/desktop.js', 'yui-3.4.1/yui/yui-min.js', ) for js_file in js_files: h.head.javascript_url(js_file) return h.root
def render_kansha(self, h, comp, *args): """Main renderer""" favicon_url = absolute_url(self.favicon, h.head.static_url) h.head << h.head.link(rel="icon", type="image/x-icon", href=favicon_url) h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=favicon_url) h << comp.render(h, model='yui-deps') h.head << h.head.meta( name='viewport', content='width=device-width, initial-scale=1.0') h.head.css_url('css/knacss.css') h.head.css_url('css/themes/fonts.css?v=2c') h.head.css_url('css/themes/kansha.css?v=2c') h.head.css_url('css/themes/%s/kansha.css?v=2c' % self.theme) h.head.javascript_url('js/jquery-2.1.3.min.js') h.head.javascript_url('js/jquery-ui-1.11.2.custom/jquery-ui.js') h.head.javascript_url("js/jquery-linkify/jquery.linkify.min.js") h.head.javascript_url('js/dnd.js?v=2d') h.head.javascript_url('js/kansha.js?v=2c') h.head.javascript_url('js/autocomplete.js') h.head.javascript_url('js/wysihtml/dist/minified/wysihtml.min.js?v=2c') h.head.javascript_url('js/wysihtml/dist/minified/wysihtml.toolbar.min.js?v=2c') h.head.javascript_url('js/wysihtml/parser_rules/simple.js') if self.selected == 'board': with h.body(class_='yui-skin-sam'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') h << self.content.on_answer(self.handle_event) else: h.head << h.head.title(self.app_title) with h.body(class_='yui-skin-sam'): with h.div(class_='wrap'): with h.div(class_='container'): h << h.div(id="mask") h << comp.render(h, model='resync') h << comp.render(h, model='oip') with h.div(id='application'): h << comp.render(h, model='menu') with h.div(class_='home'), h.div(class_='grid-2'): h << comp.render(h, 'home_menu') with h.div(class_='boards'): # answer only happens when a new board is created h << self.content.on_answer(self.select_board).render(h.AsyncRenderer()) with h.div(class_='credits'): with h.div(class_='container'): h << h.a(self.app_title, href='http://www.kansha.org', target='_blank') << (u' v%s - \u00a9 ' % VERSION) h << h.a('Net-ng', href='http://www.net-ng.com', target='_blank') << (' %d' % datetime.date.today().year) h.head.javascript_url('js/nagare.js') return h.root
def render_shell_head(self, h, comp, *args): html_conf = self.configuration['html'] # title h.head << h.head.title(APP_TITLE) # rss feed h.head << h.head.link(href=get_url_service().expand_url( ['rss', 'ideas.rss']), rel='', type='application/rss+xml', title=_('Ideas')) # favicon h.head << h.head.link( rel="icon", type="image/png", href=h.head.static_url + "favicon.png") h.head << h.head.link(rel="shortcut icon", type="image/x-icon", href=h.head.static_url + "favicon.ico") # prevent indexing by robots h.head << h.head.meta(name='robots', content='noindex,nofollow') # additional meta information h.head << h.head.meta({ 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }) h.head << h.head.meta({ 'http-equiv': 'Content-Script-Type', 'content': 'text/javascript' }) css_files = [ YUI_PREFIX + 'assets/skins/sam/skin.css', 'css/base.css', 'css/design.css', 'css/layout.css', 'css/fonts.css' ] for css_file in css_files: h.head.css_url(css_file, media='all') js_files = [ 'js/vendor/html5shiv.js', 'js/vendor/nwmatcher-1.2.5-min.js', 'js/vendor/selectivizr-min.js' ] ie_js = """[if (gte IE 6)&(lte IE 8)]> <script src="%s"></script> <script src="%s"></script> <script src="%s"></script> <![endif]""" % tuple( xhtml.absolute_url(u, h.head.static_url) for u in js_files) h.head << h.head.comment(ie_js) # Javascript if html_conf['use_combined_js']: js_files = ('js/desktop-combined.js', ) else: js_files = ( YUI_PREFIX + 'utilities/utilities.js', YUI_PREFIX + 'element/element-min.js', YUI_PREFIX + 'datasource/datasource-min.js', YUI_PREFIX + 'datatable/datatable-min.js', YUI_PREFIX + 'autocomplete/autocomplete-min.js', YUI_PREFIX + 'container/container-min.js', YUI_PREFIX + 'menu/menu-min.js', YUI_PREFIX + 'button/button-min.js', YUI_PREFIX + 'editor/editor-min.js', YUI_PREFIX + 'calendar/calendar-min.js', 'js/notification.js', 'js/rte.js', 'js/desktop.js', 'yui-3.4.1/yui/yui-min.js', ) for js_file in js_files: h.head.javascript_url(js_file) return h.root