mountain-goat 0.1.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/README.md +119 -48
  2. data/generators/mg/mg_generator.rb +17 -9
  3. data/generators/mg/templates/create_mountain_goat_tables.rb +61 -25
  4. data/generators/mg/templates/mg.rb +1 -0
  5. data/generators/mg/templates/mountain-goat.yml +22 -3
  6. data/generators/mg/templates/mountain_goat_reports.rake +17 -0
  7. data/generators/mg/templates/update_mountain_goat_tables.rb +104 -0
  8. data/lib/mountain-goat.rb +21 -12
  9. data/lib/mountain-goat/analytics.rb +134 -0
  10. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_converts_controller.rb → mg/converts_controller.rb} +12 -11
  11. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_metric_variants_controller.rb → mg/metric_variants_controller.rb} +6 -5
  12. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_metrics_controller.rb → mg/metrics_controller.rb} +8 -6
  13. data/lib/mountain-goat/controllers/mg/mg.rb +47 -0
  14. data/lib/mountain-goat/controllers/{mountain_goat → mg}/mountain_goat_controller.rb +5 -42
  15. data/lib/mountain-goat/controllers/mg/playground_controller.rb +8 -0
  16. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_rallies_controller.rb → mg/rallies_controller.rb} +4 -26
  17. data/lib/mountain-goat/controllers/mg/report_items_controller.rb +82 -0
  18. data/lib/mountain-goat/controllers/mg/reports_controller.rb +90 -0
  19. data/lib/mountain-goat/m_g.rb +64 -0
  20. data/lib/mountain-goat/metric_tracking.rb +192 -74
  21. data/lib/mountain-goat/models/mg/ci_meta.rb +10 -0
  22. data/lib/mountain-goat/models/mg/convert.rb +147 -0
  23. data/lib/mountain-goat/models/mg/convert_meta_type.rb +20 -0
  24. data/lib/mountain-goat/models/mg/cs_meta.rb +10 -0
  25. data/lib/mountain-goat/models/{metric.rb → mg/metric.rb} +3 -5
  26. data/lib/mountain-goat/models/mg/metric_variant.rb +25 -0
  27. data/lib/mountain-goat/models/mg/mountain_goat.rb +3 -0
  28. data/lib/mountain-goat/models/{rally.rb → mg/rally.rb} +4 -3
  29. data/lib/mountain-goat/models/mg/report.rb +11 -0
  30. data/lib/mountain-goat/models/mg/report_item.rb +24 -0
  31. data/lib/mountain-goat/models/mg/report_mailer.rb +18 -0
  32. data/lib/mountain-goat/public/g-bar-min.js +7 -0
  33. data/lib/mountain-goat/public/g-dot-min.js +7 -0
  34. data/lib/mountain-goat/public/g-line-min.js +7 -0
  35. data/lib/mountain-goat/public/g-pie-min.js +1 -0
  36. data/lib/mountain-goat/public/g-raphael-min.js +7 -0
  37. data/lib/mountain-goat/public/jqModel.css +41 -0
  38. data/lib/mountain-goat/public/jqModel.js +69 -0
  39. data/lib/mountain-goat/public/jquery.raphael.js +208 -0
  40. data/lib/mountain-goat/public/mg.css +135 -26
  41. data/lib/mountain-goat/public/mg.js +53 -1
  42. data/lib/mountain-goat/public/raphael-min.js +7 -0
  43. data/lib/mountain-goat/public/utils.js +520 -0
  44. data/lib/mountain-goat/switch_variant.rb +4 -4
  45. data/lib/mountain-goat/version.rb +1 -1
  46. data/lib/mountain-goat/views/mountain_goat/layouts/_pdf.html.erb +15 -0
  47. data/lib/mountain-goat/views/mountain_goat/layouts/mountain_goat.html.erb +17 -5
  48. data/lib/mountain-goat/views/mountain_goat/layouts/xhr.html.erb +2 -0
  49. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/.tmp_show.html.erb.4433~ +0 -0
  50. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/_convert_form.html.erb +0 -0
  51. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/_convert_meta_type_form.html.erb +0 -0
  52. data/lib/mountain-goat/views/mountain_goat/mg/converts/edit.html.erb +13 -0
  53. data/lib/mountain-goat/views/mountain_goat/mg/converts/index.html.erb +25 -0
  54. data/lib/mountain-goat/views/mountain_goat/mg/converts/new.html.erb +13 -0
  55. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/show.html.erb +3 -28
  56. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/_metric_variant_form.html.erb +0 -4
  57. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/edit.html.erb +13 -0
  58. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/index.html.erb +3 -3
  59. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/new.html.erb +15 -0
  60. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/show.html.erb +4 -5
  61. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/.tmp_show.html.erb.21270~ +0 -0
  62. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/_metric_form.html.erb +0 -2
  63. data/lib/mountain-goat/views/mountain_goat/mg/metrics/edit.html.erb +13 -0
  64. data/lib/mountain-goat/views/mountain_goat/mg/metrics/index.html.erb +14 -0
  65. data/lib/mountain-goat/views/mountain_goat/mg/metrics/new.html.erb +14 -0
  66. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/show.html.erb +7 -8
  67. data/lib/mountain-goat/views/mountain_goat/{mountain_goat → mg/mountain_goat}/login.html.erb +0 -0
  68. data/lib/mountain-goat/views/mountain_goat/mg/playground/test.html.erb +14 -0
  69. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/.tmp__rally.html.erb.40484~ +0 -0
  70. data/lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies.html.erb +5 -0
  71. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/_rallies_form.html.erb +0 -0
  72. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/_rally.html.erb +0 -0
  73. data/lib/mountain-goat/views/mountain_goat/mg/rallies/edit.html.erb +13 -0
  74. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/index.html.erb +1 -1
  75. data/lib/mountain-goat/views/mountain_goat/mg/rallies/new.html.erb +13 -0
  76. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/show.html.erb +1 -1
  77. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_chart.html.erb +18 -0
  78. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_form.html.erb +10 -0
  79. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_pivot_form.html.erb +14 -0
  80. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_show.html.erb +29 -0
  81. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_svg_chart.html.erb +4 -0
  82. data/lib/mountain-goat/views/mountain_goat/mg/report_items/edit.html.erb +19 -0
  83. data/lib/mountain-goat/views/mountain_goat/mg/report_items/new.html.erb +17 -0
  84. data/lib/mountain-goat/views/mountain_goat/mg/report_mailer/report.html.erb +27 -0
  85. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report.html.erb +22 -0
  86. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb +21 -0
  87. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb +5 -0
  88. data/lib/mountain-goat/views/mountain_goat/mg/reports/edit.html.erb +36 -0
  89. data/lib/mountain-goat/views/mountain_goat/mg/reports/index.html.erb +26 -0
  90. data/lib/mountain-goat/views/mountain_goat/mg/reports/new.html.erb +17 -0
  91. data/lib/mountain-goat/views/mountain_goat/mg/reports/show.html.erb +21 -0
  92. data/test/fixtures/{ci_metas.yml → mg_ci_metas.yml} +0 -0
  93. data/test/fixtures/{convert_meta_types.yml → mg_convert_meta_types.yml} +0 -0
  94. data/test/fixtures/{converts.yml → mg_converts.yml} +5 -0
  95. data/test/fixtures/{cs_metas.yml → mg_cs_metas.yml} +0 -0
  96. data/test/fixtures/mg_deliveries.yml +9 -0
  97. data/test/fixtures/{metric_variants.yml → mg_metric_variants.yml} +0 -0
  98. data/test/fixtures/{metrics.yml → mg_metrics.yml} +2 -3
  99. data/test/fixtures/{rallies.yml → mg_rallies.yml} +6 -2
  100. data/test/fixtures/mg_report_items.yml +13 -0
  101. data/test/fixtures/mg_reports.yml +15 -0
  102. data/test/mg_convert_test.rb +32 -0
  103. data/test/mg_converts_controller_test.rb +47 -0
  104. data/test/mg_metric_variants_controller_test.rb +46 -0
  105. data/test/mg_metrics_controller_test.rb +52 -0
  106. data/test/mg_mountain_goat_controller_test.rb +45 -0
  107. data/test/mg_mountain_goat_test.rb +392 -0
  108. data/test/mg_playground_controller_test.rb +11 -0
  109. data/test/mg_rallies_controller_test.rb +36 -0
  110. data/test/mg_report_item_test.rb +7 -0
  111. data/test/mg_report_items_controller_test.rb +31 -0
  112. data/test/mg_report_test.rb +18 -0
  113. data/test/mg_reports_controller_test.rb +50 -0
  114. data/test/test_helper.rb +203 -0
  115. metadata +108 -55
  116. data/lib/mountain-goat/models/ci_meta.rb +0 -9
  117. data/lib/mountain-goat/models/convert.rb +0 -70
  118. data/lib/mountain-goat/models/convert_meta_type.rb +0 -19
  119. data/lib/mountain-goat/models/cs_meta.rb +0 -9
  120. data/lib/mountain-goat/models/metric_variant.rb +0 -22
  121. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/edit.html.erb +0 -13
  122. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/index.html.erb +0 -48
  123. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/new.html.erb +0 -13
  124. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/edit.html.erb +0 -13
  125. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/new.html.erb +0 -15
  126. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/edit.html.erb +0 -13
  127. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/index.html.erb +0 -14
  128. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/new.html.erb +0 -14
  129. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/_rallies.html.erb +0 -5
  130. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/edit.html.erb +0 -13
  131. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/new.html.erb +0 -13
  132. data/test/ocelot_converts_controller_test.rb +0 -45
  133. data/test/ocelot_metric_variants_controller_test.rb +0 -45
  134. data/test/ocelot_metrics_controller_test.rb +0 -45
  135. data/test/ocelot_rallies_controller_test.rb +0 -8
