diff --git a/pylons_app/config/routing.py b/pylons_app/config/routing.py --- a/pylons_app/config/routing.py +++ b/pylons_app/config/routing.py @@ -32,6 +32,12 @@ def make_map(config): m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', action='add_repo') + #FEEDS + map.connect('rss_feed_home', '/{repo_name}/feed/rss', + controller='feed', action='rss') + map.connect('atom_feed_home', '/{repo_name}/feed/atom', + controller='feed', action='atom') + map.connect('login_home', '/login', controller='login') map.connect('logout_home', '/logout', controller='login', action='logout') @@ -39,7 +45,7 @@ def make_map(config): controller='changeset', revision='tip') map.connect('summary_home', '/{repo_name}/summary', controller='summary') - map.connect('shortlog_home', '/{repo_name}/shortlog/', + map.connect('shortlog_home', '/{repo_name}/shortlog', controller='shortlog') map.connect('branches_home', '/{repo_name}/branches', controller='branches') diff --git a/pylons_app/controllers/feed.py b/pylons_app/controllers/feed.py new file mode 100644 --- /dev/null +++ b/pylons_app/controllers/feed.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import logging +from operator import itemgetter +from pylons import tmpl_context as c, request, config +from pylons_app.lib.base import BaseController, render +from pylons_app.lib.utils import get_repo_slug +from pylons_app.model.hg_model import HgModel +from pylons_app.lib.auth import LoginRequired +log = logging.getLogger(__name__) + +class FeedController(BaseController): + + #secure it or not ? + def __before__(self): + super(FeedController, self).__before__() + + def atom(self): + return 'Hello Atom' + + def rss(self): + return 'Hello rss' diff --git a/pylons_app/templates/index.html b/pylons_app/templates/index.html --- a/pylons_app/templates/index.html +++ b/pylons_app/templates/index.html @@ -20,10 +20,8 @@ from pylons_app.lib import filters %else: ${name} %endif - ↓ ↑ - %def>
| - RSS + ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=repo['name']),class_='rss_logo')} | - Atom + ${h.link_to(_('Atom'),h.url('rss_feed_home',repo_name=repo['name']),class_='atom_logo')} |