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
@@ -0,0 +1,208 @@
1
+ /**
2
+ * @author Geoff
3
+ */
4
+
5
+ (function($) {
6
+ function trace(s) {
7
+ try { console.log(s); } catch (e) { /* alert(s) */ }
8
+ };
9
+
10
+ /* CONSTANTS */
11
+ var txt = {font: '12px Helvetica, Arial', fill: "#d6d6d6", stroke: "#d6d6d6"};
12
+ var txt1 = {font: '10px Helvetica, Arial', fill: "#fff"};
13
+ var txt2 = {font: '12px Helvetica, Arial', fill: "#000"};
14
+ var colorhue = .6 || Math.random();
15
+ var color = "hsb(" + [colorhue, .5, 1] + ")";
16
+ var normalLegend = {'fill': '#D6D6D6','font': '10px Helvetica, Arial', 'font-weight': '400'};
17
+ var highlightedLegend = {'fill': '#FFFFFF','font-weight': '800'};
18
+
19
+ Raphael.fn.drawGrid = function (x, y, w, h, wv, hv, color) {
20
+ color = color || "#000";
21
+ var path = ["M", Math.round(x) + .5, Math.round(y) + .5, "L", Math.round(x + w) + .5, Math.round(y) + .5, Math.round(x + w) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y) + .5],
22
+ rowHeight = h / hv,
23
+ columnWidth = w / wv;
24
+ for (var i = 1; i < hv; i++) {
25
+ path = path.concat(["M", Math.round(x) + .5, Math.round(y + i * rowHeight) + .5, "H", Math.round(x + w) + .5]);
26
+ }
27
+ for (i = 1; i < wv; i++) {
28
+ path = path.concat(["M", Math.round(x + i * columnWidth) + .5, Math.round(y) + .5, "V", Math.round(y + h) + .5]);
29
+ }
30
+ return this.path(path.join(",")).attr({stroke: color});
31
+ };
32
+
33
+ Raphael.fn.g.addChartLabels = function(chart, titles) {
34
+ chart.labels = this.set();
35
+ var x = 15; var h = 5;
36
+ for( var i = 0; i < titles.length; ++i ) {
37
+ var clr = chart.lines[i].attr("stroke");
38
+ chart.labels.push(this.set());
39
+ chart.labels[i].push(this.g["disc"](x + 5, h, 5)
40
+ .attr({fill: clr, stroke: "none"}));
41
+ chart.labels[i].push(txt = this.text(x + 20, h, titles[i])
42
+ .attr(this.g.txtattr)
43
+ .attr(normalLegend)
44
+ .attr({"text-anchor": "start"}));
45
+ x += chart.labels[i].getBBox().width * 1.2;
46
+ chart.labels[i].txt = txt;
47
+ chart.lines[i].legend = chart.labels[i];
48
+ };
49
+ };
50
+
51
+ var hoverOver = function(e, r, chart) {
52
+ trace(arguments);
53
+ trace(this);
54
+ trace(chart);
55
+ trace(chart.frame);
56
+ trace(this.attr("cx"));
57
+ //trace(this.symbols[0]);
58
+ if (typeof(chart.leave_timer) != "undefined" && chart.leave_timer != null) {
59
+ clearTimeout(chart.leave_timer);
60
+ chart.leave_timer = null;
61
+ }
62
+
63
+ if (!this.attr("cx")) {
64
+ trace("whatever!");
65
+ return;
66
+ }
67
+
68
+ var side = 3;
69
+ trace([this.attr("cx") + chart.frame.getBBox().width, chart.width]);
70
+ if (this.attr("cx") + chart.frame.getBBox().width > chart.width) {
71
+ side = 1;
72
+ }
73
+
74
+ var data = parseInt(this.value);
75
+ var lbl = this.axis;
76
+
77
+ if (!data || !lbl) {
78
+ //For non-labeled items
79
+ return;
80
+ }
81
+
82
+ var label = chart.frame.label.clone();
83
+ var clone = r.g.popupit(this.attrs.cx, this.attrs.cy, label, side).attr({fill: "#000", stroke: "#666", "stroke-width": 2, "fill-opacity": .7}).hide();
84
+
85
+ chart.is_label_visible = chart.is_label_visible || false;
86
+
87
+ chart.frame.show().stop().animate({ path: clone.attr("path") }, 200 * chart.is_label_visible );
88
+ chart.frame.label[0].attr({text: data + " hit" + (data == 1 ? "" : "s")}).show().stop().animateWith(chart.frame, {x: label[0].attr("x"), y: label[0].attr("y")}, 200 * chart.is_label_visible );
89
+ chart.frame.label[1].attr({text: newText = $.datepicker.formatDate('MM d', new Date(parseInt(lbl)))}).show().stop().animateWith(chart.frame, {x: label[1].attr("x"), y: label[1].attr("y")}, 200 * chart.is_label_visible );
90
+
91
+ clone.remove();
92
+ label.remove();
93
+
94
+ //this.attr("r_normal", this.attr("r"));
95
+ //this.attr("r", 15);
96
+ chart.is_label_visible = true;
97
+
98
+ //Let's also select the legend label
99
+ this.line.legend.txt.attr(highlightedLegend);
100
+
101
+ chart.labels.stop();
102
+ var labelsBB = chart.axis.getBBox();
103
+ var legendBB = this.line.legend.getBBox();
104
+ var totalLabelsBB = chart.labels.getBBox();
105
+ trace([labelsBB, legendBB, totalLabelsBB]);
106
+
107
+ if (totalLabelsBB.width > labelsBB.width) {
108
+ offset = ( labelsBB.width / 2.0 - legendBB.width / 2.0 + 20.0 /*adjustment*/ ) - legendBB.x;
109
+ trace("Animate to " + offset);
110
+ chart.labels.animate({'translation': [ offset, 0.0] }, 200);
111
+ }
112
+ };
113
+
114
+ var hoverOut = function (e, r, chart) {
115
+ //this.attr("r", this.attr("r_normal"));
116
+ this.line.legend.txt.attr(normalLegend);
117
+
118
+ chart.leave_timer = setTimeout(function () {
119
+ chart.frame.hide();
120
+ chart.frame.label.hide();
121
+ chart.is_label_visible = false;
122
+ }, 400);
123
+ };
124
+
125
+ var formatAxis = function(chart, axis, type) {
126
+ if (type == "date") {
127
+ $.each(chart.axis[axis].text.items, function(i, label) {
128
+ //trace(label);
129
+ originalText = label.attr('text');
130
+ newText = $.datepicker.formatDate('m/dd', new Date(parseInt(originalText)));
131
+ label.attr({'text': newText, 'fill': '#D6D6D6'});
132
+ });
133
+ } else {
134
+ $.each(chart.axis[axis].text.items, function(i, label) {
135
+ label.attr({'fill': '#D6D6D6'});
136
+ });
137
+ }
138
+ chart.axis[axis].attr({'stroke': "#404040"});
139
+ };
140
+
141
+ $.fn.raphael = function() {
142
+ return this.each(function() {
143
+ var r = Raphael(this.id);
144
+ var x, y, titles;
145
+ var type = $(this).data('raphael') || "line";
146
+
147
+ if ($(this).data('x') && $(this).data('y')) {
148
+ x = eval('[' + $(this).data('x') + ']');
149
+ y = eval('[' + $(this).data('y') + ']');
150
+ } else {
151
+ x = [];
152
+ y = [];
153
+ titles = [];
154
+ var i = 0;
155
+ while ($(this).data('x' + i) && $(this).data('y' + i)) {
156
+ x.push(eval('[' + $(this).data('x' + i) + ']'));
157
+ y.push(eval('[' + $(this).data('y' + i) + ']'));
158
+ titles.push($(this).data('title' + i) || "Item " + i);
159
+ i++;
160
+ }
161
+ }
162
+
163
+ if (type == "line") {
164
+ r.drawGrid(25, 25, $(this).width() - 50, $(this).height() - 50, 6, 5, "#333");
165
+
166
+ var label = r.set();
167
+ var chart = r.g.linechart(10, 10, $(this).width() - 20, $(this).height() - 20, x, y, { axis: "0 0 1 1", symbol: '', gutter: 15 } ).attr({x: x, y: y});
168
+ chart.width = $(this).width() - 20;
169
+ chart.height = $(this).height() - 20;
170
+
171
+ if (titles != null) r.g.addChartLabels(chart, titles);
172
+
173
+ var label = r.set(r.text(60, 12, "24 hits").attr(txt), r.text(60, 27, "22 September 2008").attr(txt1).attr({fill: color})).hide();
174
+ chart.frame = r.g.popupit(100, 100, label, 1).attr({fill: "#fff", stroke: "#666", "stroke-width": 2, "fill-opacity": .7}).hide();
175
+ chart.frame.label = label;
176
+
177
+ chart.hover(function(e) { hoverOver.call(this, e, r, chart); }, function(e){ hoverOut.call(this, e, r, chart); } );
178
+ formatAxis(chart, 0, $(this).data('x-axis'));
179
+ formatAxis(chart, 1, $(this).data('y-axis'));
180
+ } else if (type == "pie") {
181
+ r.g.txtattr.font = txt;
182
+ var pie = r.g.piechart($(this).width() / 2.2, $(this).height() / 2.0, Math.min($(this).width(), $(this).height()) / 2.4, y, {legend: x, legendcolor: "#d6d6d6", legendpos: "east", href: ["http://raphaeljs.com", "http://g.raphaeljs.com"]});
183
+ pie.hover(function () {
184
+ this.sector.stop();
185
+ this.sector.scale(1.1, 1.1, this.cx, this.cy);
186
+ if (this.label) {
187
+ this.label[0].stop();
188
+ this.label[0].scale(1.5);
189
+ this.label[1].attr({"font-weight": 800});
190
+ }
191
+ }, function () {
192
+ this.sector.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce");
193
+ if (this.label) {
194
+ this.label[0].animate({scale: 1}, 500, "bounce");
195
+ this.label[1].attr({"font-weight": 400});
196
+ }
197
+ });
198
+ }
199
+
200
+ });
201
+ };
202
+
203
+ $(document).ready(function() {
204
+ $('*[data-raphael]').raphael();
205
+ });
206
+
207
+ })(jQuery);
208
+
@@ -19,7 +19,7 @@ body, select, pre {
19
19
  }
20
20
 
21
21
  a {
22
- color: #fff;
22
+ color: #bbb;
23
23
  text-decoration: none;
24
24
  }
25
25
 
@@ -28,7 +28,7 @@ a:hover {
28
28
  text-decoration: underline;
29
29
  }
30
30
 
31
- .header {
31
+ .main-header {
32
32
  top: 0;
33
33
  width: 100%;
34
34
  position: fixed;
@@ -36,19 +36,19 @@ a:hover {
36
36
  background-color: rgba(2,2,2,0.7);
37
37
  }
38
38
 
39
- .header .head {
40
- width: 900px;
39
+ .main-header .head {
40
+ width: 930px;
41
41
  margin: 0 auto;
42
42
  height: 107px;
43
43
  }
44
44
 
45
- .header ul.nav {
45
+ .main-header ul.nav {
46
46
  margin: 0;
47
47
  float: right;
48
48
  height: 100%;
49
49
  }
50
50
 
51
- .header ul.nav li {
51
+ .main-header ul.nav li {
52
52
  float: left;
53
53
  list-style: none outside none;
54
54
  width: 140px;
@@ -57,11 +57,11 @@ a:hover {
57
57
  margin-right: -1px;
58
58
  }
59
59
 
60
- .header ul.nav li:hover {
60
+ .main-header ul.nav li:hover {
61
61
  background-color: #FF2800;
62
62
  }
63
63
 
64
- .header ul.nav li > a{
64
+ .main-header ul.nav li > a{
65
65
  display: block;
66
66
  font-size: 24px;
67
67
  padding: 42px 0px;
@@ -250,33 +250,25 @@ form input[type='submit'] {
250
250
  float: left;
251
251
  background: rgb(30,30,30);
252
252
  background: rgba(0,0,0,.9);
253
-
254
253
  width: 900px;
255
- margin: 0px 0px 0px 40px;
256
- padding: 0px 10px 10px 10px;
254
+ margin: 0px 0px 0px 20px;
255
+ padding: 0px 10px;
257
256
  color: #D6D6D6;
257
+ text-align: center;
258
258
  }
259
- .stat-header, .statpad .title, .statpad .statbody{
259
+ .statpad .title, .statpad .statbody{
260
260
  background: #222222;
261
261
  border-top: 1px solid #333333;
262
262
  border-bottom: 1px solid #151617;
263
263
  }
264
- .stat-header, .statpad, .statnote{
264
+ .statpad, .statnote{
265
265
  box-shadow: 2px 0 3px #0D0D0D, -2px 0 3px #0D0D0D, 0 3px 3px #0D0D0D, 0 -2px 3px #0D0D0D;
266
266
  }
267
- .stat-header{
268
- float: left;
269
- width: 100%;
270
- height: 50px;
271
- line-height: 50px;
272
- margin: 10px 0px 0px 0px;
273
- font-size: 30px;
274
- text-align: center;
275
- }
267
+
276
268
  .statpad{
277
269
  float: left;
278
270
  width: 445px;
279
- margin-top: 10px;
271
+ margin-bottom: 10px;
280
272
 
281
273
  }
282
274
  .statpad .title{
@@ -296,13 +288,13 @@ form input[type='submit'] {
296
288
  margin-right: 10px;
297
289
  }
298
290
  .statbody.pie{
299
- width: 345px;
300
- padding-left: 90px;
301
291
  }
302
292
  .statbody.pie .legend{
303
293
  display: none;
304
294
  }
305
-
295
+ .statbody.pie .chart{
296
+ margin: 0px auto;
297
+ }
306
298
  .quad.statpad{
307
299
  box-shadow: none;
308
300
  }
@@ -343,6 +335,8 @@ form input[type='submit'] {
343
335
  padding-left: 3px;
344
336
  font-size: 12px;
345
337
  }
338
+
339
+
346
340
  .asterisk{
347
341
  font-size: 12px;
348
342
  }
@@ -431,3 +425,118 @@ ul.rally-list li.rally .time {
431
425
  float: right;
432
426
  margin-top: -20px;
433
427
  }
428
+
429
+ .model .header, .model .body {
430
+ float: left;
431
+ }
432
+
433
+ .flash-model .jqmWindow {
434
+ background: #FFFFFF;
435
+ border-radius: 10px;
436
+ border: 5px solid #DDDDDD;
437
+ padding: 0px;
438
+ }
439
+ .flash-model .header{
440
+ border-radius: 6px 6px 0px 0px;
441
+ width: 100%;
442
+ line-height: 30px;
443
+ padding: 0px;
444
+ font-weight: bold;
445
+ color: #FFFFFF;
446
+ }
447
+ .flash-model .header .title{
448
+ padding-left: 10px;
449
+ }
450
+ .flash-model .body{
451
+ padding: 10px 20px 20px 20px;
452
+ }
453
+
454
+ .flash-model .header {
455
+ background: #88BBEE;
456
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#88BBEE', endColorstr='#5588CC');
457
+ background: -webkit-gradient(linear, left top, left bottom, from(#8BE), to(#58C));
458
+ background: -moz-linear-gradient(top, #8BE, #58C);
459
+ }
460
+
461
+ a.jqmClose{
462
+ position: absolute;
463
+ right: 20px;
464
+ top: 5px;
465
+ color: #EEEEFF;
466
+ }
467
+
468
+ input[type="submit"], .smallbutton, .mediumbutton, .bigbutton{
469
+ border: 0px solid #CCCCCC;
470
+ border-radius: 5px;
471
+ color: #FFFFFF;
472
+ text-align: center;
473
+ text-decoration: none;
474
+ text-shadow: 1px 1px 1px #666666;
475
+ }
476
+
477
+ .smallbutton, input[type="submit"].smallbutton{
478
+ width: 90px;
479
+ height: 22px;
480
+ margin: 0px;
481
+ font-size: 15px;
482
+ }
483
+ .bluebutton{
484
+ background: #6699CC;
485
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6699CC', endColorstr='#3366AA');
486
+ background: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#3366AA));
487
+ background: -moz-linear-gradient(top, #6699CC, #3366AA);
488
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px 1px 0px #77AAEE inset, 0px -1px 0px #225599 inset;
489
+ }
490
+ .bluebutton:hover, .bluebutton:active{
491
+ background: #88BBEE;
492
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#88BBEE', endColorstr='#5588CC');
493
+ background: -webkit-gradient(linear, left top, left bottom, from(#8BE), to(#58C));
494
+ background: -moz-linear-gradient(top, #8BE, #58C);
495
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px 1px 0px #99CCFF inset, 0px -1px 0px #4477BB inset;
496
+ }
497
+ .greenbutton{
498
+ background: #66CC66;
499
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66CC66', endColorstr='#339933');
500
+ background: -webkit-gradient(linear, left top, left bottom, from(#66CC66), to(#339933));
501
+ background: -moz-linear-gradient(top, #66CC66, #339933);
502
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px -1px 0px #99FF99;
503
+ text-shadow: 1px 1px 0px #336633;
504
+ }
505
+ .greenbutton.active, .greenbutton:active, .greenbutton:hover{
506
+ background: #22AA22;
507
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#22AA22', endColorstr='#339933');
508
+ background: -webkit-gradient(linear, left top, left bottom, from(#22AA22), to(#339933));
509
+ background: -moz-linear-gradient(top, #228822, #339933);
510
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px 0px 1px 0px #004400 inset, 0px -1px 0px #66AA66;
511
+ }
512
+ .redbutton{
513
+ background: #EE7777;
514
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EE7777', endColorstr='#CC4F4F');
515
+ background: -webkit-gradient(linear, left top, left bottom, from(#EE7777), to(#CC4F4F));
516
+ background: -moz-linear-gradient(top, #EE7777, #CC4F4F);
517
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px -1px 0px #FF9999;
518
+ text-shadow: 1px 1px 0px #993333;
519
+ }
520
+ .redbutton.active, .redbutton:active, .redbutton:hover{
521
+ background: #EE7777;
522
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EE7777', endColorstr='#CC4F4F');
523
+ background: -webkit-gradient(linear, left top, left bottom, from(#EE7777), to(#CC4F4F));
524
+ background: -moz-linear-gradient(top, #BB4444, #CC4F4F);
525
+ box-shadow: 2px 2px 4px rgba(0,0,0,.2), 0px 0px 2px 0px #663333 inset, 0px -1px 0px #AA6666;
526
+ }
527
+ .smallbutton.redbutton{
528
+ width: auto;
529
+ padding: 0px 7px;
530
+ }
531
+
532
+ .report-item {
533
+ padding: 8px;
534
+ }
535
+ .report-info .report {
536
+ font-size: 22px;
537
+ font-weight: bold;
538
+ }
539
+
540
+ .report-item-actions > span {
541
+ padding-left: 10px;
542
+ }
@@ -23,7 +23,7 @@
23
23
  var convert_id = $('.recent-rally').data('convert-id');
24
24
  if (rally_id) {
25
25
  $.ajax({
26
- url: '/mg/rallies/new',
26
+ url: '/mg/rallies/new_rallies',
27
27
  data: { 'recent_rally': rally_id, 'convert_id': convert_id },
28
28
  success: function(json) {
29
29
  if (!json.success) {
@@ -50,5 +50,57 @@
50
50
  if ($('abbr.time-ago').size() > 0) {
51
51
  $('abbr.time-ago').timeago();
52
52
  }
53
+
54
+ var pantherFormSubmit = function(e, obj) {
55
+ e.preventDefault();
56
+
57
+ $(this).trigger('pre-submit', [e, obj]);
58
+ path = $(this).attr('action');
59
+ res = $(this).data('res');
60
+
61
+ Panther.ajax(path, res, $(this).serialize(), { 'doInlineLoading': true, 'method': 'post', 'context': this } );
62
+ }
63
+
64
+ $('.remote-form.report-item').live('finish', function(e, json, res) {
65
+ if (json.close_dialog) {
66
+ $('.jqmWindow').jqmHide(); //close these first
67
+ }
68
+ });
69
+
70
+ $('form.remote-form').submit(pantherFormSubmit);
71
+
72
+ $('.remote-link').live('click', function(e, obj) {
73
+ e.preventDefault();
74
+ path = $(this).data('path');
75
+ res = $(this).data('res');
76
+
77
+ Panther.ajax(path, res, '', { 'doInlineLoading': true, 'context': this } );
78
+ });
79
+
80
+ $('*[data-varies]').each(function() {
81
+ var that = $(this);
82
+ that.bind($(this).data('varies'), function() {
83
+ Panther.ajax( that.data('varies-url'), that.data('varies.res'), { value: that.val() } );
84
+ });
85
+ });
86
+
87
+ $(document).bind('inject', function(e, selector, html, action) {
88
+ if (!action || action == "inject") {
89
+ $(selector).html(html);
90
+
91
+ } else if (action == "prepend") {
92
+ $(selector).prepend($(html));
93
+ }
94
+ });
95
+
96
+ $(document).bind('inject', function(e, selector, html) {
97
+ $(selector).find('form.remote-form').submit(pantherFormSubmit);
98
+ $(selector).find('*[data-varies]').each(function() {
99
+ $(this).bind($(this).data('varies'), function() {
100
+ console.log([$(this).data('varies-path'), $(this).data('varies-res'), { value: $(this).val() }]);
101
+ Panther.ajax( $(this).data('varies-path'), $(this).data('varies-res'), { value: $(this).val() } );
102
+ });
103
+ });
104
+ });
53
105
  });
54
106
  })();