Some more work towards having a working news module. This isn't anywhere near ready yet!
This commit is contained in:
parent
115a420cee
commit
ebb145654f
4 changed files with 27 additions and 47 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('apps.news.views',
|
||||
# (r'^news/show/(?P<entry_id>\d+)/$', 'show_news'),
|
||||
(r'^show/(?P<entry_id>\d+)/$', 'show_news'),
|
||||
# (r'^news/categories/list/$', 'recent_kills'),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,34 +2,21 @@
|
|||
# News display.
|
||||
#
|
||||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.db import connection
|
||||
from django.template import RequestContext
|
||||
from django import newforms as forms
|
||||
from django.newforms.util import ValidationError
|
||||
import django.views.generic.list_detail as list_detail
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import simplejson
|
||||
|
||||
import frontier.settings as settings
|
||||
from frontier.apps.player.models import UserProfile
|
||||
from frontier.apps.news.models import NewsTopic, NewsEntry
|
||||
from apps.news.models import NewsTopic, NewsEntry
|
||||
|
||||
nav_block = """
|
||||
<div>
|
||||
</div>
|
||||
"""
|
||||
|
||||
def index(request):
|
||||
def show_news(request, entry_id):
|
||||
"""
|
||||
News index.
|
||||
Show an individual news entry.
|
||||
"""
|
||||
news_entries = NewsEntry.objects.all().order_by('-date_posted')[:10]
|
||||
#news_entries = NewsEntry.objects.all().order_by('-date_posted')[:10]
|
||||
|
||||
pagevars = {
|
||||
"page_title": "Front Page",
|
||||
"nav_block": nav_block,
|
||||
"news_entries": news_entries,
|
||||
}
|
||||
|
||||
context_instance = RequestContext(request)
|
||||
return render_to_response('news/index.html', pagevars, context_instance)
|
||||
return render_to_response('base.html', pagevars, context_instance)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue