general: redirection page (#6199)
This commit is contained in:
parent
8e86134677
commit
a3c371f76a
|
@ -41,6 +41,7 @@ class Page(models.Model):
|
|||
parent = models.ForeignKey('self', null=True, blank=True)
|
||||
order = models.PositiveIntegerField()
|
||||
exclude_from_navigation = models.BooleanField(_('Exclude from navigation'), default=False)
|
||||
redirect_url = models.CharField(_('Redirect URL'), max_length=100, blank=True)
|
||||
|
||||
public = models.BooleanField(_('Public'), default=True)
|
||||
groups = models.ManyToManyField(Group, blank=True)
|
||||
|
|
|
@ -7,7 +7,7 @@ div#sidebar {
|
|||
float: left;
|
||||
}
|
||||
|
||||
div#placeholders {
|
||||
div#page-content {
|
||||
padding-left: 17em;
|
||||
min-height: 5em;
|
||||
}
|
||||
|
@ -150,3 +150,11 @@ div#pages-list > div.level-1 {
|
|||
div#pages-list > div.level-2 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
p#redirection {
|
||||
display: block;
|
||||
background: #fafafa;
|
||||
padding: 3ex 1ex;
|
||||
box-shadow: rgba(0, 0, 0, 0.04) 0px 1px 1px 0px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,16 @@
|
|||
|
||||
</div> <!-- #sidebar -->
|
||||
|
||||
<div id="page-content">
|
||||
{% if object.redirect_url %}
|
||||
<div>
|
||||
<h2>Redirection</h2>
|
||||
<p id="redirection">
|
||||
This page redirects to: <a href="{{ object.redirect_url }}">{{ object.redirect_url }}</a>.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="placeholders"
|
||||
data-cell-order-url="{% url 'combo-manager-cell-order' page_pk=object.id %}"
|
||||
>
|
||||
|
@ -72,4 +82,6 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -44,6 +44,9 @@ def page(request):
|
|||
if not page.is_visible(request.user):
|
||||
raise PermissionDenied()
|
||||
|
||||
if page.redirect_url:
|
||||
return HttpResponseRedirect(page.redirect_url)
|
||||
|
||||
combo_template = settings.COMBO_PUBLIC_TEMPLATES[page.template_name]
|
||||
|
||||
cells = CellBase.get_cells(page_id=page.id)
|
||||
|
|
Loading…
Reference in New Issue