public
Fork of benburkert/cruisecontrolrb
Description: CruiseControl.rb is a continuous integration tool, written in Ruby. It is quick to install, simple to use and easy to hack.
Homepage: http://cruisecontrolrb.thoughtworks.com/
Clone URL: git://github.com/dustin/cruisecontrolrb.git
cruisecontrolrb / app / views / projects / _project.rhtml
100644 80 lines (71 sloc) 2.757 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<div id="project_<%= project.name %>" class="project build_<%= project.last_complete_build_status %>">
<table class="project_pane">
<tr>
 
  <td class="project_summary">
 
    <div>
      <span class="project_name">
        <%= link_to project.name, :action => 'show', :id => project.name %>
      </span>
    </div>
 
    <div class="recent_builds">
 
      <% recent_builds = project.last_five_builds %>
 
      <span class="lead">
        <%= recent_builds.first ? 'build ' : '<span class="build_status">Never built</span>' %>
        <br/>
        <%= link_to image_tag('rss_light.gif'), :action => 'show', :id => project.name, :format => 'rss' %>
      </span>
 
      <% unless recent_builds.empty? %>
        <div class="builds_list">
          <% recent_builds.each do |build| %>
            <% if build == recent_builds.first %>
                <div class="build_summary"><%= link_to_build_with_elapsed_time(project, build) %></div>
            <% else %>
                <div class="build_summary"><%= link_to_build(project, build) %></div>
            <% end %>
          <% end %>
        </div>
      <% end %>
    </div>
  </td>
 
  <td class="builder_control">
    <% unless Configuration.disable_build_now -%>
      <div class="buttons">
        <% form_remote_tag(
             :url => { :action => 'build', :id => project },
             :before => "$('build_#{project.to_param}').disabled = true; " +
                        "$('build_#{project.to_param}').className = 'build_button_disabled'; " +
                        "Element.update('build_#{project.to_param}', 'Wait...')"
           ) do %>
          <button id="build_<%= project.to_param %>"
            type="submit" class="build_button" value="txt" alt="Build Now">
            <% if project.builder_state_and_activity == 'builder_down' %>
              Start Builder
            <% else %>
              Build Now
            <% end %>
          </button>
        <% end %>
      </div>
    <% end %>
    <%= display_builder_state(project.builder_state_and_activity) %>
  </td>
 
  <td class="build_details">
    <% latest_build = recent_builds.first %>
    <% if latest_build %>
      <% if latest_build.incomplete? %>
        <div>
          Now building: <%= latest_build.label %>
          for <%= format_seconds(latest_build.elapsed_time_in_progress, :general) %>
        </div>
      <% end %>
      <%= show_revisions_in_build(revisions_in_build(latest_build)) %>
      <br>
      <% if latest_build.brief_error %>
        <div><%= link_to latest_build.brief_error, {:action => 'show', :id => project.name}, {:class => "failed"} %></div>
      <% end %>
      <div class="error_message"><%= project.builder_error_message %></div>
    <% end %>
  </td>
</tr>
</table>
</div>