/
dashboard.haml
78 lines (75 loc) · 2.15 KB
/
dashboard.haml
1
2
3
4
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
- @css = %w(dashboard)
- @js = %w(tmpl dashboard)
/.success This is a test!
.dashboard
.span-12.filter#sites
.header
Sites
%img{ :class => 'add', :src => '/image/add.png' }
%img{ :class => 'remove hide', :src => '/image/remove.png' }
- @sites.each do |site|
.selectable= site['name']
.span-12.last.hide.filter#envs
.header
Environments
%img{ :class => 'add', :src => '/image/add.png' }
%img{ :class => 'remove hide', :src => '/image/remove.png' }
.span-24.last.hide.filter#categories
.header
Categories
%img{ :class => 'add', :src => '/image/add.png' }
%img{ :class => 'remove hide', :src => '/image/remove.png' }
.span-24.last.hide.filter#tests
.header
Tests
%img{ :class => 'add', :src => '/image/add.png' }
%img{ :class => 'remove hide', :src => '/image/remove.png' }
%textarea.hide#tests_form_template
.dialog
%form{ :action => '/tests', :method => 'post' }
.span-2
%label{ :for => 'test_name' } Name
.span-5
%input{ :id => 'test_name', :name => 'name', :type => 'text' }
.clear
.submit
%input{ :type => 'submit', :value => 'Submit' }
%input{ :class => 'cancel', :type => 'reset', :value => 'Cancel' }
%textarea.hide#tests_form_variant_template
.span-2
%label Variant
.span-5
%input{ :class => 'variants', :name => 'variants[]', :type => 'text' }
%textarea.hide#test_template
%table
%tr
%th.first <%= test.name %>
%th Visits
%th Conversions
%th Suggested Visits
%th Confidence
%th Status
<% $.each(test.variants, function(i, variant) { %>
%tr{ :class => '<% if (i % 2 == 0) { %>odd<% } %>'}
%td <%= variant.name %>
<%
var found = false;
$.each(variant.for_dashboard, function(e, item) {
if (e == env) {
found = true; %>
%td <%= item.visits %>
%td <%= item.conversion_rate %>
%td <%= item.suggested_visits %>
%td <%= item.confidence %>
%td ?
<%
}
});
if (!found) { %>
%td 0
%td -
%td -
%td -
%td ?
<% } %>
<% }); %>