diff --git a/euscanwww/djeuscan/api/handlers.py b/euscanwww/djeuscan/api/handlers.py index 18e1aca..922fe16 100644 --- a/euscanwww/djeuscan/api/handlers.py +++ b/euscanwww/djeuscan/api/handlers.py @@ -97,8 +97,12 @@ class PackagesHandler(AnonymousBaseHandler): herd = Herd.objects.get(herd=kwargs['herd']) packages = Package.objects.for_herd(herd, last_versions=True) data = {'herd': herd} - elif 'maintainer_id' in kwargs: - maintainer = Maintainer.objects.get(id=kwargs['maintainer_id']) + elif 'maintainer_id' in kwargs or 'maintainer_email' in kwargs: + if 'maintainer_id' in kwargs: + maintainer = Maintainer.objects.get(id=kwargs['maintainer_id']) + elif 'maintainer_email' in kwargs: + maintainer = Maintainer.objects.get(email=kwargs['maintainer_email']) + packages = Package.objects.for_maintainer( maintainer, last_versions=True diff --git a/euscanwww/djeuscan/api/urls.py b/euscanwww/djeuscan/api/urls.py index ffab482..578a8be 100644 --- a/euscanwww/djeuscan/api/urls.py +++ b/euscanwww/djeuscan/api/urls.py @@ -24,6 +24,8 @@ urlpatterns = patterns('djeuscan.api.views', url(r'^1.0/packages/by-maintainer/(?P\d+)\.(?P.+)$', packages_handler, name='api.views.packages'), + url(r'^1.0/packages/by-maintainer/(?P[^/]+)\.(?P.+)$', + packages_handler, name='api.views.packages'), url(r'^1.0/packages/by-herd/(?P[\@\{\}\w+.-]*)\.(?P.+)?$', packages_handler, name='api.views.packages'), url(r'^1.0/packages/by-category/(?P[\w+][\w+.-]*)\.(?P.+)?$', diff --git a/euscanwww/djeuscan/feeds.py b/euscanwww/djeuscan/feeds.py index 7399618..98590a9 100644 --- a/euscanwww/djeuscan/feeds.py +++ b/euscanwww/djeuscan/feeds.py @@ -146,9 +146,16 @@ class PackageFeed(BaseFeed): class MaintainerFeed(BaseFeed): feed_type = Atom1Feed - def get_object(self, request, maintainer_id): + def get_object(self, request, maintainer_id=None, maintainer_email=None): + print maintainer_id, maintainer_email + if maintainer_id: + obj = get_object_or_404(Maintainer, id=maintainer_id) + else: + obj = get_object_or_404(Maintainer, email=maintainer_email) + + print obj return { - "obj": get_object_or_404(Maintainer, id=maintainer_id), + "obj": obj, "options": request.GET, } @@ -159,8 +166,7 @@ class MaintainerFeed(BaseFeed): return "Last changes for %s" % data["obj"] def link(self, data): - return reverse('djeuscan.views.maintainer', - kwargs={'maintainer_id': data["obj"].id}) + return reverse('djeuscan.views.maintainer', args=[data["obj"].email]) def _items(self, data): return VersionLog.objects.for_maintainer(data["obj"]), 50 diff --git a/euscanwww/djeuscan/templates/euscan/_maintainers_table.html b/euscanwww/djeuscan/templates/euscan/_maintainers_table.html index bfbdd21..665e3e8 100644 --- a/euscanwww/djeuscan/templates/euscan/_maintainers_table.html +++ b/euscanwww/djeuscan/templates/euscan/_maintainers_table.html @@ -18,7 +18,7 @@ {% for maintainer in maintainers %} - + {% if maintainer.maintainers__name != maintainer.maintainers__email %} {{ maintainer.maintainers__name }} <{{ maintainer.maintainers__email }}> {% else %} @@ -31,8 +31,8 @@ {% if extras %} - - + + {% endif %} diff --git a/euscanwww/djeuscan/templates/euscan/_package_details.html b/euscanwww/djeuscan/templates/euscan/_package_details.html index 8746088..7f92133 100644 --- a/euscanwww/djeuscan/templates/euscan/_package_details.html +++ b/euscanwww/djeuscan/templates/euscan/_package_details.html @@ -33,12 +33,12 @@ {% for maintainer in package.maintainers.all %}

{% if maintainer.name != maintainer.email %} - + {{ maintainer.name }} <{{ maintainer.email }}> {% else %} - + {{ maintainer.email }} {% endif %} diff --git a/euscanwww/djeuscan/templates/euscan/accounts/index.html b/euscanwww/djeuscan/templates/euscan/accounts/index.html index e9ac816..0e61ed6 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/index.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/index.html @@ -75,7 +75,7 @@ Hot maintainers:

diff --git a/euscanwww/djeuscan/templates/euscan/maintainer.html b/euscanwww/djeuscan/templates/euscan/maintainer.html index 65f498c..d73b582 100644 --- a/euscanwww/djeuscan/templates/euscan/maintainer.html +++ b/euscanwww/djeuscan/templates/euscan/maintainer.html @@ -11,7 +11,7 @@ {{ block.super }}
  • feed - + {{ maintainer.name|truncatechars:15 }}
  • @@ -22,10 +22,10 @@ Maintainer: {{ maintainer.name }} <{{ maintainer.email }}> {% if user.is_authenticated %} - - @@ -37,19 +37,19 @@

    Statistics

    Current statistics

    - pie versions - pie packages + pie versions + pie packages

    All Time

    - version weekly - versions monthly + version weekly + versions monthly

    - packages weekly - packages monthly + packages weekly + packages monthly