diff options
author | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2012-09-24 14:02:35 +0200 |
---|---|---|
committer | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2012-09-24 14:04:01 +0200 |
commit | bcca273d79b1500e89df73b485710d6bd6fd9482 (patch) | |
tree | a64a58871a89d00d5bd3a81052f595131bd22db3 | |
parent | fa239c41c04964afa2a84c051e66625ab6f57249 (diff) | |
download | sonarqube-bcca273d79b1500e89df73b485710d6bd6fd9482.tar.gz sonarqube-bcca273d79b1500e89df73b485710d6bd6fd9482.zip |
SONAR-3675 Remove old code now that AJAX is not used for event widget
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb | 25 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/events.html.erb | 47 |
2 files changed, 0 insertions, 72 deletions
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 @@ -<h3><%= message('events') -%> -<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 %> - |