Module: PostRunner::ViewWidgets

Included in:
ActivityReport, ActivityView, ChartView, TrackView
Defined in:
lib/postrunner/ViewWidgets.rb

Instance Method Summary collapse

Instance Method Details

#frame(doc, title) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/postrunner/ViewWidgets.rb', line 32

def frame(doc, title)
  doc.div({ 'class' => 'widget_frame' }) {
    doc.div({ 'class' => 'widget_frame_title' }) {
      doc.b(title)
    }
    doc.div {
      yield if block_given?
    }
  }
end

#view_widgets_style(doc) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/postrunner/ViewWidgets.rb', line 5

def view_widgets_style(doc)
  doc.style(".widget_frame {\n  box-sizing: border-box;\n  width: 600px;\n  padding: 10px 15px 15px 15px;\n  margin: 15px auto 15px auto;\n  border: 1px solid #ddd;\n  background: #fff;\n  background: linear-gradient(#f6f6f6 0, #fff 50px);\n  background: -o-linear-gradient(#f6f6f6 0, #fff 50px);\n  background: -ms-linear-gradient(#f6f6f6 0, #fff 50px);\n  background: -moz-linear-gradient(#f6f6f6 0, #fff 50px);\n  background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px);\n  box-shadow: 0 3px 10px rgba(0,0,0,0.15);\n  -o-box-shadow: 0 3px 10px rgba(0,0,0,0.1);\n  -ms-box-shadow: 0 3px 10px rgba(0,0,0,0.1);\n  -moz-box-shadow: 0 3px 10px rgba(0,0,0,0.1);\n  -webkit-box-shadow: 0 3px 10px rgba(0,0,0,0.1);\n}\n.widget_frame_title {\n  padding-bottom: 5px;\n}\n"
           )
end