Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a page settings button instead of publish if there is no title #2743

Merged
merged 1 commit into from
Feb 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions cms/cms_toolbar.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from cms.api import get_page_draft
from cms.constants import TEMPLATE_INHERITANCE_MAGIC
from cms.constants import TEMPLATE_INHERITANCE_MAGIC, RIGHT
from cms.exceptions import LanguageError
from cms.models import Title
from cms.toolbar.items import TemplateItem
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -330,6 +330,14 @@ def add_page_menu(self):
current_page_menu.add_modal_item(_('Delete page'), url=delete_url, close_on_url=self.toolbar.URL_CHANGE,
on_close=on_delete_redirect_url, disabled=not_edit_mode)

if not self.title:
self.toolbar.add_button(
_("Page settings"),
"%s?language=%s" % (reverse('admin:cms_page_change', args=[self.page.pk]), self.toolbar.language),
side=self.toolbar.RIGHT,
extra_classes=["cms_btn-action"],
)

def add_history_menu(self):
# history menu
history_menu = self.toolbar.get_or_create_menu('history', _('History'), position=2)
Expand Down