diff --git a/codepot/README b/codepot/README
index be1697f4..a8417076 100644
--- a/codepot/README
+++ b/codepot/README
@@ -107,5 +107,6 @@ LICENSE
jQuery UI 1.8 MIT or GPL
PHPGraphLib MIT
CLOC 1.62 GPL
+ Chart.js MIT
------------------------------------------------------------------------
diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php
index 2d68bbb4..053bdb4e 100644
--- a/codepot/src/codepot/controllers/code.php
+++ b/codepot/src/codepot/controllers/code.php
@@ -677,6 +677,41 @@ class Code extends Controller
return $path;
}
+ function history_json ($projectid = '', $path = '', $rev = SVN_REVISION_HEAD)
+ {
+ $this->load->model ('ProjectModel', 'projects');
+
+ $login = $this->login->getUser ();
+ if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
+ {
+ header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
+ return;
+ }
+
+ $project = $this->projects->get ($projectid);
+ if ($project === FALSE || ($project->public !== 'Y' && $login['id'] == ''))
+ {
+ header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
+ return;
+ }
+
+ $this->load->model ('SubversionModel', 'subversion');
+
+ $path = $this->converter->HexToAscii ($path);
+ if ($path == '.') $path = ''; /* treat a period specially */
+ $path = $this->_normalize_path ($path);
+
+ $file = $this->subversion->getHistory ($projectid, $path, SVN_REVISION_HEAD);
+ if ($file === FALSE)
+ {
+ header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error');
+ return;
+ }
+
+ $history = $file['history'];
+ print codepot_json_encode ($history);
+ }
+
function graph ($type = '', $projectid = '', $path = '', $rev = SVN_REVISION_HEAD)
{
$this->load->model ('ProjectModel', 'projects');
diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php
index b805da45..6cc66a79 100644
--- a/codepot/src/codepot/views/project_home.php
+++ b/codepot/src/codepot/views/project_home.php
@@ -19,7 +19,115 @@
+
+
+
+
+
@@ -280,9 +394,13 @@ foreach ($urls as $url)
id}");
-print "
";
+//$graph_url = codepot_merge_path (site_url(), "/code/graph/commits-per-month/{$project->id}");
+//print "
";
?>
+
+
+
+
diff --git a/codepot/src/js/Chart.min.js b/codepot/src/js/Chart.min.js
new file mode 100644
index 00000000..7dd4e43c
--- /dev/null
+++ b/codepot/src/js/Chart.min.js
@@ -0,0 +1,11 @@
+/*!
+ * Chart.js
+ * http://chartjs.org/
+ * Version: 1.0.1
+ *
+ * Copyright 2015 Nick Downie
+ * Released under the MIT license
+ * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
+ */
+(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;this.width=t.canvas.width,this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n