Project

General

Profile

RE: Hudson Plugin 0.1.0 » index.rhtml

Jason Messmer, 2009-07-01 16:58

 
1
<%# $Id: index.rhtml 175 2009-06-27 15:42:20Z toshiyuki.ando1971 $
2
# To change this template, choose Tools | Templates
3
# and open the template in the editor.
4
%>
5
<style type="text/css">
6
<!-- div#content {
7
  background-image: url("<%="#{@settings.url}images/hudson.png"%>");
8
  background-position: left bottom;
9
  background-repeat: no-repeat;
10
}
11

    
12
 .icon-blue { background-image: url("<%="#{@settings.url}images/24x24/blue.gif"%>"); }
13
 .icon-red { background-image: url("<%="#{@settings.url}images/24x24/red.gif"%>"); }
14
 .icon-grey { background-image: url("<%="#{@settings.url}images/24x24/grey.gif"%>"); }
15
 .icon-yellow { background-image: url("<%="#{@settings.url}images/24x24/yellow.gif"%>"); }
16
 .icon-disabled { background-image: url("<%="#{@settings.url}images/24x24/grey.gif"%>"); }
17

    
18
 .icon-blue_anime { background-image: url("<%="#{@settings.url}images/24x24/blue_anime.gif"%>"); }
19
 .icon-red_anime { background-image: url("<%="#{@settings.url}images/24x24/red_anime.gif"%>"); }
20
 .icon-grey_anime { background-image: url("<%="#{@settings.url}images/24x24/grey_anime.gif"%>"); }
21
 .icon-yellow_anime { background-image: url("<%="#{@settings.url}images/24x24/yellow_anime.gif"%>"); }
22
-->
23
</style>
24

    
25
<h2><%=l(:label_job_list)%></h2>
26

    
27
<% if @jobs.length == 0 %>
28
  <div class="nodata"><%=l(:notice_no_jobs)%></div>
29
<% else %>
30
  <div class="flash notice" id="info" style="display:none;">build accepted</div>
31
  <div class="flash error" id="error" style="display:none;">build failure</div>
32
  <div id="remote-debug" style="display:none;"></div>
33

    
34
  <% @jobs.each do |job|%>
35
    <div class="contextual">
36
     <%= link_to_remote_if_authorized(image_tag("#{@settings.url}images/24x24/clock.gif", :alt => 'build', :title => 'Schedule a build'),
37
          :url => {:action => 'build', :id => @project, :name => job.name},
38
          :update => {:success => 'remote-debug', :failure => 'remote-debug'},
39
          :success => "if(request.responseText.indexOf('build_accepted') > 0 ){Element.show('info');Element.hide('error');}else{Element.show('error');Element.hide('info');}",
40
          :failure => "Element.show('error');Element.hide('info');")
41
    %>
42
    </div>
43

    
44
    <div class="contextual latest-build" id='latest-build-<%=job.name%>'>
45
      <%=job.latest_build.error if "" != job.latest_build.error%>
46
      <% if "" == job.latest_build.error %>
47
        <% if "" != job.latest_build.number %>
48
          <%=image_tag 'document.png', :class=>'icon-build-history', :id=>"build-history-#{job.name}"%>
49
          <%=link_to "##{job.latest_build.number}", job.latest_build.url%>
50
          <%=content_tag("span", job.latest_build.result, :class => "result #{job.latest_build.result.downcase}") if true != job.latest_build.building && "" != job.latest_build.result%>
51
          <%=content_tag("span", l(:notice_building), :class => "result") if true == job.latest_build.building %>
52
          <%=content_tag("span", job.latest_build.finished_at.localtime.strftime("%Y/%m/%d %H:%M:%S")) %>
53
        <% end %>
54
        <%=l(:notice_no_builds) if "" == job.latest_build.number%>
55
      <% end %>
56
    </div>
57

    
58
    <div class="job-state">
59
      <h3 class="icon icon-<%=job.state%>"><span style="padding-left:10px"><%=link_to job.name, job.url%></span></h3>
60
    <% if @settings[:show_compact] != true %>
61
      <div class="wiki">
62
        <%= textilizable job.description -%>
63
      </div>
64

    
65
      <ul>
66
        <% job.health_reports.each do |report| %>
67
          <%="<li>#{link_to(report.description, report.url)} #{report.score}%" if report.url != ""%>
68
          <%="<li>#{report.description} #{report.score}%" if report.url == ""%>
69
        <% end %>
70
      </ul>
71
    <% end %>
72
    </div>
73
  <% end %>
74

    
75
  <div id="build-history" style="display:none;"></div>
76
  <%= javascript_tag "new BuildHistory('#{url_for(:controller => 'hudson', :action => 'history', :id=>@project)}')" %>
77
<% end %>
78

    
79
<% content_for :sidebar do %>
80
  <%= render :partial => 'hudson_sidebar' %>
81
<% end %>
82

    
83
<style type="text/css"></style>
84

    
85
<% content_for :header_tags do %>
86
  <%= stylesheet_link_tag "hudson.css", :plugin => "redmine_hudson", :media => "screen" %>
87
  <%= javascript_include_tag 'build_history', :plugin => "redmine_hudson" %>
88
<% end %>
(2-2/3)