Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

158 lines (147 sloc) 7.296 kb
{% load i18n adminmedia sekizai_tags cms_js_tags cms_admin %}
{% addtoblock "js" %}
<script type="text/javascript">
var _jQuery = window.jQuery || null;
var _$ = window.$ || null;
</script>
{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{% admin_static_url %}js/jquery.min.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/libs/class.min.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/jquery.ui.custom.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/cms.base.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/cms.toolbar.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/cms.placeholders.js"></script>{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cms/css/plugins/cms.toolbar.css" />{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cms/css/plugins/cms.placeholders.css" />{% endaddtoblock %}
{% addtoblock "js" %}
<script type="text/javascript">
CMS.$(document).ready(function () {
// initialize toolbar and pass required options
CMS.API.Toolbar = new CMS.Toolbar('#cms_toolbar', {
'csrf': '{{ csrf_token }}',
'debug': true,
'settings': {
'toolbar': 'expanded',
'mode': 'edit'
},
'lang': {
'move_warning': {% javascript_string %}{% trans "The selected element can not be moved to the desired location." %}{% end_javascript_string %},
'delete_request': {% javascript_string %}{% trans "Are you sure you want to delete this plugin?" %}{% end_javascript_string %},
'cancel': {% javascript_string %}{% trans "Cancel" %}{% end_javascript_string %}
}
});
// global accessor for placeholders
CMS.API.Placeholders = new CMS.Placeholders('.cms_placeholder', '.cms_plugin');
{% if request.toolbar.login_form.errors %}
CMS.API.Toolbar.showError('{{ request.toolbar.login_form.non_field_errors }}{% if request.toolbar.login_form.username.errors %}{% trans "Username" %}: {{ request.toolbar.login_form.username.errors }}{% endif %}{% if request.toolbar.login_form.password.errors %}{% trans "Password" %}: {{ request.toolbar.login_form.password.errors }}{% endif %}');
{% endif %}
});
</script>
{% endaddtoblock %}
{% addtoblock "js" %}
<script type="text/javascript">
window.jQuery = _jQuery;
window.$ = _$;
</script>
{% endaddtoblock %}
<div id="cms_toolbar" class="cms_reset cms_light{% if not user.is_authenticated %} cms_toolbar-auth{% endif %}">
<!-- start: toolbar -->
<div class="cms_toolbar">
<div class="cms_toolbar-left">
<div class="cms_toolbar-item cms_toolbar-item_logo"><a href="/">{% trans "django CMS" %}</a></div>
{% if not user.is_authenticated %}
<form class="cms_toolbar-item cms_form-login" method="post" action="?edit&cms-toolbar-login=1">
{% csrf_token %}
<label{% if request.toolbar.login_form.username.errors %} class="cms_error"{% endif %}>{% trans "Username" %} {{ request.toolbar.login_form.username }}</label>
<label{% if request.toolbar.login_form.password.errors or request.toolbar.login_form.non_field_errors %} class="cms_error"{% endif %}>{% trans "Password" %} {{ request.toolbar.login_form.password }}</label>
<label><input type="submit" value="Login" /></label>
</form>
{% endif %}
<ul class="cms_toolbar-item cms_toolbar-item_navigation">
{% for item in request.toolbar.get_items %}
{{ item.render }}
{% endfor %}
<li{% if not request.toolbar.edit_mode %} class="cms_toolbar-item_navigation-disabled"{% endif %}>
<a href="{% url admin:cms_page_change current_page.pk %}">{% trans "Publish" %}</a>
<ul>
<li><a href="{% url admin:cms_page_publish_page current_page.pk %}" rel="ajax">{% trans "Publish now" %}</a></li>
<li><a href="{% url admin:cms_page_remove_delete_state current_page.pk %}" data-text="{% trans "Are you sure you want to revert to live?" %}" rel="dialogue">{% trans "Revert to live" %}</a></li>
</ul>
</li>
</ul>
</div>
<div class="cms_toolbar-right">
{% if request.toolbar.edit_mode %}
<ul class="cms_toolbar-item cms_toolbar-item_buttons">
<li{% if request.toolbar.edit_mode %} class="active"{% endif %}><a href="?edit">{% trans "Edit" %}</a></li>
<li><a href="?layout=true">{% trans "Layout" %}</a></li>
<!--<li{% if not request.toolbar.edit_mode %} class="active"{% endif %}><a href="?edit-off">{% trans "View" %}</a></li>-->
</ul>
{% endif %}
<div class="cms_toolbar-item cms_toolbar-item_switch{% if not request.toolbar.edit_mode %} cms_toolbar-item_switch-active{% endif %}">
<!--
TODO: URL STYLE:
draft=on / draft=off triggers buttons
edit=on / edit=off triggers edit mode
layout=on / layout=off triggers layout mode
view=on / view=off triggers view mode
-->
<a href="{% if request.toolbar.edit_mode %}?edit_off{% else %}?edit{% endif %}">
<span class="cms_toolbar-item_switch-on">{% trans "Live" %}</span>
<span class="cms_toolbar-item_switch-off">{% trans "Draft" %}</span>
</a>
<span class="cms_toolbar-item_switch-knob">{% trans "Change" %}</span>
</div>
</div>
</div>
<div class="cms_toolbar-trigger"><a href="#">{% trans "Toggle toolbar" %}</a></div>
<!-- end: toolbar -->
<!-- start: sidebar -->
<div class="cms_sideframe">
<div class="cms_sideframe-resize"><span class="cms_sideframe-knob"></span></div>
<div class="cms_sideframe-frame"></div>
<div class="cms_sideframe-shim"></div>
</div>
<!-- end: sidebar -->
<!-- start: dialogue -->
<div class="cms_dialogue">
<div class="cms_dialogue-title">{% trans "Notification" %}</div>
<div class="cms_dialogue-inner">
<div class="cms_dialogue-text"></div>
<div class="cms_dialogue-buttons">
<a href="#" class="cms_dialogue-cancel">{% trans "No" %}</a>
<a href="#" class="cms_dialogue-confirm">{% trans "Yes" %}</a>
<a href="#" class="cms_dialogue-accept">{% trans "Ok" %}</a>
</div>
</div>
</div>
<!-- end: dialogue -->
<!-- start: modal -->
<div class="cms_modal">
<div class="cms_modal-head">
<span class="cms_modal-title">&nbsp;</span>
<span class="cms_modal-collapse" title="minimize">-</span>
<span class="cms_modal-close" title="close">x</span>
</div>
<div class="cms_modal-body">
<div class="cms_modal-shim"></div>
<div class="cms_modal-frame"></div>
</div>
<div class="cms_modal-foot">
<div class="cms_modal-breadcrumb">
<span class="cms_modal-breadcrumb-title">{% trans "Plugin Tree" %}</span>
<span class="cms_modal-breadcrumb-items">&nbsp;</span>
</div>
<div class="cms_modal-buttons">
<div class="cms_modal-save">{% trans "Save" %}</div>
<div class="cms_modal-cancel">{% trans "Cancel" %}</div>
</div>
<div class="cms_modal-resize"></div>
</div>
</div>
<!-- end: modal -->
<!-- start: placeholder -->
<div class="cms_placeholders-tooltip">Double-click to edit</div>
<div class="cms_placeholders-menu">&nbsp;</div>
<!-- end: placeholder -->
</div>
Jump to Line
Something went wrong with that request. Please try again.