Changeset 54 for server/trunk
- Timestamp:
- 11/30/10 04:47:31 (14 years ago)
- Location:
- server/trunk/web
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Distrib.pm
r53 r54 160 160 } 161 161 162 sub distrib :Chained('distrib_view') PathPart('') {162 sub distrib :Chained('distrib_view') PathPart('') :Args(0) { 163 163 my ( $self, $c ) = @_; 164 164 $c->forward('list', [ $c->stash->{dist} ]); … … 167 167 } 168 168 169 sub media :Chained(' distrib_view') PathPart('media') {169 sub media :Chained('/distrib/distrib_view') PathPart('media') :Args(0) { 170 170 my ( $self, $c ) = @_; 171 171 $c->forward('struct', [ $c->stash->{dist} ]); … … 290 290 } 291 291 292 sub srpm_by_name :Chained('distrib_view') PathPart('srpms /by-name') Args(1) {292 sub srpm_by_name :Chained('distrib_view') PathPart('srpms') Args(1) { 293 293 my ($self, $c, $name) = @_; 294 294 $c->stash->{dist}{src} = 1; … … 299 299 } 300 300 301 sub rpm_by_name :Chained('distrib_view') PathPart('rpms /by-name') Args(1) {301 sub rpm_by_name :Chained('distrib_view') PathPart('rpms') Args(1) { 302 302 my ($self, $c, $name) = @_; 303 303 $c->stash->{dist}{src} = 0; … … 308 308 } 309 309 310 sub rpm_by_pkid :Chained('distrib_view') PathPart('by-pkgid') Args(1) { 310 sub 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 } 311 317 } 312 318 … … 316 322 } 317 323 318 sub media_list_rpms :Chained('_media_list_rpms') PathPart('') {324 sub media_list_rpms :Chained('_media_list_rpms') PathPart('') :Args(0) { 319 325 my ( $self, $c ) = @_; 320 326 $c->forward('anyrpms', [ $c->stash->{dist} ]); 321 327 } 322 328 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 } 329 sub media_rpm_byname :Chained('_media_list_rpms') PathPart('rpms') { 330 my ( $self, $c, $name ) = @_; 331 } 332 sub media_srpm_byname :Chained('_media_list_rpms') PathPart('srpms') { 333 my ( $self, $c, $name ) = @_; 334 } 335 329 336 sub media_rpm_bypkgid :Chained('_media_list_rpms') PathPart('by-pkgid') { 330 337 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 } 332 343 } 333 344 -
server/trunk/web/lib/Sophie/Controller/Root.pm
r50 r54 26 26 my ( $self, $c ) = @_; 27 27 28 if ($c->req->path =~ m:[^/]+\/ $:) {28 if ($c->req->path =~ m:[^/]+\/+$:) { 29 29 my $path = $c->req->path; 30 30 $path =~ s:/*$::; … … 33 33 } 34 34 35 if (!$c->stash->{ path}) {35 if (!$c->stash->{sitepath}) { 36 36 my @path; 37 my @reqpath = grep { $_ }split('/', $c->req->path);37 my @reqpath = split('/', $c->req->path); 38 38 foreach (@reqpath) { 39 39 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 => $_ || '*' }); 41 42 } 42 43 } -
server/trunk/web/root/static/sophie.css
r17 r54 8 8 padding-left: 1em; 9 9 } 10 11 .pkgid { 12 font-family: monospace; 13 } -
server/trunk/web/root/templates/html/distrib/distrib.tt
r53 r54 1 1 <ol> 2 2 [% 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> 4 4 [% END %] 5 5 </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 1 1 <!-- $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">[% 8 rpm.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.