@@ -1,14 +1,14 @@
1
1
 
2
2
  class SwitchVariant
3
- def initialize(logger, metric, convert, chosen_variant)
3
+ def initialize(logger, metric, chosen_variant)
4
4
  @chosen_variant = chosen_variant
5
- @metric, @convert = metric, convert
5
+ @metric = metric
6
6
  @logger = logger
7
7
  raise ArgumentError, "Metric type must be switch-type" if !@metric.is_switch
8
8
  end
9
9
 
10
10
  def method_missing(sym, *args, &block)
11
- priority = ( args.first || 1.0 ).to_f
11
+ #priority = ( args.first || 1.0 ).to_f
12
12
 
13
13
  if @chosen_variant.nil?
14
14
  #If we have not chosen a variant, we are going to look through
@@ -17,7 +17,7 @@ class SwitchVariant
17
17
  @logger.warn "Looking at option #{sym.to_s}"
18
18
  if @metric.metric_variants.find( :first, :conditions => { :switch_type => sym.to_s } ).nil?
19
19
  @logger.warn "Creating switch-type metric-variant #{sym.to_s}"
20
- @metric.metric_variants.create!( :name => sym.to_s, :switch_type => sym.to_s, :priority => priority, :value => nil )
20
+ @metric.metric_variants.create!( :name => sym.to_s, :switch_type => sym.to_s, :value => nil )
21
21
  end
