Merge branch 'master' into kaedroho-project-template

This commit is contained in:
Matt Westcott 2014-09-11 10:18:56 +01:00
commit 446fd81a46
15 changed files with 49 additions and 20 deletions

View file

@ -4,15 +4,17 @@ Changelog
0.6 (xx.xx.20xx)
~~~~~~~~~~~~~~~~
* Added Django 1.7 support
* Added {% routablepageurl %} template tag (@timheap)
* Added RoutablePageMixin (@timheap)
* Added {% routablepageurl %} template tag (Tim Heap)
* Added RoutablePageMixin (Tim Heap)
* MenuItems can now have bundled JavaScript
* Added a new hook for registering admin menu items
* Added the register_admin_menu_item hook for registering menu items at startup
* Added version indicator to the admin interface
* Renamed wagtailsearch.indexed to wagtailsearch.index
* Fix: Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/'
* Fix: Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/' (Nathan Brizendine)
* Fix: Search results in the page chooser now respect the page_type parameter on PageChooserPanel
* Fix: Rendition filenames are now prevented from going over 60 chars, even with a large focal_point_key
* Fix: Child relations that are defined on a model's superclass (such as the base Page model) are now picked up correctly by the page editing form, page copy operations and the replace_text management command
* Fix: (For Django 1.7 support) Do not import South when using Django 1.7 (thenewguy)
0.5 (01.08.2014)
~~~~~~~~~~~~~~~~

View file

@ -31,6 +31,7 @@ Contributors
* Robert Clark
* Tim Heap
* Nathan Brizendine
* thenewguy
Translators
===========

View file

@ -29,6 +29,9 @@ if not on_rtd: # only import and set the theme if we're building docs locally
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
# Get Wagtail version
from wagtail.wagtailcore import __version__
# Autodoc may need to import some models modules which require django settings
# be configured
os.environ['DJANGO_SETTINGS_MODULE'] = 'wagtail.tests.settings'
@ -70,9 +73,9 @@ copyright = u'2014, Torchbox'
# built documents.
#
# The short X.Y version.
version = '0.5'
version = __version__
# The full version, including alpha/beta/rc tags.
release = '0.5'
release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -104,6 +104,8 @@ In addition to the model fields provided, ``Page`` has many properties and metho
.. autoattribute:: url
.. autoattribute:: full_url
.. automethod:: get_verbose_name
.. automethod:: relative_url

View file

@ -1,7 +1,7 @@
.. _editing-api:
Displaying fields with the Editing API
====================================
======================================
.. note::
This documentation is currently being written.
@ -388,6 +388,8 @@ For information on developing custom hallo.js plugins, see the project's page: h
Edit Handler API
~~~~~~~~~~~~~~~~
.. _admin_hooks:
Admin Hooks
-----------

View file

@ -21,7 +21,8 @@ Minor features
* A new template tag has been added for reversing URLs inside routable pages. See :ref:`routablepageurl_template_tag`.
* RoutablePage can now be used as a mixin. See :class:`wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin`.
* MenuItems can now have bundled JavaScript
* Added a new hook for registering admin menu items. See :ref:`register_admin_menu_item`
* Added the ``register_admin_menu_item`` hook for registering menu items at startup. See :ref:`admin_hooks`
* Added a version indicator into the admin interface (hover over the wagtail to see it)
Bug fixes
@ -46,4 +47,4 @@ Deprecated features
===================
* The ``wagtail.wagtailsearch.indexed`` module has been renamed to ``wagtail.wagtailsearch.index``

View file

