Skip to content

Loading…

fixes #2685 (tree view has links to current page language) #2723

Merged
merged 6 commits into from

3 participants

@digi604
Divio AG member

fixes #2685

  • needs frontend fixes
@coveralls

Coverage Status

Coverage remained the same when pulling 019c21c on digi604:fix-2685 into 28b70a4 on divio:develop.

@FinalAngel FinalAngel was assigned by digi604
@digi604 digi604 added the frontend label
@digi604 digi604 added this to the 3.0 milestone
@digi604 digi604 merged commit 3a09d5c into divio:develop

1 check was pending

Details default The Travis CI build is in progress
@coveralls

Coverage Status

Coverage decreased (-0.29%) when pulling b7137c2 on digi604:fix-2685 into ca9bdc7 on divio:develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 25, 2014
  1. @digi604

    fixes the backend part

    digi604 committed
Commits on Feb 26, 2014
  1. @FinalAngel

    remove tabs

    FinalAngel committed
Commits on Feb 27, 2014
  1. @FinalAngel
  2. @FinalAngel

    update language on sideframe

    FinalAngel committed
  3. @digi604

    Merge pull request #8 from FinalAngel/fixes/2685

    digi604 committed
    Fixes/2685
  4. @digi604

    Merge branch 'develop' into fix-2685

    digi604 committed
    Conflicts:
    	cms/templates/admin/cms/page/tree/menu_item.html