22
22
  else
23
23
  if @chosen_variant.switch_type.to_s == sym.to_s
@@ -1,3 +1,3 @@
1
1
  class MountainGoat
2
- VERSION = "0.1.8"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml"
6
+ xmlns:svg="http://www.w3.org/2000/svg"
7
+ xmlns:xlink="http://www.w3.org/1999/xlink">
8
+ <head>
9
+ <meta http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1" />
10
+ <title>Mountain Goat</title>
11
+ </head>
12
+ <body>
13
+ <%= yield %>
14
+ </body>
15
+ </html>
@@ -15,25 +15,37 @@
15
15
  <meta name="viewport" content="width=device-width" />
16
16
 
17
17
  <link rel="stylesheet" href="/mg/public/mg_css" type="text/css" />
18
+ <link rel="stylesheet" href="/mg/public/jqModel_css" type="text/css" />
18
19
 
19
20
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
21
+ <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js" type="text/javascript"></script>
22
+ <script src="/mg/public/jqModel_js" type="text/javascript"></script>
23
+ <script src="/mg/public/raphael-min_js" type="text/javascript"></script>
24
+ <script src="/mg/public/g-raphael-min_js" type="text/javascript"></script>
25
+ <script src="/mg/public/g-bar-min_js" type="text/javascript"></script>
26
+ <script src="/mg/public/g-dot-min_js" type="text/javascript"></script>
27
+ <script src="/mg/public/g-line-min_js" type="text/javascript"></script>
28
+ <script src="/mg/public/g-pie-min_js" type="text/javascript"></script>
20
29
  <script src="/mg/public/jquery_flot_js" type="text/javascript"></script>
