Index: server/trunk/web/lib/Sophie/Controller/0Explorer.pm
===================================================================
--- server/trunk/web/lib/Sophie/Controller/0Explorer.pm	(revision 75)
+++ server/trunk/web/lib/Sophie/Controller/0Explorer.pm	(revision 76)
@@ -53,6 +53,19 @@
     my $rsdist = $c->forward('/search/distrib_search', [ $c->session->{__explorer} ]);
 
+    my @col = qw(dirname basename md5 size pkgid count);
     $c->stash->{xmlrpc} = [ 
-        map { { pkgid => $_->get_column('pkgid') } }
+        map { {
+            pkgid => $_->get_column('pkgid'),
+            filename => $_->get_column('dirname') . $_->get_column('basename'),
+            dirname => $_->get_column('dirname'),
+            basename => $_->get_column('basename'),
+            md5 => $_->get_column('md5'),
+            perm => $_->get_column('perm'),
+            size => $_->get_column('size'),
+            user => $_->get_column('user'),
+            group => $_->get_column('group'),
+            has_content => $_->get_column('has_content'),
+            count => $_->get_column('count')
+            } }
         $c->model('Base')
       ->resultset('Files')
@@ -62,10 +75,10 @@
           },
           { 
-              'select' => [
-                  'contents IS NULL as has_contents', 'pkgid'
-              ],
-              as => [ qw(has_content pkgid) ],
-              order_by => 'pkgid' 
-          }
+              'select' => [ 'contents is NOT NULL as has_content', 'rpmfilesmode(mode) as perm', @col, '"group"',
+                  '"user"' ],
+              as => [ qw(has_content perm), @col, 'group', 'user' ],
+              order_by => [ 'pkgid' ],
+
+          },
       )->all ];
 }
Index: server/trunk/web/lib/Sophie/Controller/Distrib.pm
===================================================================
--- server/trunk/web/lib/Sophie/Controller/Distrib.pm	(revision 75)
+++ server/trunk/web/lib/Sophie/Controller/Distrib.pm	(revision 76)
@@ -287,30 +287,30 @@
 }
 
-sub list_rpms :Chained('distrib_view') PathPart('rpms') {
+sub list_rpms :Chained('distrib_view') PathPart('rpms') Args(0) {
     my ( $self, $c ) = @_;
     $c->forward('rpms', $c->stash->{dist});
 }
 
-sub list_srpms :Chained('distrib_view') PathPart('srpms') {
+sub list_srpms :Chained('distrib_view') PathPart('srpms') Args(0) {
     my ( $self, $c ) = @_;
     $c->forward('srpms', $c->stash->{dist});
 }
 
-sub srpm_by_name :Chained('distrib_view') PathPart('srpms') Args(1) {
-    my ($self, $c, $name) = @_;
+sub srpm_by_name :Chained('distrib_view') PathPart('srpms') {
+    my ($self, $c, $name, @subpart) = @_;
     $c->stash->{dist}{src} = 1;
     ($c->stash->{pkgid}) = @{ $c->forward('/search/bytag',
         [ $c->stash->{dist}, 'name', $name ])->{results} };
     $c->go('/404/index') unless ($c->stash->{pkgid});
-    $c->go('/rpms/rpms', [ $c->stash->{pkgid} ]);
-}
-
-sub rpm_by_name :Chained('distrib_view') PathPart('rpms') Args(1) {
-    my ($self, $c, $name) = @_;
+    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]);
+}
+
+sub rpm_by_name :Chained('distrib_view') PathPart('rpms') {
+    my ($self, $c, $name, @subpart) = @_;
     $c->stash->{dist}{src} = 0;
     ($c->stash->{pkgid}) = @{ $c->forward('/search/bytag',
         [ $c->stash->{dist}, 'name', $name ])->{results} };
     $c->go('/404/index') unless ($c->stash->{pkgid});
-    $c->go('/rpms/rpms', [ $c->stash->{pkgid} ]);
+    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]);
 }
 
