stephenmcd/mezzanine — pull request #724 by acatton (2013-07-09 00:47:43+00:00)
Title: Expose is_current_parent in menu template

This property allow template to know whether or not the page we're looping over is the parent of the current page.

My case is the following:

* If the current page is at the top level, I display:

```
Title: Current page
list of sub pages
```

* If the current page is not at the top level, I display:

```
Title: Parent page
list of sub pages
```

Also, I'm doing some page preview, and the slug is not in the URL. So `page.is_current` doesn't work. Why not use the pk instead? It doesn't break any test.

Here's how I'm using `page.is_current_parent`:
```html
{% load pages_tags %}

{% if page_branch_in_menu %}
{% for page in page_branch %}
{% if page.is_primary and page.is_current %}

{{ page.title }}

{% page_menu page %}

{% elif page.is_current_or_ascendant and not page.is_current %}
{% if page.is_current_parent %}

{{ page.title }}

{% endif %}
{% page_menu page %}
{% if page.is_current_parent %}

{% endif %}
{% elif not page.is_primary %}
{% if page.is_current or page.is_current_sibling or page.is_current_child %}
{{ page.title }}

{% endif %}
{% endif %}
{% endfor %}
{% endif %}
```