https://svn.lrde.epita.fr/svn/ranch/trunk
Index: ChangeLog
from Nicolas Desprès <nicolas.despres(a)lrde.epita.fr>
Start to handle the system.
* web/ranch/test/functional/benches_controller_test.rb: Test that
the system query get something.
* web/ranch/app/controllers/benches_controller.rb: Query the system
hostname list.
* web/ranch/app/views/benches/regression.rhtml: Display the system
list.
app/controllers/benches_controller.rb | 7 +++++++
app/views/benches/regression.rhtml | 16 ++++++++++++++++
test/functional/benches_controller_test.rb | 1 +
3 files changed, 24 insertions(+)
Index: web/ranch/test/functional/benches_controller_test.rb
--- web/ranch/test/functional/benches_controller_test.rb (revision 59)
+++ web/ranch/test/functional/benches_controller_test.rb (working copy)
@@ -39,6 +39,7 @@
assert_not_nil assigns(:bench)
assert_not_nil assigns(:output_arg_num)
assert_not_nil assigns(:inputs)
+ assert_not_nil assigns(:systems)
assert_kind_of Hash, assigns(:revision)
assert assigns(:revision)[:start] < assigns(:revision)[:stop]
assert assigns(:revision)[:start] >= 1
Index: web/ranch/app/controllers/benches_controller.rb
--- web/ranch/app/controllers/benches_controller.rb (revision 59)
+++ web/ranch/app/controllers/benches_controller.rb (working copy)
@@ -29,6 +29,13 @@
"ORDER BY outputs.arg_num "
@output_arg_nb = @output_arg_nb.size
end
+ @systems = System.find_by_sql %(
+ SELECT systems.hostname
+ FROM systems, outputs
+ WHERE systems.id = outputs.system_id
+ AND outputs.bench_id = #{(a)bench.id}
+ GROUP BY systems.id
+ ORDER BY systems.hostname)
if params[:revision].nil? or params[:revision][:range].nil?
@revision = {}
@revision[:stop], @revision[:start] = default_revision
Index: web/ranch/app/views/benches/regression.rhtml
--- web/ranch/app/views/benches/regression.rhtml (revision 59)
+++ web/ranch/app/views/benches/regression.rhtml (working copy)
@@ -59,8 +59,24 @@
<tr>
<td><%= outputs_tag "output_arg_num", @bench.name, @output_arg_num
%></td>
</tr>
+ </table>
</td>
+</tr>
+
+<!-- SYSTEMS -->
+
+<tr>
+ <td>System:</td>
+ <td>
+ <table>
+ <tr>
+ <select id="system" name="system">
+ <% for system in @systems do %>
+ <%= content_tag "option", system.hostname, :value => system.hostname
%>
+ <% end %>
+ </tr>
</table>
+ </td>
</tr>
<!-- SUBMIT BUTTON -->