21
30
  <script src="/mg/public/jquery_timeago_js" type="text/javascript"></script>
31
+ <script src="/mg/public/jquery_raphael_js" type="text/javascript"></script>
22
32
  <script src="/mg/public/mg_js" type="text/javascript"></script>
23
-
33
+ <script src="/mg/public/utils_js" type="text/javascript"></script>
34
+
24
35
  </head>
25
36
 
26
37
  <body>
27
38
 
28
- <div class="header">
39
+ <div class="main-header">
29
40
  <div class="head">
30
41
  <a href="/mg" class="logo">
31
42
  <img src="/mg/public/mg_png" />
32
43
  </a>
33
44
  <ul class="nav">
34
- <li><a href="<%= mountain_goat_converts_url %>">Goals</a></li>
35
- <li><a href="<%= mountain_goat_metrics_url %>">Metrics</a></li>
36
- <li><a href="<%= mountain_goat_rallies_url %>">Rallies</a></li>
45
+ <li><a href="<%= mg_converts_url %>">Goals</a></li>
46
+ <li><a href="<%= mg_metrics_url %>">Metrics</a></li>
47
+ <li><a href="<%= mg_rallies_url %>">Rallies</a></li>
48
+ <li><a href="<%= mg_reports_url %>">Reports</a></li>
37
49
  <li><a href="/">Exit</a></li>
38
50
  </ul>
39
51
  </div>
@@ -0,0 +1,2 @@
1
+
2
+ <%= yield %>
@@ -0,0 +1,13 @@
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>
@@ -0,0 +1,25 @@
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>
@@ -0,0 +1,13 @@
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>
@@ -2,8 +2,8 @@
2
2
  <div id="container-main" class="mt-converts show">
3
3
  <div class="mountain-goat-panel centered">
4
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>
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
7
  </ul>
8
8
 
9
9
  <h1><%=h @convert.name %></h1>
@@ -35,34 +35,9 @@
35
35
  </div>
36
36
  <% end %>
37
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
38
 
63
39
  <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>
40
+ <a class="button" href="<%= edit_mg_convert_url :id => @convert.id %>">Edit</a>
66
41
  </div>
67
42
 
68
43
  </div>
@@ -31,10 +31,6 @@
31
31
  </div>
32
32
  </div>
33
33
  <% end %>
34
- <div class="item priority">
35
- <%= f.label :priority, 'Priority' %>
36
- <%= f.text_field :priority, :class => 'priority' %>
37
- </div>
38
34
 
39
35
  <div class="item submit">
40
36
  <%= f.submit 'Submit' %>
@@ -0,0 +1,13 @@
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>
@@ -21,14 +21,14 @@
21
21
  <td><%=h metric_variant.opt2 %></td>
22
22
  <td><%=h metric_variant.served %></td>
23
23
  <td><%=h metric_variant.conversions %></td>
24
- <td><a href="<%= mountain_goat_metric_variant_url metric_variant %>">Show</a></td>
25
- <td><a href="<%= edit_mountain_goat_metric_variant_url metric_variant %>">Edit</a></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
26
  </tr>
27
27
  <% end %>
28
28
  </table>
29
29
 
30
30
  <br />
31
31
 
32
- <%= link_to 'New metric_variant', new_mountain_goat_metric_variant_url %>
32
+ <%= link_to 'New metric_variant', new_mg_metric_variant_url %>
33
33
  </div>
34
34
  </div>
@@ -0,0 +1,15 @@
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>
@@ -2,9 +2,8 @@
2
2
  <div id="container-main" class="mt-metric-variants">
3
3
  <div class="mountain-goat-panel cenetered">
4
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_variant.metric.convert.id %>"><%=h @metric_variant.metric.convert.name %> Goal</a></li>
7
- <li><a href="<%= mountain_goat_metric_url :id => @metric_variant.metric.id %>"><%=h @metric_variant.metric.title %></a></li>
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>
8
7
  </ul>
9
8
 
10
9
  <h1><%=h @metric_variant.name %></h1>
@@ -12,7 +11,7 @@
12
11
  <div class="metric-category">
13
12
  <div class="item rate">
14
13
  <span class="rate-holder">
15
- <span class="title"><a href="<%= mountain_goat_metric_variant_url @metric_variant %>"><%=h @metric_variant.name %></a></span>
14
+ <span class="title"><a href="<%= mg_metric_variant_url @metric_variant %>"><%=h @metric_variant.name %></a></span>
16
15
  <span class="rates" style="width:<%= number_to_percentage(@metric_variant.conversion_rate, :precision => 0) %>"></span>
17
16
  </span>
18
17
 
@@ -25,7 +24,7 @@
25
24
  </div>
26
25
 
27
26
  <div class="actions">
28
- <a class="button" href="<%= edit_mountain_goat_metric_variant_url :id => @metric_variant.id %>">Edit</a>
27
+ <a class="button" href="<%= edit_mg_metric_variant_url :id => @metric_variant.id %>">Edit</a>
29
28
  </div>
30
29
  </div>
31
30
  </div>
@@ -1,7 +1,5 @@
1
1
  <%# locals => f %>
2
2
 
3
- <%= f.hidden_field(:convert_id) %>
4
-
5
3
  <% if f.object.new_record? %>
6
4
  <div class="item metric-type">
7
5
  <%= f.label :metric_type, 'Type (this is technical)' %>
@@ -0,0 +1,13 @@
1
+
2
+
3
+ <div id="container-main" class="mt-metrics">
4
+ <div class="mountain-goat-panel centered">
5
+ <h1>Edit <%= @metric.title %></h1>
6
+
7
+ <% form_for :metric, @metric, :url => mg_metric_url(:id => @metric.id), :html => { :method => :put } do |f| %>
8
+ <%= f.error_messages %>
9
+
10
+ <%= render :partial => 'mg/metrics/metric_form', :locals => { :f => f } %>
11
+ <% end %>
12
+ </div>
13
+ </div>
@@ -0,0 +1,14 @@
1
+
2
+ <div id="container-main" class="mt-metrics">
3
+ <div class="mountain-goat-panel">
4
+ <h1>All metrics</h1>
5
+
6
+ <% @metrics.each do |metric| %>
7
+ <h2><a href="<%= mg_metric_url metric %>"><%=h metric.title %> </a></h2>
8
+ <% end %>
9
+
10
+ <span class="actions">
11
+ <a class="button" href="<%= new_mg_metric_url %>">New metric</a>
12
+ </span>
13
+ </div>
14
+ </div>
@@ -0,0 +1,14 @@
1
+
2
+
3
+ <div id="container-main" class="mt-metrics">
4
+ <div class="mountain-goat-panel cenetered">
5
+ <h2>New metric</h2>
6
+
7
+ <% form_for :metric, @metric, :url => mg_metrics_url do |f| %>
8
+ <%= f.error_messages %>
9
+
10
+ <%= render :partial => 'mg/metrics/metric_form', :locals => { :f => f } %>
11
+ <% end %>
12
+
13
+ </div>
14
+ </div>
@@ -2,9 +2,8 @@
2
2
  <div id="container-main" class="mt-metrics">
