weight-recorder 0.1.3 → 0.1.4

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: 675171b9d1a15a19c2fad53ec54d99ab5621e729
4
- data.tar.gz: e2480e90f74f880db2773215f615f9e593dd9f74
3
+ metadata.gz: 877da1c39f46b47849815309a9b92379a6489cbd
4
+ data.tar.gz: 19ed5f3143e47d7c055ec05a205fa41cddc9abcc
5
5
  SHA512:
6
- metadata.gz: b0f41879966bafc7bc242b40b5c32d9e989a7b48803423e34605523dfec67a5ef05cb6f189c8bf0d51ff5a6331d9aa18b653aeb7ac7b789a23555b97c80cc6ea
7
- data.tar.gz: 326879e3756a7af61f6236272712ea8758eb30f7f5200524347483b34cc1a1e4bf6a4e690655d90111d42ffca1a1dae3ff04aae50c950b3f5327a9f8c3912921
6
+ metadata.gz: 365f6b7df0047810ea16234d62c8691fada29fd58b418a7ece19f1707b8438086745a9a05950f8e0a0eb5a5dde5f6bf8089aa4d360c17501f7bb837029f39638
7
+ data.tar.gz: 1f86ec64faf7dde1bf1ea84904071ddcdaa2abc60eec62c76febaba5002be3c50b7fb70422109fb936f0d3d53a7492671c4f329ab1564a7c1d71f4f6cd470f10
data/lib/application.rb CHANGED
@@ -23,7 +23,7 @@ module Recorder
23
23
  end
24
24
 
25
25
  get '/' do
26
- redirect 'data'
26
+ redirect 'chart'
27
27
  end
28
28
 
29
29
  get '/data' do
@@ -82,6 +82,7 @@ module Recorder
82
82
 
83
83
  get '/chart' do
84
84
  @weight_options = {min: 84, max: 90}
85
+ @bodyfat_options = {min: 15, max: 30}
85
86
  @weight_data,@bodyfat_data = get_data
86
87
  haml :chart
87
88
  end
data/lib/recorder/db.rb CHANGED
@@ -5,12 +5,8 @@ require 'active_record'
5
5
 
6
6
  module Recorder
7
7
 
8
- # データベースへの接続処理を扱うモジュール
9
- # @author sugamasao
10
8
  module DB
11
9
 
12
- #データベースへの接続とテーブルの作成を行う
13
- # @return [void]
14
10
  def self.prepare
15
11
  database_path = File.join(ENV['HOME'], '.recorder','recorder.sqlite3')
16
12
 
@@ -1,3 +1,3 @@
1
1
  module Recorder
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -0,0 +1,17 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta(charset='utf-8')
5
+ %meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no")
6
+ %title Weight Recorder
7
+ /%link(href='/css/bootstrap.min.css' rel='stylesheet' type='text/css')
8
+ %link(rel='stylesheet' type='text/css'){href: uri('css/bootstrap.min.css')}
9
+
10
+ %a(class="glyphicon glyphicon-plus-sign" href='data/new') new
11
+ %button{class: ('btn btn-default navbar-btn')}
12
+ %a(class="glyphicon glyphicon-asterisk" href='chart') chart
13
+ %a(class="glyphicon glyphicon-asterisk" href='data') data
14
+ %button{class: ('btn btn-default navbar-btn')}
15
+
16
+ .container
17
+ !=yield
data/lib/views/chart.haml CHANGED
@@ -1,8 +1,5 @@
1
- %h1 Charts
2
-
3
- %div
4
- %a{href: uri('/')} List
1
+ %h2 Total Charts
5
2
 
6
3
  %p
7
4
  != line_chart @weight_data, @weight_options
8
- != line_chart @bodyfat_data
5
+ != line_chart @bodyfat_data, @bodyfat_options
data/lib/views/index.haml CHANGED
@@ -18,14 +18,15 @@
18
18
  %td= d.date
19
19
  %td= d.created_at.strftime('%Y/%m/%d %H:%M')
20
20
  %td
21
- %a{href: uri("/data/#{d.id}/edit")} Edit
21
+ %button{class: ('btn btn-default navbar-btn')}
22
+ %a(class="glyphicon glyphicon-edit"){href: uri("/data/#{d.id}/edit")} edit
22
23
  %td
23
24
  %form.form-inline(method='post'){action: uri("/data/#{d.id}")}
24
25
  %input(name='_method' type='hidden' value='delete')
25
26
  .form-group
26
- %button(class='btn btn-default')
27
- %a(class='glyphicon glyphicon-minus-sign')
28
- %a(type='submit' onclick='return confirm("Delete data?")') Delete
27
+ %button(class='btn btn-default navbar-btn')
28
+ %a(class='glyphicon glyphicon-trash')
29
+ %a(type='submit' onclick='return confirm("Delete data?")') delete
29
30
 
30
31
 
31
32
 
@@ -13,11 +13,14 @@
13
13
  %nav.navbar.navbar-default
14
14
  .container-fluid
15
15
  .navbar-header
16
- %a.navbar-brand{href: uri('/data')} Weight Recorder
16
+ /%a.navbar-brand{href: uri('/data')} Weight Recorder
17
+ %a.navbar-brand Bob's weight
17
18
  %button{class: ('btn btn-default navbar-btn')}
18
- %a(class="glyphicon glyphicon-plus-sign" href='data/new') new
19
+ %a(class="glyphicon glyphicon-pencil"){href: uri('data/new')} new
19
20
  %button{class: ('btn btn-default navbar-btn')}
20
- %a(class="glyphicon glyphicon-plus-sign" href='chart') chart
21
+ %a(class="glyphicon glyphicon-picture"){href: uri('chart')} chart
22
+ %button{class: ('btn btn-default navbar-btn')}
23
+ %a(class="glyphicon glyphicon-th-list"){href: uri('data')} data
21
24
 
22
25
  .container
23
26
  !=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.3
4
+ version: 0.1.4
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-09-01 00:00:00.000000000 Z
11
+ date: 2016-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -196,6 +196,7 @@ files:
196
196
  - lib/recorder/data.rb
197
197
  - lib/recorder/db.rb
198
198
  - lib/recorder/version.rb
199
+ - lib/views/#layout.haml#
199
200
  - lib/views/_errors.haml
200
201
  - lib/views/_form.haml
201
202
  - lib/views/chart.haml