From 8024a226c747a99e09d309cbb0208a268a8451c6 Mon Sep 17 00:00:00 2001
From: BeezyT <timo@ezdesign.de>
Date: Thu, 22 Mar 2012 17:27:26 +0000
Subject: [PATCH] refs #534 assets for row evolution

git-svn-id: http://dev.piwik.org/svn/trunk@6095 59fd770c-687e-43c8-a1e3-f5a4ff64c105
---
 lang/en.php                                   |   9 ++
 plugins/CoreHome/templates/jqplot.css         | 126 ++++++++++++++++++
 .../templates/popup_multirowevolution.tpl     |  35 +++++
 .../CoreHome/templates/popup_rowevolution.tpl |  31 +++++
 plugins/ExampleUI/Controller.php              |   1 +
 themes/default/images/row_evolution.png       | Bin 0 -> 1934 bytes
 6 files changed, 202 insertions(+)
 create mode 100644 plugins/CoreHome/templates/popup_multirowevolution.tpl
 create mode 100644 plugins/CoreHome/templates/popup_rowevolution.tpl
 create mode 100644 themes/default/images/row_evolution.png

diff --git a/lang/en.php b/lang/en.php
index 9fb67a3e02..f69f33aeff 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -1527,4 +1527,13 @@ Note: this token will expire in 24 hrs.',
 	'PDFReports_ReportIncludeNWebsites' => 'The report will include main metrics for all websites that have at least one visit (from the %s websites currently available).',
 	'ImageGraph_PluginDescription' => 'Generate beautiful static PNG Graph images for any Piwik report.',
 	'ImageGraph_ColumnOrdinateMissing' => 'The column \'%s\' was not found in this report.',
+	'RowEvolution_AvailableMetrics' => 'Metrics for',
+	'RowEvolution_MetricDetailsText' => 'between %s and %s, %s over the period',
+	'RowEvolution_Documentation' => 'Click the metrics to display them in the large evolution graph. Use shift-click to display multiple metrics at once.',
+	'RowEvolution_CompareRows' => 'Compare records',
+	'RowEvolution_ComparingRecords' => 'Comparing %s rows',
+	'RowEvolution_CompareDocumentation' => 'Click the link below and open this popup for another row from the same table to compare multiple records.<br />Use shift-click to mark the row for comparison without opening this popup.',
+	'RowEvolution_PickARow' => 'Pick a row to compare',
+	'RowEvolution_PickAnotherRow' => 'Pick another row to compare',
+	'RowEvolution_MultiRowEvolutionTitle' => 'Evolution of multiple rows',
 );
diff --git a/plugins/CoreHome/templates/jqplot.css b/plugins/CoreHome/templates/jqplot.css
index 728e5da159..b8797b373b 100644
--- a/plugins/CoreHome/templates/jqplot.css
+++ b/plugins/CoreHome/templates/jqplot.css
@@ -99,6 +99,132 @@
     font-size: 1.2em;
 }
 
+
+/**
+ * ROW EVOLUTION POPUP
+ */
+
+.rowevolution {
+	position: relative;
+	overflow: hidden;
+}
+
+.rowevolution h2 {
+	font-size: 16px;
+	margin: 0;
+	padding: 0;
+}
+
+.rowevolution .metrics-container {
+	padding: 11px 0 5px 0;
+}
+
+.rowevolution table.metrics {
+	border-spacing: 0;
+}
+.multirowevolution table.metrics {
+	margin-bottom: 12px;
+}
+.rowevolution table.metrics,
+.multirowevolution table.metrics {
+	/* prevent select for shift-click on metric toggles */
+	user-select: none; /* CSS3 */
+    -moz-user-select: none; /* Gecko (Firefox) */
+    -khtml-user-select:none; /* Webkit (Safari, Chrome) */
+}
+
+.rowevolution table.metrics tr {
+	margin: 0;
+	padding: 0;
+	cursor: pointer;
+}
+
+.rowevolution table.metrics td {
+	vertical-align: middle;
+	text-align: left;
+	margin: 0;
+	padding: 4px 0;
+	cursor: pointer;
+}
+
+.rowevolution table.metrics td.sparkline {
+	width: 120px;
+}
+.multirowevolution table.metrics td.sparkline {
+	padding-top: 15px;
+}
+
+/** IE7 does not support inline image data, which is needed for spark lines */
+*+html .multirowevolution table.metrics td.sparkline,
+*+html .rowevolution table.metrics td.sparkline {
+	display: none;
+}
+
+.rowevolution table.metrics td.text {
+	font-size: 13px;
+	line-height: 18px;
+	color: #7E7363;
+	font-weight: bold;
+}
+.multirowevolution table.metrics td.text {
+	padding-top: 8px;
+}
+
+.rowevolution table.metrics td.text span.details {
+	font-weight: normal;
+	color: #444;
+}
+
+.rowevolution table.metrics td.text span.change {
+	display: block;
+	float: left;
+	padding-left: 15px;
+}
+
+.rowevolution table.metrics td.text span.up {
+	color: green;
+}
+
+.rowevolution table.metrics td.text span.down {
+	color: red;
+}
+
+.rowevolution-documentation {
+	font-size: 12px;
+	margin: 2px 0 5px 0;
+	padding:  5px 0 5px 23px;
+	color: #888;
+	background: url(../../../themes/default/images/help.png) no-repeat left center;
+}
+
+.rowevolution .metric-selectbox,
+.rowevolution .compare-container {
+	padding: 15px 0 5px 0;
+}
+
+.rowevolution .metric-selectbox select {
+	font-size: 13px;
+	color: #444;
+	margin: 8px 0 0 0;
+	padding: 0;
+}
+
+a.rowevolution-startmulti {
+	font-size: 12px;
+	color: #7E7363;
+	font-weight: bold;
+	text-decoration: none;
+}
+
+a.rowevolution-startmulti:hover {
+	color: #444;
+}
+
+
+/**
+ * SERIES PICKER FOR CHARTS
+ */
+ 
 .jqplot-seriespicker {
 	display: block;
 	position: absolute;
diff --git a/plugins/CoreHome/templates/popup_multirowevolution.tpl b/plugins/CoreHome/templates/popup_multirowevolution.tpl
new file mode 100644
index 0000000000..7e5fd2d416
--- /dev/null
+++ b/plugins/CoreHome/templates/popup_multirowevolution.tpl
@@ -0,0 +1,35 @@
+<div class="rowevolution multirowevolution">
+	<div class="popup-title">{'RowEvolution_MultiRowEvolutionTitle'|translate|escape:'html'}</div>
+	<div class="graph">
+		{$graph}
+	</div>
+	<div class="metrics-container">
+		<h2>{$availableRecordsText|translate}</h2>
+		<table class="metrics" border="0" cellpadding="0" cellspacing="0">
+			{foreach from=$metrics item=metric}
+				<tr>
+					<td class="sparkline">
+						{$metric.sparkline}
+					</td>
+					<td class="text">
+						<span style="color:{$metric.color}">{$metric.label|escape:'html'}</span><br />
+						<span class="details">{$metric.details}</span>
+					</td>
+				</tr>
+			{/foreach}
+		</table>
+		<a href="#" class="rowevolution-startmulti">&raquo; {'RowEvolution_PickAnotherRow'|translate}</a>
+	</div>
+	{if count($availableMetrics) > 1}
+	<div class="metric-selectbox">
+		<h2>{'RowEvolution_AvailableMetrics'|translate}</h2> 
+		<select name="metric" class="multirowevoltion-metric">
+			{foreach from=$availableMetrics item=metricName key=metric}
+				<option value="{$metric|escape:'html'}"{if $selectedMetric == $metric} selected="selected"{/if}>
+					{$metricName|escape:'html'}
+				</option>
+			{/foreach}
+		</select>
+	</div>
+	{/if}
+</div>
\ No newline at end of file
diff --git a/plugins/CoreHome/templates/popup_rowevolution.tpl b/plugins/CoreHome/templates/popup_rowevolution.tpl
new file mode 100644
index 0000000000..bbbed6cbed
--- /dev/null
+++ b/plugins/CoreHome/templates/popup_rowevolution.tpl
@@ -0,0 +1,31 @@
+<div class="rowevolution">
+	<div class="graph">
+		{$graph}
+	</div>
+	<div class="metrics-container">
+		<h2>{$availableMetricsText}</h2>
+		<div class="rowevolution-documentation">
+			{'RowEvolution_Documentation'|translate}
+		</div>
+		<table class="metrics" border="0" cellpadding="0" cellspacing="0">
+			{foreach from=$metrics item=metric}
+				<tr>
+					<td class="sparkline">
+						{$metric.sparkline}
+					</td>
+					<td class="text">
+						<span style="color:{$metric.color}">{$metric.label|escape:'html'}</span>: 
+						<span class="details">{$metric.details}</span>
+					</td>
+				</tr>
+			{/foreach}
+		</table>
+	</div>
+	<div class="compare-container">
+		<h2>{'RowEvolution_CompareRows'|translate}</h2>
+		<div class="rowevolution-documentation">
+			{'RowEvolution_CompareDocumentation'|translate}
+		</div>
+		<a href="#" class="rowevolution-startmulti">&raquo; {'RowEvolution_PickARow'|translate}</a>
+	</div>
+</div>
\ No newline at end of file
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php
index b778b9f318..3a0d18e1ba 100644
--- a/plugins/ExampleUI/Controller.php
+++ b/plugins/ExampleUI/Controller.php
@@ -26,6 +26,7 @@ class Piwik_ExampleUI_Controller extends Piwik_Controller
 		$view->setLimit( 24 );
 		$view->disableExcludeLowPopulation();
 		$view->disableShowAllColumns();
+		$view->disableRowEvolution();
 		$view->setAxisYUnit('°C'); // useful if the user requests the bar graph
 		return $this->renderView($view);
 	}
diff --git a/themes/default/images/row_evolution.png b/themes/default/images/row_evolution.png
new file mode 100644
index 0000000000000000000000000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