Skip to content

Commit

Permalink
Removed YUI, multiple improvements I can't remember since Xmas
Browse files Browse the repository at this point in the history
  • Loading branch information
cknoxrun committed Feb 21, 2017
1 parent d714c46 commit 301ab7f
Show file tree
Hide file tree
Showing 95 changed files with 333 additions and 756 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ vendor/cache/
vendor/ruby
public/assets
config/deployvendor/ruby
*.sublime*
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ gem 'jquery-ui-themes'
gem 'jbuilder', '~> 2.0'
gem 'highcharts-rails'
gem 'jquery-tablesorter'
gem 'yui-rails'
gem 'jquery-cookie-rails'
gem 'country-select'
gem 'devise'
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ GEM
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
will_paginate (3.1.5)
yui-rails (3.13.0.0.3.0)
rails (>= 3.1)

PLATFORMS
ruby
Expand Down Expand Up @@ -296,7 +294,6 @@ DEPENDENCIES
uglifier (>= 1.3.0)
web-console (~> 2.0)
will_paginate
yui-rails

RUBY VERSION
ruby 2.3.0p0
Expand Down
Binary file removed app/assets/images/einstein/logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
//= require jstree
//= require tether
//= require bootstrap
//= require yui-min
//= require_tree .
File renamed without changes.
12 changes: 0 additions & 12 deletions app/controllers/administrators_controller.rb

This file was deleted.

8 changes: 5 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ class ApplicationController < ActionController::Base
before_action :authenticate_user!

def layout_by_resource
if devise_controller? && resource_name == :client
'public'
else
if user_signed_in?
'lims'
elsif client_signed_in?
'client'
else
'public'
end
end

Expand Down
2 changes: 0 additions & 2 deletions app/helpers/administrators_helper.rb

This file was deleted.

9 changes: 4 additions & 5 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,24 @@ def nah(value=nil, message="Not Available")
end
end


def destroy_link(params, title='delete')
def link_to_destroy(params, title='delete')
link_to "#{icon(:remove)} #{title}".html_safe, params,
data: { confirm: 'Are you sure you want to delete this entry?' },
method: :delete, class: 'btn btn-outline-danger btn-sm',
title: 'Delete Entry'
end

def edit_link(params, title='edit')
def link_to_edit(params, title='edit')
link_to "#{icon(:edit)} #{title}".html_safe, params,
class: 'btn btn-sm btn-outline-primary', title: 'Edit Entry'
end

def show_link(params, title='view')
def link_to_show(params, title='view')
link_to "#{icon(:eye)} #{title}".html_safe, params,
class: 'btn btn-sm btn-outline-primary', title: 'Show Entry'
end

def new_link(title, params)
def link_to_new(title, params)
title ||= 'new'
link_to "#{icon(:'plus-square')} add #{title}".html_safe, params, class: 'btn btn-sm btn-outline-success'
end
Expand Down
7 changes: 0 additions & 7 deletions app/views/administrators/index.html.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/batches/batches/unprepped.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<td><%= check_box_tag 'samples[]', s.id %></td>
<td><%= s.barcode %></td>
<td><%= s.collected_on %></td>
<%# show_link s.sample ? sample_sample_path(s.sample, s) : test_subject_sample_path(s.test_subject, s) %>
<%# link_to_show s.sample ? sample_sample_path(s.sample, s) : test_subject_sample_path(s.test_subject, s) %>
</tr>
<% end %>

Expand Down
10 changes: 5 additions & 5 deletions app/views/bovine/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% title 'Home' %>
<h1>Welcome to Metaboflo</h1>
<p>
Welcome to the Metaboflo Laboratory Information Management System (LIMS).
Welcome to the Metaboflo Laboratory Information Management System (LIMS).
Metaboflo is a central repository for study management and metabolomics scientific information.<br />
</p>

<table class="list stats">
<tr class="header">
<th colspan="2">General Statistics</th>
Expand Down Expand Up @@ -37,9 +37,9 @@
<tr class="<%= cycle('odd', 'even') %>">
<td><%= experiment.name %></td>
<td><%= experiment.perform_on %></td>
<td><%= show_link [experiment.sample, experiment] %></td>
<td><%= edit_link edit_sample_experiment_path(experiment.sample, experiment) %></td>
<td><%= destroy_link [experiment.sample, experiment] %></td>
<td><%= link_to_show [experiment.sample, experiment] %></td>
<td><%= link_to_edit edit_sample_experiment_path(experiment.sample, experiment) %></td>
<td><%= link_to_destroy [experiment.sample, experiment] %></td>
</tr>
<% end %>
</table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/data_file_types/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<%= render 'form' %>

