Changeset 50 for server/trunk


Ignore:
Timestamp:
11/29/10 15:22:53 (14 years ago)
Author:
nanardon
Message:
  • add view of rpms over distrib

add path inside website

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

Legend:

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

    r42 r50  
    204204 
    205205sub srpm_by_name :Chained('distrib_view') PathPart('srpms/by-name') Args(1) { 
    206 } 
     206    my ($self, $c, $name) = @_; 
     207    $c->stash->{dist}{src} = 1; 
     208    ($c->stash->{pkgid}) = @{ $c->forward('/search/bytag', 
     209        [ $c->stash->{dist}, 'name', $name ]) }; 
     210    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     211    $c->go('/rpms/rpms', [ $c->stash->{pkgid} ]); 
     212} 
     213 
    207214sub rpm_by_name :Chained('distrib_view') PathPart('rpms/by-name') Args(1) { 
    208 } 
     215    my ($self, $c, $name) = @_; 
     216    $c->stash->{dist}{src} = 0; 
     217    ($c->stash->{pkgid}) = @{ $c->forward('/search/bytag', 
     218        [ $c->stash->{dist}, 'name', $name ]) }; 
     219    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     220    $c->go('/rpms/rpms', [ $c->stash->{pkgid} ]); 
     221} 
     222 
    209223sub rpm_by_pkid :Chained('distrib_view') PathPart('by-pkgid') Args(1) { 
    210224} 
  • server/trunk/web/lib/Sophie/Controller/Root.pm

    r42 r50  
    3131        $c->res->redirect($c->uri_for("/$path")); 
    3232        return; 
     33    } 
     34 
     35    if (!$c->stash->{path}) { 
     36        my @path; 
     37        my @reqpath = grep { $_ } split('/', $c->req->path); 
     38        foreach (@reqpath) { 
     39            push(@path, $_); 
     40            push(@{ $c->stash->{sitepath} }, { path => $c->uri_for('/', @path), name => $_ }); 
     41        } 
    3342    } 
    3443 
  • server/trunk/web/lib/Sophie/Controller/Rpms.pm

    r47 r50  
    147147            user => $_->get_column('user'), 
    148148            group => $_->get_column('group'), 
     149            has_content => $_->get_column('has_content'), 
    149150        } 
    150151    } $c->model('Base')->resultset('Files')->search( 
     
    153154            }, 
    154155            {  
    155                 'select' => [ 'rpmfilesmode(mode) as perm', @col, '"group"', 
     156                'select' => [ 'contents is NOT NULL as has_content', 'rpmfilesmode(mode) as perm', @col, '"group"', 
    156157                    '"user"' ], 
    157                 as => [ qw(perm), @col, 'group', 'user' ], 
     158                as => [ qw(has_content perm), @col, 'group', 'user' ], 
    158159                order_by => [ 'dirname', 'basename' ], 
    159160 
  • server/trunk/web/root/templates/html/explorer/index.html

    r40 r50  
    11 
    2 <p> 
     2<!-- <p> 
    33<a href="[% c.uri_for('/explorer') %]">/</a> 
    44[% FOREACH p = eachpath %] 
    55<a href="[% c.uri_for('/explorer', p.path) %]">[% p.dir | html %]</a> 
    66[% END %] 
    7 </p> 
     7</p>--> 
    88 
    99<div id="exp_dir" style="float: left; border: outset; width: 30%"> 
  • server/trunk/web/root/templates/html/rpms/rpms.tt

    r49 r50  
    6666[% FOREACH file = xmlrpc.files %] 
    6767[%- IF loop.first -%] 
    68 <pre style="padding: 1em; margin: 2em;"> 
     68<table border=0 style="font-family: monospace"> 
    6969[%- END -%] 
    70 [% file.perm %] [% file.size | format('%6d') %] [% file.user | format('%10s') -%] 
    71 [%- file.group | format('%10s') %] [% file.filename %] 
    72  
     70<tr><td>[% file.perm %]</td><td>[% file.size | format('%6d') %]</td><td>[% 
     71file.user | format('%10s') -%]</td> 
     72<td>[%- file.group | format('%10s') %]</td><td>[% file.filename %]</td> 
     73<td>[% file.has_content %]</tr> 
    7374[%- IF loop.last -%] 
    74 </pre> 
     75</table> 
    7576[%- END -%] 
    7677[% END %] 
  • server/trunk/web/root/templates/includes/header.tt

    r48 r50  
    2828        </p> 
    2929    </div> 
     30    <div style="clear:both"></div> 
     31    <div style="float: left"> 
     32        [% FOREACH p = sitepath %] 
     33        <a href="[% p.path %]">[% p.name | html %]</a> 
     34        [% IF NOT loop.last %]&gt;[% END %] 
     35        [% END %] 
     36    </div> 
    3037    <div style="float: right"> 
    31         Search:<br> 
    3238        [% INCLUDE 'search/simple_search.tt' %] 
    3339    </div> 
Note: See TracChangeset for help on using the changeset viewer.