Skip to content

Commit

Permalink
Merge branch 'master' into feature/fep
Browse files Browse the repository at this point in the history
Conflicts:
	wagtail/tests/fixtures/test.json
	wagtail/tests/wagtail_hooks.py
	wagtail/wagtailadmin/static/wagtailadmin/scss/components/header.scss
	wagtail/wagtailadmin/templates/wagtailadmin/shared/breadcrumb.html
	wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py
	wagtail/wagtailadmin/views/pages.py
	wagtail/wagtailcore/models.py
  • Loading branch information
gasman committed Jul 2, 2014
2 parents af8b6cd + f3a70c9 commit 1f56824
Show file tree
Hide file tree
Showing 255 changed files with 9,729 additions and 4,699 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -12,7 +12,7 @@ services:
# Package installation
install:
- python setup.py install
- pip install psycopg2 pyelasticsearch elasticutils==0.8.2 wand
- pip install psycopg2 elasticsearch wand embedly
- pip install coveralls
# Pre-test configuration
before_script:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -3,14 +3,28 @@ Changelog

0.4 (xx.xx.20xx)
~~~~~~~~~~~~~~~~
* ElasticUtils/pyelasticsearch swapped for elasticsearch-py
* Added notification preferences
* Added 'original' as a resizing rule supported by the 'image' tag
* Hallo.js updated to version 1.0.4
* Snippets are now ordered alphabetically
* Removed the "More" section from the admin menu
* Added pagination to page listings in admin
* Support for setting a subpage_types property on page models, to define which page types are allowed as subpages
* Added a new datetime picker widget
* Added styleguide (mainly for wagtail developers)
* Aesthetic improvements to preview experience
* 'image' tag now accepts extra keyword arguments to be output as attributes on the img tag
* Added an 'attrs' property to image rendition objects to output src, width, height and alt attributes all in one go
* Added 'construct_whitelister_element_rules' hook for customising the HTML whitelist used when saving rich text fields
* Added 'in_menu' and 'not_in_menu' methods to PageQuerySet
* Added 'get_next_siblings' and 'get_prev_siblings' to Page
* Added init_new_page signal
* Fix: Animated GIFs are now coalesced before resizing
* Fix: Wand backend clones images before modifying them
* Fix: Admin breadcrumb now positioned correctly on mobile
* Fix: Page chooser breadcrumb now updates the chooser modal instead of linking to Explorer
* Fix: Embeds - Fixed crash when no HTML field is sent back from the embed provider

0.3.1 (03.06.2014)
~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTORS.rst
@@ -1,8 +1,8 @@
Original Authors
================

* Matthew Westcott matthew.westcott@torchbox.com
* David Cranwell david.cranwell@torchbox.com
* Matthew Westcott matthew.westcott@torchbox.com twitter: @gasmanic
* David Cranwell david.cranwell@torchbox.com twitter: @davecranwell
* Karl Hobley karl.hobley@torchbox.com
* Helen Chapman helen.chapman@torchbox.com

Expand All @@ -28,6 +28,8 @@ Contributors
* Ben Margolis
* Tom Talbot
* Jeffrey Hearn
* Robert Clark
* Tim Heap

Translators
===========
Expand Down
2 changes: 1 addition & 1 deletion README.rst
@@ -1,7 +1,7 @@
.. image:: https://travis-ci.org/torchbox/wagtail.png?branch=master
:target: https://travis-ci.org/torchbox/wagtail

.. image:: https://coveralls.io/repos/torchbox/wagtail/badge.png?branch=master&zxcv
.. image:: https://coveralls.io/repos/torchbox/wagtail/badge.png?branch=master&zxcv1
:target: https://coveralls.io/r/torchbox/wagtail?branch=master

.. image:: https://pypip.in/v/wagtail/badge.png?zxcv
Expand Down
18 changes: 17 additions & 1 deletion docs/building_your_site/djangodevelopers.rst
@@ -1,9 +1,15 @@
For Django developers
=====================

.. contents:: Contents
:local:

.. note::
This documentation is currently being written.

Overview
~~~~~~~~

Wagtail requires a little careful setup to define the types of content that you want to present through your website. The basic unit of content in Wagtail is the ``Page``, and all of your page-level content will inherit basic webpage-related properties from it. But for the most part, you will be defining content yourself, through the construction of Django models using Wagtail's ``Page`` as a base.

Wagtail organizes content created from your models in a tree, which can have any structure and combination of model objects in it. Wagtail doesn't prescribe ways to organize and interrelate your content, but here we've sketched out some strategies for organizing your models.
Expand Down Expand Up @@ -204,7 +210,6 @@ Methods:
* get_context
* get_template
* is_navigable
* get_other_siblings
* get_ancestors
* get_descendants
* get_siblings
Expand Down Expand Up @@ -269,6 +274,7 @@ not_type(self, model):
return self.get_query_set().not_type(model)


.. _wagtail_site_admin:

Site
~~~~
Expand All @@ -278,3 +284,13 @@ Django's built-in admin interface provides the way to map a "site" (hostname or
Access this by going to ``/django-admin/`` and then "Home › Wagtailcore › Sites." To try out a development site, add a single site with the hostname ``localhost`` at port ``8000`` and map it to one of the pieces of content you have created.

Wagtail's developers plan to move the site settings into the Wagtail admin interface.


.. _redirects:

Redirects
~~~~~~~~~

Wagtail provides a simple interface for creating arbitrary redirects to and from any URL.

