Skip to content

Commit

Permalink
Merge branch 'master' into value_constraints_batch_1
Browse files Browse the repository at this point in the history
  • Loading branch information
gsrohde committed Jun 19, 2015
2 parents 9c30227 + 0d852fe commit b1f5891
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 98 deletions.
2 changes: 0 additions & 2 deletions app/models/db_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class DBFile < ActiveRecord::Base
def setup(user_id, upload, args = nil)
self[:created_user_id] = user_id
self[:updated_user_id] = user_id
self[:parent_id] = args[:parent_id]
self[:file_id] = args[:file_id]
if upload # Uploaded file
self[:file_name] = upload.original_filename
self[:md5] = Digest::MD5.file(upload.path).hexdigest
Expand Down
5 changes: 1 addition & 4 deletions app/views/citations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( citations_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand All @@ -73,6 +73,3 @@
</div>
</div>
</div>



2 changes: 1 addition & 1 deletion app/views/covariates/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( covariates_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/cultivars/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( cultivars_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
24 changes: 12 additions & 12 deletions app/views/dbfiles/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div class="content">
<div class="container">
<div class="sixteen columns">
<header>
<h1>Editing File</h1>
<hearder>
<%= form_for @file, :url => dbfile_path(@file) do |f| %>
<%= f.error_messages %>
<div class="sixteen columns">
<header>
<h1>Editing File</h1>
</header>
<%= form_for @file, :url => dbfile_path(@file) do |f| %>
<%= f.error_messages %>
<div class="row">
<div class="eight columns alpha">
<%= f.label :machine_id %><br />
<%= f.select :machine_id, Machine.all.collect { |p| [p.select_default, p.id] }, :class => "input-full" %>
</div>
<div class="eight columns alpha">
<%= f.label :machine_id %><br />
<%= f.select :machine_id, Machine.all.collect { |p| [p.select_default, p.id] }, {}, { :class => "input-full" } %>
</div>
</div>
<div class="row">
<div class="sixteen columns alpha">
<%= f.label :file_path %><br />
<%= f.text_field :file_path, :class => "input-full" %>
<%= f.label :file_path %><br />
<%= f.text_field :file_path, :class => "input-full" %>
</div>
</div>
<div class="row">
Expand Down
60 changes: 40 additions & 20 deletions app/views/dbfiles/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
<h1>New File</h1>
<%= form_for @file, :url => dbfiles_path, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<div class="content">
<div class="container">
<div class="sixteen columns">
<header>
<h1>New File</h1>
</header>
<%= form_for @file, :url => dbfiles_path do |f| %>
<%= f.error_messages %>
<div class="row">
<div class="eight columns alpha">
<%= f.label :machine_id %><br />
<%= f.select :machine_id, Machine.all.collect { |p| [p.select_default, p.id] }, {}, { :class => "input-full" } %>
</div>
</div>
<div class="row">
<div class="sixteen columns alpha">
<%= f.label :file_path %><br />
<%= f.text_field :file_path, :class => "input-full" %>
</div>
</div>
<div class="row">
<div class="sixteen columns alpha">
<%= f.label :file_name %><br />
<%= f.text_field :file_name, :class => "input-full" %>
</div>
</div>

<p>
<%= f.label :machine_id %><br />
<%= f.select :machine_id, Machine.all.collect { |p| [p.select_default, p.id] } %>
</p>
<p>
<%= f.label :file_path %><br />
<%= f.text_field :file_path %>
</p>
<p>
<%= f.label :file_name %><br />
<%= f.text_field :file_name %>
</p>

<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<div class="form-actions">
<div class="button-group">
<%= link_to( dbfiles_path ) do %>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
<%= f.submit 'Create', :class => "button button-primary" %>
</div>
</div>
<% end %>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/entities/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( entities_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/formats/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( formats_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/machines/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( machines_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/managements/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( managements_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/methods/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( methods_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/pfts/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( pfts_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/priors/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( priors_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
11 changes: 1 addition & 10 deletions app/views/sites/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,8 @@

<div class="form-actions">
<div class="button-group">
<%= link_to( @site ) do %>
<button class="button" type="button">Show</button>
<% end%>
<%= link_to( sites_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand All @@ -429,12 +426,6 @@

<% end %>
<% end %>

<span id='search_term'></span>
<div id="index_table" style="display: none;">
</div>

<%= link_to 'Back', sites_path %>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/species/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( species_index_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/traits/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</div>
<div class="four columns omega">
<%= f.label :access_level %>
<%= f.select :access_level, [["1.Restricted",1],['2.EBI Researchers',2],['3.External Researchers',3],['4.Public',4]], :selected => 2,:class => "input-full" %>
<%= f.select :access_level, [["1.Restricted",1],['2.EBI Researchers',2],['3.External Researchers',3],['4.Public',4]], :class => "input-full" %>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/traits/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<div class="row form-actions">
<div class="button-group">
<%= link_to(traits_path) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/treatments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( treatments_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( users_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/variables/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( variables_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<div class="button-group pull-right">
Expand Down
4 changes: 2 additions & 2 deletions app/views/yields/_index_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<td class="center"><%= link_to_if y.site, y.site, y.site %></td>
<td class="center"><%= link_to_if y.treatment, y.treatment, y.treatment %></td>

<% if ( current_user.access_level < y.access_level ) or ( y.user_id == current_user.id ) or ( current_user.page_access_level <= 2 ) %>
<% if (current_user.page_access_level <= 3) %>
<td class="center">
<%= select_tag 'checked-'+y.id.to_s, options_for_select([["failed",-1],["unchecked",0],["passed",1]],y.checked) %> <span id='checked_notify-<%= y.id %>'></span>
</td>

<% else %>
<td class="center"><%= ["failed","unchecked","passed"][y.checked-1] %></td>
<td class="center"><%= ["failed","unchecked","passed"][y.checked + 1] %></td>
<% end %>
<% if ( current_user.access_level < y.access_level ) or ( current_user.access_level = y.access_level and y.checked ) or ( y.user_id == current_user.id ) or ( current_user.page_access_level <= 2 )%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/yields/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<%= f.select :dateloc, options_for_select($dateloc_drop.sort, f.object.dateloc || $dateloc_drop_default), :class => "input-full" %>
<br />
<%= f.label :access_level %>
<%= f.select :access_level, [["1.Restricted",1],['2.EBI',2],['3.External',3],['4.Public',4]], :selected => current_user.access_level, :class => "input-full" %>
<%= f.select :access_level, [["1.Restricted",1],['2.EBI',2],['3.External',3],['4.Public',4]], :class => "input-full" %>
</div>
<div class="eight columns omega">
<%= f.label :notes %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/yields/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<div class="form-actions">
<div class="button-group">
<%= link_to( yields_path ) do %>
<button class="button" type="button">Back</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end%>
</div>
<%= f.hidden_field :citation_id, :value => session['citation'] %>
Expand Down
2 changes: 1 addition & 1 deletion lib/data_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def all_limited(current_user)
access_level = 4
end

if respond_to?("checked") and respond_to?("user_id")
if column_names.include?("checked") and column_names.include?("user_id")
where("(#{table_name}.checked >= ? and #{table_name}.access_level >= ?) or #{table_name}.user_id = ?",
checked, access_level, user)
else
Expand Down
4 changes: 2 additions & 2 deletions spec/features/management_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
end
it 'should display the new management form' do
visit(treatments_path)
first(:xpath, ".//a[text() = 'New Management for this treatment']").click
first(:xpath, ".//a[text() = 'Create a New Management for this Treatment']").click
page.should_not have_content "We're sorry"
end
it 'should not have a citations select box' do
visit(treatments_path)
first(:xpath, ".//a[text() = 'New Management for this treatment']").click
first(:xpath, ".//a[text() = 'Create a New Management for this Treatment']").click
page.should_not have_selector(:xpath, '//select[@name="management[citation_id]"]')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/pft_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
# test for redmine bug #1784
it 'should not create a new PFT when the Back button is clicked' do
visit '/pfts/new'
click_button 'Back'
click_button 'All Records'
page.should_not have_content 'Pft was successfully created.'
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/treatment_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

before :each do
visit '/treatments/'
first(:xpath,".//a[@alt='edit' and contains(@href,'/edit')]").click
first(:xpath,".//a[@title='edit' and contains(@href,'/edit')]").click
end

it 'following edit link should return content "Editing Treatment" ' do
Expand Down
26 changes: 0 additions & 26 deletions spec/views/treatments/index.html.erb_spec.rb

This file was deleted.

0 comments on commit b1f5891

Please sign in to comment.