View
6 cms/admin/change_list.py
@@ -62,6 +62,10 @@ def __init__(self, request, *args, **kwargs):
def get_query_set(self, request=None):
if COPY_VAR in self.params:
del self.params[COPY_VAR]
+ if 'language' in self.params:
+ del self.params['language']
+ if 'page_id' in self.params:
+ del self.params['page_id']
if django.VERSION[1] > 3:
qs = super(CMSChangeList, self).get_query_set(request).drafts()
else:
@@ -82,7 +86,7 @@ def get_query_set(self, request=None):
def is_filtered(self):
from cms.utils.plugins import SITE_VAR
lookup_params = self.params.copy() # a dictionary of the query string
- for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, SITE_VAR):
+ for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, SITE_VAR, 'language', 'page_id'):
if i in lookup_params:
del lookup_params[i]
if not lookup_params.items() and not self.query:
View
3 cms/admin/pageadmin.py
@@ -20,7 +20,7 @@
from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from django.template.defaultfilters import escape
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, get_language
from django.utils.decorators import method_decorator
from django.views.decorators.http import require_POST
@@ -636,6 +636,7 @@ def changelist_view(self, request, extra_context=None):
'has_add_permission': self.has_add_permission(request),
'root_path': reverse('admin:index'),
'app_label': app_label,
+ 'preview_language': request.GET.get('language', get_language()),
'CMS_MEDIA_URL': get_cms_setting('MEDIA_URL'),
'CMS_PERMISSION': get_cms_setting('PERMISSION'),
'DEBUG': settings.DEBUG,
View
9 cms/cms_toolbar.py
@@ -101,7 +101,7 @@ def add_admin_menu(self):
for site in sites_queryset:
sites_menu.add_link_item(site.name, url='http://%s' % site.domain,
active=site.pk == self.current_site.pk)
- # admin
+ # admin
admin_menu.add_sideframe_item(_('Administration'), url=reverse('admin:index'))
admin_menu.add_break(ADMINISTRATION_BREAK)
# cms users
@@ -140,7 +140,7 @@ def populate(self):
self.change_admin_menu()
if self.page:
self.add_page_menu()
- # history menu
+ # history menu
if self.page and self.toolbar.edit_mode:
self.add_history_menu()
self.change_language_menu()
@@ -249,7 +249,10 @@ def change_language_menu(self):
def change_admin_menu(self):
admin_menu = self.toolbar.get_or_create_menu(ADMIN_MENU_IDENTIFIER)
# cms page admin
- admin_menu.add_sideframe_item(_('Pages'), url=reverse("admin:cms_page_changelist"), position=0)
+ url = "%s?language=%s" % (reverse("admin:cms_page_changelist"), self.toolbar.language)
+ if self.page:
+ url += "&page_id=%s" % self.page.pk
+ admin_menu.add_sideframe_item(_('Pages'), url=url, position=0)
def add_page_menu(self):
# menu for current page
View
2 cms/static/cms/css/plugins/cms.pagetree.css
@@ -1,3 +1,3 @@
@charset "utf-8";/*!
* @copyright: https://github.com/divio/django-cms
- */#sitemap{padding:0;margin:0;margin:0;background:#fefefe}#sitemap a{text-decoration:none;outline:none;border:none}#sitemap a:hover{text-decoration:underline}#sitemap li,#sitemap ul{list-style-type:none}#sitemap li input.hidden{position:absolute;left:-9999em}#sitemap li a.icon,#sitemap li span.icon,#sitemap li a.move,#sitemap li a.copy,#sitemap li a.edit,#sitemap li a.advanced-settings,#sitemap li span.info{display:inline-block;width:18px;height:18px;margin-top:5px;background:url("../../img/pagetree/sprite.png") no-repeat 0 0}#sitemap li a.move{background-position:-20px -20px;margin-top:0}#sitemap li a.copy{background-position:-40px -60px;margin-top:0}#sitemap li a.edit{background-position:-40px -20px;margin-top:0}#sitemap li a.advanced-settings{background-position:-60px -60px;margin-top:0}#sitemap li span.info{background-position:-81px -20px;margin-top:-1px;cursor:pointer}#sitemap li a.selector-add{background-position:-20px 0;margin-left:4px;margin-top:-1px}#sitemap li a.addlink,#sitemap li a.deletelink{display:inline-block;width:10px;height:10px;padding:0;margin:0 0 0 4px;background-position:0 0}#sitemap li .col-softroot span.icon{background-position:-80px 0;margin-top:0}#sitemap li .col-apphook span.icon{background-position:-40px -80px;margin-top:0}#sitemap li a.move span,#sitemap li a.copy span,#sitemap li a.selector-add span,#sitemap li a.addlink span,#sitemap li a.deletelink span,#sitemap li a.edit span,#sitemap li a.advanced-settings span,#sitemap li span.info span,#sitemap .col-navigation input,#sitemap .col-published input{display:none}#sitemap ul.header{position:relative;top:1px}#sitemap ul.header,#sitemap ul.header li{padding:0;margin:0;border:none;background:none}#sitemap ul.header li{color:#666;font-size:11px;font-weight:400;height:16px;padding:5px 0 4px 5px;border-bottom:1px solid #dededc;background:#fefefe}#sitemap ul.header li .cont{height:15px;border:none !important;background:none !important}#sitemap ul.header li .col1{font-size:10px}#sitemap ul.header li .col2>div{font-size:10px;line-height:14px;border:none;background:none}#sitemap li .cont{display:block;border-top:1px solid #dededc !important}#sitemap li.open>.cont{border-bottom:1px solid #dededc !important}#sitemap li.open ul .cont{border-top:none !important;border-bottom:1px solid #dededc !important}#sitemap li.moveable>div{border-bottom:none !important}#sitemap li.last.leaf .cont,#sitemap li.last.closed .cont{border-bottom:none !important}#sitemap .tree-default .col-navigation,#sitemap .tree-default .col-published{line-height:30px}#sitemap li.open ul{margin-left:0;border-bottom:1px solid #dededc !important}#sitemap li.open.last ul{border-bottom:none !important}#sitemap li.open ul.last{border-bottom:none !important}#sitemap § li .col1>div{text-align:center}#sitemap li .col1 .title{background:none}#sitemap li .col1 .success{color:#666;padding-left:10px}#sitemap li .col1 a.changelink{display:none;line-height:27px;margin:6px 0 0 10px !important}#sitemap li .col1 .title,#sitemap li .col1 .success{float:left;line-height:29px;height:28px;padding-left:20px}#sitemap li .move-target-container{display:none;float:left;font-size:14px;line-height:27px;margin-right:10px}#sitemap li .move-target-container a:hover{text-decoration:none}#sitemap li .move-target{display:inline-block;padding:2px 8px;border-left:1px solid #ddd}#sitemap li .move-target:first-child{border-left:none}#sitemap li .col2>div{float:left;line-height:28px;white-space:nowrap;text-align:center;width:auto;height:28px;padding:0 5px;border-left:1px solid #ddd}#sitemap li .col2>div a,#sitemap li .col2>div span{vertical-align:middle}#sitemap li .cont:hover{background:#fafafa}#sitemap li.moveable .col1 .title{background:url("../../img/pagetree/tree-li-drag.gif") no-repeat 0 0}#sitemap li .col-language a{text-transform:uppercase}#sitemap .cont:hover .col1 a.changelink{display:block}#sitemap li#dragged{min-width:500px}#sitemap li#dragged .col2{display:none}#sitemap .info-details{display:none}#sitemap li .info:hover{position:relative}#sitemap li .info:hover .info-details{display:block}#sitemap .info-details{cursor:default;position:absolute;right:-6px;top:-6px;z-index:100;text-align:left;line-height:18px;padding:5px 10px;background:white;border:1px solid #ccc;-webkit-border-radius:3px 0 3px 3px;-moz-border-radius:3px 0 3px 3px;-ms-border-radius:3px 0 3px 3px;-o-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#sitemap .info-details mark{font-weight:bold;background:none;font-style:normal;display:-moz-inline-stack;display:inline-block;vertical-align:middle;*vertical-align:auto;zoom:1;*display:inline;min-width:100px}#sitemap .info-details span{display:inline !important}#changelist-filter-button{line-height:30px;display:block;position:absolute;right:0;top:0;z-index:1000;width:150px;height:auto;padding:0 0 0 10px;margin:0;border:1px solid #ddd;border-right:none;border-top:none;background:#fafafa}#changelist-filter{top:30px}#changelist-filter h2{display:none}.change-list .filtered{min-height:auto;background:white !important}#site-selector{float:left;margin:9px 18px 0 8px}#loader-message{position:fixed;top:0;right:0;padding:4px 8px;background:white;display:none}#sitemap{border:1px solid #dededc}#sitemap ul.header li .col2>div{padding:0 5.5px}#sitemap li .col-softroot span.icon{width:18px !important;height:18px !important;margin:0 !important;background:url("../../img/pagetree/sprite.png") -80px 0 no-repeat !important}#sitemap li .col-apphook span.icon{width:18px !important;height:18px !important;margin:0 !important;background:url("../../img/pagetree/sprite.png") -40px -80px no-repeat !important}#sitemap li .col-language span{width:14px !important;height:14px !important;margin:-3px 0 0 !important;display:-moz-inline-stack;display:inline-block;vertical-align:middle;*vertical-align:auto;zoom:1;*display:inline;-webkit-border-radius:7px;-moz-border-radius:7px;-ms-border-radius:7px;-o-border-radius:7px;border-radius:7px;color:transparent}#sitemap li .col-language span.dirty{background-color:#6ba6ff;-webkit-animation:pulsate 2.5s ease-out infinite;-moz-animation:pulsate 2.5s ease-out infinite;animation:pulsate 2.5s ease-out infinite}#sitemap li .col-language span.empty{background-color:#e8e9e5}#sitemap li .col-language span.unpublished{background-color:#ff2942}#sitemap li .col-language span.unpublishedparent{background-color:#ff7787}#sitemap li .col-language span.published{background-color:#65b417}#sitemap li .cont{overflow:visible !important}.col-language{position:relative}#sitemap .tree li .col-language .language-tooltip{display:none;position:absolute;right:20px;top:4px;z-index:9999;line-height:1;padding:4px 6px;font-size:11px;color:#ccc;background-color:black;background:rgba(0,0,0,0.8);border:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}#sitemap .tree li .col-language .language-tooltip a{color:#ddd}#sitemap .tree li .col-language .language-tooltip a:hover{color:white;text-decoration:none}#sitemap .tree li .col-language .language-tooltip:before{display:block;width:0;height:0;position:absolute;top:50%;right:-5px;margin-top:-4px;content:" ";border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:5px solid rgba(0,0,0,0.8)}#sitemap .tree li .col-language .language-tooltip.language-tooltip-multiple a:first-child:after{content:" - "}@-webkit-keyframes pulsate{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}
+ */#sitemap{padding:0;margin:0;margin:0;background:#fefefe}#sitemap a{text-decoration:none;outline:none;border:none}#sitemap a:hover{text-decoration:underline}#sitemap li,#sitemap ul{list-style-type:none}#sitemap li input.hidden{position:absolute;left:-9999em}#sitemap li a.icon,#sitemap li span.icon,#sitemap li a.move,#sitemap li a.copy,#sitemap li a.edit,#sitemap li a.advanced-settings,#sitemap li span.info{display:inline-block;width:18px;height:18px;margin-top:5px;background:url("../../img/pagetree/sprite.png") no-repeat 0 0}#sitemap li a.move{background-position:-20px -20px;margin-top:0}#sitemap li a.copy{background-position:-40px -60px;margin-top:0}#sitemap li a.edit{background-position:-40px -20px;margin-top:0}#sitemap li a.advanced-settings{background-position:-60px -60px;margin-top:0}#sitemap li span.info{background-position:-81px -20px;margin-top:-1px;cursor:pointer}#sitemap li a.selector-add{background-position:-20px 0;margin-left:4px;margin-top:-1px}#sitemap li a.addlink,#sitemap li a.deletelink{display:inline-block;width:10px;height:10px;padding:0;margin:0 0 0 4px;background-position:0 0}#sitemap li .col-softroot span.icon{background-position:-80px 0;margin-top:0}#sitemap li .col-apphook span.icon{background-position:-40px -80px;margin-top:0}#sitemap li a.move span,#sitemap li a.copy span,#sitemap li a.selector-add span,#sitemap li a.addlink span,#sitemap li a.deletelink span,#sitemap li a.edit span,#sitemap li a.advanced-settings span,#sitemap li span.info span,#sitemap .col-navigation input,#sitemap .col-published input{display:none}#sitemap ul.header{position:relative;top:1px}#sitemap ul.header,#sitemap ul.header li{padding:0;margin:0;border:none;background:none}#sitemap ul.header li{color:#666;font-size:11px;font-weight:400;height:16px;padding:5px 0 4px 5px;border-bottom:1px solid #dededc;background:#fefefe}#sitemap ul.header li .cont{height:15px;border:none !important;background:none !important}#sitemap ul.header li .col1{font-size:10px}#sitemap ul.header li .col2>div{font-size:10px;line-height:14px;border:none;background:none}#sitemap li .cont{display:block;border-top:1px solid #dededc !important}#sitemap li.open>.cont{border-bottom:1px solid #dededc !important}#sitemap li.open ul .cont{border-top:none !important;border-bottom:1px solid #dededc !important}#sitemap li.moveable>div{border-bottom:none !important}#sitemap li.last.leaf .cont,#sitemap li.last.closed .cont{border-bottom:none !important}#sitemap .tree-default .col-navigation,#sitemap .tree-default .col-published{line-height:30px}#sitemap li.open ul{margin-left:0;border-bottom:1px solid #dededc !important}#sitemap li.open.last ul{border-bottom:none !important}#sitemap li.open ul.last{border-bottom:none !important}#sitemap § li .col1>div{text-align:center}#sitemap li .col1 .title{background:none}#sitemap li .col1 .success{color:#666;padding-left:10px}#sitemap li .col1 a.changelink{display:none;line-height:27px;margin:6px 0 0 10px !important}#sitemap li .col1 .title,#sitemap li .col1 .success{float:left;line-height:29px;height:28px;padding-left:20px}#sitemap li .move-target-container{display:none;float:left;font-size:14px;line-height:27px;margin-right:10px}#sitemap li .move-target-container a:hover{text-decoration:none}#sitemap li .move-target{display:inline-block;padding:2px 8px;border-left:1px solid #ddd}#sitemap li .move-target:first-child{border-left:none}#sitemap li .col2>div{float:left;line-height:28px;white-space:nowrap;text-align:center;width:auto;height:28px;padding:0 5px;border-left:1px solid #ddd}#sitemap li .col2>div a,#sitemap li .col2>div span{vertical-align:middle}#sitemap li .cont:hover{background:#fafafa}#sitemap li.moveable .col1 .title{background:url("../../img/pagetree/tree-li-drag.gif") no-repeat 0 0}#sitemap li .col-language a{text-transform:uppercase}#sitemap .cont:hover .col1 a.changelink{display:block}#sitemap .cont-active{background:#ffc}#sitemap li#dragged{min-width:500px}#sitemap li#dragged .col2{display:none}#sitemap .info-details{display:none}#sitemap li .info:hover{position:relative}#sitemap li .info:hover .info-details{display:block}#sitemap .info-details{cursor:default;position:absolute;right:-6px;top:-6px;z-index:100;text-align:left;line-height:18px;padding:5px 10px;background:white;border:1px solid #ccc;-webkit-border-radius:3px 0 3px 3px;-moz-border-radius:3px 0 3px 3px;-ms-border-radius:3px 0 3px 3px;-o-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#sitemap .info-details mark{font-weight:bold;background:none;font-style:normal;display:-moz-inline-stack;display:inline-block;vertical-align:middle;*vertical-align:auto;zoom:1;*display:inline;min-width:100px}#sitemap .info-details span{display:inline !important}#changelist-filter-button{line-height:30px;display:block;position:absolute;right:0;top:0;z-index:1000;width:150px;height:auto;padding:0 0 0 10px;margin:0;border:1px solid #ddd;border-right:none;border-top:none;background:#fafafa}#changelist-filter{top:30px}#changelist-filter h2{display:none}.change-list .filtered{min-height:auto;background:white !important}#site-selector{float:left;margin:9px 18px 0 8px}#loader-message{position:fixed;top:0;right:0;padding:4px 8px;background:white;display:none}#sitemap{border:1px solid #dededc}#sitemap ul.header li .col2>div{padding:0 5.5px}#sitemap li .col-softroot span.icon{width:18px !important;height:18px !important;margin:0 !important;background:url("../../img/pagetree/sprite.png") -80px 0 no-repeat !important}#sitemap li .col-apphook span.icon{width:18px !important;height:18px !important;margin:0 !important;background:url("../../img/pagetree/sprite.png") -40px -80px no-repeat !important}#sitemap li .col-language span{width:14px !important;height:14px !important;margin:-3px 0 0 !important;display:-moz-inline-stack;display:inline-block;vertical-align:middle;*vertical-align:auto;zoom:1;*display:inline;-webkit-border-radius:7px;-moz-border-radius:7px;-ms-border-radius:7px;-o-border-radius:7px;border-radius:7px;color:transparent}#sitemap li .col-language span.dirty{background-color:#6ba6ff;-webkit-animation:pulsate 2.5s ease-out infinite;-moz-animation:pulsate 2.5s ease-out infinite;animation:pulsate 2.5s ease-out infinite}#sitemap li .col-language span.empty{background-color:#e8e9e5}#sitemap li .col-language span.unpublished{background-color:#ff2942}#sitemap li .col-language span.unpublishedparent{background-color:#ff7787}#sitemap li .col-language span.published{background-color:#65b417}#sitemap li .cont{overflow:visible !important}.col-language{position:relative}#sitemap .tree li .col-language .language-tooltip{display:none;position:absolute;right:20px;top:4px;z-index:9999;line-height:1;padding:4px 6px;font-size:11px;color:#ccc;background-color:black;background:rgba(0,0,0,0.8);border:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}#sitemap .tree li .col-language .language-tooltip a{color:#ddd}#sitemap .tree li .col-language .language-tooltip a:hover{color:white;text-decoration:none}#sitemap .tree li .col-language .language-tooltip:before{display:block;width:0;height:0;position:absolute;top:50%;right:-5px;margin-top:-4px;content:" ";border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:5px solid rgba(0,0,0,0.8)}#sitemap .tree li .col-language .language-tooltip.language-tooltip-multiple a:first-child:after{content:" - "}@-webkit-keyframes pulsate{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}
View
45 cms/static/cms/js/plugins/cms.sideframe.js
@@ -89,8 +89,10 @@ $(document).ready(function () {
open: function (url, animate) {
// prepare iframe
var that = this;
+ var language = 'language=' + CMS.config.request.language;
+ var page_id = 'page_id=' + CMS.config.request.page_id;
var holder = this.sideframe.find('.cms_sideframe-frame');
- var iframe = $('<iframe src="'+url+'" class="" frameborder="0" />');
+ var iframe = $('<iframe src="'+this._url(url, [language, page_id])+'" class="" frameborder="0" />');
iframe.hide();
var width = this.settings.sideframe.position || this.options.sideframeWidth;
@@ -294,6 +296,47 @@ $(document).ready(function () {
this.sideframe.find('.cms_sideframe-shim').css('z-index', 1);
$(document).unbind('mousemove.cms');
+ },
+
+ _url: function (url, params) {
+ // return url if there is no param
+ if(url.split('?').length <= 1 || window.JSON === undefined) return url;
+ // setup local vars
+ var urlArray = url.split('?');
+ var urlParams = urlArray[1].split('&');
+ var origin = urlArray[0];
+ var arr = [];
+ var keys = [];
+ var values = [];
+ var tmp = '';
+
+ // loop through the available params
+ $.each(urlParams, function (index, param) {
+ arr.push({ 'param': param.split('=')[0], 'value': param.split('=')[1] });
+ });
+ // loop through the new params
+ $.each(params, function (index, param) {
+ arr.push({ 'param': param.split('=')[0], 'value': param.split('=')[1] });
+ });
+
+ // merge manually because jquery...
+ $.each(arr, function (index, item) {
+ if(keys.indexOf(item.param) === -1) {
+ keys.push(item.param);
+ values.push(item.value);
+ } else {
+ values[keys.indexOf(item.param)] = item.value;
+ }
+ });
+
+ // merge new url
+ $.each(keys, function (index, key) {
+ tmp += '&' + key + '=' + values[index];
+ });
+ tmp = tmp.replace('&', '?');
+ url = origin + tmp;
+
+ return url;
}
});
View
3 cms/static/cms/sass/plugins/cms.pagetree.scss
@@ -103,6 +103,9 @@ $color-background-blue-hover: #e6f6fd;
// edit button
.cont:hover .col1 a.changelink { display:block; }
+ // active state
+ .cont-active { background:lighten(#ffff99, 10%); }
+
// drag modus
li#dragged { min-width:500px; }
li#dragged .col2 { display:none; }
View
24 cms/templates/admin/cms/page/tree/menu_item.html
@@ -1,9 +1,11 @@
{% load cms_admin i18n %}
-<div class="cont {{ css_class }}">
+<div class="cont {{ css_class }}{% if page.id|lower == request.GET.page_id|lower %} cont-active{% endif %}">
<div class="col1">
{% if has_change_permission %}
- <a href="{{ page.id }}/{{ lang }}/preview/" target="_parent" class="title" {% if cl.is_popup %}onclick="opener.dismissRelatedLookupPopup(window, {{ page.id }}); return false;" title="{% trans "select this page" %}"{% else %}title="{% trans "edit this page" %}"{% endif %}>{{ page.get_admin_tree_title }}</a>
+ {% language preview_language %}
+ <a href="{{ page.id }}/{{ preview_language }}/preview/" target="_parent" class="title" {% if cl.is_popup %}onclick="opener.dismissRelatedLookupPopup(window, {{ page.id }}); return false;" title="{% trans "select this page" %}"{% else %}title="{% trans "edit this page" %}"{% endif %}>{{ page.get_admin_tree_title }}</a>
+ {% endlanguage %}
{% else %}
<span class="title">{{ page.get_admin_tree_title }}</span>
{% endif %}
@@ -22,13 +24,13 @@
{% if page.soft_root or page.is_home %}<div class="col-softroot"><span class="icon softroot-icon" title="{% if page.soft_root %}{% trans 'softroot' %}{% else %}{% trans 'home' %}{% endif %}"></span></div>{% endif %}
{% if page.application_urls %}<div class="col-apphook"><a href="{{ page.id }}/advanced-settings/"><span class="icon apphook-icon" title="{% blocktrans with page.application_urls as apphook%}Application: {{ apphook }}{% endblocktrans %}"></span></a></div>{% endif %}
- {% for lang in site_languages %}
+ {% for lang in site_languages %}
<div class="col-language">
{% if has_change_permission %}
<a href="{% if lang in page.languages %}./{{ page.id }}/{{ lang }}/preview/{% else %}./{{ page.id }}/?language={{ lang }}{% endif %}" class="trigger-tooltip"{% if lang in page.languages %} target="_top"{% endif %} title="{% blocktrans with lang|upper as language %}Edit this page in {{ language }} {% endblocktrans %}">{% tree_publish_row page lang %}</a>
{% if lang in page.languages %}
<div class="language-tooltip" hidden="hidden">
- <a href="./{{ page.id }}/{{ lang }}/unpublish/">{% trans "Unpublish" %}</a>
+ <a href=".//{{ lang }}/unpublish/">{% trans "Unpublish" %}</a>
<a href="./{{ page.id }}/{{ lang }}/publish/">{% trans "Publish" %}</a>
</div>
{% endif %}
@@ -36,8 +38,8 @@
{% tree_publish_row page lang %}
{% endif %}
</div>
- {% endfor %}
- <div class="col-navigation">
+ {% endfor %}
+ <div class="col-navigation">
<label>
<img alt="{{ page.in_navigation|yesno:"True,False" }}" src="{% cms_admin_icon_base %}icon-{{ page.in_navigation|yesno:"yes,no" }}.gif" />
{% if has_change_permission %}<input type="checkbox" class="navigation-checkbox" name="navigation-{{ page.id }}" {% if page.in_navigation %}checked="checked"{% endif %} value="{{ page.in_navigation|yesno:"1,0" }}" />{% endif %}
@@ -46,9 +48,9 @@
<div class="col-actions">
{% if has_change_permission %}
- <a href="{{ url }}{{ page.id }}/" class="edit" title="{% trans "Page settings" %}"><span>{% trans "page settings" %}</span></a>
- <!--a href="{{ url }}{{ page.id }}/advanced-settings/" class="advanced-settings" title="{% trans "Advanced settings" %}"><span>{% trans "Advanced settings" %}</span></a-->
- <a href="#" class="copy" title="{% trans "Copy" %}" id="copy-link-{{ page.id }}"><span>{% trans "copy" %}</span></a>{% endif %}
+ <a href="{{ url }}{{ page.id }}/" class="edit" title="{% trans "Page settings" %}"><span>{% trans "page settings" %}</span></a>
+ <!--a href="{{ url }}{{ page.id }}/advanced-settings/" class="advanced-settings" title="{% trans "Advanced settings" %}"><span>{% trans "Advanced settings" %}</span></a-->
+ <a href="#" class="copy" title="{% trans "Copy" %}" id="copy-link-{{ page.id }}"><span>{% trans "copy" %}</span></a>{% endif %}
{% if has_add_page_permission and has_add_on_same_level_permission %}
<a href="#" class="addlink" title="{% trans "Add Child" %}" id="add-link-{{ page.id }}"><span>{% trans "add" %}</span></a>
@@ -58,7 +60,7 @@
<a href="./add/?target={{ page.id }}&amp;position=last-child" class="addlink" title="{% trans "Add Child" %}" id="add-link-{{ page.id }}"><span>{% trans "add" %}</span></a>
{% endif %}
{% endif %}
- {% if not filtered %}
+ {% if not filtered %}
{% if has_move_page_permission %}<a href="#" class="move" title="{% trans "Cut" %}" id="move-link-{{ page.id }}"><span>{% trans "cut" %}</span></a>{% endif %}
{% endif %}
{% if has_delete_permission %}<a href="{{ page.id }}/delete/" title="{% trans "Delete" %}" class="deletelink"><span>{% trans "delete" %}</span></a>{% endif %}
@@ -77,4 +79,4 @@
</span>
</div>
</div>
-</div>
+</div>
View
4 cms/templates/cms/toolbar/toolbar_javascript.html
@@ -30,6 +30,10 @@
'auth': {% if user.is_authenticated %}true{% else %}false{% endif %},
'debug': {% if debug %}true{% else %}false{% endif %},
'csrf': '{{ csrf_token }}',
+ 'request': {
+ 'language': '{{ request.GET.language }}',
+ 'page_id': '{{ request.current_page.pk }}'
+ },
'lang': {
'debug': '{% blocktrans %}Development version using django CMS {{ cms_version }}{% endblocktrans %}',
'cancel': '{% trans "Cancel" %}',
Something went wrong with that request. Please try again.