@ -2,6 +2,8 @@
import sys, os
from wagtail.wagtailcore import __version__
try:
from setuptools import setup, find_packages
@ -50,7 +52,7 @@ if not PY3:
setup(
name='wagtail',
version='0.5',
version=__version__,
description='A Django content management system focused on flexibility and user experience',
author='Matthew Westcott',
author_email='matthew.westcott@torchbox.com',

View file

@ -4,7 +4,3 @@ class RemovedInWagtail07Warning(DeprecationWarning):
class RemovedInWagtail08Warning(PendingDeprecationWarning):
pass
class RemovedInWagtail08Warning(PendingDeprecationWarning):
pass

View file

@ -1,10 +1,10 @@
{% extends "wagtailadmin/admin_base.html" %}
{% load wagtailadmin_tags %}
{% load wagtailadmin_tags wagtailcore_tags %}
{% load i18n %}
{% block furniture %}
<div class="nav-wrapper">
<div class="inner">
<a href="{% url 'wagtailadmin_home' %}" class="logo"><img src="{{ STATIC_URL }}wagtailadmin/images/wagtail-logo.svg" alt="Wagtail" width="80" /><span>{% trans "Dashboard" %}</span></a>
<a href="{% url 'wagtailadmin_home' %}" class="logo" title="Wagtail v.{% wagtail_version %}"><img src="{{ STATIC_URL }}wagtailadmin/images/wagtail-logo.svg" alt="Wagtail" width="80" /><span>{% trans "Dashboard" %}</span></a>
{% main_nav %}
</div>

View file

@ -18,7 +18,7 @@
<div class="avatar icon icon-user"><img src="{% gravatar_url user.email %}" /></div>
</div>
{% endif %}
<div class="col10">
<div class="col9">
<h1>{% blocktrans %}Welcome to the {{ site_name }} Wagtail CMS{% endblocktrans %}</h1>
<h2>{{ user.get_full_name|default:user.username }}</h2>
</div>

View file

@ -1 +1,2 @@
__version__ = '0.5'
default_app_config = 'wagtail.wagtailcore.apps.WagtailCoreAppConfig'

View file

@ -1,6 +1,10 @@
import django
from django.db import models
from django.forms import Textarea
from south.modelsinspector import add_introspection_rules
if django.VERSION < (1, 7):
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^wagtail\.wagtailcore\.fields\.RichTextField"])
from wagtail.wagtailcore.rich_text import DbWhitelister, expand_db_html
@ -29,5 +33,3 @@ class RichTextField(models.TextField):
defaults = {'widget': RichTextArea}
defaults.update(kwargs)
return super(RichTextField, self).formfield(**defaults)
add_introspection_rules([], ["^wagtail\.wagtailcore\.fields\.RichTextField"])

View file

@ -553,6 +553,9 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
@classmethod
def get_verbose_name(cls):
"""
Returns the human-readable "verbose name" of this page model e.g "Blog page".
"""
# This is similar to doing cls._meta.verbose_name.title()
# except this doesn't convert any characters to lowercase
return ' '.join([word[0].upper() + word[1:] for word in cls._meta.verbose_name.split()])

View file

@ -3,6 +3,7 @@ from django.utils.safestring import mark_safe
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.rich_text import expand_db_html
from wagtail.wagtailcore import __version__
register = template.Library()
@ -27,6 +28,11 @@ def slugurl(context, slug):
return None
@register.simple_tag
def wagtail_version():
return __version__
@register.filter
def richtext(value):
return mark_safe('<div class="rich-text">' + expand_db_html(value) + '</div>')

View file

@ -123,6 +123,14 @@ class TestRouting(TestCase):
self.assertEqual(christmas_page.url, '/events/christmas/')
self.assertEqual(christmas_page.relative_url(default_site), '/events/christmas/')
def test_page_with_no_url(self):
root = Page.objects.get(url_path='/')
default_site = Site.objects.get(is_default_site=True)
self.assertEqual(root.full_url, None)
self.assertEqual(root.url, None)
self.assertEqual(root.relative_url(default_site), None)
def test_urls_with_multiple_sites(self):
events_page = Page.objects.get(url_path='/home/events/')
events_site = Site.objects.create(hostname='events.example.com', root_page=events_page)