{% load assets %}
{% load webcms_tags %}
{% load webcms_asset_tags %}

{% assets "blueprint_css" %}<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" />{% endassets %}
{% assets "jquery_ui_css" %}<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" />{% endassets %}
{% assets "webcms_css" %}<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" />{% endassets %}

<link rel="stylesheet" type="text/css" href="/media/lib/webcms-themes/default/screen.css" media="screen" />

{% if request.webcms_options.template == 'local' or request.webcms_options.template == request.webcms_options.site.name %}
{% set_template_styles request.webcms_options.template 'local' request.session.frontend_editing %}
{% else %}
{% set_template_styles request.webcms_options.template 'global' request.session.frontend_editing %}
{% endif %}

{% if request.session.frontend_editing %}
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/screen.css" media="screen" />
{% for template_theme in template_styles %}
<link rel="stylesheet {% if template_theme != request.webcms_options.theme %}alternate{% endif %}" type="text/css" href="{{ theme_path }}/colors/{{ template_theme }}.css" title="{{ template_theme }}" media="screen" />
{% endfor %}
{% else %}
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/colors/{{ request.webcms_options.theme }}.css" title="{{ request.webcms_options.theme }}" media="screen" />
{% endif %}

{% assets "jquery_js" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
{% assets "jquery_ui_js" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}

<script type="text/javascript">
var page_id = {{ webcms_page.id }};

var webcms_session = {
	'path': '{{ request.path }}',
	'site_id': '1',
	'page_id': '{{ webcms_page.id }}',
	'user_id': '{{ request.user.id }}',
	'page_cols': [{{ webcms_page.options.col1_width }}, {{ webcms_page.options.col2_width }}, {{ webcms_page.options.col3_width }}, {{ webcms_page.options.col4_width }}]
};

</script>
{% if request.webcms_options.template == 'local' or request.webcms_options.template == request.webcms_options.site.name %}
<script type="text/javascript" src="/media/theme/js/init.js"></script>
{% else %}
<script type="text/javascript" src="/media/lib/webcms-themes/{{ request.webcms_options.template }}/js/init.js"></script>
{% endif %}

{% google_analytics "default" "async" %}
