{% macro flash_messages() -%} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %}
× {{ message }}
{% endfor %} {% endif %} {% endwith %} {%- endmacro %} {% macro networkbar_login_beacon(url) %} {% endmacro %} {% macro networkbar_inner(siteid, links, toplevel=false, appurl='#') %} {%- for link in links %}
  • {%- if link.children -%} {{ link.title }} {%- else -%} {%- if link.sep -%} {{ link.title }} {%- else -%} {{ link.title }} {%- endif -%} {%- endif -%}
  • {%- endfor %} {% endmacro %} {% macro networkbar(siteid=none, login=false, baseclass=none, containerclass="container", beacon=true) -%}
    {%- with links = networkbar_links() %}{% if links %} {%- cache 60, 'networkbar-links-html', siteid or '' %} {%- endcache %} {%- endif %}{% endwith %} {%- if login %} {%- if login and beacon and not g.user %} {%- if g.lastuser %} {{ networkbar_login_beacon(g.lastuser.endpoint_url(g.lastuser.login_beacon_iframe_endpoint) + '?client_id=' + config['LASTUSER_CLIENT_ID'] + '&login_url=' + url_for('login', _external=true)) }} {%- endif %} {%- endif %} {%- endif %}
    {%- endmacro %} {% macro responsive_networkbar_inner(siteid, links, toplevel=false, appurl='#') %} {%- for link in links %}
  • {%- if link.children -%} {{ link.title }} {%- else -%} {%- if link.sep -%} {{ link.title }} {%- else -%} {{ link.title }} {%- endif -%} {%- endif -%}
  • {%- endfor %} {% endmacro %} {% macro responsive_networkbar(siteid=none, login=false, baseclass=none, containerclass="container", beacon=true, links=[]) -%} {%- endmacro %} {% macro hgnav(site_title="HasGeek", site_nav_button=none, site_nav=none, auth=true, network=true, site_links=[], user_links=[], loginbtntext="Login") %} {%- if not g.user %} {%- if g.lastuser %} {{ networkbar_login_beacon(g.lastuser.endpoint_url(g.lastuser.login_beacon_iframe_endpoint) + '?client_id=' + config['LASTUSER_CLIENT_ID'] + '&login_url=' + url_for('login', _external=true)) }} {%- endif %} {%- endif %} {%- endmacro %} {% macro add_hasgeek_auth(links, loginbtntext) %} {% if g.user -%} {%- else %} {{ loginbtntext }} {%- endif %} {%- endmacro %} {% macro add_hasgeek_network() %} {% with %} {% set network_links=[ {'title': 'HasGeek', 'url': 'http://hasgeek.com', 'icon': 'https://hasgeek.com/static/img/hg-banner.png'}, {'title': 'Talkfunnel', 'url': 'https://talkfunnel.com/', 'icon': 'https://static.hasgeek.co.in/static/img/hgnav/hg_funnel.png'}, {'title': 'Hasjob', 'url': 'https://hasjob.co/', 'icon': 'https://static.hasjob.co/static/img/logo-star.png'}, {'title': 'HGTV', 'url': 'https://hasgeek.tv/', 'icon': 'https://static.hasgeek.co.in/static/img/hgnav/hg_hgtv.png'}, ]%} {% endwith %} {%- endmacro %}