From: Andreas Bauer
---
src/webui/app/controllers/package_controller.rb | 24 ++++++++++++++++++++--
src/webui/app/views/package/show.rhtml | 2 +-
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/webui/app/controllers/package_controller.rb b/src/webui/app/controllers/package_controller.rb
index e9087b5..c02c974 100644
--- a/src/webui/app/controllers/package_controller.rb
+++ b/src/webui/app/controllers/package_controller.rb
@@ -119,6 +119,27 @@ class PackageController < ApplicationController
redirect_to :action => :show, :project => @project, :package => @package
end
+ def remove_file
+ if not params[:filename]
+ flash[:note] = "Removing file aborted: no filename given."
+ redirect_to :action => :show, :project => params[:project], :package => params[:package]
+ end
+
+ @project = params[:project]
+ @package = Package.find( params[:package], :project => @project )
+ filename = params[:filename]
+
+ @package.remove_file filename
+
+ if @package.save
+ flash[:note] = "File '#{filename}' removed successfully"
+ else
+ flash[:note] = "Failed to remove file '#{filename}'"
+ end
+
+ redirect_to :action => :show, :project => @project, :package => @package
+ end
+
def add_person
@project_name = session[:project_name]
@package = Package.find( params[:package], :project => @project_name )
@@ -150,9 +171,6 @@ class PackageController < ApplicationController
else
flash[:note] = "Failed to add user '#{params[:userid]}'"
end
- response = Suse::Backend.get_log( @project, @repository, @package, @arch )
- send_data( response.body, :type => "text/plain",
- :disposition => "inline" )
redirect_to :action => :show, :package => @package, :project => @project_name
end
diff --git a/src/webui/app/views/package/show.rhtml b/src/webui/app/views/package/show.rhtml
index a6bc664..a26f76b 100644
--- a/src/webui/app/views/package/show.rhtml
+++ b/src/webui/app/views/package/show.rhtml
@@ -21,7 +21,7 @@
<% end %>
</td>
<td><%= link_to "[Download]", file_url( @project, @package, file.filename ) %></td>
- <td><%= link_to "[Remove]", :action => :remove_file, :project => @project, :package => @package, :file => file.filename %></td>
+ <td><%= link_to "[Remove]", :action => :remove_file, :project => @project, :package => @package, :filename => file.filename %></td>
</tr>
<% end %>
</table>
--
1.7.7
--
To unsubscribe, e-mail: obs-commits+unsubscribe@opensuse.org
To contact the owner, e-mail: obs-commits+owner@opensuse.org