All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.server.dashboard.widget.events.html.erb Maven / Gradle / Ivy

There is a newer version: 7.0
Show newest version
<%
  if @resource.scope=='PRJ'

    conditions = "component_uuid=:component_uuid"
    values = {:component_uuid => @resource.uuid}
    # 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=?", @resource.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

    events=Event.find(:all, :conditions => [conditions, values], :order => 'event_date desc')

    categories = EventCategory.categories(true)
%>




<%= message('widget.events.title') -%>   

<% events.each do |event| categ = event.category profile_data={} if categ=='Profile' && event.event_data profile_data=Hash[*(event.event_data.split(';').map { |elt| elt.split('=') }.flatten)] end %> <% end %>
<%= l(event.event_date.to_date) %> <%= h message('event.category.' + categ, :default => categ) %> <%= link_to_if profile_data['key'] && profile_data['from'] && profile_data['to'], h(event.name), :controller => 'profiles', :action => 'changelog', :key => profile_data['key'], :since => profile_data['from'], :to => profile_data['to'] -%> <% unless event.description.blank? %> <% end %>
<%= message('widget.events.no_event') -%>
<%= message('widget.events.show_all') -%> <% end %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy