mountain-goat 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/README.md +84 -70
  2. data/generators/mg/mg_generator.rb +9 -3
  3. data/generators/mg/templates/create_mountain_goat_tables.rb +4 -0
  4. data/generators/mg/templates/mountain-goat.yml +1 -0
  5. data/lib/mountain-goat.rb +12 -12
  6. data/lib/mountain-goat/controllers/mg/mountain_goat_controller.rb +1 -1
  7. data/lib/mountain-goat/controllers/mg/report_items_controller.rb +5 -5
  8. data/lib/mountain-goat/controllers/mg/reports_controller.rb +28 -1
  9. data/lib/mountain-goat/metric_tracking.rb +4 -4
  10. data/lib/mountain-goat/models/mg/report.rb +4 -4
  11. data/lib/mountain-goat/models/mg/report_item.rb +2 -2
  12. data/lib/mountain-goat/models/mg/report_mailer.rb +7 -0
  13. data/lib/mountain-goat/public/jquery.raphael.js +25 -1
  14. data/lib/mountain-goat/public/mg.css +307 -316
  15. data/lib/mountain-goat/public/mg.js +17 -16
  16. data/lib/mountain-goat/public/mg.png +0 -0
  17. data/lib/mountain-goat/version.rb +1 -1
  18. data/lib/mountain-goat/views/mountain_goat/layouts/mountain_goat.html.erb +21 -20
  19. data/lib/mountain-goat/views/mountain_goat/mg/mountain_goat/login.html.erb +11 -19
  20. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_form.html.erb +1 -1
  21. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_pivot_form.html.erb +4 -4
  22. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb +7 -2
  23. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb +1 -1
  24. data/lib/mountain-goat/views/mountain_goat/mg/reports/edit.html.erb +27 -30
  25. data/lib/mountain-goat/views/mountain_goat/mg/reports/index.html.erb +24 -20
  26. data/lib/mountain-goat/views/mountain_goat/mg/reports/new.html.erb +14 -13
  27. data/lib/mountain-goat/views/mountain_goat/mg/reports/show.html.erb +10 -13
  28. data/mountain-goat.gemspec +2 -2
  29. metadata +31 -54
  30. data/lib/mountain-goat/controllers/mg/metric_variants_controller.rb +0 -81
  31. data/lib/mountain-goat/controllers/mg/metrics_controller.rb +0 -110
  32. data/lib/mountain-goat/controllers/mg/rallies_controller.rb +0 -43
  33. data/lib/mountain-goat/models/mg/ci_meta.rb +0 -10
  34. data/lib/mountain-goat/models/mg/convert.rb +0 -147
  35. data/lib/mountain-goat/models/mg/convert_meta_type.rb +0 -20
  36. data/lib/mountain-goat/models/mg/cs_meta.rb +0 -10
  37. data/lib/mountain-goat/models/mg/metric.rb +0 -8
  38. data/lib/mountain-goat/models/mg/metric_variant.rb +0 -25
  39. data/lib/mountain-goat/models/mg/rally.rb +0 -59
  40. data/lib/mountain-goat/views/mountain_goat/mg/converts/.tmp_show.html.erb.4433~ +0 -69
  41. data/lib/mountain-goat/views/mountain_goat/mg/converts/_convert_form.html.erb +0 -26
  42. data/lib/mountain-goat/views/mountain_goat/mg/converts/_convert_meta_type_form.html.erb +0 -27
  43. data/lib/mountain-goat/views/mountain_goat/mg/converts/edit.html.erb +0 -13
  44. data/lib/mountain-goat/views/mountain_goat/mg/converts/index.html.erb +0 -25
  45. data/lib/mountain-goat/views/mountain_goat/mg/converts/new.html.erb +0 -13
  46. data/lib/mountain-goat/views/mountain_goat/mg/converts/show.html.erb +0 -44
  47. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/_metric_variant_form.html.erb +0 -37
  48. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/edit.html.erb +0 -13
  49. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/index.html.erb +0 -34
  50. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/new.html.erb +0 -15
  51. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/show.html.erb +0 -30
  52. data/lib/mountain-goat/views/mountain_goat/mg/metrics/.tmp_show.html.erb.21270~ +0 -68
  53. data/lib/mountain-goat/views/mountain_goat/mg/metrics/_metric_form.html.erb +0 -24
  54. data/lib/mountain-goat/views/mountain_goat/mg/metrics/edit.html.erb +0 -13
  55. data/lib/mountain-goat/views/mountain_goat/mg/metrics/index.html.erb +0 -14
  56. data/lib/mountain-goat/views/mountain_goat/mg/metrics/new.html.erb +0 -14
  57. data/lib/mountain-goat/views/mountain_goat/mg/metrics/show.html.erb +0 -67
  58. data/lib/mountain-goat/views/mountain_goat/mg/rallies/.tmp__rally.html.erb.40484~ +0 -12
  59. data/lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies.html.erb +0 -5
  60. data/lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies_form.html.erb +0 -21
  61. data/lib/mountain-goat/views/mountain_goat/mg/rallies/_rally.html.erb +0 -12
  62. data/lib/mountain-goat/views/mountain_goat/mg/rallies/edit.html.erb +0 -13
  63. data/lib/mountain-goat/views/mountain_goat/mg/rallies/index.html.erb +0 -19
  64. data/lib/mountain-goat/views/mountain_goat/mg/rallies/new.html.erb +0 -13
  65. data/lib/mountain-goat/views/mountain_goat/mg/rallies/show.html.erb +0 -14
@@ -1,59 +0,0 @@
1
- class Mg::Rally < ActiveRecord::Base
2
- set_table_name :mg_rallies
3
-
4
- belongs_to :convert, :class_name => "Mg::Convert"
5
- has_many :convert_meta_types, :through => :convert, :class_name => "Mg::ConvertMetaType"
6
- #has_many :ci_metas, :through => :convert_meta_types
7
- #has_many :cs_metas, :through => :convert_meta_types
8
-
9
- #Set meta data for applicable options-- don't store nil data (waste of space)
10
- def set_meta_data(options)
11
- options.each do |option|
12
- cmt = convert_meta_types.find_by_var(option[0].to_s)
13
-
14
- #Create cmt if it doesn't current exist (unless nil)
15
- if cmt.nil? && !option[1].nil? && ( option[1].is_a?(Integer) || option[1].is_a?(String) )
16
- #infer type
17
- meta_type = "ci_meta" if option[1].is_a?(Integer)
18
- meta_type = "cs_meta" if option[1].is_a?(String)
19
- cmt = convert.convert_meta_types.create!(:name => option[0].to_s, :var => option[0].to_s, :meta_type => meta_type)
20
- end
21
-
22
- if !cmt.nil? #only if we can do it
23
- cmt.meta.create!(:rally_id => self.id, :data => option[1]) if !option[1].nil?
24
- end
25
- end
26
- end
27
-
28
- def meta_for( var )
29
- cmt = convert_meta_types.find_by_var( var.to_s )
30
- return nil if cmt.nil?
31
- m = cmt.meta.find_by_rally_id( self.id )
32
- return nil if m.nil?
33
- return m.data
34
- end
35
-
36
- def all_metas
37
- res = {}
38
- self.convert_meta_types.each do |cmt|
39
- r = res.count
40
- begin
41
- if cmt.var =~ /(\w+)[_]id/i
42
- if Kernel.const_get($1.classify)
43
- item = Kernel.const_get($1.classify).find( self.meta_for( cmt.var ) )
44
- if item.respond_to?(:name)
45
- res.merge!({ $1 => item.name })
46
- elsif item.respond_to?(:title)
47
- res.merge!({ $1 => item.title })
48
- end
49
- end
50
- end
51
- rescue
52
- end
53
-
54
- res.merge!({ cmt.var => self.meta_for( cmt.var ) }) if res.count == r
55
- end
56
-
57
- res
58
- end
59
- end
@@ -1,69 +0,0 @@
1
-
2
- <div id="container-main" class="mt-converts show">
3
- <div class="mountain-goat-panel centered">
4
- <ul class="nav">
5
- <li><a href="<%= mountain_goat_converts_url %>">Goals</a></li>
6
- <li><a href="<%= mountain_goat_convert_url @convert.id %>"><%=h @convert.name %> Goal</a></li>
7
- </ul>
8
-
9
- <h1><%=h @convert.name %></h1>
10
-
11
- <div class="statpads">
12
- <div class="flyer-analysis statpad">
13
- <div class="title">Conversions by Day</div>
14
- <div class="statbody">
15
- <%= chart("analysis_graph#{@convert.id}",
16
- { "Conversions" => { :collection => @results_per_day, :x => :date, :y => :val } },
17
- { :xaxis => {:mode => 'time', :timeformat => "%b %d" }, :yaxis => { :min => 0, :minTickSize => 1 }, :lines => { :show => true }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
18
- </div>
19
- </div>
20
-
21
- <% @convert.convert_meta_types.each do |cmt| %>
22
- <div class="flyer-analysis statpad">
23
- <div class="title">Conversions by <%=h cmt.name %></div>
24
- <div class="statbody">
25
- <% if cmt.meta_type == 'ci_meta' %>
26
- <%= chart("analysis_graph#{cmt.id}",
27
- { "Conversions" => { :collection => @results_by_cmt[cmt.id], :x => :name, :y => :val } },
28
- { :xaxis => {:autoscaleMargin => 1, :minTickSize => 1 }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true, :align => 'center', :barWidth => 1 }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
29
- <% elsif cmt.meta_type == 'cs_meta' %>
30
- <%= chart("analysis_graph#{cmt.id}",
31
- { "Conversions" => { :collection => @results_by_cmt[cmt.id], :x => :name, :y => :val } },
32
- { :xaxis => {:autoscaleMargin => 0.1, :ticks => @results_by_cmt_titles[cmt.id].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
33
- <% end %>
34
- </div>
35
- </div>
36
- <% end %>
37
- </div>
38
-
39
- <% @convert.metrics.each do |metric| %>
40
- <div class="metric-category">
41
- <span class="metric"><a href="<%= mountain_goat_metric_url :id => metric.id %>"><%= metric.title %></a></span>
42
- <% if metric.metric_variants.count == 0 %>
43
- <span class="none">No metric variants [<a href="<%= new_mountain_goat_metric_mountain_goat_metric_variant_url :mountain_goat_metric_id => metric.id %>">Add one</a>]</span>
44
- <% else %>
45
- <% metric.metric_variants.each do |mv| %>
46
- <div class="item rate">
47
- <span class="rate-holder">
48
- <span class="title"><a href="<%= mountain_goat_metric_variant_url mv %>"><%=h mv.name %></a></span>
49
- <span class="rates" style="width:<%= number_to_percentage(mv.conversion_rate, :precision => 0) %>"></span>
50
- </span>
51
-
52
- <span class="percent-holder">
53
- <span class="val"><%= number_to_percentage(mv.conversion_rate, :precision => 0) %></span>
54
- (<span class="conversions"><%= mv.conversions %></span> /
55
- <span class="served"><%= mv.served %></span>)
56
- </span>
57
- </div>
58
- <% end %>
59
- <% end %>
60
- </div>
61
- <% end %>
62
-
63
- <div class="actions">
64
- <a class="button" href="<%= edit_mountain_goat_convert_url :id => @convert.id %>">Edit</a>
65
- <a class="button" href="<%= new_mountain_goat_convert_mountain_goat_metric_url :mountain_goat_convert_id => @convert.id %>">New Metric</a>
66
- </div>
67
-
68
- </div>
69
- </div>
@@ -1,26 +0,0 @@
1
- <%# locals => f %>
2
-
3
- <% if f.object.new_record? %>
4
- <div class="item type">
5
- <%= f.label :convert_type, 'Type (this is technical)' %><br />
6
- <%= f.text_field :convert_type %>
7
- </div>
8
- <% else %>
9
- <h2><%= f.object.convert_type %></h2>
10
- <% end %>
11
-
12
- <div class="item name">
13
- <%= f.label :name, 'Goal title' %><br />
14
- <%= f.text_field :name %>
15
- </div>
16
-
17
- <div class="metas">
18
- <% f.fields_for :convert_meta_types do |builder| %>
19
- <%= render "convert_meta_type_form", :cmt_f => builder %>
20
- <% end %>
21
- </div>
22
-
23
- <div class="item submit">
24
- <%= f.submit 'Submit' %>
25
- </div>
26
-
@@ -1,27 +0,0 @@
1
- <%# locals => cmt_f %>
2
-
3
- <div class="meta">
4
- <span class="title">Meta Item</span>
5
- <div class="item meta-name">
6
- <%= cmt_f.label :name, 'Name' %><br />
7
- <%= cmt_f.text_field :name %>
8
- </div>
9
- <% if cmt_f.object.new_record? %>
10
- <div class="item meta-var">
11
- <%= cmt_f.label :var, 'Var' %><br />
12
- <%= cmt_f.text_field :var %>
13
- </div>
14
- <% else %>
15
- <span class="metric-variant-name"><%=h cmt_f.object.var %></span>
16
- <% end %>
17
-
18
- <div class="item meta-meta-type">
19
- <%= cmt_f.label :meta_type, 'Meta Type' %><br />
20
- <%= cmt_f.collection_select :meta_type, [ { :val => "ci_meta", :text => "Integer" }, { :val => "cs_meta", :text => "String" } ], :val, :text %>
21
- </div>
22
-
23
- <div class="item meta-destroy">
24
- <%= cmt_f.check_box :_destroy %>
25
- <%= cmt_f.label :_destroy, "Remove Meta" %>
26
- </div>
27
- </div>
@@ -1,13 +0,0 @@
1
-
2
-
3
- <div id="container-main" class="mt-converts">
4
- <div class="mountain-goat-panel centered">
5
- <h1>Edit <%=h @convert.name %></h1>
6
-
7
- <% form_for :convert, @convert, :url => mg_convert_url(:id => @convert.id), :html => { :method => :put } do |f| %>
8
- <%= f.error_messages %>
9
-
10
- <%= render :partial => 'mg/converts/convert_form', :locals => { :f => f } %>
11
- <% end %>
12
- </div>
13
- </div>
@@ -1,25 +0,0 @@
1
-
2
- <div id="container-main" class="mt-converts">
3
- <div class="mountain-goat-panel centered">
4
-
5
- <h1>Conversion Goals</h1>
6
-
7
- <div class="conversions">
8
- <div class="explanation">
9
- <span class="inner">
10
- Below are a list of conversion goals. Each goal has a set of metrics designed to achieve that goal. For each metric, there is a list of variants, each coupled with its conversation rate.</span>
11
- </span>
12
- </div>
13
-
14
- <div class="converts">
15
- <% @converts.each do |convert| %>
16
- <h2><a href="<%= mg_convert_url :id => convert.id %>"><%=h convert.name %></a></h2>
17
- <% end %>
18
- </div>
19
- </div>
20
-
21
- <div class="actions">
22
- <a class="button" href="<%= new_mg_convert_url %>">New Goal</a>
23
- </div>
24
- </div>
25
- </div>
@@ -1,13 +0,0 @@
1
-
2
-
3
- <div id="container-main" class="mt-converts">
4
- <div class="mountain-goat-panel centered">
5
- <h2>New convert</h2>
6
-
7
- <% form_for :convert, @convert, :url => mg_converts_url do |f| %>
8
- <%= f.error_messages %>
9
-
10
- <%= render :partial => 'mg/converts/convert_form', :locals => { :f => f } %>
11
- <% end %>
12
- </div>
13
- </div>
@@ -1,44 +0,0 @@
1
-
2
- <div id="container-main" class="mt-converts show">
3
- <div class="mountain-goat-panel centered">
4
- <ul class="nav">
5
- <li><a href="<%= mg_converts_url %>">Goals</a></li>
6
- <li><a href="<%= mg_convert_url @convert.id %>"><%=h @convert.name %> Goal</a></li>
7
- </ul>
8
-
9
- <h1><%=h @convert.name %></h1>
10
-
11
- <div class="statpads">
12
- <div class="flyer-analysis statpad">
13
- <div class="title">Conversions by Day</div>
14
- <div class="statbody">
15
- <%= mg_chart("analysis_graph#{@convert.id}",
16
- { "Conversions" => { :collection => @results_per_day, :x => :date, :y => :val } },
17
- { :xaxis => {:mode => 'time', :timeformat => "%b %d" }, :yaxis => { :min => 0, :minTickSize => 1 }, :lines => { :show => true }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
18
- </div>
19
- </div>
20
-
21
- <% @convert.convert_meta_types.each do |cmt| %>
22
- <div class="flyer-analysis statpad">
23
- <div class="title">Conversions by <%=h cmt.name %></div>
24
- <div class="statbody">
25
- <% if cmt.meta_type == 'ci_meta' %>
26
- <%= mg_chart("analysis_graph#{cmt.id}",
27
- { "Conversions" => { :collection => @results_by_cmt[cmt.id], :x => :name, :y => :val } },
28
- { :xaxis => {:autoscaleMargin => 1, :minTickSize => 1 }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true, :align => 'center', :barWidth => 1 }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
29
- <% elsif cmt.meta_type == 'cs_meta' %>
30
- <%= mg_chart("analysis_graph#{cmt.id}",
31
- { "Conversions" => { :collection => @results_by_cmt[cmt.id], :x => :name, :y => :val } },
32
- { :xaxis => {:autoscaleMargin => 0.1, :ticks => @results_by_cmt_titles[cmt.id].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
33
- <% end %>
34
- </div>
35
- </div>
36
- <% end %>
37
- </div>
38
-
39
- <div class="actions">
40
- <a class="button" href="<%= edit_mg_convert_url :id => @convert.id %>">Edit</a>
41
- </div>
42
-
43
- </div>
44
- </div>
@@ -1,37 +0,0 @@
1
- <%# locals => f %>
2
-
3
- <%= f.hidden_field :metric_id %>
4
-
5
- <% if f.object.metric.is_switch %>
6
- <span class="switch-type"><%=h f.object.switch_type %></span>
7
- <% end %>
8
-
9
- <div class="item name">
10
- <%= f.label :name, 'Name (whatever you want)' %>
11
- <%= f.text_field :name %>
12
- </div>
13
-
14
- <% if !f.object.metric.is_switch %>
15
- <div class="item value">
16
- <%= f.label :value, 'What\'s displayed' %>
17
- <%= f.text_area :value %>
18
- </div>
19
-
20
- <input type='checkbox' id="my_slider" class='slider' data-slider='.options' />
21
- <label for="my_slider">Add optional variants</label>
22
- <div class="options" style="display:none;">
23
- <div class="item opt1">
24
- <%= f.label :opt1, 'Option 1' %>
25
- <%= f.text_area :opt1 %>
26
- </div>
27
-
28
- <div class="item opt2">
29
- <%= f.label :opt2, 'Option 2' %>
30
- <%= f.text_area :opt2 %>
31
- </div>
32
- </div>
33
- <% end %>
34
-
35
- <div class="item submit">
36
- <%= f.submit 'Submit' %>
37
- </div>
@@ -1,13 +0,0 @@
1
-
2
-
3
- <div id="container-main" class="mt-metric-variants">
4
- <div class="mountain-goat-panel centered">
5
- <h1>Edit <%=h @metric_variant.name %></h1>
6
-
7
- <% form_for :metric_variant, @metric_variant, :url => mg_metric_variant_url(:id => @metric_variant.id), :html => { :method => :put } do |f| %>
8
- <%= f.error_messages %>
9
-
10
- <%= render :partial => 'mg/metric_variants/metric_variant_form', :locals => { :f => f } %>
11
- <% end %>
12
- </div>
13
- </div>
@@ -1,34 +0,0 @@
1
-
2
- <div id="container-main" class="mt-metric-variants">
3
- <div class="mountain-goat-panel cenetered">
4
- <h1>Listing Metric Variants</h1>
5
-
6
- <table>
7
- <tr>
8
- <th>Metric</th>
9
- <th>Value</th>
10
- <th>Opt1</th>
11
- <th>Opt2</th>
12
- <th>Served</th>
13
- <th>Conversions</th>
14
- </tr>
15
-
16
- <% @metric_variants.each do |metric_variant| %>
17
- <tr>
18
- <td><%=h metric_variant.metric_id %></td>
19
- <td><%=h metric_variant.value %></td>
20
- <td><%=h metric_variant.opt1 %></td>
21
- <td><%=h metric_variant.opt2 %></td>
22
- <td><%=h metric_variant.served %></td>
23
- <td><%=h metric_variant.conversions %></td>
24
- <td><a href="<%= mg_metric_variant_url metric_variant %>">Show</a></td>
25
- <td><a href="<%= edit_mg_metric_variant_url metric_variant %>">Edit</a></td>
26
- </tr>
27
- <% end %>
28
- </table>
29
-
30
- <br />
31
-
32
- <%= link_to 'New metric_variant', new_mg_metric_variant_url %>
33
- </div>
34
- </div>
@@ -1,15 +0,0 @@
1
-
2
-
3
- <div id="container-main" class="mt-metric-variants">
4
- <div class="mountain-goat-panel cenetered">
5
- <h1>New Variant for <%=h @metric.title %></h1>
6
-
7
- <% form_for :metric_variant, @metric_variant, :url => mg_metric_variants_url do |f| %>
8
- <%= f.error_messages %>
9
-
10
- <%= render :partial => 'mg/metric_variants/metric_variant_form', :locals => { :f => f } %>
11
- <% end %>
12
-
13
- <a href="<%= mg_metric_url :id => @metric.id %>">Back to <%=h @metric.title %></a>
14
- </div>
15
- </div>
@@ -1,30 +0,0 @@
1
-
2
- <div id="container-main" class="mt-metric-variants">
3
- <div class="mountain-goat-panel cenetered">
4
- <ul class="nav">
5
- <li><a href="<%= mg_converts_url %>">Goals</a></li>
6
- <li><a href="<%= mg_metric_url :id => @metric_variant.metric.id %>"><%=h @metric_variant.metric.title %></a></li>
7
- </ul>
8
-
9
- <h1><%=h @metric_variant.name %></h1>
10
-
11
- <div class="metric-category">
12
- <div class="item rate">
13
- <span class="rate-holder">
14
- <span class="title"><a href="<%= mg_metric_variant_url @metric_variant %>"><%=h @metric_variant.name %></a></span>
15
- <span class="rates" style="width:<%= number_to_percentage(@metric_variant.conversion_rate, :precision => 0) %>"></span>
16
- </span>
17
-
18
- <span class="percent-holder">
19
- <span class="val"><%= number_to_percentage(@metric_variant.conversion_rate, :precision => 0) %></span>
20
- (<span class="conversions"><%= @metric_variant.conversions %></span> /
21
- <span class="served"><%= @metric_variant.served %></span>)
22
- </span>
23
- </div>
24
- </div>
25
-
26
- <div class="actions">
27
- <a class="button" href="<%= edit_mg_metric_variant_url :id => @metric_variant.id %>">Edit</a>
28
- </div>
29
- </div>
30
- </div>
@@ -1,68 +0,0 @@
1
-
2
- <div id="container-main" class="mt-metrics">
3
- <div class="mountain-goat-panel cenetered">
4
- <ul class="nav">
5
- <li><a href="<%= mountain_goat_converts_url %>">Goals</a></li>
6
- <li><a href="<%= mountain_goat_convert_url :id => @metric.convert.id %>"><%=h @metric.convert.name %> Goal</a></li>
7
- <li><a href="<%= mountain_goat_metric_url :id => @metric.id %>"><%=h @metric.title %></a></li>
8
- </ul>
9
-
10
- <h1><%=h @metric.title %> Metric</h1>
11
-
12
- <div class="variants">
13
- <% if @metric.metric_variants.count == 0 %>
14
- <span class="none">No metric variants</span>
15
- <% else %>
16
- <div class="statpads">
17
- <div class="flyer-analysis statpad">
18
- <div class="title">Conversions</div>
19
- <div class="statbody">
20
- <%= chart("analysis_graph#{@metric.id}",
21
- { "Served" => { :collection => @rates[:served], :x => :variant_type, :y => :value },
22
- "Conversions" => { :collection => @rates[:conversions], :x => :variant_type, :y => :value } },
23
- { :xaxis => { :ticks => @rates[:titles].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :show => false, :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
24
-
25
- </div>
26
- </div>
27
- <div class="flyer-analysis statpad">
28
- <div class="title">Conversion Rates</div>
29
- <div class="statbody">
30
- <%= chart("analysis_conv_graph#{@metric.id}",
31
- { "Conversion Rate (%)" => { :collection => @rates[:conversion_rates], :x => :variant_type, :y => :value } },
32
- { :xaxis => { :ticks => @rates[:titles].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :show => false, :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "%") %>
33
-
34
- </div>
35
- </div>
36
- </div>
37
-
38
-
39
- <div class="metric-category">
40
- <span class="metric"><a href="<%= mountain_goat_metric_url :id => @metric.id %>"><%= @metric.title %></a></span>
41
- <% if @metric.metric_variants.count == 0 %>
42
- <span class="none">No metric variants [<a href="<%= new_mountain_goat_metric_mountain_goat_metric_variant_url :mountain_goat_metric_id => @metric.id %>">Add one</a>]</span>
43
- <% else %>
44
- <% @metric.metric_variants.each do |mv| %>
45
- <div class="item rate">
46
- <span class="rate-holder">
47
- <span class="title"><a href="<%= mountain_goat_metric_variant_url mv %>"><%=h mv.name %></a></span>
48
- <span class="rates" style="width:<%= number_to_percentage(mv.conversion_rate, :precision => 0) %>"></span>
49
- </span>
50
-
51
- <span class="percent-holder">
52
- <span class="val"><%= number_to_percentage(mv.conversion_rate, :precision => 0) %></span>
53
- (<span class="conversions"><%= mv.conversions %></span> /
54
- <span class="served"><%= mv.served %></span>)
55
- </span>
56
- </div>
57
- <% end %>
58
- <% end %>
59
- </div>
60
- <% end %>
61
- </div>
62
-
63
- <div class="actions">
64
- <a class="button" href="<%= edit_mountain_goat_metric_url :id => @metric %>">Edit Metric</a>
65
- <a class="button" href="<%= new_mountain_goat_metric_mountain_goat_metric_variant_url :mountain_goat_metric_id => @metric.id %>">New Variant</a>
66
- </div>
67
- </div>
68
- </div>