text list
This commit is contained in:
parent
89c6273c53
commit
03e22fa718
11
padmaTexts/templates/text_list.html
Normal file
11
padmaTexts/templates/text_list.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% for t in texts %}
|
||||||
|
<a href="{{t.get_absolute_url}}" title="{{t.title}}">{{ t.title }}</a><br />
|
||||||
|
{% endfor %}
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -6,3 +6,7 @@ from django.shortcuts import get_object_or_404, render_to_response
|
||||||
def text(request, slug):
|
def text(request, slug):
|
||||||
text = get_object_or_404(PadmaText, slug=slug)
|
text = get_object_or_404(PadmaText, slug=slug)
|
||||||
return render_to_response("text_embed.html", {'text': text})
|
return render_to_response("text_embed.html", {'text': text})
|
||||||
|
|
||||||
|
def texts(request):
|
||||||
|
texts = PadmaText.objects.all()
|
||||||
|
return render_to_response("text_list.html", {'texts': texts})
|
||||||
|
|
|
@ -9,6 +9,7 @@ admin.autodiscover()
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
# Example:
|
# Example:
|
||||||
(r'^admin/', include(admin.site.urls)),
|
(r'^admin/', include(admin.site.urls)),
|
||||||
|
(r'^$', 'texts.views.texts'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user