Changeset 54


Ignore:
Timestamp:
11/30/10 04:47:31 (14 years ago)
Author:
nanardon
Message:

complete /distrib

Location:
server/trunk/web
Files:
2 added
6 edited

Legend:

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

    r53 r54  
    160160} 
    161161 
    162 sub distrib :Chained('distrib_view') PathPart('') { 
     162sub distrib :Chained('distrib_view') PathPart('') :Args(0) { 
    163163    my ( $self, $c ) = @_; 
    164164    $c->forward('list', [ $c->stash->{dist} ]); 
     
    167167} 
    168168 
    169 sub media :Chained('distrib_view') PathPart('media') { 
     169sub media :Chained('/distrib/distrib_view') PathPart('media') :Args(0) { 
    170170    my ( $self, $c ) = @_; 
    171171    $c->forward('struct', [ $c->stash->{dist} ]); 
     
    290290} 
    291291 
    292 sub srpm_by_name :Chained('distrib_view') PathPart('srpms/by-name') Args(1) { 
     292sub srpm_by_name :Chained('distrib_view') PathPart('srpms') Args(1) { 
    293293    my ($self, $c, $name) = @_; 
    294294    $c->stash->{dist}{src} = 1; 
     
    299299} 
    300300 
    301 sub rpm_by_name :Chained('distrib_view') PathPart('rpms/by-name') Args(1) { 
     301sub rpm_by_name :Chained('distrib_view') PathPart('rpms') Args(1) { 
    302302    my ($self, $c, $name) = @_; 
    303303    $c->stash->{dist}{src} = 0; 
     
    308308} 
    309309 
    310 sub rpm_by_pkid :Chained('distrib_view') PathPart('by-pkgid') Args(1) { 
     310sub rpm_bypkgid :Chained('distrib_view') PathPart('by-pkgid') { 
     311    my ( $self, $c, $pkgid ) = @_; 
     312    if ($pkgid) { 
     313        $c->go('/rpms/rpms', [ $pkgid ]); 
     314    } else { 
     315        $c->forward('anyrpms', [ $c->stash->{dist} ]); 
     316    } 
    311317} 
    312318 
     
    316322} 
    317323 
    318 sub media_list_rpms :Chained('_media_list_rpms') PathPart('') { 
     324sub media_list_rpms :Chained('_media_list_rpms') PathPart('') :Args(0) { 
    319325    my ( $self, $c ) = @_; 
    320326    $c->forward('anyrpms', [ $c->stash->{dist} ]); 
    321327} 
    322328 
    323 sub media_rpm_byname :Chained('_media_list_rpms') PathPart('rpms/by-name') { 
    324     my ( $self, $c ) = @_; 
    325 } 
    326 sub media_srpm_byname :Chained('_media_list_rpms') PathPart('srpms/by-name') { 
    327     my ( $self, $c ) = @_; 
    328 } 
     329sub media_rpm_byname :Chained('_media_list_rpms') PathPart('rpms') { 
     330    my ( $self, $c, $name ) = @_; 
     331} 
     332sub media_srpm_byname :Chained('_media_list_rpms') PathPart('srpms') { 
     333    my ( $self, $c, $name ) = @_; 
     334} 
     335 
    329336sub media_rpm_bypkgid :Chained('_media_list_rpms') PathPart('by-pkgid') { 
    330337    my ( $self, $c, $pkgid ) = @_; 
    331     $c->forward('/rpms/rpms', [ $pkgid ]); 
     338    if ($pkgid) { 
     339        $c->go('/rpms/rpms', [ $pkgid ]); 
     340    } else { 
     341        $c->forward('anyrpms', [ $c->stash->{dist} ]); 
     342    } 
    332343} 
    333344 
  • server/trunk/web/lib/Sophie/Controller/Root.pm

    r50 r54  
    2626    my ( $self, $c ) = @_; 
    2727 
    28     if ($c->req->path =~ m:[^/]+\/$:) { 
     28    if ($c->req->path =~ m:[^/]+\/+$:) { 
    2929        my $path = $c->req->path; 
    3030        $path =~ s:/*$::; 
     
    3333    } 
    3434 
    35     if (!$c->stash->{path}) { 
     35    if (!$c->stash->{sitepath}) { 
    3636        my @path; 
    37         my @reqpath = grep { $_ } split('/', $c->req->path); 
     37        my @reqpath = split('/', $c->req->path); 
    3838        foreach (@reqpath) { 
    3939            push(@path, $_); 
    40             push(@{ $c->stash->{sitepath} }, { path => $c->uri_for('/', @path), name => $_ }); 
     40            push(@{ $c->stash->{sitepath} }, { path => $c->uri_for('/', @path), 
     41                    name => $_ || '*' }); 
    4142        } 
    4243    } 
  • server/trunk/web/root/static/sophie.css

    r17 r54  
    88    padding-left: 1em; 
    99} 
     10 
     11.pkgid { 
     12    font-family: monospace; 
     13} 
  • server/trunk/web/root/templates/html/distrib/distrib.tt

    r53 r54  
    11<ol> 
    22[% FOREACH media = xmlrpc %] 
    3 <li><a href="[% c.uri_for('/', c.req.path, media.label) %]">[% media.label %]</a></li> 
     3<li><a href="[% c.uri_for('/', c.req.path, 'media', media) %]">[% media %]</a></li> 
    44[% END %] 
    55</ol> 
  • server/trunk/web/root/templates/html/distrib/media.tt

    r53 r54  
    1  
    2 [% INCLUDE 'distrib/distrib.tt' %] 
     1<ol> 
     2[% FOREACH media = xmlrpc %] 
     3<li><a href="[% c.uri_for('/', c.req.path, media.label) %]">[% media.label %]</a></li> 
     4[% END %] 
     5</ol> 
  • server/trunk/web/root/templates/html/distrib/media_rpm_bypkgid.tt

    r27 r54  
    11<!-- $Id$ --> 
    2  
    3 [% INCLUDE 'rpms/rpms.tt' %] 
     2[% FOREACH rpm = xmlrpc %] 
     3[% IF loop.first %] 
     4<ul> 
     5[% END %] 
     6<li> 
     7    <a href="[% c.uri_for('/', c.req.path, rpm.pkgid) %]"><span class="pkgid">[% 
     8rpm.pkgid %]</span></a> 
     9([% rpm.filename | html %]) 
     10</li> 
     11[% IF loop.last %] 
     12</ul> 
     13[% END %] 
     14[% END %] 
Note: See TracChangeset for help on using the changeset viewer.