diff rhodecode/templates/index_base.html @ 3154:0226b6d6b2b5 beta

Use common function for generation of grid data - admin grid now has dedicated edit button, and uses changeset_cache - some small improvements to grid - all other datatables use this
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 09 Jan 2013 01:59:43 +0100
parents 68f9c216377d
children 0cb48c083c6b
line wrap: on
line diff
--- a/rhodecode/templates/index_base.html	Tue Jan 08 20:42:48 2013 +0100
+++ b/rhodecode/templates/index_base.html	Wed Jan 09 01:59:43 2013 +0100
@@ -127,9 +127,6 @@
     % if c.visual.lightweight_dashboard is False:
     <script>
       YUD.get('repo_count').innerHTML = ${cnt+1 if cnt else 0};
-      var func = function(node){
-          return node.parentNode.parentNode.parentNode.parentNode;
-      }
 
       // groups table sorting
       var myColumnDefs = [
@@ -214,13 +211,15 @@
       myDataTable.subscribe('postRenderEvent',function(oArgs) {
           tooltip_activate();
           quick_repo_menu();
+          var func = function(node){
+              return node.parentNode.parentNode.parentNode.parentNode;
+          }          
           q_filter('q_filter',YUQ('div.table tr td a.repo_name'),func);
       });
 
     </script>
     % else:
       <script>
-        //var url = "${h.url('formatted_users', format='json')}";
         var data = ${c.data|n};
         var myDataSource = new YAHOO.util.DataSource(data);
         myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
@@ -233,7 +232,7 @@
                {key:"name"},
                {key:"desc"},
                {key:"last_change"},
-               {key: "tip"},
+               {key:"last_changeset"},
                {key:"owner"},
                {key:"rss"},
                {key:"atom"},
@@ -267,7 +266,7 @@
             {key:"desc",label:"${_('Description')}",sortable:true},
             {key:"last_change",label:"${_('Last Change')}",sortable:true,
                 sortOptions: { sortFunction: ageSort }},
-            {key:"tip",label:"${_('Tip')}",sortable:true,
+            {key:"last_changeset",label:"${_('Tip')}",sortable:true,
                 sortOptions: { sortFunction: revisionSort }},
             {key:"owner",label:"${_('Owner')}",sortable:true},
             {key:"rss",label:"",sortable:false},
@@ -311,7 +310,7 @@
 
             // Reset sort
             var state = myDataTable.getState();
-                state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
+            state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
 
             // Get filtered data
             myDataSource.sendRequest(YUD.get('q_filter').value,{
@@ -323,7 +322,11 @@
 
         };
         YUE.on('q_filter','click',function(){
-            YUD.get('q_filter').value = '';
+            if(!YUD.hasClass('q_filter', 'loaded')){
+                YUD.get('q_filter').value = '';
+                //TODO: load here full list later to do search within groups
+                YUD.addClass('q_filter', 'loaded');
+            }
          });
 
         YUE.on('q_filter','keyup',function (e) {