def block_og_url(context, environment=environment): l__opengraph = context.resolve('_opengraph') l_page = context.resolve('page') if 0: yield None if environment.getattr(l_page, 'url'): if 0: yield None yield to_string(environment.getattr(l_page, 'url')) else: if 0: yield None yield to_string(context.call(environment.getattr(l__opengraph, 'get'), 'url'))
def block_title(context, environment=environment): l_page = context.resolve('page') l_title = context.resolve('title') if 0: yield None if environment.getattr(l_page, 'title'): if 0: yield None yield to_string(environment.getattr(l_page, 'title')) else: if 0: yield None if l_title: if 0: yield None yield to_string(l_title)
def macro(l_config): t_1 = [] pass if environment.getattr(l_config, 'enable'): pass t_1.extend(( u"var _gaq = _gaq || [];\n\t _gaq.push(['_setAccount', '", to_string(environment.getattr(l_config, 'account_id')), u"']);\n\t _gaq.push(['_trackPageview']);\n\n\t (function() {\n\t var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t })();", )) return concat(t_1)
def block_page_services(context, environment=environment): l_build_page_object = context.resolve('build_page_object') l_page = context.resolve('page') if 0: yield None if environment.getattr(l_page, 'services'): if 0: yield None included_template = environment.get_template('macros/page_object.js', '/source/core/__south.html').module l_build_page_object = getattr(included_template, 'build_page_object', missing) if l_build_page_object is missing: l_build_page_object = environment.undefined("the template %r (imported on line 35 in '/source/core/__south.html') does not export the requested name 'build_page_object'" % included_template.__name__, name='build_page_object') yield u'\n\t' yield to_string(context.call(l_build_page_object, environment.getattr(environment.getattr(l_page, 'services'), 'services_manifest'), environment.getattr(environment.getattr(l_page, 'services'), 'config'), l_page))
def block_page_services(context, environment=environment): l_build_page_object = context.resolve('build_page_object') l_page = context.resolve('page') if 0: yield None if environment.getattr(l_page, 'services'): if 0: yield None included_template = environment.get_template('macros/page_object.js', '/source\\core\\__south.html').module l_build_page_object = getattr(included_template, 'build_page_object', missing) if l_build_page_object is missing: l_build_page_object = environment.undefined("the template %r (imported on line 21 in '/source\\\\core\\\\__south.html') does not export the requested name 'build_page_object'" % included_template.__name__, name='build_page_object') yield u'\n\t' yield to_string(context.call(l_build_page_object, environment.getattr(environment.getattr(l_page, 'services'), 'services_manifest'), environment.getattr(environment.getattr(l_page, 'services'), 'config')))
def block_tail(context, missing=missing): resolve = context.resolve_or_missing undefined = environment.undefined cond_expr_undefined = Undefined if 0: yield None l_0_url_for = resolve('url_for') pass yield '\n <link rel="stylesheet" href="' yield to_string( context.call((undefined( name='url_for') if l_0_url_for is missing else l_0_url_for), 'static', filename='style.css')) yield '">'
def macro(l_page, l_transport, l_security): t_3 = [] l_sys = context.resolve('sys') l_handler = context.resolve('handler') l_util = context.resolve('util') l_api = context.resolve('api') l_authorized = context.resolve('authorized') l_oauth = context.resolve('oauth') l_null = context.resolve('null') l_channel = context.resolve('channel') pass t_3.append( to_string(t_2(t_1({'platform': {'name': environment.getattr(environment.getattr(environment.getattr(l_util, 'config'), 'project'), 'name'), 'version': environment.getattr(l_sys, 'version'), 'origindc': environment.getattr(l_util, 'datacenter'), 'instance': environment.getattr(l_util, 'instance'), 'debug': (True if environment.getattr(environment.getattr(l_util, 'config'), 'debug') else False)}, 'debug': {'logging': (environment.getattr(environment.getattr(l_util, 'config'), 'debug') or context.call(environment.getattr(environment.getattr(l_api, 'users'), 'is_current_user_admin'))), 'eventlog': environment.getattr(environment.getattr(l_util, 'config'), 'debug'), 'verbose': environment.getattr(environment.getattr(l_util, 'config'), 'debug'), 'strict': False}, 'push': ({'enabled': (True if environment.getattr(l_channel, 'token') else False), 'token': (environment.getattr(l_channel, 'token') if environment.getattr(l_channel, 'token') else l_null), 'timeout': ((environment.getattr(environment.getattr(l_channel, '_TTL'), 'seconds') / 60) if l_channel else l_null)} if l_channel else {}), 'user': ({'email': l_null, 'is_user_admin': l_null, 'nickname': l_null} if environment.getattr(l_security, 'current_user') != None else False), 'session': ({'blob': context.call(environment.getattr(environment.getattr(l_handler, 'session'), '_encode_session'))} if environment.getattr(l_handler, 'session') else {}), 'media': ({'key': environment.getattr(environment.getattr(l_page, 'media'), 'key'), 'ref': environment.getattr(environment.getattr(l_page, 'media'), 'ref'), 'name': environment.getattr(environment.getattr(l_page, 'media'), 'name')} if environment.getattr(l_page, 'media') else {'ref': None}), 'oauth': (({'id': environment.getattr(l_oauth, 'fbid')} if l_authorized else {'redirect': environment.getattr(l_oauth, 'redirect'), 'mode': environment.getattr(l_oauth, 'mode')}) if l_oauth else {}), 'services': {'endpoint': context.call(environment.getattr('://', 'join'), [(('https' if environment.getattr(l_handler, 'force_https') else False) or environment.getattr(environment.getattr(l_handler, 'request'), 'scheme')), environment.getattr(environment.getattr(l_transport, 'services'), 'endpoint')]), 'consumer': environment.getattr(environment.getattr(l_transport, 'services'), 'consumer'), 'scope': environment.getattr(environment.getattr(l_transport, 'services'), 'scope'), 'apis': context.call(environment.getattr(environment.getattr(l_transport, 'services'), 'make_object'), environment.getattr(l_page, 'services'))}}))), ) return concat(t_3)
def block_page_analytics(context, environment=environment): l_util = context.resolve('util') l_google_analytics_async = context.resolve('google_analytics_async') l_page = context.resolve('page') if 0: yield None if (not environment.getattr(environment.getattr(l_util, 'config'), 'debug')): if 0: yield None if environment.getattr(l_page, 'analytics'): if 0: yield None included_template = environment.get_template('macros/page_analytics.js', '/source\\core\\__south.html').module l_google_analytics_async = getattr(included_template, 'google_analytics_async', missing) if l_google_analytics_async is missing: l_google_analytics_async = environment.undefined("the template %r (imported on line 29 in '/source\\\\core\\\\__south.html') does not export the requested name 'google_analytics_async'" % included_template.__name__, name='google_analytics_async') yield u'\n\t\t' yield to_string(context.call(l_google_analytics_async, environment.getattr(l_page, 'analytics')))
def block_page_analytics(context, environment=environment): l_util = context.resolve('util') l_google_analytics_async = context.resolve('google_analytics_async') l_page = context.resolve('page') if 0: yield None if (not environment.getattr(environment.getattr(l_util, 'config'), 'debug')): if 0: yield None if environment.getattr(l_page, 'analytics'): if 0: yield None included_template = environment.get_template('macros/page_analytics.js', '/source/core/__south.html').module l_google_analytics_async = getattr(included_template, 'google_analytics_async', missing) if l_google_analytics_async is missing: l_google_analytics_async = environment.undefined("the template %r (imported on line 43 in '/source/core/__south.html') does not export the requested name 'google_analytics_async'" % included_template.__name__, name='google_analytics_async') yield u'\n\t\t' yield to_string(context.call(l_google_analytics_async, environment.getattr(l_page, 'analytics')))
def block_js_pageobject(context, environment=environment): l_security = context.resolve('security') l_page = context.resolve('page') l_transport = context.resolve('transport') if 0: yield None included_template = environment.get_template( 'macros/apptools.html', '/source/core/__base.html').module l_build_native_page_object = getattr(included_template, 'build_native_page_object', missing) if l_build_native_page_object is missing: l_build_native_page_object = environment.undefined( "the template %r (imported on line 77 in '/source/core/__base.html') does not export the requested name 'build_native_page_object'" % included_template.__name__, name='build_native_page_object') yield u'\n ' yield to_string( context.call(l_build_native_page_object, l_page, l_transport, l_security))
def root(context): l_message = context.resolve('message') if 0: yield None yield to_string(l_message)
def block_meta_publisher(context, environment=environment): l__meta = context.resolve('_meta') if 0: yield None yield to_string(context.call(environment.getattr(l__meta, 'get'), 'publisher'))
def block_og_type(context, environment=environment): l__opengraph = context.resolve('_opengraph') if 0: yield None yield to_string(context.call(environment.getattr(l__opengraph, 'get'), 'type'))
def block_og_fb_admins(context, environment=environment): l__opengraph = context.resolve('_opengraph') if 0: yield None yield to_string(context.call(environment.getattr(',', 'join'), context.call(environment.getattr(context.call(environment.getattr(l__opengraph, 'get'), 'facebook', {}), 'get'), 'admins')))
def block_og_fb_appid(context, environment=environment): l__opengraph = context.resolve('_opengraph') if 0: yield None yield to_string(context.call(environment.getattr(context.call(environment.getattr(l__opengraph, 'get'), 'facebook', {}), 'get'), 'app_id'))
def macro(l_services, l_config): t_1 = [] l_sys = context.resolve('sys') pass t_1.append( u'$(document).ready(function (){\n\n\t', ) for event in context.blocks['platform_statement'][0](context): t_1.append(event) t_1.append( u'\n\n\t', ) l_action = l_cfg = l_opts = l_service = missing l_enumerate = context.resolve('enumerate') for (l_service, l_action, l_cfg, l_opts) in l_services: pass t_1.extend(( u"$.apptools.api.rpc.factory('", to_string(l_service), u"', '", to_string(l_action), u"', [", )) l_i = l_method = missing l_len = context.resolve('len') for (l_i, l_method) in context.call(l_enumerate, environment.getattr(l_cfg, 'methods')): pass t_1.extend(( u"'", to_string(l_method), u"'", )) if l_i != (context.call(l_len, environment.getattr(l_cfg, 'methods')) - 1): pass t_1.append( u',', ) l_i = l_method = missing t_1.append( u'],', ) l_util = context.resolve('util') pass t_2 = context.eval_ctx.save() context.eval_ctx.autoescape = False t_1.append( to_string(context.call(environment.getattr(environment.getattr(environment.getattr(l_util, 'converters'), 'json'), 'dumps'), l_opts)), ) context.eval_ctx.revert(t_2) t_1.append( u');', ) l_action = l_cfg = l_opts = l_service = missing t_1.append( u'\n\n\t', ) for event in context.blocks['userobj'][0](context): t_1.append(event) t_1.extend(( u'\n\n\t_PLATFORM_VERSION = "', to_string(environment.getattr(l_sys, 'version')), u'";\n\t$.apptools.events.trigger(\'API_READY\');\n\n});', )) return concat(t_1)
def block_og_description(context, environment=environment): l__meta = context.resolve('_meta') if 0: yield None yield to_string(context.call(environment.getattr(l__meta, 'get'), 'description'))
def block_meta_copyright(context, environment=environment): l__meta = context.resolve('_meta') if 0: yield None yield to_string(context.call(environment.getattr(l__meta, 'get'), 'copyright'))
def block_og_region(context, environment=environment): l__location = context.resolve('_location') if 0: yield None yield to_string(context.call(environment.getattr(l__location, 'get'), 'region'))
def macro(l_services, l_config, l_page): t_4 = [] l_null = context.resolve('null') pass t_4.append( u'$(document).ready(function (){\n\n\t', ) for event in context.blocks['platform_statement'][0](context): t_4.append(event) t_4.append( u'\n\n\t', ) if l_services != l_null: pass t_4.append( u'\n\t$.apptools.api.rpc.factory([', ) l_action = l_cfg = l_opts = l_service = missing l_util = context.resolve('util') l_enumerate = context.resolve('enumerate') for (l_service, l_action, l_cfg, l_opts), l_loop in LoopContext(l_services): pass t_4.extend(( u"{\n\t\t\t\tname: '", to_string(l_service), u"',\n\t\t\t\tbase_uri: '", to_string(l_action), u"',\n\t\t\t\tmethods: [", )) t_5 = l_loop l_i = l_method = missing l_len = context.resolve('len') for (l_i, l_method) in context.call(l_enumerate, environment.getattr(l_cfg, 'methods')): pass t_4.extend(( u"'", to_string(l_method), u"'", )) if l_i != (context.call(l_len, environment.getattr(l_cfg, 'methods')) - 1): pass t_4.append( u',', ) l_loop = t_5 l_i = l_method = missing t_4.extend(( u'],\n\t\t\t\tconfig: ', to_string(t_2(context.call(environment.getattr(environment.getattr(environment.getattr(l_util, 'converters'), 'json'), 'dumps'), l_opts))), u'\n\t\t\t}', )) if (not environment.getattr(l_loop, 'last')): pass t_4.append( u',', ) l_action = l_cfg = l_opts = l_service = missing t_4.append( u']);\n\t', ) t_4.append( u'\n\n\t', ) if environment.getattr(l_page, 'open_channel'): pass t_4.append( u'\n\t', ) if environment.getattr(l_page, 'channel_token'): pass t_4.extend(( u'\n\t\t$.apptools.push.channel.establish("', to_string(environment.getattr(l_page, 'channel_token')), u'").listen();\n\t', )) t_4.append( u'\n\t', ) t_4.append( u'\n\n\t', ) for event in context.blocks['userobj'][0](context): t_4.append(event) t_4.append( u"\n\n\t$.apptools.events.trigger('API_READY');\n\n});", ) return concat(t_4)
def block_meta_keywords(context, environment=environment): l__meta = context.resolve('_meta') if 0: yield None yield to_string(context.call(environment.getattr(',', 'join'), context.call(environment.getattr(l__meta, 'get'), 'keywords', [])))