redirects, optional content
This commit is contained in:
parent
8f1c7435ec
commit
81973ba496
|
@ -14,8 +14,11 @@ Including another URLconf
|
||||||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from content import views
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.views.generic import RedirectView
|
||||||
|
|
||||||
|
from content import views
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'^admin/', admin.site.urls),
|
||||||
|
@ -24,6 +27,7 @@ urlpatterns = [
|
||||||
url(r'^.*index.php$', views.redirect_index, name='redirect_index'),
|
url(r'^.*index.php$', views.redirect_index, name='redirect_index'),
|
||||||
url(r'^.*event.php$', views.redirect_event, name='redirect_event'),
|
url(r'^.*event.php$', views.redirect_event, name='redirect_event'),
|
||||||
url(r'^.*(/images/.*)$', views.redirect_images, name='redirect_images'),
|
url(r'^.*(/images/.*)$', views.redirect_images, name='redirect_images'),
|
||||||
|
url(r'directions.html', RedirectView.as_view(url='/directions/')),
|
||||||
|
|
||||||
url(r'^projects/', views.projects, name='projects'),
|
url(r'^projects/', views.projects, name='projects'),
|
||||||
url(r'^events/', views.events, name='events'),
|
url(r'^events/', views.events, name='events'),
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if content.image_url %}
|
||||||
<img src="{{ content.image_url }}" width="75%">
|
<img src="{{ content.image_url }}" width="75%">
|
||||||
|
{% endif %}
|
||||||
<div class="content_detail">
|
<div class="content_detail">
|
||||||
<h1>{{ content.title }}</h1>
|
<h1>{{ content.title }}</h1>
|
||||||
|
|
||||||
|
@ -33,6 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if content.parent or content.children.exists %}
|
||||||
<div class="context">
|
<div class="context">
|
||||||
<b>In This Event</b>:
|
<b>In This Event</b>:
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -67,6 +70,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if content.resources.exists %}
|
{% if content.resources.exists %}
|
||||||
{% if content.links.exists %}
|
{% if content.links.exists %}
|
||||||
|
|
|
@ -15,7 +15,10 @@ def index(request):
|
||||||
return render(request, 'index.html', context)
|
return render(request, 'index.html', context)
|
||||||
|
|
||||||
def content(request, shortname):
|
def content(request, shortname):
|
||||||
content = get_object_or_404(Content, shortname=shortname, published=True)
|
if request.user.is_staff:
|
||||||
|
content = get_object_or_404(Content, shortname=shortname)
|
||||||
|
else:
|
||||||
|
content = get_object_or_404(Content, shortname=shortname, published=True)
|
||||||
return render(request, 'detail.html', {'content': content})
|
return render(request, 'detail.html', {'content': content})
|
||||||
|
|
||||||
def projects(request):
|
def projects(request):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user