3
3
  <div class="mountain-goat-panel cenetered">
4
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>
5
+ <li><a href="<%= mg_converts_url %>">Goals</a></li>
6
+ <li><a href="<%= mg_metric_url :id => @metric.id %>"><%=h @metric.title %></a></li>
8
7
  </ul>
9
8
 
10
9
  <h1><%=h @metric.title %> Metric</h1>
@@ -37,14 +36,14 @@
37
36
 
38
37
 
39
38
  <div class="metric-category">
40
- <span class="metric"><a href="<%= mountain_goat_metric_url :id => @metric.id %>"><%= @metric.title %></a></span>
39
+ <span class="metric"><a href="<%= mg_metric_url :id => @metric.id %>"><%= @metric.title %></a></span>
41
40
  <% 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>
41
+ <span class="none">No metric variants [<a href="<%= new_mg_metric_metric_variant_url :metric_id => @metric.id %>">Add one</a>]</span>
43
42
  <% else %>
44
43
  <% @metric.metric_variants.each do |mv| %>
45
44
  <div class="item rate">
46
45
  <span class="rate-holder">
47
- <span class="title"><a href="<%= mountain_goat_metric_variant_url mv %>"><%=h mv.name %></a></span>
46
+ <span class="title"><a href="<%= mg_metric_variant_url mv %>"><%=h mv.name %></a></span>
48
47
  <span class="rates" style="width:<%= number_to_percentage(mv.conversion_rate, :precision => 0) %>"></span>
49
48
  </span>
50
49
 
@@ -61,8 +60,8 @@
61
60
  </div>
62
61
 
63
62
  <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>
63
+ <a class="button" href="<%= edit_mg_metric_url :id => @metric %>">Edit Metric</a>
64
+ <a class="button" href="<%= new_mg_metric_metric_variant_url :metric_id => @metric.id %>">New Variant</a>
66
65
  </div>
67
66
  </div>
68
67
  </div>
@@ -0,0 +1,14 @@
1
+
2
+ <h2> This is a test page </h2>
3
+
4
+ <p>
5
+ <%= mv(:homies, :jump, 'default') %>
6
+ <%= mv_detailed(:homies, :click, 'Rock on')[:value] %>
7
+ <%= @controller.rc(:click, :geoff => 'a') %>
8
+ <%= @controller.rc(:click, :geoff => 'b') %>
9
+ <%= @controller.rc(:click, :geoff => 'b') %>
10
+ <%= bd(:jim, 'jim') %>
11
+ <%= bd(:beam, 'beam') %>
12
+ <%= bd(:beam, 'beam') %>
13
+ <%# @controller.rc(:click, :metric_homies => 1, :drum_id => 2, :user => true, :invitees => true) %>
14
+ </p>
@@ -0,0 +1,5 @@
1
+ <%# locals => rallies %>
2
+
3
+ <% rallies.each do |rally| %>
4
+ <%= render :partial => 'mg/rallies/rally', :locals => { :rally => rally } %>
5
+ <% end %>
@@ -0,0 +1,13 @@
1
+
2
+ <div id="container-main" class="mt-rallies">
3
+ <div class="mountain-goat-panel cenetered">
4
+ <h2>Edit rally</h2>
5
+
6
+ <% form_for :rally, @rally, :url => mg_rallies_url do |f| %>
7
+ <%= f.error_messages %>
8
+
9
+ <%= render :partial => 'mg/rallies/rallies_form', :locals => { :f => f } %>
10
+ <% end %>
11
+
12
+ </div>
13
+ </div>