moksha/lib/helpers.py | 8 +++----- moksha/public/javascript/ui/moksha.ui.grid.js | 9 ++++++++- 2 files changed, 11 insertions(+), 6 deletions(-)
New commits: commit a1322da10ad8a4e806ecefedd24c461ca1eaa2ca Author: John (J5) Palmieri johnp@redhat.com Date: Thu May 21 16:37:18 2009 -0400
add a first_visible_row and last_visible_row variables for display purposes
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js index b27ac4a..fe5de28 100644 --- a/moksha/public/javascript/ui/moksha.ui.grid.js +++ b/moksha/public/javascript/ui/moksha.ui.grid.js @@ -61,6 +61,7 @@
$('.' + o.rowClass, self.element).replaceWith(''); o.visible_rows = 0; + o.last_visible_row = 0; },
insert_row: function(i, row_data) { @@ -85,6 +86,7 @@ $ph.parent().append($new_row); $new_row.addClass(row_class).addClass(o.rowClass); o.visible_rows++; + o.last_visible_row = o.start_row + o.visible_rows; } else { // insert before i element and update all row numbers var row_class = o.rowClass + '_' + i.toString(); @@ -107,6 +109,8 @@ o.visible_rows = o.rows_per_page; self.remove_row(o.rows_per_page); } + + o.last_visible_row = o.start_row + o.visible_rows; }
$new_row.show(); @@ -350,6 +354,7 @@ // reset based on returned values o.total_rows = json.total_rows; o.start_row = json.start_row; + o.first_visible_row = o.start_row + 1; // user visible index always starts with 1 not 0 o.rows_per_pager = json.rows_per_page;
moksha.defer(self, function() { @@ -536,6 +541,8 @@ rows_per_page: 10, page_num: 1, total_rows: 0, + first_visible_row: 1, // 1 based index + last_visible_row: 1, // 1 based index visible_rows: 0, filters: {}, unique_key: undefined, @@ -895,7 +902,7 @@ $.extend( $.template.helpers , {
filter: function(v, filter_cb) { return window[filter_cb](v); - } + }, } );
commit 29beff328e5d3897a33489268e69ee3350d812bc Author: John (J5) Palmieri johnp@redhat.com Date: Thu May 21 16:36:47 2009 -0400
don't unicode decode too early
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py index 70954a4..f61be17 100644 --- a/moksha/lib/helpers.py +++ b/moksha/lib/helpers.py @@ -1,16 +1,16 @@ # This file is part of Moksha. # Copyright (C) 2008-2009 Red Hat, Inc. -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
@@ -55,8 +55,6 @@ def _update_params(params, d):
# recursive dicts also get updated # by the passed params - if isinstance(value, unicode): - value = value.encode('utf8', 'replace') if isinstance(value, dict): value = _update_params(value, d) value = json.dumps(value)
moksha-commits@lists.fedorahosted.org