mountain-goat 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. data/README.md +4 -3
  2. data/generators/mg/mg_generator.rb +2 -2
  3. data/init.rb +0 -1
  4. data/lib/mountain-goat.rb +0 -2
  5. data/lib/mountain-goat/controllers/mg/report_items_controller.rb +1 -1
  6. data/lib/mountain-goat/controllers/mg/tests_controller.rb +0 -16
  7. data/lib/mountain-goat/m_g.rb +20 -19
  8. data/lib/mountain-goat/models/mg/choice.rb +6 -0
  9. data/lib/mountain-goat/public/g-funnel.js +1 -1
  10. data/lib/mountain-goat/version.rb +1 -1
  11. data/lib/mountain-goat/views/mountain_goat/mg/records/_records.html.erb +1 -1
  12. data/lib/mountain-goat/views/mountain_goat/mg/records/index.html.erb +0 -1
  13. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report.html.erb +1 -1
  14. data/lib/mountain-goat/views/mountain_goat/mg/tests/show.html.erb +14 -11
  15. metadata +5 -15
  16. data/lib/mgflotilla.rb +0 -170
  17. data/lib/mountain-goat/public/jquery.flot.js +0 -2615
  18. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_show.html.erb.86489~ +0 -32
  19. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__chart.html.erb.73596~ +0 -18
  20. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__show.html.erb.52502~ +0 -29
  21. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_form.html.erb.42949~ +0 -26
  22. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_report_items.html.erb.96264~ +0 -5
  23. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_edit.html.erb.39909~ +0 -33
  24. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_show.html.erb.37905~ +0 -18
  25. data/lib/mountain-goat/views/mountain_goat/mg/tests/.tmp_show.html.erb.19989~ +0 -63
@@ -1,32 +0,0 @@
1
- <div id="container-main" class="mg-goals show">
2
- <h1><%=h @goal.name.capitalize %></h1>
3
- <div class="container-content">
4
- <div class="statboard">
5
- <div class="flyer-analysis statpad">
6
- <div class="title">Records by Day</div>
7
- <div class="statbody">
8
- <%= mg_chart("analysis_graph#{@goal.id}",
9
- { "Conversions" => { :collection => @results_per_day, :x => :date, :y => :val } },
10
- { :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 => "records(s)") %>
11
- </div>
12
- </div>
13
-
14
- <% @goal.mg_goal_meta_types.each do |gmt| %>
15
- <div class="flyer-analysis statpad">
16
- <div class="title">Records by <%=h gmt.name %></div>
17
- <div class="statbody">
18
- <% if gmt.meta_type == 'ci_meta' || gmt.meta_type == 'gi_meta' %>
19
- <%= mg_chart("analysis_graph#{gmt.id}",
20
- { "Records" => { :collection => @results_by_gmt[gmt.id], :x => :name, :y => :val } },
21
- { :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 => "records(s)") %>
22
- <% elsif gmt.meta_type == 'cs_meta' || gmt.meta_type == 'gs_meta' %>
23
- <%= mg_chart("analysis_graph#{gmt.id}",
24
- { "Conversions" => { :collection => @results_by_gmt[gmt.id], :x => :name, :y => :val } },
25
- { :xaxis => {:autoscaleMargin => 0.1, :ticks => @results_by_gmt_titles[gmt.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 => "records(s)") %>
26
- <% end %>
27
- </div>
28
- </div>
29
- <% end %>
30
- </div>
31
- </div>
32
- </div>
@@ -1,18 +0,0 @@
1
- <%# locals => report_item %>
2
-
3
- <div class="statpad">
4
- <div class="title"><%= report_item.chart_title %></div>
5
- <div class="statbody">
6
- <div id="chart_item<%=h report_item.id %>" data-raphael="line" data-x-axis="date"
7
- <% it = 0 %>
8
- <%# TODO: There's a ton of assumptions here %>
9
- <% report_item.chart_items.each do |name, channel| %>
10
- data-title<%= it %>="<%= name || "Direct" %>"
11
- data-x<%= it %>="<%= channel.map { |i| i[:x].to_time.to_i * 1000 }.join(',') %>"
12
- data-y<%= it %>="<%= channel.map { |i| i[:y] }.join(',') %>"
13
- <% it = it + 1 %>
14
- <% end %>
15
- style="width: 425px; height: 260px;" />
16
- </div>
17
- </div>
18
- </div>
@@ -1,29 +0,0 @@
1
- <%# locals => report_item %>
2
-
3
- <div class="report-item">
4
- <span class="report-info">
5
- <span class="report">
6
- <% if report_item.reportable.nil? || !report_item.reportable.respond_to?(:name) %>
7
- &lt;Undefined&gt;
8
- <% else %>
9
- <%= report_item.reportable.name %>
10
- <% end %>
11
- </span>
12
- <span class="pivot">
13
- <% if report_item.pivot.nil? || !report_item.pivot.respond_to?(:name) %>
14
- [None]
15
- <% else %>
16
- <%= report_item.pivot.name %>
17
- <% end %>
18
- </span>
19
- </span>
20
- <span class="report-item-actions">
21
- <span class="edit">
22
- <a href="javascript:void(0)" class="remote-link smallbutton" data-path="<%= edit_mg_report_item_url(:id => report_item.id) %>" data-res=".report-items-model .model">Edit</a>
23
- </span>
24
-
25
- <span class="remove">
26
- <a href="javascript:void(0)" class="remote-link smallbutton" data-path="<%= destroy_mg_report_item_url(:id => report_item.id) %>" data-res=".report-items-model .model">Remove</a>
27
- </span>
28
- </span>
29
- </div>
@@ -1,26 +0,0 @@
1
- <%# locals => f %>
2
-
3
- <div class="item title">
4
- <%= f.label :title %>
5
- <%= f.text_field :title %>
6
- </div>
7
-
8
- <div class="item description">
9
- <%= f.label :description %>
10
- <%= f.text_field :description %>
11
- </div>
12
-
13
- <div class="item report_type">
14
- <%= f.label :report_type, 'Report Type' %>
15
- <%= f.select :report_type, options_for_select( [ [ 'Graph', 'graph' ], [ 'Funnel', 'funnel' ] ] ) %>
16
- </div>
17
-
18
- <div class="item delivert_set">
19
- <%= f.label :delivery_set, 'Frequency' %>
20
- <%= f.select :delivery_set, options_for_select( [ [ 'Daily', 'daily' ], [ 'Weekly', 'weekly' ], [ 'Monthly', 'monthly' ], ['Never', 'never'] ] ) %>
21
- </div>
22
-
23
- <div class="item recipients">
24
- <%= f.label :recipients, 'Recipients' %>
25
- <%= f.text_area :recipients %>
26
- </div>
@@ -1,5 +0,0 @@
1
- <%# locals => report %>
2
-
3
- <% report.mg_report_items.each do |report_item| %>
4
- <%= render :partial => 'mg/report_items/show', :locals => { :report_item => report_item } %>
5
- <% end %>
@@ -1,33 +0,0 @@
1
- <div id="container-main" class="mg-report-edit">
2
- <h1>Edit <%= @report.title %></h1>
3
- <div class="container-content">
4
- <div class="edit-form">
5
-
6
- <% form_for :report, @report, :url => mg_report_url(:id => @report.id), :html => { :method => :put } do |f| %>
7
- <%= f.error_messages %>
8
-
9
- <%= render :partial => 'mg/reports/report_form', :locals => { :f => f } %>
10
-
11
- <div class="report-report-items">
12
- <h4>Report Items</h4>
13
-
14
- <%= render :partial => "mg/reports/report_report_items", :locals => { :report => @report } %>
15
- </div>
16
-
17
- <div class="action-bar">
18
- <a href="javascript:void(0)" class="button remote-link" data-path="<%= new_mg_report_report_item_url(:report_id => @report.id) %>" data-res=".report-items-model .model">Add Item</a>
19
-
20
- <%= f.submit 'Submit' %>
21
- </div>
22
-
23
- <div class="report-items-model flash-model model">
24
- <div class="jqmWindow">
25
- <a href="#" class="jqmClose">Close</a>
26
- <div class="model" data-model=".jqmWindow"></div>
27
- </div>
28
- </div>
29
- <% end %>
30
- </div>
31
- </div>
32
- </div>
33
-
@@ -1,18 +0,0 @@
1
- <div id="container-main" class="mg-report-show">
2
- <h1><%=h @report.title %></h1>
3
- <div class="container-content">
4
- <h3><%=h @report.description %></h3>
5
-
6
- <% if @report.report_type == 'graph' %>
7
- <% @report.mg_report_items.each do |report_item| %>
8
- <%= render 'mg/report_items/chart', :report_item => report_item %>
9
- <% end %>
10
- <% elsif @report.report_type == 'funnel' %>
11
- <%= render 'mg/report_items/funnel', :report => @report %>
12
- <% end %>
13
-
14
- <div class="actions">
15
- <a class="button" href="<%= edit_mg_report_url @report %>">Edit</a>
16
- </div>
17
- </div>
18
- </div>
@@ -1,63 +0,0 @@
1
- <div id="container-main" class="mg-tests">
2
- <h1><%=h @test.title.capitalize %> Test</h1>
3
- <div class="container-content">
4
-
5
- <div class="choices">
6
- <% if @test.mg_choices.count == 0 %>
7
- <span class="none">No choices</span>
8
- <% else %>
9
- <div class="statboard">
10
- <div class="flyer-analysis statpad">
11
- <div class="title">Records</div>
12
- <div class="statbody">
13
- <%= mg_chart("analysis_graph#{@test.id}",
14
- { "Served" => { :collection => @rates[:served], :x => :choice_type, :y => :value },
15
- "Reward Count" => { :collection => @rates[:reward_count], :x => :choice_type, :y => :value } },
16
- { :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 => "record(s)") %>
17
-
18
- </div>
19
- </div>
20
- <div class="flyer-analysis statpad">
21
- <div class="title">Reward Rates</div>
22
- <div class="statbody">
23
- <%= mg_chart("analysis_conv_graph#{@test.id}",
24
- { "Reward Rate" => { :collection => @rates[:reward_rates], :x => :choice_type, :y => :value } },
25
- { :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 => "") %>
26
-
27
- </div>
28
- </div>
29
- </div>
30
-
31
-
32
- <div class="choices">
33
- <% if @test.mg_choices.count == 0 %>
34
- <span class="none">No choices [<a href="<%= new_mg_test_choice_url :test_id => @test.id %>">Add one</a>]</span>
35
- <% else %>
36
- <div class="title-bar">
37
- <span class="category choice">Choice</span>
38
- <span class="category served">Served</span>
39
- <span class="category hit-points">Points</span>
40
- <span class="category hit-points-avg">Avg. Points</span>
41
- <span class="category actions">Actions</span>
42
- </div>
43
- <ul class="listed">
44
- <% @test.mg_choices.each do |choice| %>
45
- <li class="choice">
46
- <span class="category choice"><%=h choice.name %></span>
47
- <span class="category served"><%= choice.served %></span>
48
- <span class="category hit-points"><%= choice.reward || "None" %></span>
49
- <span class="category hit-points-avg"><%=h choice.reward_rate || "N/A" %></span>
50
- <span class="category actions"><a href="<%= mg_choice_url choice %>">Edit</a></span>
51
- </li>
52
- <% end %>
53
- </ul>
54
- <% end %>
55
- </div>
56
- <% end %>
57
- </div>
58
-
59
- <div class="action-bar">
60
- <a class="button" href="<%= new_mg_test_choice_url :test_id => @test.id %>">New Choice</a>
61
- </div>
62
- </div>
63
- </div>