manager: add link to go to the public view

This commit is contained in:
Frédéric Péters 2014-12-13 13:30:04 +01:00
parent ac0fba548e
commit ee27b040c6
3 changed files with 19 additions and 0 deletions

View File

@ -39,6 +39,14 @@ class Page(models.Model):
def __unicode__(self):
return self.title
def get_online_url(self):
parts = [self.slug]
page = self
while page.parent_id:
page = page.parent
parts.append(page.slug)
return '/' + '/'.join(reversed(parts))
class CellBase(models.Model):
page = models.ForeignKey(Page)

View File

@ -129,3 +129,9 @@ li.cell-type input:checked ~ ul {
display: block;
height: auto;
}
.view-online {
margin-left: 2em;
}
.icon-eye-open:before { content: "\f06e "; }

View File

@ -7,6 +7,11 @@
<a rel="popup" href="{% url 'combo-manager-page-edit' pk=object.id %}">edit</a>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a href="{{ object.get_online_url }}" class="view-online icon-eye-open">Voir en ligne</a>
{% endblock %}
{% block content %}
<div id="meta">