# HG changeset patch # User Marcin Kuzminski # Date 2011-12-17 19:31:54 # Node ID eaf09acf68722d246f0bf67c2c864e96c16fb685 # Parent 089c81cf04d94166778e11bfe8173cca2ae1b6d3 added sorting to bookmarks tags and branches diff --git a/rhodecode/public/js/rhodecode.js b/rhodecode/public/js/rhodecode.js --- a/rhodecode/public/js/rhodecode.js +++ b/rhodecode/public/js/rhodecode.js @@ -646,6 +646,12 @@ var get_group_name = function(node){ var name = node.firstElementChild.children[1].innerHTML; return name } +var get_date = function(node){ + console.log(node.firstElementChild) + var date_ = node.firstElementChild.innerHTML; + return date_ +} + var revisionSort = function(a, b, desc, field) { var a_ = fromHTML(a.getData(field)); @@ -692,4 +698,16 @@ var groupNameSort = function(a, b, desc, var comp = YAHOO.util.Sort.compare; var compState = comp(a_, b_, desc); return compState; +}; +var dateSort = function(a, b, desc, field) { + var a_ = fromHTML(a.getData(field)); + var b_ = fromHTML(b.getData(field)); + + // extract name from table + a_ = get_date(a_) + b_ = get_date(b_) + + var comp = YAHOO.util.Sort.compare; + var compState = comp(a_, b_, desc); + return compState; }; \ No newline at end of file diff --git a/rhodecode/templates/bookmarks/bookmarks.html b/rhodecode/templates/bookmarks/bookmarks.html --- a/rhodecode/templates/bookmarks/bookmarks.html +++ b/rhodecode/templates/bookmarks/bookmarks.html @@ -30,11 +30,49 @@ + + \ No newline at end of file diff --git a/rhodecode/templates/bookmarks/bookmarks_data.html b/rhodecode/templates/bookmarks/bookmarks_data.html --- a/rhodecode/templates/bookmarks/bookmarks_data.html +++ b/rhodecode/templates/bookmarks/bookmarks_data.html @@ -1,11 +1,14 @@ -%if c.repo_bookmarks: - +%if c.repo_bookmarks: +
+
+ - - - - + + + + + %for cnt,book in enumerate(c.repo_bookmarks.items()): %endfor
${_('name')}${_('date')}${_('author')}${_('revision')}${_('Name')}${_('Date')}${_('Author')}${_('Revision')}
@@ -24,6 +27,7 @@
+ %else: ${_('There are no bookmarks yet')} %endif \ No newline at end of file diff --git a/rhodecode/templates/branches/branches.html b/rhodecode/templates/branches/branches.html --- a/rhodecode/templates/branches/branches.html +++ b/rhodecode/templates/branches/branches.html @@ -30,11 +30,48 @@ + \ No newline at end of file diff --git a/rhodecode/templates/branches/branches_data.html b/rhodecode/templates/branches/branches_data.html --- a/rhodecode/templates/branches/branches_data.html +++ b/rhodecode/templates/branches/branches_data.html @@ -1,11 +1,14 @@ %if c.repo_branches: - +
+
+ + %for cnt,branch in enumerate(c.repo_branches.items()):
${_('name')} ${_('date')} ${_('author')} ${_('revision')}
@@ -43,6 +46,7 @@ %endfor %endif
+ %else: ${_('There are no branches yet')} %endif \ No newline at end of file diff --git a/rhodecode/templates/tags/tags.html b/rhodecode/templates/tags/tags.html --- a/rhodecode/templates/tags/tags.html +++ b/rhodecode/templates/tags/tags.html @@ -30,11 +30,47 @@ \ No newline at end of file diff --git a/rhodecode/templates/tags/tags_data.html b/rhodecode/templates/tags/tags_data.html --- a/rhodecode/templates/tags/tags_data.html +++ b/rhodecode/templates/tags/tags_data.html @@ -1,11 +1,14 @@ -%if c.repo_tags: - +%if c.repo_tags: +
+
+ - - - - + + + + + %for cnt,tag in enumerate(c.repo_tags.items()): - + %endfor
${_('name')}${_('date')}${_('author')}${_('revision')}${_('Name')}${_('Date')}${_('Author')}${_('Revision')}
@@ -22,9 +25,10 @@
r${tag[1].revision}:${h.short_id(tag[1].raw_id)}
+ %else: ${_('There are no tags yet')} %endif \ No newline at end of file