From bcca273d79b1500e89df73b485710d6bd6fd9482 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Mon, 24 Sep 2012 14:02:35 +0200 Subject: [PATCH] SONAR-3675 Remove old code now that AJAX is not used for event widget --- .../app/controllers/project_controller.rb | 25 ---------- .../WEB-INF/app/views/project/events.html.erb | 47 ------------------- 2 files changed, 72 deletions(-) delete mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb index e4eb8537e9f..a993d5331ec 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb @@ -247,31 +247,6 @@ class ProjectController < ApplicationController not_found('category') unless @categories.include? @category end - def events - @categories = EventCategory.categories(true) - @snapshot = Snapshot.find(params[:id]) - @category = params[:category] - - conditions = "resource_id=:resource_id" - values = {:resource_id => @snapshot.project_id} - unless @category.blank? - conditions << " AND category=:category" - values[:category] = @category - end - # in order to not display events linked to deleted snapshot, we build the SQL request with 'NOT IN' as most of the time, there won't be unprocessed snapshots - snapshots_to_be_deleted = Snapshot.find(:all, :conditions => ["status='U' AND project_id=?", @snapshot.project_id]) - unless snapshots_to_be_deleted.empty? - conditions << " AND snapshot_id NOT IN (:sids)" - values[:sids] = snapshots_to_be_deleted.map { |s| s.id } - end - - category_names=@categories.map { |cat| cat.name } - @events=Event.find(:all, :conditions => [conditions, values], :order => 'event_date desc').select do |event| - category_names.include?(event.category) - end - render :action => 'events', :layout => !request.xhr? - end - def update_version snapshot=Snapshot.find(params[:sid]) not_found("Snapshot not found") unless snapshot diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb deleted file mode 100644 index 17233b3f8c1..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -

<%= message('events') -%>    -

- - - - - - - -<% - max_rows=10 - index=0 - @events.each do |event| - if index==max_rows -%><% - end -%> - - - - - - -<% index+=1 - end - if index>=max_rows -%><% - end -%> - -
-
- -<% if index>=max_rows %> - <%= message('show_more') -%> -<% end %> - -- 2.39.5