mountain-goat 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.gitignore +1 -0
  2. data/.gitignore~ +2 -0
  3. data/README.md +4 -3
  4. data/generators/mg/mg_generator.rb +2 -2
  5. data/lib/mountain-goat/controllers/mg/goals_controller.rb +4 -7
  6. data/lib/mountain-goat/controllers/mg/report_items_controller.rb +35 -2
  7. data/lib/mountain-goat/mg_core.rb +1 -1
  8. data/lib/mountain-goat/models/mg/goal.rb +1 -1
  9. data/lib/mountain-goat/models/mg/report.rb +1 -1
  10. data/lib/mountain-goat/public/g-funnel.js +1 -1
  11. data/lib/mountain-goat/switch_choice.rb +2 -2
  12. data/lib/mountain-goat/version.rb +1 -1
  13. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_show.html.erb.86489~ +32 -0
  14. data/lib/mountain-goat/views/mountain_goat/mg/goals/show.html.erb +20 -12
  15. data/lib/mountain-goat/views/mountain_goat/mg/report_items/{.tmp__chart.html.erb.13419~ → .tmp__chart.html.erb.73596~} +0 -0
  16. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__show.html.erb.52502~ +29 -0
  17. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_show.html.erb +13 -2
  18. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_form.html.erb.42949~ +26 -0
  19. data/lib/mountain-goat/views/mountain_goat/mg/reports/{.tmp__report_report_items.html.erb.26030~ → .tmp__report_report_items.html.erb.96264~} +1 -1
  20. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_edit.html.erb.39909~ +33 -0
  21. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_show.html.erb.37905~ +18 -0
  22. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb +2 -2
  23. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb +3 -1
  24. data/lib/mountain-goat/views/mountain_goat/mg/tests/.tmp_show.html.erb.19989~ +63 -0
  25. metadata +13 -20
  26. data/lib/mountain-goat/views/mountain_goat/layouts/.tmp_mountain_goat.html.erb.50680~ +0 -76
  27. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp__goal_form.html.erb.5027~ +0 -0
  28. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp__goal_meta_type_form.html.erb.39992~ +0 -0
  29. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_edit.html.erb.55874~ +0 -0
  30. data/lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_index.html.erb.97274~ +0 -36
  31. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__funnel.html.erb.60493~ +0 -18
  32. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__report_item_form.html.erb.87420~ +0 -10
  33. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__report_item_pivot_form.html.erb.77056~ +0 -14
  34. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp_edit.html.erb.31048~ +0 -19
  35. data/lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp_new.html.erb.36371~ +0 -17
  36. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_form.html.erb.76535~ +0 -21
  37. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_edit.html.erb.78064~ +0 -36
  38. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_index.html.erb.74591~ +0 -23
  39. data/lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_show.html.erb.58427~ +0 -21
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .svn
2
2
  .DS_Store
3
+ .tmp
data/.gitignore~ ADDED
@@ -0,0 +1,2 @@
1
+ .svn
2
+ .DS_Store
data/README.md CHANGED
@@ -40,13 +40,13 @@ For more information, read my blog post on how mountain goat quickly accomplishe
40
40
 
41
41
  ## Upgrade from < 1.0.0
42
42
 
43
- If you are upgrading from Mountain Goat < 1.0.2, please run the following command (please overwrite mountain-goat.yml when prompted):
43
+ If you are upgrading from Mountain Goat < 1.0.3, please run the following command (please overwrite mountain-goat.yml when prompted):
44
44
 
45
- ./script/generate mg --update=1.0.0,1.0.2
45
+ ./script/generate mg --update=1.0.0,1.0.3
46
46
 
47
47
  rake db:migrate
48
48
 
49
- This will install new migrations necessary for version 1.0.2. Leave out the 1.0.0 from the command if you are upgrading from version 1.0.0.
49
+ This will install new migrations necessary for version 1.0.3. Leave out the 1.0.0 from the command if you are upgrading from version 1.0.0.
50
50
 
51
51
  ## Install
52
52
 
@@ -267,6 +267,7 @@ As mountain goat is a suite that is added into your project dynamically, the fol
267
267
  * mg_reports
268
268
 
269
269
  ## Change log
270
+ 1.0.3 - Some overall bug-fixes and start to use Raphael Graphs
270
271
  1.0.2 - Big UI overhaul ~ Robert
271
272
  - Renamed objects to reflect real-world thinking (e.g. metric => test)
272
273
  - Fixed glitch in bandit choice selection
@@ -2,7 +2,7 @@ class MgGenerator < Rails::Generator::Base
2
2
  def add_options!(opt)
3
3
  opt.on('-p', '--password=password', String, "Your password to access Mountain Goat") { |v| options[:password] = v}
4
4
  opt.on('-w', '--wkhtmltopdf=/path/to/dir', String, "Path to installation of wkhtmltopdf (optional)") { |v| options[:wkhtmltopdf] = v}
5
- opt.on('-u', '--update=1.0.0,1.0.2', String, "If you have previously installed Mountain Goat, use to generate *update* tables.") { |v| options[:update] = v}
5
+ opt.on('-u', '--update=1.0.0,1.0.3', String, "If you have previously installed Mountain Goat, use to generate *update* tables.") { |v| options[:update] = v}
6
6
  puts <<-HELPFUL_INSTRUCTIONS
7
7
 
8
8
  Mountain Goat is your home for in-house bandit testing.
@@ -42,7 +42,7 @@ class MgGenerator < Rails::Generator::Base
42
42
  m.migration_template 'update_mountain_goat_tables.rb', 'db/migrate', { :migration_file_name => "update_mountain_goat_tables" }
43
43
  end
44
44
 
45
- if update.include?("1.0.2") || update.include?("1.0.1")
45
+ if update.include?("1.0.3") || update.include?("1.0.2") || update.include?("1.0.1")
46
46
  m.migration_template 'update_mountain_goat_tables_v2.rb', 'db/migrate', { :migration_file_name => "update_mountain_goat_tables_v2" }
47
47
  end
48
48
 
@@ -28,22 +28,19 @@ class Mg::GoalsController < Mg
28
28
  end
29
29
 
30
30
  @results_by_gmt = {}
31
- @results_by_gmt_titles = {}
32
31
 
33
32
  @goal.mg_goal_meta_types.each do |gmt|
34
33
  @results_by_gmt[gmt.id] = []
35
- @results_by_gmt_titles[gmt.id] = {}
36
- i = 0
34
+
37
35
  gmt.meta.all(:select => "data, count(*) as count", :group => "data").each do |meta|
38
36
  next if meta.data.nil?
39
37
  if gmt.meta_type == 'cs_meta' || gmt.meta_type == 'gs_meta'
40
- @results_by_gmt[gmt.id].push( { :name => i, :val => meta.count } )
41
- @results_by_gmt_titles[gmt.id].merge!({ i => meta.data })
38
+ @results_by_gmt[gmt.id].push( { :name => meta.data, :val => meta.count, :title => meta.data } )
39
+ #@results_by_gmt_titles[gmt.id].merge!({ i => meta.data })
42
40
  else
43
- @results_by_gmt[gmt.id].push( { :name => meta.data, :val => meta.count } )
41
+ @results_by_gmt[gmt.id].push( { :name => meta.data, :val => meta.count, :title => meta.data } )
44
42
  end
45
43
 
46
- i += 1
47
44
  end
48
45
  end
49
46
 
@@ -22,7 +22,7 @@ class Mg::ReportItemsController < Mg
22
22
  raise ArgumentError, "Invalid report" if @report.nil?
23
23
 
24
24
  @report_item = @report.mg_report_items.new(params[:report_item].clone.delete_if { |k, v| k.intern == :reportable || k.intern == :pivot } )
25
- @report_item.order = @report.mg_report_items.to_a.map { |ri| ri.order }.push(0).max + 1#@report.report_items.maximum(:order) + 1 -- weird sqlite3 bugs
25
+ @report_item.order = @report.mg_report_items.maximum(:order) + 1 # @report.mg_report_items.to_a.map { |ri| ri.order }.push(0).max + 1# -- weird sqlite3 bugs
26
26
 
27
27
  if !params[:report_item][:reportable].blank?
28
28
  id, model = params[:report_item][:reportable].split('-')
@@ -78,5 +78,38 @@ class Mg::ReportItemsController < Mg
78
78
  end
79
79
  end
80
80
 
81
- #TODO: Destroy
81
+ def up
82
+ @report_item = Mg::ReportItem.find(params[:id])
83
+
84
+ old_order = @report_item.order
85
+ @report_item2 = Mg::ReportItem.last( :conditions => ["mg_report_items.order < ?", old_order], :order => "mg_report_items.order")
86
+
87
+ ( render :json => { :success => true } and return ) if @report_item2.nil?
88
+
89
+ @report_item.update_attribute(:order, @report_item2.order)
90
+ @report_item2.update_attribute(:order, old_order)
91
+
92
+ render :json => { :success => true, :result => render_to_string( :partial => "mg/reports/report_report_items", :locals => { :report => @report_item.mg_report } ) }
93
+ end
94
+
95
+ def down
96
+ @report_item = Mg::ReportItem.find(params[:id])
97
+
98
+ old_order = @report_item.order
99
+ @report_item2 = Mg::ReportItem.first( :conditions => ["mg_report_items.order > ?", old_order], :order => "mg_report_items.order")
100
+
101
+ ( render :json => { :success => true } and return ) if @report_item2.nil?
102
+
103
+ @report_item.update_attribute(:order, @report_item2.order)
104
+ @report_item2.update_attribute(:order, old_order)
105
+
106
+ render :json => { :success => true, :result => render_to_string( :partial => "mg/reports/report_report_items", :locals => { :report => @report_item.mg_report } ) }
107
+ end
108
+
109
+ def destroy
110
+ @report_item = Mg::ReportItem.find(params[:id])
111
+ @report_item.destroy
112
+
113
+ render :json => { :success => true, :result => render_to_string( :partial => "mg/reports/report_report_items", :locals => { :report => @report_item.mg_report } ) }
114
+ end
82
115
  end
@@ -19,7 +19,7 @@ module MgCore
19
19
  mg.resources :tests, :has_many => :choices, :member => { :hide => :get, :unhide => :get }
20
20
  mg.resources :records, :collection => { :new_records => :get }
21
21
  mg.resources :reports, :has_many => :report_items, :member => { :show_svg => :get, :hide => :get, :unhide => :get }
22
- mg.resources :report_items, :member => { :destroy => :get, :update => :post }, :collection => { :get_extra => :get }
22
+ mg.resources :report_items, :member => { :destroy => :get, :update => :post, :up => :get, :down => :get }, :collection => { :get_extra => :get }
23
23
  mg.resources :playground, :collection => { :test => :get }
24
24
  mg.new_records '/records/new', :controller => :records, :action => :new_records
25
25
  mg.fresh_choices '/fresh-choices', :controller => :tests, :action => :fresh_choices
@@ -27,7 +27,7 @@ class Mg::Goal < ActiveRecord::Base
27
27
 
28
28
  # Helper function to retrieve a goal by symbol
29
29
  def self.by_type(s)
30
- Mg::Goal.find( :first, :conditions => { :mg_goal_type => s.to_s } )
30
+ Mg::Goal.find( :first, :conditions => { :goal_type => s.to_s } )
31
31
  end
32
32
 
33
33
  # Get all records for given meta (e.g. for "Referer": { "Youtube" => Record1, } ...)
@@ -1,7 +1,7 @@
1
1
  class Mg::Report < ActiveRecord::Base
2
2
  set_table_name :mg_reports
3
3
 
4
- has_many :mg_report_items, :class_name => "Mg::ReportItem", :foreign_key => "mg_report_id"
4
+ has_many :mg_report_items, :class_name => "Mg::ReportItem", :foreign_key => "mg_report_id", :order => "mg_report_items.order"
5
5
  has_many :reportables, :through => :mg_report_items
6
6
 
7
7
  validates_presence_of :title
@@ -58,7 +58,7 @@ Raphael.fn.g.funnelchart = function (cx, cy, cw, ch, values, opts) {
58
58
  var path = trap(sx0, sy0, w0, w1, sh);
59
59
  var p = this.path(path).attr({fill: opts.colors && opts.colors[i] || this.g.colors[i] || "#666", stroke: opts.stroke || "#fff", "stroke-width": (opts.strokewidth == null ? 1 : opts.strokewidth), "stroke-linejoin": "round"});
60
60
  if (values[i].labeltext)
61
- p.insetLabel = this.text(sx0 + w0 / 2.0, sy0 + sh / 3.0, values[i].labeltext + ( i > 0 ? ( " " + ( values[i] - values[i - 1] / values[i - 1] ) + "%" ) : "")).attr({font: "20px Helvetica", stroke: "#fff", fill: "#eee", "fill-opacity": 0.95, "stroke-opacity": 0 });
61
+ p.insetLabel = this.text(sx0 + w0 / 2.0, sy0 + sh / 3.0, values[i].labeltext + ( i > 0 ? ( " " + ( ( values[i] - values[i - 1] ) / values[i - 1] ) + "%" ) : "")).attr({font: "20px Helvetica", stroke: "#fff", fill: "#eee", "fill-opacity": 0.95, "stroke-opacity": 0 });
62
62
 
63
63
  p.value = values[i];
64
64
  sectors.push(p);
@@ -15,9 +15,9 @@ class SwitchChoice
15
15
  # each option and make sure we have a back-end entry in choices
16
16
  # for the type
17
17
  @logger.warn "Looking at option #{sym.to_s}"
18
- if @test.choices.find( :first, :conditions => { :switch_type => sym.to_s } ).nil?
18
+ if @test.mg_choices.find( :first, :conditions => { :switch_type => sym.to_s } ).nil?
19
19
  @logger.warn "Creating switch-type choice #{sym.to_s}"
20
- @test.choices.create!( :name => sym.to_s, :switch_type => sym.to_s, :value => nil )
20
+ @test.mg_choices.create!( :name => sym.to_s, :switch_type => sym.to_s, :value => nil )
21
21
  end
22
22
  else
23
23
  if @chosen_choice.switch_type.to_s == sym.to_s
@@ -1,3 +1,3 @@
1
1
  class MountainGoat
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -0,0 +1,32 @@
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>
@@ -5,9 +5,16 @@
5
5
  <div class="flyer-analysis statpad">
6
6
  <div class="title">Records by Day</div>
7
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)") %>
8
+ <% if @results_per_day.count > 2 %>
9
+ <div id="chart_item<%=h @goal.id %>" data-raphael="line" data-x-axis="date"
10
+ data-title0="Records"
11
+ data-x0="<%= @results_per_day.map { |i| i[:date] }.join(',') %>"
12
+ data-y0="<%= @results_per_day.map { |i| i[:val] }.join(',') %>"
13
+ style="width: 425px; height: 260px;" />
14
+ </div>
15
+ <% else %>
16
+ Results will populate shortly
17
+ <% end %>
11
18
  </div>
12
19
  </div>
13
20
 
@@ -15,15 +22,16 @@
15
22
  <div class="flyer-analysis statpad">
16
23
  <div class="title">Records by <%=h gmt.name %></div>
17
24
  <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 %>
25
+ <div id="chart_item_gmt_<%=h gmt.id %>" data-raphael="pie" data-x-axis="date"
26
+ <% if gmt.meta_type == 'ci_meta' || gmt.meta_type == 'gi_meta' %>
27
+ data-title="<%= @results_by_gmt[gmt.id].map { |i| "'#{( i[:title] || "(Blank)" )}'" }.join(',') %>"
28
+ data-x="<%= @results_by_gmt[gmt.id].map { |i| i[:name] }.join(',') %>"
29
+ <% else %>
30
+ data-x="<%= @results_by_gmt[gmt.id].map { |i| "'#{i[:name]}'" }.join(',') %>"
31
+ <% end %>
32
+ data-y="<%= @results_by_gmt[gmt.id].map { |i| i[:val] }.join(',') %>"
33
+ style="width: 425px; height: 260px;" />
34
+ </div>
27
35
  </div>
28
36
  </div>
29
37
  <% end %>
@@ -0,0 +1,29 @@
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,4 +1,4 @@
1
- <%# locals => report_item %>
1
+ <%# locals => report_item, show_up, show_down %>
2
2
 
3
3
  <div class="report-item">
4
4
  <span class="report-info">
@@ -23,7 +23,18 @@
23
23
  </span>
24
24
 
25
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>
26
+ <a href="javascript:void(0)" class="remote-link smallbutton" data-path="<%= destroy_mg_report_item_url(:id => report_item.id) %>" data-res=".report-report-items">Remove</a>
27
+ </span>
28
+
29
+ <span class="up-down">
30
+ <% if show_up %>
31
+ <a href="javascript:void(0)" class="remote-link smallbutton" data-path="<%= up_mg_report_item_url(:id => report_item.id) %>" data-res=".report-report-items">Up</a>
32
+ <% end %>
33
+
34
+ <% if show_down %>
35
+ <% if show_up %>/<% end %>
36
+ <a href="javascript:void(0)" class="remote-link smallbutton" data-path="<%= down_mg_report_item_url(:id => report_item.id) %>" data-res=".report-report-items">Down</a>
37
+ <% end %>
27
38
  </span>
28
39
  </span>
29
40
  </div>
@@ -0,0 +1,26 @@
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 +1,5 @@
1
1
  <%# locals => report %>
2
2
 
3
- <% report.report_items.each do |report_item| %>
3
+ <% report.mg_report_items.each do |report_item| %>
4
4
  <%= render :partial => 'mg/report_items/show', :locals => { :report_item => report_item } %>
5
5
  <% end %>
@@ -0,0 +1,33 @@
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
+
@@ -0,0 +1,18 @@
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>
@@ -12,12 +12,12 @@
12
12
 
13
13
  <div class="item report_type">
14
14
  <%= f.label :report_type, 'Report Type' %>
15
- <%= f.select :report_type, options_for_select( [ [ 'Graph', 'graph' ], [ 'Funnel', 'funnel' ] ] ) %>
15
+ <%= f.select :report_type, options_for_select( [ [ 'Graph', 'graph' ], [ 'Funnel', 'funnel' ] ], f.object.report_type ) %>
16
16
  </div>
17
17
 
18
18
  <div class="item delivert_set">
19
19
  <%= f.label :delivery_set, 'Frequency' %>
20
- <%= f.select :delivery_set, options_for_select( [ [ 'Daily', 'daily' ], [ 'Weekly', 'weekly' ], [ 'Monthly', 'monthly' ], ['Never', 'never'] ] ) %>
20
+ <%= f.select :delivery_set, options_for_select( [ [ 'Daily', 'daily' ], [ 'Weekly', 'weekly' ], [ 'Monthly', 'monthly' ], ['Never', 'never'] ], f.object.delivery_set ) %>
21
21
  </div>
22
22
 
23
23
  <div class="item recipients">
@@ -1,5 +1,7 @@
1
1
  <%# locals => report %>
2
2
 
3
+ <% i = 0 %>
3
4
  <% report.mg_report_items.each do |report_item| %>
4
- <%= render :partial => 'mg/report_items/show', :locals => { :report_item => report_item } %>
5
+ <%= render :partial => 'mg/report_items/show', :locals => { :report_item => report_item, :show_up => i > 0, :show_down => i < report.mg_report_items.count - 1 } %>
6
+ <% i += 1 %>
5
7
  <% end %>
@@ -0,0 +1,63 @@
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>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mountain-goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Geoffrey Hayes
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-10-09 00:00:00 -07:00
19
+ date: 2011-10-11 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
 
63
63
  files:
64
64
  - .gitignore
65
+ - .gitignore~
65
66
  - Gemfile
66
67
  - Gemfile.lock
67
68
  - History.md
@@ -128,7 +129,6 @@ files:
128
129
  - lib/mountain-goat/public/utils.js
129
130
  - lib/mountain-goat/switch_choice.rb
130
131
  - lib/mountain-goat/version.rb
131
- - lib/mountain-goat/views/mountain_goat/layouts/.tmp_mountain_goat.html.erb.50680~
132
132
  - lib/mountain-goat/views/mountain_goat/layouts/_pdf.html.erb
133
133
  - lib/mountain-goat/views/mountain_goat/layouts/mountain_goat.html.erb
134
134
  - lib/mountain-goat/views/mountain_goat/layouts/xhr.html.erb
@@ -137,10 +137,7 @@ files:
137
137
  - lib/mountain-goat/views/mountain_goat/mg/choices/index.html.erb
138
138
  - lib/mountain-goat/views/mountain_goat/mg/choices/new.html.erb
139
139
  - lib/mountain-goat/views/mountain_goat/mg/choices/show.html.erb
140
- - lib/mountain-goat/views/mountain_goat/mg/goals/.tmp__goal_form.html.erb.5027~
141
- - lib/mountain-goat/views/mountain_goat/mg/goals/.tmp__goal_meta_type_form.html.erb.39992~
142
- - lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_edit.html.erb.55874~
143
- - lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_index.html.erb.97274~
140
+ - lib/mountain-goat/views/mountain_goat/mg/goals/.tmp_show.html.erb.86489~
144
141
  - lib/mountain-goat/views/mountain_goat/mg/goals/_goal_form.html.erb
145
142
  - lib/mountain-goat/views/mountain_goat/mg/goals/_goal_meta_type_form.html.erb
146
143
  - lib/mountain-goat/views/mountain_goat/mg/goals/edit.html.erb
@@ -156,12 +153,8 @@ files:
156
153
  - lib/mountain-goat/views/mountain_goat/mg/records/index.html.erb
157
154
  - lib/mountain-goat/views/mountain_goat/mg/records/new.html.erb
158
155
  - lib/mountain-goat/views/mountain_goat/mg/records/show.html.erb
159
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__chart.html.erb.13419~
160
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__funnel.html.erb.60493~
161
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__report_item_form.html.erb.87420~
162
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__report_item_pivot_form.html.erb.77056~
163
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp_edit.html.erb.31048~
164
- - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp_new.html.erb.36371~
156
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__chart.html.erb.73596~
157
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/.tmp__show.html.erb.52502~
165
158
  - lib/mountain-goat/views/mountain_goat/mg/report_items/_chart.html.erb
166
159
  - lib/mountain-goat/views/mountain_goat/mg/report_items/_funnel.html.erb
167
160
  - lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_form.html.erb
@@ -171,11 +164,10 @@ files:
171
164
  - lib/mountain-goat/views/mountain_goat/mg/report_items/edit.html.erb
172
165
  - lib/mountain-goat/views/mountain_goat/mg/report_items/new.html.erb
173
166
  - lib/mountain-goat/views/mountain_goat/mg/report_mailer/report.html.erb
174
- - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_form.html.erb.76535~
175
- - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_report_items.html.erb.26030~
176
- - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_edit.html.erb.78064~
177
- - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_index.html.erb.74591~
178
- - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_show.html.erb.58427~
167
+ - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_form.html.erb.42949~
168
+ - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp__report_report_items.html.erb.96264~
169
+ - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_edit.html.erb.39909~
170
+ - lib/mountain-goat/views/mountain_goat/mg/reports/.tmp_show.html.erb.37905~
179
171
  - lib/mountain-goat/views/mountain_goat/mg/reports/_report.html.erb
180
172
  - lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb
181
173
  - lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb
@@ -183,6 +175,7 @@ files:
183
175
  - lib/mountain-goat/views/mountain_goat/mg/reports/index.html.erb
184
176
  - lib/mountain-goat/views/mountain_goat/mg/reports/new.html.erb
185
177
  - lib/mountain-goat/views/mountain_goat/mg/reports/show.html.erb
178
+ - lib/mountain-goat/views/mountain_goat/mg/tests/.tmp_show.html.erb.19989~
186
179
  - lib/mountain-goat/views/mountain_goat/mg/tests/_test_form.html.erb
187
180
  - lib/mountain-goat/views/mountain_goat/mg/tests/edit.html.erb
188
181
  - lib/mountain-goat/views/mountain_goat/mg/tests/index.html.erb
@@ -1,76 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
-
3
- <% is_mobile = false if local_assigns[:is_mobile].nil? %>
4
-
5
- <html xmlns="http://www.w3.org/1999/xhtml">
6
-
7
- <head>
8
- <title>Mountain Goat <% if @title %> - <%=h @title %><% end %></title>
9
-
10
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11
-
12
- <%# These are mobile specific settings. We are disabling zooming and fixing the width. %>
13
- <meta content='True' name='HandheldFriendly' />
14
- <!--<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />-->
15
- <meta name="viewport" content="width=device-width" />
16
-
17
- <link rel="stylesheet" href="/mg/public/mg_css" type="text/css" />
18
- <link rel="stylesheet" href="/mg/public/jqModel_css" type="text/css" />
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>
29
- <script src="/mg/public/jquery_flot_js" type="text/javascript"></script>
30
- <script src="/mg/public/jquery_timeago_js" type="text/javascript"></script>
31
- <script src="/mg/public/jquery_raphael_js" type="text/javascript"></script>
32
- <script src="/mg/public/mg_js" type="text/javascript"></script>
33
- <script src="/mg/public/utils_js" type="text/javascript"></script>
34
-
35
- </head>
36
-
37
- <body>
38
- <div class="mg-header structure">
39
- <div class="container-center">
40
- <div class="header">
41
- <a href="/mg" class="logo">
42
- <img src="/mg/public/mg_png" />
43
- </a>
44
- <ul class="nav">
45
- <li><a href="<%= mg_goals_url %>">Goals</a></li>
46
- <li><a href="<%= mg_tests_url %>">Tests</a></li>
47
- <li><a href="<%= mg_records_url %>">Records</a></li>
48
- <li><a href="<%= mg_reports_url %>">Reports</a></li>
49
- <li><a href="/">Exit</a></li>
50
- </ul>
51
- </div>
52
- </div>
53
- </div>
54
-
55
- <div class="mg-content structure">
56
- <div class="container-center">
57
- <% if !flash[:notice].blank? || !flash[:error].blank? %>
58
- <div class="flash">
59
- <% if !flash[:error].blank? %>
60
- <div class="error"><%= flash[:error] %></div>
61
- <% end %>
62
- <% if !flash[:notice].blank? %>
63
- <div class="notice"><%= flash[:notice] %></div>
64
- <% end %>
65
- </div>
66
- <% end %>
67
- <%= yield %>
68
- </div>
69
- </div>
70
-
71
- <div class="mg-footer structure">
72
-
73
- </div>
74
- </body>
75
-
76
- </html>
@@ -1,36 +0,0 @@
1
- <div id="container-main" class="mg-goals">
2
- <h1>Your Goals</h1>
3
- <div class="container-content">
4
- <div class="title-bar">
5
- <span class="category name">Goal</span>
6
- <span class="category hit-total">Total</span>
7
- <span class="category hit-recent">Recent</span>
8
- <span class="category hit-points">Points</span>
9
- <span class="category actions">Actions</span>
10
- </div>
11
- <ul class="listed">
12
- <% @goals.each do |goal| %>
13
- <li class="conversion-goal">
14
- <span class="category name"><%=h goal.name %></span>
15
- <span class="category hit-total"><%=h goal.mg_records.count %></span>
16
- <span class="category hit-recent"><%=h goal.recent_records(1.week).count %></span>
17
- <span class="category hit-points"><%=h goal.rewards_total || "None" %></span>
18
- <span class="category actions">
19
- <a href="<%= mg_goal_url :id => goal.id %>">View</a>
20
- <a href="<%= hide_mg_goal_url :id => goal.id %>">Hide</a>
21
- </span>
22
- </li>
23
- <% end %>
24
- </ul>
25
- <div class="action-bar">
26
- <a class="button" href="<%= new_mg_goal_url %>">New Goal</a>
27
- </div>
28
- </div>
29
-
30
- <div class="hidden-goals">
31
- <% @hidden_goals.each do |goal| %>
32
- <span class="name"><%=h goal.name %></span>
33
- <span class="unhide"><a href="<%= unhide_mg_goal_url :id => goal.id %>">Restore</a></span>
34
- <% end %>
35
- </div>
36
- </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,10 +0,0 @@
1
- <%# locals => f %>
2
- <div class="item reportable">
3
- <%= f.label :reportable, "Report Item" %>
4
- <%= f.select :reportable, options_for_select( [[ "Select a Goal", "" ]] + Mg::Convert.all.map { |conv| [ conv.name, "#{conv.id}-#{conv.class}" ] }, f.object.reportable.nil? ? "" : "#{f.object.reportable_id}-#{f.object.reportable_type}" ), {}, :'data-varies' => 'change', :'data-varies-path' => get_extra_mg_report_items_url, :'data-varies-res' => '#extra' %>
5
- </div>
6
- <div id="extra">
7
- <% if !f.object.nil? && !f.object.reportable.nil? %>
8
- <%= render :partial => 'mg/report_items/report_item_pivot_form', :locals => { :reportable => f.object.reportable }.merge( f.object.pivot.nil? ? {} : { :pivot => f.object.pivot } ) %>
9
- <% end %>
10
- </div>
@@ -1,14 +0,0 @@
1
- <%# locals => reportable, optional => pivot %>
2
-
3
- <% pivot = nil if !local_assigns.has_key?(:pivot) %>
4
-
5
- <% if reportable.instance_of?(Mg::Convert) %>
6
- <% cmts = reportable.convert_meta_types %>
7
- <% end %>
8
-
9
- <% if !cmts.nil? %>
10
- <div class="item pivot">
11
- <%= label_tag :'report_item[pivot]', "Pivot" %>
12
- <%= select_tag :'report_item[pivot]', options_for_select( [[ "None", "" ]] + cmts.map { |cmt| [ cmt.name, "#{cmt.id}-#{cmt.class}" ] }, pivot.nil? ? "" : "#{pivot.id}-#{pivot.type}" ) %>
13
- </div>
14
- <% end %>
@@ -1,19 +0,0 @@
1
-
2
- <div class="header">
3
- <span class="title">Edit Report Item</span>
4
- </div>
5
- <div class="body">
6
- <div class="report-items">
7
- <% form_for :report_item, @report_item, :url => update_mg_report_item_url(:id => @report_item.id), :html => { :method => :post, :class => "remote-form report-item", :'data-res' => ".report-items-model .model" } do |f| %>
8
-
9
- <div>
10
- <%= f.error_messages %>
11
- <%= render :partial => 'mg/report_items/report_item_form', :locals => { :f => f } %>
12
- </div>
13
-
14
- <div class="submit">
15
- <%= f.submit 'Update', :class => 'bluebutton' %>
16
- </div>
17
- <% end %>
18
- </div>
19
- </div>
@@ -1,17 +0,0 @@
1
-
2
- <div class="header">
3
- <span class="title">Add a new Report Item</span>
4
- </div>
5
- <div class="body">
6
- <% form_for :report_item, @report_item, :url => mg_report_report_items_url(:report_id => @report.id), :html => { :method => :post, :class => "remote-form report-item", :'data-res' => ".report-items-model .model" } do |f| %>
7
-
8
- <div>
9
- <%= f.error_messages %>
10
- <%= render :partial => 'mg/report_items/report_item_form', :locals => { :f => f } %>
11
- </div>
12
-
13
- <div class="submit">
14
- <%= f.submit 'Save', :class => 'bluebutton' %>
15
- </div>
16
- <% end %>
17
- </div>
@@ -1,21 +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_area :description %>
11
- </div>
12
-
13
- <div class="item delivert_set">
14
- <%= f.label :delivery_set, 'Frequency' %>
15
- <%= f.select :delivery_set, options_for_select( [ [ 'daily', 'daily' ], [ 'weekly', 'weekly' ], [ 'monthly', 'monthly' ] ] ) %>
16
- </div>
17
-
18
- <div class="item recipients">
19
- <%= f.label :recipients, 'Recipients' %>
20
- <%= f.text_area :recipients %>
21
- </div>
@@ -1,36 +0,0 @@
1
-
2
- <div id="container-main" class="mt-reports">
3
- <div class="mountain-goat-panel centered">
4
- <ul class="nav">
5
- <li><a href="<%= mg_reports_url %>">Reports</a></li>
6
- <li><a href="<%= mg_report_url @report.id %>"><%=h @report.title %></a></li>
7
- </ul>
8
-
9
- <h1>Edit <%= @report.title %></h1>
10
-
11
- <% form_for :report, @report, :url => mg_report_url(:id => @report.id), :html => { :method => :put } do |f| %>
12
- <%= f.error_messages %>
13
-
14
- <div class="report-report-items">
15
- <h4>Report Items</h4>
16
- <%= render :partial => "mg/reports/report_report_items", :locals => { :report => @report } %>
17
- </div>
18
-
19
- <a href="javascript:void(0)" class="smallbutton redbutton remote-link" data-path="<%= new_mg_report_report_item_url(:report_id => @report.id) %>" data-res=".report-items-model .model">+ Add Item</a>
20
-
21
- <%= render :partial => 'mg/reports/report_form', :locals => { :f => f } %>
22
-
23
- <div class="item submit">
24
- <%= f.submit 'Submit' %>
25
- </div>
26
-
27
- <div class="report-items-model flash-model model">
28
- <div class="jqmWindow">
29
- <a href="#" class="jqmClose">Close</a>
30
- <div class="model" data-model=".jqmWindow"></div>
31
- </div>
32
- </div>
33
- <% end %>
34
- </div>
35
- </div>
36
-
@@ -1,23 +0,0 @@
1
- <div id="container-main" class="mg-reports">
2
- <h1>Your Reports</h1>
3
- <div class="container-content">
4
- <div class="title-bar">
5
- <span class="category name">Report</span>
6
- <span class="category frequency">Frequency</span>
7
- <span class="category actions">Actions</span>
8
- </div>
9
- <ul class="listed">
10
- <% @reports.each do |report| %>
11
- <li class="report">
12
- <span class="category name"><%=h report.title %></span>
13
- <span class="category frequency">Frequency</span>
14
- <span class="category actions"><a href="<%= edit_mg_report_url :id => report.id %>">Edit</a> Hide</span>
15
- </li>
16
- <% end %>
17
- </ul>
18
-
19
- <div class="action-bar">
20
- <a class="button" href="<%= new_mg_report_url %>">New Report</a>
21
- </div>
22
- </div>
23
- </div>
@@ -1,21 +0,0 @@
1
-
2
- <div id="container-main" class="mt-reports show">
3
- <div class="mountain-goat-panel centered">
4
- <ul class="nav">
5
- <li><a href="<%= mg_reports_url %>">Reports</a></li>
6
- <li><a href="<%= mg_report_url @report.id %>"><%=h @report.title %></a></li>
7
- </ul>
8
-
9
- <h2><%=h @report.title %></h2>
10
-
11
- <h4><%=h @report.description %></h4>
12
-
13
- <% @report.report_items.each do |report_item| %>
14
- <%= render 'mg/report_items/chart', :report_item => report_item %>
15
- <% end %>
16
-
17
- <div class="actions">
18
- <a class="button" href="<%= edit_mg_report_url @report %>">Edit</a>
19
- </div>
20
- </div>
21
- </div>