Undo sort by branch, needs more work than 10 minutes of free time
authorJoachim Breitner <mail@joachim-breitner.de>
Thu, 31 Mar 2016 21:11:46 +0000 (23:11 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Thu, 31 Mar 2016 21:11:46 +0000 (23:11 +0200)
site/index.html
site/js/gipeda.js

index a2786ba..e8e3a90 100644 (file)
@@ -262,7 +262,7 @@ html {
 <script id="branches"  type="text/x-handlebars-template">
   <h2>Branches</h2>
   <table class="table branch-table">
-   {{#each_branch branches}}
+   {{#each_unnaturally branches}}
      {{#with (lookup ../revisions this)}}
       {{#with this.summary}}
       <tr
@@ -308,7 +308,7 @@ html {
        </td>
       </tr>
      {{/with}}
-   {{/each_branch}}
+   {{/each_unnaturally}}
   </table>
 </script>
 
index cd8a882..2d7fa3d 100644 (file)
@@ -226,6 +226,7 @@ Handlebars.registerHelper('humanDate', function(timestamp) {
 Handlebars.registerHelper('each_naturally', function(context,options){
     var output = '';
     if (context) {
+       console.log(context);
        var keys = jQuery.map(context, function(v,k) {return k});
        var sorted_keys = keys.sort(naturalSort);
        sorted_keys.map(function (k,i) {
@@ -237,6 +238,7 @@ Handlebars.registerHelper('each_naturally', function(context,options){
 Handlebars.registerHelper('each_unnaturally', function(context,options){
     var output = '';
     if (context) {
+       console.log(context);
        var keys = jQuery.map(context, function(v,k) {return k});
         // needs https://github.com/overset/javascript-natural-sort/issues/21 fixed
        //var sorted_keys = keys.sort(naturalSort).reverse();
@@ -248,19 +250,6 @@ Handlebars.registerHelper('each_unnaturally', function(context,options){
     return output;
 });
 
-// Sort by age, then by name
-Handlebars.registerHelper('each_branch', function(context,options){
-    var output = '';
-    if (context) {
-       jQuery.map(context, function (b,i) { return {branch: b, branchName: i}; })
-            .sort(function(a,b) { return a.branch.gitDate - b.branch.gitDate; })
-            .map(function (b,i) {
-                output += options.fn(b.branch, {data: {key: b.branchName, index: i}});
-            });
-    }
-    return output;
-});
-
 // We cache everything
 var jsonSeen = {};
 var jsonFetching = {};