<%= show_link @data_file_type %>
<%= link_to_show @data_file_type %>
8 changes: 4 additions & 4 deletions app/views/data_file_types/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<tr class="<%= cycle('odd', 'even') %>">
<td><%= data_file_type.name %></td>
<td><%= data_file_type.description %></td>
<td><%= show_link data_file_type %></td>
<td><%= edit_link edit_data_file_type_path(data_file_type) %></td>
<td><%= destroy_link(data_file_type) %></td>
<td><%= link_to_show data_file_type %></td>
<td><%= link_to_edit edit_data_file_type_path(data_file_type) %></td>
<td><%= link_to_destroy(data_file_type) %></td>
</tr>
<% end %>
</table>

<br />

<%= new_link 'data file type', new_data_file_type_path %>
<%= link_to_new 'data file type', new_data_file_type_path %>
2 changes: 1 addition & 1 deletion app/views/data_file_types/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
</p>


<%= edit_link edit_data_file_type_path(@data_file_type) %>
<%= link_to_edit edit_data_file_type_path(@data_file_type) %>
6 changes: 3 additions & 3 deletions app/views/data_files/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<td><%= link_to h(data_file.data_file_name), data_file.data.url %></td>
<td><%= number_to_human_size(data_file.data_file_size) %></td>
<td><%= link_to h(data_file.data_file_type.name), data_file_type_path(data_file.data_file_type) %></td>
<td><%= show_link experiment_data_file_path(data_file.experiment, data_file) %></td>
<td><%= destroy_link experiment_data_file_path(data_file.experiment, data_file) %></td>
<td><%= link_to_show experiment_data_file_path(data_file.experiment, data_file) %></td>
<td><%= link_to_destroy experiment_data_file_path(data_file.experiment, data_file) %></td>
</tr>
<% end %>
</table>

<br />

<% if @experiment %>
<%= new_link 'data file for this experiment', new_experiment_data_file_path(@experiment) %>
<%= link_to_new 'data file for this experiment', new_experiment_data_file_path(@experiment) %>
<% end %>
4 changes: 2 additions & 2 deletions app/views/diets/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>Editing diet</h1>

<%= render :partial => 'form' %>
<%= show_link @diet %>

<%= link_to_show @diet %>
8 changes: 4 additions & 4 deletions app/views/diets/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<% @diets.each do |diet| %>
<tr>
<td><%= diet.name %></td>
<td><%= show_link diet %></td>
<td><%= edit_link edit_diet_path(diet) %></td>
<td><%= destroy_link diet %></td>
<td><%= link_to_show diet %></td>
<td><%= link_to_edit edit_diet_path(diet) %></td>
<td><%= link_to_destroy diet %></td>
</tr>
<% end %>
</table>

<br />

<%= new_link 'diet', new_diet_path %>
<%= link_to_new 'diet', new_diet_path %>
6 changes: 3 additions & 3 deletions app/views/diets/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<th>Name</th>
<th>Amount (%)</th>
</tr>

<% @diet.diet_ingredients.each do |diet_ingredient| -%>
<tr>
<td><%= diet_ingredient.ingredient.name %></td>
Expand All @@ -29,7 +29,7 @@
<th>Name</th>
<th>Amount</th>
</tr>

<% @diet.compositions.each do |composition| -%>
<tr>
<td><%= composition.nutrient.name %></td>
Expand All @@ -41,4 +41,4 @@

<br />

<%= edit_link edit_diet_path(@diet) %>
<%= link_to_edit edit_diet_path(@diet) %>
2 changes: 1 addition & 1 deletion app/views/experiments/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<%= render :partial => 'form' %>

<%= show_link [@sample, @experiment] %>
<%= link_to_show [@sample, @experiment] %>
51 changes: 0 additions & 51 deletions app/views/experiments/index.html.erb

This file was deleted.

46 changes: 46 additions & 0 deletions app/views/experiments/index.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
h1= @sample.blank? ? 'Experiments' : "Experiments for sample # @sample "

table.list
thead
tr
th= TestSubject.title
th Sample
th Title
th Type
th Description
th To be analyzed by
th To be analyzed on
th Analyzed by
th Analyzed on
th Data Files
th colspan="3"
tbody
- @experiments.each do |experiment|
tr
td= link_to(experiment.sample.root, experiment.sample.root)
td= link_to(experiment.sample, experiment.sample)
td= experiment.name
td= experiment.experiment_type.name unless experiment.experiment_type.nil?
td= truncate(experiment.description, :length => 50)
td= link_to(experiment.assigned_to.name, experiment.assigned_to) if experiment.assigned_to.present?
td= experiment.perform_on
td
- if experiment.performed_by
= link_to(experiment.performed_by.name, experiment.performed_by)
- else
= nah nil
td = nah experiment.performed_on
td
- if experiment.data_files.length > 0
ul
- experiment.data_files.each do |data_file|
li= link_to data_file.data_file_name, data_file.data.url
- else
= nah
td= link_to_show [experiment.sample, experiment]
td= link_to_edit edit_sample_experiment_path(experiment.sample, experiment)
td= link_to_destroy [experiment.sample, experiment]

- if @sample.present?
= link_to_new 'experiment for this sample', new_sample_experiment_path(@sample)

Loading

0 comments on commit 301ab7f

Please sign in to comment.