From 2909dc657a865b3bf35707fa4599ecab0bfe3b8f Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 30 Dec 2011 00:06:08 +0100 Subject: add templates and first view for news --- sublab_project/news/templates/news/news_list.html | 10 ++ sublab_project/news/urls.py | 8 ++ sublab_project/templates/404.html | 13 ++ sublab_project/templates/500.html | 130 +++++++++++++++++++ sublab_project/templates/base.html | 151 ++++++++++++++++++++++ sublab_project/urls.py | 6 +- 6 files changed, 314 insertions(+), 4 deletions(-) create mode 100644 sublab_project/news/templates/news/news_list.html create mode 100644 sublab_project/news/urls.py (limited to 'sublab_project') diff --git a/sublab_project/news/templates/news/news_list.html b/sublab_project/news/templates/news/news_list.html new file mode 100644 index 0000000..ab998e8 --- /dev/null +++ b/sublab_project/news/templates/news/news_list.html @@ -0,0 +1,10 @@ +{% extends 'base.html' %} + +{%block content %} + {% for post in news_list %} +

+ {{ post.date_updated|date }} - {{ post.title }} +

+

{{ post.content }}

+ {% endfor %} +{% endblock content %} diff --git a/sublab_project/news/urls.py b/sublab_project/news/urls.py new file mode 100644 index 0000000..a1c5c0a --- /dev/null +++ b/sublab_project/news/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls.defaults import patterns, include, url +from django.views.generic import ListView, DetailView + +from news.models import News + +urlpatterns = patterns('', + url(r'^$', ListView.as_view(model=News, paginate_by=8), name='news_list') +) diff --git a/sublab_project/templates/404.html b/sublab_project/templates/404.html index e69de29..0aab876 100644 --- a/sublab_project/templates/404.html +++ b/sublab_project/templates/404.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block title %}sublab - page not found{% endblock %} + +{# {% block motd %}{% endblock %} #} +{% block content %} + Leider konnten wir die Datei zu Deiner Anfrage nicht finden. Eventuell + ist der Link den Du benutzt hast fehlerhaft oder veraltet. Falls Du der + Meinung bist, dass dieser Link funktionieren sollte, kontaktiere bitte + kontakt [at] sublab.org. + + Hier geht es zur Startseite. +{% endblock %} diff --git a/sublab_project/templates/500.html b/sublab_project/templates/500.html index e69de29..dd87d27 100644 --- a/sublab_project/templates/500.html +++ b/sublab_project/templates/500.html @@ -0,0 +1,130 @@ + + + + + sublab - page not found + + + + + + {# #} + {# #} + + + + + + + + + +
+
+ + + +
+

+ [ mate und technik ] +

+

+ Das sublab - ein Hackerspace in Leipzig +

+
+ + + +
+ +

+ Statusdisplay +

+
+
+ + + + + + + + + + + + + +
+ Taifun: + + Online  Offline +
+ Trieste: + + Online  Offline +
+ Nautilus: + + Online  Offline +
+
+
+

+ Mitglied werden +

+
+ +
+ Bei der Verarbeitung deiner Anfrage ist ein Fehler aufgetreten. Falls Du der + Meinung bist, dass das dieser Vorgang funktionieren sollte, kontaktiere bitte + kontakt [at] sublab.org.
+ Hier geht es zur Startseite. +
+
+ + + +
+
+ + + diff --git a/sublab_project/templates/base.html b/sublab_project/templates/base.html index e69de29..2c71ff7 100644 --- a/sublab_project/templates/base.html +++ b/sublab_project/templates/base.html @@ -0,0 +1,151 @@ + + + + + {% block title %}sublab - Ein Hackerspace in Leipzig{% endblock %} + + + + + {% if meta_date %}{% endif %} + + {# #} + {# #} + + + + + + + + + +
+
+ + + +
+

+ [ mate und technik ] +

+

+ Das sublab - ein Hackerspace in Leipzig +

+
+ + + +
+ +

+ Statusdisplay +

+
+
+ + + + + + + + + + + + + +
+ Taifun: + + Online  Offline +
+ Trieste: + + Online  Offline +
+ Nautilus: + + Online  Offline +
+
+
+

+ {% block motd %} + sublab website - jetzt mit Django + {% endblock %} +

+
+ Webcam im Fenster +
+ Temperaturen im sublab +
+

+ Mitglied werden +

+
+ +
+ {% block content %} + This is where the content would be. + {% endblock %} +
+
+ + + +
+
+ + + diff --git a/sublab_project/urls.py b/sublab_project/urls.py index c35dcb6..7d52b8b 100644 --- a/sublab_project/urls.py +++ b/sublab_project/urls.py @@ -1,4 +1,5 @@ from django.conf.urls.defaults import patterns, include, url +from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin @@ -6,12 +7,9 @@ admin.autodiscover() urlpatterns = patterns('', # Examples: - # url(r'^$', 'sublab_project.views.home', name='home'), - # url(r'^sublab_project/', include('sublab_project.foo.urls')), - # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), + url(r'^', include('news.urls')) ) -- cgit v1.2.1