Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

template adjustments

  • Loading branch information...
commit 77282c8cf58206decf913f311cb95d9d07b1e590 1 parent b65c3d8
@FinalAngel FinalAngel authored
View
BIN  cms/static/cms/images/cms_toolbar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  cms/static/cms/img/toolbar/sprite_toolbar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 cms/static/cms/js/plugins/cms.base.js
@@ -154,7 +154,11 @@ CMS.$(document).ready(function ($) {
},
savePlugin: function (type, context) {
- console.log(type);
+
+ // lets reload the browser
+ setTimeout(function () {
+ CMS.API.Helpers.reloadBrowser();
+ }, context.timeout || 0);
}
};
View
2  cms/templates/admin/cms/page/close_frame.html
@@ -4,7 +4,7 @@
{% endcomment %}
<!doctype html>
-<html lang="en" >
+<html lang="en">
<head>
<title>{% trans "Successfully saved." %}</title>
<script type="text/javascript" src="{% admin_static_url %}js/jquery.min.js"></script>
View
2  cms/templates/admin/cms/page/history/recover_header.html
@@ -7,7 +7,7 @@
{% block extrahead %}
{{ block.super }}
-<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
+<script type="text/javascript" src="{% url "admin:jsi18n" %}"></script>
{{ media }}
{% endblock %}
View
133 cms/templates/admin/cms/page/plugin/change_form.html
@@ -1,126 +1,43 @@
-{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia cms_admin %}
+{% extends "admin/change_form.html" %}
+{% load i18n admin_static admin_modify cms_admin %}
{% load url from future %}
+{% comment %}
+- This template is used whenever a plugin is loaded
+{% endcomment %}
+
{% block extrahead %}
{{ block.super }}
-<script type="text/javascript" src="{% admin_static_url %}js/jquery.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}cms/js/csrf.js"></script>
-<!-- admins cript -->
-<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
-
-<script type="text/javascript" src="{{ STATIC_URL }}cms/js/libs/class.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/cms.base.js"></script>
-
+{% block jquery %}<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>{% endblock jquery %}
+<script type="text/javascript" src="{% url "admin:jsi18n" %}"></script>
+<script type="text/javascript" src="{% static "cms/js/csrf.js" %}"></script>
+<script type="text/javascript" src="{% static "cms/js/libs/class.min.js" %}"></script>
+<script type="text/javascript" src="{% static "cms/js/plugins/cms.base.js" %}"></script>
{{ media }}
+{% endblock %}
-<script type="text/javascript">
-//<![CDATA[
-(function($) {
- function runOnLoad(f) {
- if (runOnLoad.loaded){
- f();
- }else{
- runOnLoad.funcs.push(f);
- }
- }
- runOnLoad.funcs = [];
- runOnLoad.loaded = false;
- runOnLoad.run = function() {
- if (runOnLoad.loaded) return;
-
- for(var i = 0; i < runOnLoad.funcs.length; i++) {
- try {
- runOnLoad.funcs[i]();
- }catch(e) { }
- }
- runOnLoad.loaded = true;
- delete runOnLoad.funcs;
- delete runOnLoad.run;
- };
- if (window.addEventListener){
- window.addEventListener("load", runOnLoad.run, false);
- }else if (window.attachEvent){
- window.attachEvent("onload", runOnLoad.run);
- }else{
- window.onload = runOnLoad.run;
- }
- runOnLoad(function(){
- parent.setiframeheight($('body').height()+20, {{ plugin.pk }});
- });
- $(document).ready(function(){
- $("a.add-another,a.related-lookup").each(function(i, sign){
- var href = $(sign).attr("href");
- if (href.substr(0,2) == ".."){
- href = "../../"+href;
- $(sign).attr("href", href);
- }
- });
- });
-})(window.CMS.$);
-//]]>
-</script>
-
-
+{% block extrastyle %}
+{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endblock %}
-
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_static_url %}css/forms.css" />{% endblock %}
-
+
{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
-
{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
-
-{% block breadcrumbs %}{% if not is_popup %}
+{% block content_title %}{% comment %}<h1>{{ plugin.get_plugin_name }}</h1>{% endcomment %}{% endblock %}
+
+{% block breadcrumbs %}
+{% if not is_popup %}
<div class="breadcrumbs">
<a href="../../../">{% trans "Home" %}</a> &rsaquo;
<a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo;
{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
{% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
-{% endif %}{% endblock %}
-
-{% block content_title %}<h2>{{ plugin.get_plugin_name }}</h2>{% endblock %}
-
-{% block content %}<div id="content-main">
-{% block top %}{% if preview %}{% render_plugin plugin %}{% endif %}{% endblock %}
-<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
-<div>
-{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
-{% if save_on_top %}{% submit_row %}{% endif %}
-{% if errors %}
- <p class="errornote">
- {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
- </p>
- <ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul>
{% endif %}
-
-{% block fieldsets %}
-{% for fieldset in adminform %}
- {% include "admin/includes/fieldset.html" %}
-{% endfor %}
{% endblock %}
-
-{% block after_field_sets %}{% endblock %}
-
-{% for inline_admin_formset in inline_admin_formsets %}
- {% include inline_admin_formset.opts.template %}
-{% endfor %}
-
-{% block after_related_objects %}{% endblock %}
-
-
-{% if add %}
- <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script>
-{% endif %}
-
-{# JavaScript for prepopulated fields #}
-{% prepopulated_fields_js %}
-
-</div>
-<span class="plugin-submit-row"{% if is_popup %} style="overflow: auto;"{% endif %}>
- <input type="submit" style="float:none;" name="_save" class="default" value="{% trans "Save" %}" {{ onclick_attrib }}/>
- <input type="submit" style="margin-left: 8px;" value="{% trans "Cancel" %}" name="_cancel" class="cancel-btn">
-</span>
-</form>
-</div>
+{% block object-tools %}
+{% block top %}{% if preview %}{% render_plugin plugin %}{% endif %}{% endblock %}
+{{ block.super }}
{% endblock %}
+
+{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
View
30 cms/templates/admin/cms/page/plugin/confirm_form.html
@@ -1,41 +1,49 @@
{% extends "admin/change_form.html" %}
-{% load i18n admin_modify adminmedia cms_js_tags cms_admin %}
+{% load i18n admin_static admin_modify cms_admin %}
{% comment %}
- This template is used whenever a plugin has been saved
{% endcomment %}
+{% block title %}{% trans "Change a page" %}{% endblock %}
+{% block content_title %}{% endblock %}
+
{% block extrahead %}
{{ block.super }}
-<script type="text/javascript" src="{% admin_static_url %}js/jquery.min.js"></script>
+{% block jquery %}<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>{% endblock jquery %}
{{ media }}
{% endblock %}
-{% block title %}{% trans "Change a page" %}{% endblock %}
-{% block content_title %}{% endblock %}
-
{% block content %}
+{% if messages %}
+<ul class="messages">
+ {% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+ {% endfor %}
+</ul>
+{% endif %}
+
<script type="text/javascript">
jQuery(document).ready(function ($) {
// determine how to handle the plugin call
var type = '{% if deleted %}delete{% else %}add{% endif %}';
- if(window.parent.CMS) type = 'popup';
+ if(window.parent && window.parent.CMS) type = 'popup';
// extra context that can be passed to the calling function
// TODO: context should be passed through the backend
var context = {
'window': window,
'timeout': {{ window_close_timeout|default:0 }},
'plugin_id': '{{ plugin_id }}', // used for everything
- 'plugin_type': {{ type }}, // used for hide_iframe
- 'plugin_name': {{ name }}, // used for hide_iframe
+ 'plugin_type': '{{ type }}', // used for hide_iframe
+ 'plugin_name': '{{ name }}', // used for hide_iframe
'plugin_icon': '{{ icon }}', // used for wysiwyg
'plugin_desc': '{{ alt }}', // used for wysiwyg
'message': '{% if cancel %}{% trans "Your changes to this plugin have not been saved." %}{% else %}{% trans "Plugin saved successfully." %}{% endif %}'
};
// determing if we are inside the current window or in a popup
- if(window.CMS) CMS.API.Helpers.savePlugin(type, context);
- if(window.parent.CMS) window.parent.CMS.API.Helpers.savePlugin(type, context);
- // todo we might need to check how it works on a popup
+ var CMS = CMS || window.parent.CMS;
+ // save current plugin
+ CMS.API.Helpers.savePlugin(type, context)
});
</script>
{% endblock %}
View
2  cms/templates/admin/cms/page/submit_row.html
@@ -19,7 +19,7 @@
</div>
<script type="text/javascript">
// using the django admin jQuery version
-jQuery('document').ready(function ($) {
+jQuery(document).ready(function ($) {
$('form').submit(function () {
$('input[type="submit"]').attr('disabled','disabled');
});
View
20 cms/templates/admin/cms/page/tree/copy_premissions.html
@@ -15,17 +15,19 @@
<script type="text/javascript">
jQuery(document).ready(function($) {
// change submit states, open dialog
- $('#{{ dialog_id }}').dialog({
- bgiframe: true,
- autoOpen: true,
- height: 200,
- width: 400,
- modal: true,
- buttons: {
- Cancel: function() {
+ var dialog = '#{{ dialog_id }}';
+
+ $(dialog).dialog({
+ 'bgiframe': true,
+ 'autoOpen': true,
+ 'height': 200,
+ 'width': 400,
+ 'modal': true,
+ 'buttons': {
+ 'Cancel': function() {
$(this).dialog('close');
},
- OK: function() {
+ 'OK': function() {
formData = {};
$.each($('#{{ dialog_id }}-form').formToArray(), function(i, item){
formData[item.name] = item.value;
Please sign in to comment.
Something went wrong with that request. Please try again.