weight-recorder 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cae9eb183877b338a0fa881481a9aa22bf132f2f
4
- data.tar.gz: 1f931cbbddc17446b50f7e3e91a09820c839683e
3
+ metadata.gz: 74b82aad9cbceb4cccbb238299e320480092c8ba
4
+ data.tar.gz: 8690d758f23d762c18d2ef5b2f715267de6aab88
5
5
  SHA512:
6
- metadata.gz: e235eac007766b1c83939d5b59c22c5fd2615d89d51504494fa11d80bfdda90fe310fe2c15eeb7a9f87377389d5a633c4737f204960afc215063df4a82be1a03
7
- data.tar.gz: a4d60474ac5ebfd7970d798f799dbb6e1c54a05f7702fb27af435d4c87e14b66d7db54132d3878ff7d57d8b489a3060f65a387034cc9542e6c1e84a759b5c521
6
+ metadata.gz: e83f583ead21d9d83e77895e674afcc5917a33930e4bf1f3658d1b125f57283b14be6bcdcd1a425d6f2b762e2a629d668dc7d5c3d66416907ccd90d41fbcc314
7
+ data.tar.gz: c2e543be74ea5a12947b381732ae1e9fc83640cd05ad1f25c5d06d2693c7e3e08227406194bf04e0aec23ba4828cfcd831e2573ee71267a8eae6464ddfeea337
@@ -107,18 +107,28 @@ module Recorder
107
107
  haml :chart
108
108
  end
109
109
 
110
+ get '/chart_recent' do
111
+ @weight_options = {min: @min, max: @max}
112
+ @bodyfat_options = {min: @min, max: @max}
113
+ @weight_data,@bodyfat_data = get_data(:recent)
114
+ haml :chart
115
+ end
116
+
110
117
  require 'date'
111
118
  require 'time'
112
119
 
113
- def get_data(period=:all)
120
+ def get_data(period=:whole)
114
121
  @data = Data.order('created_at DESC')
115
122
  weight_data,bodyfat_data=[],[]
116
123
  today = Date.today
117
124
  week_before=Time.parse((today-7).strftime)
118
125
  month_before=Time.parse((today-28).strftime)
126
+ recent=Time.parse('2016-8-26')
119
127
  @data.each{|d|
120
128
  case period
121
- when :all
129
+ when :whole
130
+ when :recent
131
+ next if d.date < recent
122
132
  when :week
123
133
  next if d.date < week_before
124
134
  when :month
@@ -1,3 +1,3 @@
1
1
  module Recorder
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
@@ -21,11 +21,13 @@
21
21
  %button{class: ('btn btn-default navbar-btn')}
22
22
  %a(class="glyphicon glyphicon-th-list"){href: uri('data')} data
23
23
  %button{class: ('btn btn-default navbar-btn')}
24
- %a(class="glyphicon glyphicon-picture"){href: uri('chart')} all
24
+ %a(class="glyphicon glyphicon-picture"){href: uri('chart')} whole
25
25
  %button{class: ('btn btn-default navbar-btn')}
26
26
  %a(class="glyphicon glyphicon-picture"){href: uri('chart_week')} week
27
27
  %button{class: ('btn btn-default navbar-btn')}
28
28
  %a(class="glyphicon glyphicon-picture"){href: uri('chart_month')} month
29
+ %button{class: ('btn btn-default navbar-btn')}
30
+ %a(class="glyphicon glyphicon-picture"){href: uri('chart_recent')} recent
29
31
 
30
32
  .container
31
33
  !=yield
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weight-recorder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeto R. Nishitani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2016-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord