]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3675 Remove old code now that AJAX is not used for event widget
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 24 Sep 2012 12:02:35 +0000 (14:02 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 24 Sep 2012 12:04:01 +0000 (14:04 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb [deleted file]

index e4eb8537e9f32d7436c8e16094d279ccbf283f69..a993d5331ec4f1de1004365bf00fdae6992fd293 100644 (file)
@@ -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 (file)
index 17233b3..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<h3><%= message('events') -%> &nbsp;&nbsp;
-<select class="small" id="select_category" onchange="<%= remote_function(:update => 'events_portlet', :url => { :controller => :project, :action => :events, :id => @snapshot.id },
-  :with => "'category=' + $F('select_category')", :method => 'get') -%>">
-<option value=""><%= message('all') -%></option>
-<% @categories.each do |categ| %>
-<option value="<%= h categ.name -%>" <%= 'selected' if @category==categ.name -%>><%= h message('event.category.' + categ.name, :default => categ.name) %></option>
-<% end %>
-</select></h3>
-
-<table id="events" class="spaced data">
-<thead>
-<tr>
-  <th colspan="4">
-  </th>
-</tr>
-</thead>
-<%
-   max_rows=10
-   index=0
-   @events.each do |event|
-     if index==max_rows
-%><tbody style="display:none" id="all_events"><%
-     end
-%>
-<tr class="<%= cycle 'even','odd' -%>">
-    <td x="<%= event.event_date -%>"><%= l(event.event_date.to_date) %></td>
-    <td><%= h message('event.category.' + event.category, :default => event.category) %></td>
-    <td><%= event.name %></td>
-    <td>
-        <% unless event.description.blank? %>
-<a href="#" class="nolink" title="<%= h event.description -%>" alt="<%= h event.description -%>"><img src="<%= ApplicationController.root_context -%>/images/information.png" /></a>
-        <% end %>
-    </td>
-</tr>
-<%   index+=1
-   end
-   if index>=max_rows
-%></tbody><%
-   end
-%>
-
-</table>
-
-<% if index>=max_rows %>
-      <a href="#" onclick="$('all_events').show();$('show_more_events').hide()" id="show_more_events" class="action"><%= message('show_more') -%></a>
-<% end %>
-