diff --git a/.gitignore b/.gitignore index 4240324240a..7ae80232257 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ !.travis.yml *.swp *.lock +*.log *.pid cms/django *.DS_Store diff --git a/cms/test_utils/cli.py b/cms/test_utils/cli.py index 446dd673359..bbfe41ec9ce 100644 --- a/cms/test_utils/cli.py +++ b/cms/test_utils/cli.py @@ -177,6 +177,7 @@ def configure(db_url, **extra): ('col_two.html', gettext('two columns')), ('col_three.html', gettext('three columns')), ('nav_playground.html', gettext('navigation examples')), + ('simple.html', 'simple'), ), CMS_PLACEHOLDER_CONF={ 'col_sidebar': { diff --git a/cms/test_utils/project/templates/simple.html b/cms/test_utils/project/templates/simple.html new file mode 100644 index 00000000000..d38708759bd --- /dev/null +++ b/cms/test_utils/project/templates/simple.html @@ -0,0 +1,5 @@ +{% load cms_tags sekizai_tags %} +{% render_block "css" %} +{% cms_toolbar %} +{% placeholder "placeholder" %} +{% render_block "js" %} diff --git a/cms/tests/__init__.py b/cms/tests/__init__.py index aa94d6e57c0..6e799bbe570 100644 --- a/cms/tests/__init__.py +++ b/cms/tests/__init__.py @@ -36,4 +36,5 @@ from cms.tests.menu_page_viewperm_staff import * from cms.tests.nested_plugins import * from cms.tests.check import * -from cms.tests.no_i18n import * \ No newline at end of file +from cms.tests.frontend import * +from cms.tests.no_i18n import * diff --git a/cms/tests/frontend.py b/cms/tests/frontend.py new file mode 100644 index 00000000000..81da4b3aa05 --- /dev/null +++ b/cms/tests/frontend.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from cms.api import create_page +from django.contrib.auth.models import User +from django.utils.unittest.case import SkipTest, skipIf + +try: + from selenium.webdriver.firefox.webdriver import WebDriver + from selenium.common.exceptions import NoSuchElementException + from django.test import LiveServerTestCase +except ImportError: + from django.test import TestCase as LiveServerTestCase + WebDriver = NoSuchElementException = False + + +class CMSLiveTests(LiveServerTestCase): + @classmethod + def setUpClass(cls): + if WebDriver: + cls.selenium = WebDriver() + super(CMSLiveTests, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + if hasattr(cls, 'selenium'): + cls.selenium.quit() + super(CMSLiveTests, cls).tearDownClass() + + + +class ToolbarBasicTests(CMSLiveTests): + @skipIf(not WebDriver, 'Selenium not found or Django too old') + def test_toolbar_login(self): + create_page('Home', 'simple.html', 'en', published=True).publish() + user = User() + user.username = 'admin' + user.set_password('admin') + user.is_superuser = user.is_staff = user.is_active = True + user.save() + url = '%s/?edit' % self.live_server_url + self.selenium.get(url) + self.assertRaises(NoSuchElementException, self.selenium.find_element_by_class_name, 'cms_toolbar-item_logout') + self.selenium.find_element_by_class_name('cms_toolbar_icon-toggle').click() + username_input = self.selenium.find_element_by_id("cms_toolbar-item_login-username") + username_input.send_keys('admin') + password_input = self.selenium.find_element_by_id("cms_toolbar-item_login-password") + password_input.send_keys('admin') + password_input.submit() + self.assertTrue(self.selenium.find_element_by_class_name('cms_toolbar-item_logout')) diff --git a/docs/getting_started/installation.rst b/docs/getting_started/installation.rst index 56ccdd7ff20..78143c6e208 100644 --- a/docs/getting_started/installation.rst +++ b/docs/getting_started/installation.rst @@ -38,8 +38,18 @@ Requirements Recommended =========== -* `django-filer`_ with its `django CMS plugins`_, file and image management - application to use instead of some core plugins +These packages are not *required*, but they provide useful functionality with +minimal additional configuration and are well-proven. + +File and image handling +----------------------- + +* `Django Filer`_ for file and image management +* `django CMS plugins`_, which provides plugins for use with Django Filer + +Revision management +------------------- + * `django-reversion`_ 1.6.6 (with Django 1.4.5), 1.7 (with Django 1.5) to support versions of your content (If using a different Django version it is a good idea to check the page `Compatible-Django-Versions`_ in the @@ -48,10 +58,12 @@ Recommended .. note:: - Since django CMS 2.4 we only save the latest 25 publish revisions anymore. - You can change this behavior with :setting:`CMS_MAX_PAGE_PUBLISH_REVERSIONS`. + As of django CMS 2.4, only the most recent 25 published revisions are + saved. You can change this behaviour if required with + :setting:`CMS_MAX_PAGE_PUBLISH_REVERSIONS`. Be aware that saved revisions + will cause your database size to increase. -.. _django-filer: https://github.com/stefanfoulis/django-filer +.. _Django Filer: https://github.com/stefanfoulis/django-filer .. _django CMS plugins: https://github.com/stefanfoulis/cmsplugin-filer .. _django-reversion: https://github.com/etianen/django-reversion .. _Compatible-Django-Versions: https://github.com/etianen/django-reversion/wiki/Compatible-Django-Versions @@ -101,15 +113,15 @@ On Mac OSX On Microsoft Windows ==================== -**TODO**. +**TODO** ********* Databases ********* We recommend using `PostgreSQL`_ or `MySQL`_ with django CMS. Installing and -maintaining database systems is outside the scope of this documentation, but is -very well documented on the systems' respective websites. +maintaining database systems is outside the scope of this documentation, but +is very well documented on the systems' respective websites. To use django CMS efficiently, we recommend: diff --git a/docs/upgrade/2.4.rst b/docs/upgrade/2.4.rst index 34602255bfc..ca1f2e8617a 100644 --- a/docs/upgrade/2.4.rst +++ b/docs/upgrade/2.4.rst @@ -31,11 +31,11 @@ Django 1.4 and Python 2.6 are now the minimum required versions. Migrations overhaul =================== -In version 2.4, migrations have been completely rewritten to address issues with -newer South releases. +In version 2.4, migrations have been completely rewritten to address issues +with newer South releases. -To ease the upgrading process, all the migrations for the `cms` application have -been consolidated into a single migration file, `0001_initial.py`. +To ease the upgrading process, all the migrations for the `cms` application +have been consolidated into a single migration file, `0001_initial.py`. * migration 0001 is a *real* migration, that gets you to the same point migrations 0001-0036 used to * the migrations 0002 to 0036 inclusive still exist, but are now all *dummy* @@ -113,8 +113,8 @@ can publish changes to the public site. this topic. -Added Fix MPTTT Management command -================================== +Added Fix MPTT Management command +================================= Added a management command for fixing MPTT tree data. @@ -126,8 +126,9 @@ The command can be run with:: Removed the MultilingualMiddleware ================================== -We removed the MultilingualMiddleware. This removed the very ugly monkey patching of the -reverse() function as well. As a benefit we now support localization of urls and Apphook urls with standard django helpers. +We removed the MultilingualMiddleware. This removed rather some unattractive +monkey-patching of the ``reverse()`` function as well. As a benefit we now +support localization of urls and Apphook urls with standard Django helpers. For django 1.4 more infos can be found here: diff --git a/docs/upgrade/3.0.rst b/docs/upgrade/3.0.rst index baf18411e3b..eff645899ac 100644 --- a/docs/upgrade/3.0.rst +++ b/docs/upgrade/3.0.rst @@ -15,23 +15,32 @@ What's new in 3.0 from a previous version. - New Frontend Editing ==================== -Django CMS 3.0 introduces a new Frontend Editing. We now have a edit and build mode. In edit mode you can only edit -plugins and in build mode you can rearrange and add plugins. +django CMS 3.0 introduces a new Frontend Editing system. + +In the new system, Placeholders and their Plugins are no longer managed in the +Admin site, but only from the Frontend. + +In addition, the system now offer two editing views: + +* **content** view, for editing the configuration and content of plugins +* **structure** view, in which plugins can be added and rearranged New Toolbar =========== -The Toolbar code has been simplified and the appearance refreshed. Toolbar now allows for adding and changing entries. -The toolbar has now a built in language chooser for languages that are not public yet. A user settings module has been -introduced to save the language of the staff user so the toolbar and admin interface stays the same even when he -switches languages. +The Toolbar's code has been simplified and its appearance refreshed. + +The Toolbar is now a more consistent management tool for adding and changing +objects in a django CMS-based system. + +Creating Toolbar items for your own application +----------------------------------------------- -To add a toolbar for you app create a `cms_toolbar.py` in your app. +You'll need to create a `cms_toolbar.py` in your app. Example:: @@ -57,7 +66,7 @@ Example:: You extend CMSToolbar and register it with the toolbar_pool. -In the `insert_items()` function you recieve some parameters: +In the `insert_items()` function you receive some parameters: - items @@ -87,47 +96,74 @@ Example:: Item(reverse('admin:sampleapp_category_change', args=[cat.pk]), "Change Category")) return render_to_response('sampleapp/category_view.html', RequestContext(request, {'category': cat})) + + +Better multilingual editing +=========================== + +Improvements in the environment django CMS provides for managing a multi-lingual site include: + +* a built-in language chooser for languages that are not public yet +* configurable behaviour of the Admin site's language when switching between + languages of edited content CMS_SEO_FIELDS ============== -Was removed. ``meta_description`` fields max_length was changed to 155 for optimal Google integration. -``page_title`` is default on top. SEO fieldset in admin removed. ``meta_keywords`` field removed as not relevant -anymore. +**Removed**, along with the SEO fieldset in admin. + +* ``meta_description`` field's max_length is now 155 for optimal Google integration. +* ``page_title`` is default on top +* ``meta_keywords`` field has been removed, as it no longer serves any purpose + CMS_MENU_TITLE_OVERWRITE ======================== -New default is True. +New default is ``True``. + language_chooser ================ -The ``language_chooser`` templatetag now only displays languages that are public. Use the toolbar language chooser -to change the language to non public languages. +The ``language_chooser`` templatetag now only displays languages that are +public. Use the toolbar language chooser to change the language to non-public +languages. + Undo and Redo ============= -If you have django-reversion installed you now have undo and redo directly in the toolbar. +If you have ``django-reversion`` installed you now have **undo** and **redo** +options available directly in the toolbar. These can now revert *plugin* +content as well as *page* content. show_editable_page_title ======================== New ``show_editable_page_title`` to edit page title from the frontend. + Plugins removed =============== -We removed plugins from the core. Espacilly cms.plugins.text -Find the new official CKEditor based Text Plugin at djangocms-text-ckeditor. +We have removed plugins from the core. This is not because you are not +expected to use them, but because django CMS should not impose unnecessary +choices about what to install upon its adopters. + +The most significant of these removals is ``cms.plugins.text``. + +We provide ``djangocms-text-ckeditor``, a CKEditor-based Text Plugin. It's +available from https://github.com/djangocms-text-ckeditor. You may of course +use your preferred editor; others are available. + -Plugin Context Processors take an extra argument -================================================ +Plugin Context Processors take a new argument +============================================= -:ref:`plugin-context-processors` have had an argument added so that the rest of -the context is available to them. So if you have existing Plugin Context +:ref:`plugin-context-processors` have had an argument added so that the rest +of the context is available to them. So if you have existing Plugin Context Processors you will need to change their function signature to add the extra argument. diff --git a/test_requirements/selenium-1.4.txt b/test_requirements/selenium-1.4.txt new file mode 100644 index 00000000000..c775b28a48d --- /dev/null +++ b/test_requirements/selenium-1.4.txt @@ -0,0 +1,2 @@ +-r django-1.4.txt +selenium