Commit 67e2b653 authored by eliott's avatar eliott
Browse files

Removed feeds from devsite

parent 8fcdf0c2
from django.contrib.syndication.feeds import Feed
from archweb_dev.packages.models import Package
from archweb_dev.news.models import News
#from datetime import datetime
class PackageFeed(Feed):
title = 'Recent Package Updates'
link = '/packages/'
description = 'Recent Package Updates'
def items(self):
return Package.objects.order_by('-last_update')[:10]
def item_pubdate(self, item):
return item.last_update
def item_categories(self, item):
return (item.repo.name,item.category.category)
class NewsFeed(Feed):
title = 'Recent News Updates'
link = '/news/'
description = 'Recent News Updates'
def items(self):
return News.objects.order_by('-postdate', '-id')[:10]
def item_pubdate(self, item):
return item.postdate
def item_author_name(self, item):
return item.author.get_full_name()
# vim: set ts=4 sw=4 et:
{% extends "base.html" %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="Arch Linux News Updates" href="/feeds/news/" />
<link rel="alternate" type="application/rss+xml" title="Arch Linux Package Updates" href="/feeds/packages/" />
{% endblock %}
{% block content_left %}
<div id="about" class="box">
<h2>Welcome to Arch!</h2>
<p>
You've reached the website for <strong>Arch Linux</strong>, a lightweight
and flexible linux distribution that tries to Keep It Simple.
</p><p>
Currently we have official packages optimized for the i686 and x86-64
architectures. We complement our official package sets with a
<a href="http://aur.archlinux.org">community-operated package repository</a>
that grows in size and quality each and every day.
</p><p>
Our strong community is diverse and helpful, and we pride ourselves on
the range of skillsets and uses for Arch that stem from it. Please
check out our <a href="http://bbs.archlinux.org">forums</a> and
<a href="http://www.archlinux.org/mailman/listinfo/">mailing lists</a>
to get your feet wet. Also glance through our <a href="http://wiki.archlinux.org">wiki</a>
if you want to learn more about Arch.
</p><p style="text-align: right">
<a href="/about/"><span style="font-size:x-small">Learn more...</span></a>
</p>
</div>
<br /><br />
<div style="float:right;position:relative;bottom:-25px">
<a href="/feeds/news/"><img src="/media/rss.png" alt="RSS Feed" /></a>
</div>
<h2 class="title">Latest News</h2>
<div>
{% for news in news_updates %}
......@@ -54,8 +24,7 @@ <h4 class="news"><a href="{{ news.get_absolute_url }}">{{ news.title }}</a></h4>
<div id="updates">
<table width="100%">
<tr>
<td><h3>Recent Updates</h3></td>
<td style="vertical-align:top;text-align:right"><a href="/feeds/packages/"><img src="/media/rss.png" alt="RSS Feed" /></a></td>
<td colspan="2"><h3>Recent Updates</h3></td>
</tr>
{% for pkg in pkg_updates %}
<tr>
......
from django.conf.urls.defaults import *
from django.conf import settings
from archweb_dev.news.models import News
from archweb_dev.feeds import PackageFeed, NewsFeed
from django.views.decorators.cache import cache_page
feeds = {
'packages': PackageFeed,
'news': NewsFeed
}
urlpatterns = patterns('',
# Dynamic Stuff
(r'^packages/flag/(\d+)/$', 'archweb_dev.packages.views.flag'),
......@@ -45,9 +39,6 @@
(r'^wiki/index/$', 'archweb_dev.wiki.views.index'),
(r'^wiki/$', 'archweb_dev.wiki.views.main'),
# Feeds
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
# (mostly) Static Pages
(r'^$', 'archweb_dev.devel.views.siteindex'),
(r'^about/$', 'archweb_dev.devel.views.about'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment