-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pikesley
committed
Jan 29, 2016
1 parent
58a6341
commit 1a210d2
Showing
11 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
@import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css); | ||
@import url(//fonts.googleapis.com/css?family=NTR); | ||
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'); | ||
@import url('//fonts.googleapis.com/css?family=NTR'); | ||
|
||
$font-family-sans-serif: NTR, sans-serif; | ||
|
||
body { | ||
text-transform: lowercase; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,3 @@ | ||
<%= link_to 'Add new measurement', new_glucose_measurement_path, class: 'btn btn-success pull-right' %> | ||
<h1>Glucose</h1> | ||
|
||
<table class='table table-bordered table-striped' id='blood-glucose'> | ||
<% date_sift(@metrics).each_pair do |day, values| %> | ||
<tr> | ||
<th colspan=2> | ||
<% date = Time.parse(day) %> | ||
<%= date.strftime "%A %B #{date.day.ordinalize}" %> | ||
</th> | ||
</tr> | ||
<% values.each do |value| %> | ||
<%= render partial: 'shared/table_row', locals: { | ||
passed_value: value, | ||
fields: ['value'], | ||
edit_path: edit_glucose_measurement_path(value) | ||
} %> | ||
<% end %> | ||
<% end %> | ||
</table> | ||
|
||
<script> | ||
$('.glucose-measurement-value').each(function() { | ||
if($(this).text() > 8.0) { | ||
$(this).addClass('bg-high') | ||
} | ||
if($(this).text() < 4.0) { | ||
$(this).addClass('bg-low') | ||
} | ||
}) | ||
</script> | ||
<%= render partial: 'shared/index', locals: { | ||
title: 'glucose' | ||
} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
<%= link_to 'Add new meds', new_medication_event_path, class: 'btn btn-success pull-right' %> | ||
<h1>Meds</h1> | ||
|
||
<table class='table table-bordered table-striped'> | ||
<% date_sift(@metrics).each_pair do |day, values| %> | ||
<tr> | ||
<th colspan=3> | ||
<% date = Time.parse(day) %> | ||
<%= date.strftime "%A %B #{date.day.ordinalize}" %> | ||
</th> | ||
</tr> | ||
<% values.each do |value| %> | ||
<%= render partial: 'shared/table_row', locals: { | ||
passed_value: value, | ||
fields: ['amount', 'insulin'], | ||
edit_path: edit_medication_event_path(value) | ||
} %> | ||
<% end %> | ||
<% end %> | ||
</table> | ||
<%= render partial: 'shared/index', locals: { | ||
title: 'meds' | ||
} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<%= link_to "Add new #{title}", | ||
send("new_#{@metrics.first.class.name.underscore}_path".to_sym), | ||
class: 'btn btn-success pull-right' %> | ||
<h1><%= title.titleize %></h1> | ||
|
||
<%= render partial: 'shared/table', locals: { | ||
metrics: @metrics | ||
} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<table class='table table-bordered table-striped'> | ||
<% date_sift(metrics).each_pair do |day, values| %> | ||
<tr> | ||
<th colspan=64> <!-- bootstrap ignores this maybe? --> | ||
<% date = Time.parse(day) %> | ||
<%= date.strftime "%A %B #{date.day.ordinalize}" %> | ||
</th> | ||
</tr> | ||
<% values.each do |value| %> | ||
<%= render partial: 'shared/table_row', locals: { | ||
passed_value: value, | ||
fields: begin | ||
@metrics.first.class.fields | ||
rescue NoMethodError | ||
@metrics.first.attributes.keys[2..-3] | ||
end | ||
} %> | ||
<% end %> | ||
<% end %> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class MoveColumn < ActiveRecord::Migration | ||
def change | ||
change_column :medication_events, :amount, :float, after: :insulin | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters