/soc/2012/sanket/www-statscollector: 10f30e45bad1: Change Plugin...

sanket sanket at soc.pidgin.im
Sun Aug 12 04:33:27 EDT 2012


Changeset: 10f30e45bad1725279bc555fa40eb7b8b9fbad3a
Author:	 sanket <sanket at soc.pidgin.im>
Date:	 2012-08-12 00:49 +0530
Branch:	 default
URL: http://hg.pidgin.im/soc/2012/sanket/www-statscollector/rev/10f30e45bad1

Description:

Change Plugins Detail page back to old style new-page instead of modal

The new page will get the same parameters as the original page (as part
of the GET parameters). Thus trimming of results can happen by appending
the GET parameters using javascript.

Also the color theme is restored to the old plain blue/white as the
main page!

diffstat:

 pidgin_stats_collector/display/views.py                      |  9 ++++++---
 pidgin_stats_collector/media/js/charts.js                    |  4 +---
 pidgin_stats_collector/media/js/stats.js                     |  8 ++++++++
 pidgin_stats_collector/templates/display/plugins-detail.html |  1 +
 4 files changed, 16 insertions(+), 6 deletions(-)

diffs (62 lines):

diff --git a/pidgin_stats_collector/display/views.py b/pidgin_stats_collector/display/views.py
--- a/pidgin_stats_collector/display/views.py
+++ b/pidgin_stats_collector/display/views.py
@@ -275,11 +275,14 @@ def sorted_dict(d, f=None, cut=None):
 
 def plugins_detail(request):
 
-  stats_dict = process_stats()
+  from_date, to_date = process_date(request.GET)
+  stats_dict = process_stats(from_date, to_date)
 
   return render_to_response('display/plugins-detail.html',{
-      'plugin_cat': simplejson.dumps(sorted_dict(stats_dict[PLUGIN_STR])[0]),
-      'plugin_dat': simplejson.dumps(sorted_dict(stats_dict[PLUGIN_STR])[1]),
+      'plugin_cat': \
+          simplejson.dumps(sorted_dict(stats_dict[PLUGIN_STR])[0]),
+      'plugin_dat': \
+          simplejson.dumps(sorted_dict(stats_dict[PLUGIN_STR])[1])
     });
 
 def process_date(get_dict):
diff --git a/pidgin_stats_collector/media/js/charts.js b/pidgin_stats_collector/media/js/charts.js
--- a/pidgin_stats_collector/media/js/charts.js
+++ b/pidgin_stats_collector/media/js/charts.js
@@ -152,9 +152,7 @@ function pluginDetailChart(cat, dat, e, 
         chart: {
             renderTo: e,
             type: 'bar',
-            margin: [ 100, 100, 200, 200],
-             plotBackgroundColor: "#999966",
-             backgroundColor: "#000"
+            margin: [ 100, 100, 200, 200]
         },
         title: {
             text: ttle
diff --git a/pidgin_stats_collector/media/js/stats.js b/pidgin_stats_collector/media/js/stats.js
--- a/pidgin_stats_collector/media/js/stats.js
+++ b/pidgin_stats_collector/media/js/stats.js
@@ -37,4 +37,12 @@
         $('#year-select').append('<option>'+i+'</option>');
     }
 
+    /* Change plugin links to include the GET query */
+    var plugins_href = $('[href="plugins-detail"]');
+    $.each(plugins_href, function(c, g){
+        var link = g.getAttribute('href');
+        var query = '?' + document.location.search.substr(1);
+        g.setAttribute('href', link + query);
+    });
+
 });
diff --git a/pidgin_stats_collector/templates/display/plugins-detail.html b/pidgin_stats_collector/templates/display/plugins-detail.html
--- a/pidgin_stats_collector/templates/display/plugins-detail.html
+++ b/pidgin_stats_collector/templates/display/plugins-detail.html
@@ -13,6 +13,7 @@
       <link type="application/opensearchdescription+xml" rel="search" href="/search/opensearch" title="Search Pidgin">
     <script type="text/javascript" src="/media/js/jquery-1.3.2.min.js"></script><script type="text/javascript" src="/media/js/trac.js"></script><script type="text/javascript" src="/media/js/search.js"></script>
 	<script src="/media/js/highcharts.js"></script>
+    <script src="/media/js/charts.js"></script>
 	<script src="/media/js/modules/exporting.js"></script>
 
     <script type="text/javascript">



More information about the Commits mailing list