Changeset 272


Ignore:
Timestamp:
01/02/11 15:33:03 (13 years ago)
Author:
nanardon
Message:
  • add some title and keywords
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Controller/Distrib.pm

    r263 r272  
    277277    my ( $self, $c ) = @_; 
    278278    $c->forward('list', [ $c->stash->{dist} ]); 
    279     # TODO store properly results 
    280     # No call from json here 
    281 } 
     279} 
     280 
     281# Url: /distrib/<DISTRIBUTION>/<RELEASE>/<ARCH>/media 
    282282 
    283283sub media :Chained('/distrib/distrib_view') PathPart('media') :Args(0) { 
     
    480480sub list_rpms :Chained('distrib_view') PathPart('rpms') Args(0) { 
    481481    my ( $self, $c ) = @_; 
     482    if (!$c->forward('exists', [ $c->stash->{dist} ])) { 
     483        $c->go('/404/index'); 
     484    } 
     485    $c->stash->{metarevisite} = 60; 
     486    $c->stash->{metatitle} = sprintf( 
     487        'Available Rpms for %s / %s / %s', 
     488        $c->stash->{dist}{distribution}, 
     489        $c->stash->{dist}{release}, 
     490        $c->stash->{dist}{arch} 
     491    ); 
     492    push(@{$c->stash->{keywords}}, 
     493        $c->stash->{dist}{distribution}, 
     494        $c->stash->{dist}{release}, 
     495        $c->stash->{dist}{arch}); 
    482496    $c->forward('rpms', [ $c->stash->{dist} ]); 
    483497} 
     
    492506sub list_srpms :Chained('distrib_view') PathPart('srpms') Args(0) { 
    493507    my ( $self, $c ) = @_; 
     508    if (!$c->forward('exists', [ $c->stash->{dist} ])) { 
     509        $c->go('/404/index'); 
     510    } 
     511    $c->stash->{metarevisite} = 60; 
     512    $c->stash->{metatitle} = sprintf( 
     513        'Available Srpms for %s / %s / %s', 
     514        $c->stash->{dist}{distribution}, 
     515        $c->stash->{dist}{release}, 
     516        $c->stash->{dist}{arch} 
     517    ); 
     518    push(@{$c->stash->{keywords}}, 
     519        $c->stash->{dist}{distribution}, 
     520        $c->stash->{dist}{release}, 
     521        $c->stash->{dist}{arch}); 
    494522    $c->forward('srpms', [ $c->stash->{dist} ]); 
    495523} 
     
    508536        [ $c->stash->{dist}, $name ]) }; 
    509537    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     538    push(@{$c->stash->{keywords}}, 
     539        $c->stash->{dist}{distribution}, 
     540        $c->stash->{dist}{release}, 
     541        $c->stash->{dist}{arch}); 
    510542    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]); 
    511543} 
     
    524556        [ $c->stash->{dist}, $name ]) }; 
    525557    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     558    push(@{$c->stash->{keywords}}, 
     559        $c->stash->{dist}{distribution}, 
     560        $c->stash->{dist}{release}, 
     561        $c->stash->{dist}{arch}); 
    526562    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]); 
    527563} 
     
    544580            [ $c->stash->{dist}, $pkgid ]) } ) { 
    545581            $c->go('/rpms/rpms', [ $pkgid, @subpart ]); 
     582            push(@{$c->stash->{keywords}}, 
     583                $c->stash->{dist}{distribution}, 
     584                $c->stash->{dist}{release}, 
     585                $c->stash->{dist}{arch}); 
    546586        } else { 
    547587            $c->go('/404/index'); 
     
    555595    my ( $self, $c, $media ) = @_; 
    556596    $c->stash->{dist}{media} = $media; 
     597    push(@{$c->stash->{keywords}}, 
     598        $c->stash->{dist}{distribution}, 
     599        $c->stash->{dist}{release}, 
     600        $c->stash->{dist}{arch}, 
     601        $c->stash->{dist}{media}, 
     602    ); 
    557603} 
    558604 
Note: See TracChangeset for help on using the changeset viewer.