%# $Id: index.rhtml 175 2009-06-27 15:42:20Z toshiyuki.ando1971 $
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>
<%=l(:label_job_list)%>
<% if @jobs.length == 0 %>
<%=l(:notice_no_jobs)%>
<% else %>
build accepted
build failure
<% @jobs.each do |job|%>
<%= link_to_remote_if_authorized(image_tag("#{@settings.url}images/24x24/clock.gif", :alt => 'build', :title => 'Schedule a build'),
:url => {:action => 'build', :id => @project, :name => job.name},
:update => {:success => 'remote-debug', :failure => 'remote-debug'},
:success => "if(request.responseText.indexOf('build_accepted') > 0 ){Element.show('info');Element.hide('error');}else{Element.show('error');Element.hide('info');}",
:failure => "Element.show('error');Element.hide('info');")
%>
<%=job.latest_build.error if "" != job.latest_build.error%>
<% if "" == job.latest_build.error %>
<% if "" != job.latest_build.number %>
<%=image_tag 'document.png', :class=>'icon-build-history', :id=>"build-history-#{job.name}"%>
<%=link_to "##{job.latest_build.number}", job.latest_build.url%>
<%=content_tag("span", job.latest_build.result, :class => "result #{job.latest_build.result.downcase}") if true != job.latest_build.building && "" != job.latest_build.result%>
<%=content_tag("span", l(:notice_building), :class => "result") if true == job.latest_build.building %>
<%=content_tag("span", job.latest_build.finished_at.localtime.strftime("%Y/%m/%d %H:%M:%S")) %>
<% end %>
<%=l(:notice_no_builds) if "" == job.latest_build.number%>
<% end %>
<%=link_to job.name, job.url%>
<% if @settings[:show_compact] != true %>
<%= textilizable job.description -%>
<% job.health_reports.each do |report| %>
<%="- #{link_to(report.description, report.url)} #{report.score}%" if report.url != ""%>
<%="
- #{report.description} #{report.score}%" if report.url == ""%>
<% end %>
<% end %>
<% end %>
<%= javascript_tag "new BuildHistory('#{url_for(:controller => 'hudson', :action => 'history', :id=>@project)}')" %>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'hudson_sidebar' %>
<% end %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "hudson.css", :plugin => "redmine_hudson", :media => "screen" %>
<%= javascript_include_tag 'build_history', :plugin => "redmine_hudson" %>
<% end %>