From 5d56a255700c4d80a3c346d7ce4648c62e45d8f1 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 9 Aug 2013 22:03:20 +0200 Subject: new account page layout, added translations for webui --- pyload/web/app/scripts/helpers/formatSize.js | 7 ++++++- pyload/web/app/scripts/views/accounts/accountView.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'pyload/web/app/scripts') diff --git a/pyload/web/app/scripts/helpers/formatSize.js b/pyload/web/app/scripts/helpers/formatSize.js index 3b62e74c7..926c4793d 100644 --- a/pyload/web/app/scripts/helpers/formatSize.js +++ b/pyload/web/app/scripts/helpers/formatSize.js @@ -1,10 +1,15 @@ // Format bytes in human readable format -define('helpers/formatSize', ['handlebars'], function(Handlebars) { +define('helpers/formatSize', ['handlebars', './gettext'], function(Handlebars, gettext) { 'use strict'; var sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB']; function formatSize(bytes, options) { if (!bytes || bytes === 0) return '0 B'; + if (bytes === -1) + return gettext('not available'); + if (bytes === -2) + return gettext('unlimited'); + var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10); // round to two digits return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i]; diff --git a/pyload/web/app/scripts/views/accounts/accountView.js b/pyload/web/app/scripts/views/accounts/accountView.js index 89f69d7e7..7d1f04315 100644 --- a/pyload/web/app/scripts/views/accounts/accountView.js +++ b/pyload/web/app/scripts/views/accounts/accountView.js @@ -4,7 +4,8 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/accounts/account'], return Backbone.Marionette.ItemView.extend({ - tagName: 'tr', + tagName: 'div', + className: 'row-fluid', template: template, events: { -- cgit v1.2.3