@@ -347,10 +347,10 @@
 
 sub media_rpm_bypkgid :Chained('_media_list_rpms') PathPart('by-pkgid') {
-    my ( $self, $c, $pkgid, $part ) = @_;
+    my ( $self, $c, $pkgid, @part ) = @_;
     if ($pkgid) {
         if (@{ $c->forward('/search/bypkgid', [ $c->stash->{dist}, $pkgid
             ])->{results} } ) {
             $c->stash->{pkgid} = $pkgid;
-            $c->go('/rpms/rpms', [ $pkgid, $part ]);
+            $c->go('/rpms/rpms', [ $pkgid, @part ]);
         } else {
             $c->go('/404/index');
Index: server/trunk/web/lib/Sophie/Controller/Rpms.pm
===================================================================
--- server/trunk/web/lib/Sophie/Controller/Rpms.pm	(revision 75)
+++ server/trunk/web/lib/Sophie/Controller/Rpms.pm	(revision 76)
@@ -141,6 +141,4 @@
     {
         my $match = $c->stash->{pkgid};
-        ($c->stash->{rpmurl}) = $c->req->path =~
-            m{(.*/\Q$match\E)(?:/[^/]+)?$};
     }
     #$c->model('Base')->resultset('Rpms')->search(pkgid => $pkgid)->next;
@@ -152,11 +150,12 @@
 
 sub rpms : Private {
-    my ( $self, $c, $pkgid, $subpart) = @_;
+    my ( $self, $c, $pkgid, $subpart, @args) = @_;
+    $c->stash->{rpmurl} = $c->req->path;
     # Because $c->forward don't take into account Chained sub
     $c->forward('rpms_', [ $pkgid ]);
     for ($subpart || '') {
-        /^deps$/      and $c->go('alldeps',      [ $pkgid ]);
-        /^files$/     and $c->go('files',     [ $pkgid ]);
-        /^changelog$/ and $c->go('changelog', [ $pkgid ]);
+        /^deps$/      and $c->go('alldeps',   [ $pkgid, @args ]);
+        /^files$/     and $c->go('files',     [ $pkgid, @args ]);
+        /^changelog$/ and $c->go('changelog', [ $pkgid, @args ]);
     }
 
@@ -173,4 +172,5 @@
 sub alldeps :Chained('rpms_') :PathPart('deps') :Args(0) :XMLRPCLocal {
     my ( $self, $c, $pkgid ) = @_;
+    $c->stash->{rpmurl} = ($c->req->path =~ m:(.*)/[^/]+:)[0];
     $pkgid ||= $c->stash->{pkgid};
 
@@ -202,8 +202,13 @@
 
 sub files :Chained('rpms_') :PathPart('files') :Args(0) :XMLRPCLocal {
-    my ( $self, $c, $pkgid ) = @_;
+    my ( $self, $c, $pkgid, $number ) = @_;
+    $c->stash->{rpmurl} = ($c->req->path =~ m:(.*)/[^/]+:)[0];
     $pkgid ||= $c->stash->{pkgid};
 
-    my @col = qw(dirname basename md5 size);
+    if ($number) { # This come from a forward
+        $c->go('files_contents', [ $number ]);
+    }
+
+    my @col = qw(dirname basename md5 size count);
     $c->stash->{xmlrpc} = [ map {
         {
@@ -217,4 +222,5 @@
             group => $_->get_column('group'),
             has_content => $_->get_column('has_content'),
+            count => $_->get_column('count'),
         }
     } $c->model('Base')->resultset('Files')->search(
@@ -232,7 +238,24 @@
 }
 
+sub files_contents :Chained('rpms_') :PathPart('files') :Args(1) {
+    my ( $self, $c, $number ) = @_;
+    $c->stash->{rpmurl} = ($c->req->path =~ m:(.*)/[^/]+/[^/]+:)[0];
+    my $pkgid = $c->stash->{pkgid};
+
+    $c->stash->{xmlrpc} = $c->model('Base')->resultset('Files')->search(
+        {
+            pkgid => $pkgid,
+            count => $number,
+        },
+        {
+            select => ['contents'],
+        }
+    )->get_column('contents')->first;
+}
+
 sub changelog :Chained('rpms_') :PathPart('changelog') :Args(0) {
     my ( $self, $c, $pkgid ) = @_;
     $pkgid ||= $c->stash->{pkgid};
+    $c->stash->{rpmurl} = ($c->req->path =~ m:(.*)/[^/]+:)[0];
 
     my @ch;
Index: server/trunk/web/root/static/sophie.css
===================================================================
--- server/trunk/web/root/static/sophie.css	(revision 75)
+++ server/trunk/web/root/static/sophie.css	(revision 76)
@@ -27,2 +27,9 @@
     font-size: 1.2em;
 }
+
+pre.filedata {
+    padding: 2em;
+    margin: 2em;
+    background: #F5F5DC;
+    border: outset;
+}
Index: server/trunk/web/root/templates/html/0explorer/file.tt
===================================================================
--- server/trunk/web/root/templates/html/0explorer/file.tt	(revision 75)
+++ server/trunk/web/root/templates/html/0explorer/file.tt	(revision 76)
@@ -4,8 +4,29 @@
 
 [% FOREACH file = xmlrpc %]
+[% IF loop.first %]
+<table>
+[% END %]
 [% info = c.forward('/rpms/info', [ file.pkgid ]) %]
+<tr><td colspan="6">
 <a href="[% c.uri_for('/rpms', file.pkgid) %]">
     [% info.name | html %]-[% info.version %]-[% info.release %].[% info.arch %]
-</a><br>
+</a></td></tr>
+
+<tr class="filename"><td>[% file.perm %]</td><td align="right">[% file.size | format('%6d')
+%]</td><td>[% file.user | format('%10s') -%]</td>
+<td>[%- file.group | format('%10s') %]</td><td>[% file.md5 %]</td>
+<td>
+[% IF file.has_content %]
+<a href="[% c.uri_for('/rpms', file.pkgid, 'files', file.count) %]">
+[% file.basename %]
+</a>
+[% ELSE %]
+[% file.basename %]
+[% END %]
+</td></tr>
+
+[% IF loop.last %]
+</table>
+[% END %]
 [% END %]
 
Index: server/trunk/web/root/templates/html/rpms/files.tt
===================================================================
--- server/trunk/web/root/templates/html/rpms/files.tt	(revision 75)
+++ server/trunk/web/root/templates/html/rpms/files.tt	(revision 76)
@@ -10,6 +10,14 @@
 <tr><td>[% file.perm %]</td><td align="right">[% file.size | format('%6d') %]</td><td>[%
 file.user | format('%10s') -%]</td>
-<td>[%- file.group | format('%10s') %]</td><td>[% file.filename %]</td>
-<td>[% file.has_content %]</tr>
+<td>[%- file.group | format('%10s') %]</td>
+<td>
+    [% IF file.has_content %]
+    <a href="[% c.uri_for('/', rpmurl, 'files', file.count) %]">
+    [% file.filename | html  %]
+    </a>
+    [% ELSE %]
+    [% file.filename | html  %]
+    [% END %]
+</td></tr>
 [%- IF loop.last -%]
 </table>
Index: server/trunk/web/root/templates/html/rpms/files_contents.html
===================================================================
--- server/trunk/web/root/templates/html/rpms/files_contents.html	(revision 76)
+++ server/trunk/web/root/templates/html/rpms/files_contents.html	(revision 76)
@@ -0,0 +1,5 @@
+<!-- $Id -->
+
+[% INCLUDE 'rpms/menu.tt' %]
+
+[% INCLUDE 'rpms/files_contents.tt' %]
Index: server/trunk/web/root/templates/html/rpms/files_contents.tt
===================================================================
--- server/trunk/web/root/templates/html/rpms/files_contents.tt	(revision 76)
+++ server/trunk/web/root/templates/html/rpms/files_contents.tt	(revision 76)
@@ -0,0 +1,5 @@
+<!-- $Id$ -->
+
+<pre class="filedata">
+[% xmlrpc | html %]
+</pre>
Index: server/trunk/web/root/templates/html/rpms/menu.tt
===================================================================
--- server/trunk/web/root/templates/html/rpms/menu.tt	(revision 75)
+++ server/trunk/web/root/templates/html/rpms/menu.tt	(revision 76)
@@ -2,2 +2,3 @@
 <a href="[% c.uri_for('/', rpmurl, 'deps') %]">Deps</a>
 <a href="[% c.uri_for('/', rpmurl, 'files') %]">Files</a>
+<a href="[% c.uri_for('/', rpmurl, 'changelog') %]">ChangeLog</a>
