Changeset 98 for server/trunk/web/lib/Sophie/Controller/Sources.pm
- Timestamp:
- 12/08/10 17:00:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Sources.pm
r97 r98 25 25 my ( $self, $c ) = @_; 26 26 27 $c->response->body('Matched Sophie::Controller::Sources in Sources.'); 27 if ($c->req->param('search')) { 28 $c->stash->{xmlrpc} = [ $c->model('Base::Rpms') 29 ->search( 30 { 31 name => { 'LIKE' => $c->req->param('search') . '%' }, 32 issrc => 1, 33 }, 34 { 35 group_by => [ qw(name) ], 36 select => [ qw(name) ], 37 } 38 )->get_column('name')->all ]; 39 } else { 40 $c->stash->{xmlrpc} = []; 41 } 28 42 } 29 43 … … 92 106 )->search_related('SrcFiles')->search( 93 107 { 94 #has_content => 1,108 has_content => 1, 95 109 basename => $filename, 96 110 }, 97 111 { 112 '+columns' => [ qw(me.evr) ], 98 113 order_by => [ 'evr using >>' ], 99 114 } … … 102 117 } 103 118 104 sub rpm_sources :Path :Args(1) { 119 sub rpm_sources_ :PathPrefix :Chained :CaptureArgs(1) { 120 my ($self, $c, $rpm) = @_; 121 $c->stash->{rpm} = $rpm; 122 } 123 124 sub rpm_sources :Chained('rpm_sources_') :PathPart('') :Args(0) { 105 125 my ($self, $c, $rpm) = @_; 106 126 107 $c->forward('srcfiles', [ {}, $ rpm]);127 $c->forward('srcfiles', [ {}, $c->stash->{rpm} ]); 108 128 109 129 } 110 130 111 sub rpm_sources_file :Path :Args(2) { 112 my ($self, $c, $rpm, $filename) = @_; 131 sub rpm_sources_file_ :Chained('rpm_sources_') :PathPart('') :CaptureArgs(1) { 132 my ($self, $c, $filename) = @_; 133 $c->stash->{filename} = $filename; 113 134 114 $c->forward('srcfilesbyfile', [ {}, $rpm, $filename ]); 135 $c->stash->{list} = $c->forward('srcfilesbyfile', [ {}, 136 $c->stash->{rpm}, $c->stash->{filename} ] ); 137 } 138 139 sub rpm_sources_file :Chained('rpm_sources_file_') :PathPart('') :Args(0) { 140 my ($self, $c ) = @_; 141 142 #$c->forward('srcfilesbyfile', [ {}, 143 # $c->stash->{rpm}, $c->stash->{filename} ] ); 144 145 } 146 147 sub rpm_sources_file_pkg_ :Chained('rpm_sources_file_') :PathPart('') :CaptureArgs(1) { 148 my ($self, $c, $pkgid) = @_; 149 $c->stash->{pkgid} = $pkgid; 150 $c->stash->{xmlrpc} = { $c->model('Base::SrcFiles')->find( 151 { 152 153 pkgid => $c->stash->{pkgid}, 154 basename => $c->stash->{filename}, 155 }, 156 { 157 '+columns' => ['contents'], 158 } 159 )->get_columns }; 160 } 161 162 sub rpm_sources_file_pkg :Chained('rpm_sources_file_pkg_') :PathPart('') :Args(0) { 163 my ($self, $c) = @_; 115 164 116 165 }
Note: See TracChangeset
for help on using the changeset viewer.