.. image:: ../images/screen_wagtail_redirects.png
52 changes: 43 additions & 9 deletions docs/building_your_site/frontenddevelopers.rst
@@ -1,7 +1,8 @@
For Front End developers
========================

.. contents::
.. contents:: Contents
:local:

========================
Overview
Expand Down Expand Up @@ -90,6 +91,9 @@ In addition to Django's standard tags and filters, Wagtail provides some of its
Images (tag)
~~~~~~~~~~~~

.. versionchanged:: 0.4
The 'image_tags' tags library was renamed to 'wagtailimages_tags'

The ``image`` tag inserts an XHTML-compatible ``img`` element into the page, setting its ``src``, ``width``, ``height`` and ``alt``. See also :ref:`image_tag_alt`.

The syntax for the tag is thus::
Expand All @@ -100,7 +104,7 @@ For example:

.. code-block:: django
{% load image %}
{% load wagtailimages_tags %}
...
{% image self.photo width-400 %}
Expand Down Expand Up @@ -186,30 +190,57 @@ The available resizing methods are:
More control over the ``img`` tag
---------------------------------

In some cases greater control over the ``img`` tag is required, for example to add a custom ``class``. Rather than generating the ``img`` element for you, Wagtail can assign the relevant data to another object using Django's ``as`` syntax:
Wagtail provides two shorcuts to give greater control over the ``img`` element:

.. versionadded:: 0.4
**Adding attributes to the {% image %} tag**

Extra attributes can be specified with the syntax ``attribute="value"``:

.. code-block:: django
{% load image %}
...
{% image self.photo width-400 class="foo" id="bar" %}
No validation is performed on attributes add in this way by the developer. It's possible to add `src`, `width`, `height` and `alt` of your own that might conflict with those generated by the tag itself.


**Generating the image "as"**

Wagtail can assign the image data to another object using Django's ``as`` syntax:

.. code-block:: django
{% image self.photo width-400 as tmp_photo %}
<img src="{{ tmp_photo.src }}" width="{{ tmp_photo.width }}"
height="{{ tmp_photo.height }}" alt="{{ tmp_photo.alt }}" class="my-custom-class" />
.. versionadded:: 0.4
The ``attrs`` shortcut
-----------------------

You can also use the ``attrs`` property as a shorthand to output the ``src``, ``width``, ``height`` and ``alt`` attributes in one go:

.. code-block:: django
<img {{ tmp_photo.attrs }} class="my-custom-class" />
.. _rich-text-filter:

Rich text (filter)
~~~~~~~~~~~~~~~~~~

.. versionchanged:: 0.4
The 'rich_text' tags library was renamed to 'wagtailcore_tags'

This filter takes a chunk of HTML content and renders it as safe HTML in the page. Importantly it also expands internal shorthand references to embedded images and links made in the Wagtail editor into fully-baked HTML ready for display.

Only fields using ``RichTextField`` need this applied in the template.

.. code-block:: django
{% load rich_text %}
{% load wagtailcore_tags %}
...
{{ self.body|richtext }}
Expand Down Expand Up @@ -245,14 +276,17 @@ Wagtail embeds and images are included at their full width, which may overflow t
Internal links (tag)
~~~~~~~~~~~~~~~~~~~~

.. versionchanged:: 0.4
The 'pageurl' tags library was renamed to 'wagtailcore_tags'

pageurl
--------

Takes a Page object and returns a relative URL (``/foo/bar/``) if within the same site as the current page, or absolute (``http://example.com/foo/bar/``) if not.

.. code-block:: django
{% load pageurl %}
{% load wagtailcore_tags %}
...
<a href="{% pageurl self.blog_page %}">
Expand All @@ -263,7 +297,7 @@ Takes any ``slug`` as defined in a page's "Promote" tab and returns the URL for

.. code-block:: django
{% load slugurl %}
{% load wagtailcore_tags %}
...
<a href="{% slugurl self.your_slug %}">
Expand Down
20 changes: 20 additions & 0 deletions docs/contributing.rst
Expand Up @@ -17,6 +17,26 @@ Coding guidelines
* PEP8. We ask that all Python contributions adhere to the `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ style guide, apart from the restriction on line length (E501). The `pep8 tool <http://pep8.readthedocs.org/en/latest/>`_ makes it easy to check your code, e.g. ``pep8 --ignore=E501 your_file.py``.
* Tests. Wagtail has a suite of tests, which we are committed to improving and expanding. We run continuous integration at `travis-ci.org/torchbox/wagtail <https://travis-ci.org/torchbox/wagtail>`_ to ensure that no commits or pull requests introduce test failures. If your contributions add functionality to Wagtail, please include the additional tests to cover it; if your contributions alter existing functionality, please update the relevant tests accordingly.

Styleguide
~~~~~~~~~~

Developers working on the Wagtail UI or creating new UI components may wish to test their work against our Styleguide, which is provided as the contrib module "wagtailstyleguide".

To install the styleguide module on your site, add it to the list of ``INSTALLED_APPS`` in your settings:

.. code-block:: python
INSTALLED_APPS = (
...
'wagtail.contrib.wagtailstyleguide',
...
)
At present the styleguide is static: new UI components must be added to it manually, and there are no hooks into it for other modules to use. We hope to support hooks in the future.

The styleguide doesn't currently provide examples of all the core interface components; notably the Page, Document, Image and Snippet chooser interfaces are not currently represented.


Translations
~~~~~~~~~~~~

Expand Down

0 comments on commit 1f56824

Please sign in to comment.