From 657232f77dbe3e89c7332e6ca676c6e75eed8908 Mon Sep 17 00:00:00 2001 From: sanj Date: Thu, 20 Jan 2011 13:32:03 +0530 Subject: [PATCH] show best practice id's in list --- itf/bestpractices/models.py | 2 +- itf/static/js/itf/app.js | 4 ++++ itf/static/js/itf/itf.js | 13 ++++++++++++- itf/static/js/itf/widgets.js | 13 +++++++++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/itf/bestpractices/models.py b/itf/bestpractices/models.py index c7e5bf0..47ac110 100644 --- a/itf/bestpractices/models.py +++ b/itf/bestpractices/models.py @@ -21,7 +21,7 @@ class BestPractice(ItfModel): sort_fields = ['title'] def __unicode__(self): - return self.title + return str(self.id) + ": " + self.title def info_dict(self): return { diff --git a/itf/static/js/itf/app.js b/itf/static/js/itf/app.js index 1bacaea..b6fab32 100644 --- a/itf/static/js/itf/app.js +++ b/itf/static/js/itf/app.js @@ -16,6 +16,9 @@ app.launch(function(data) { app.$body = $('body'); app.$document = $(document); app.$window = $(window); + app.$window.resize(function() { + ITF.setSizes(); + }); /* app.user = data.user; app.config = data.config; @@ -35,6 +38,7 @@ app.launch(function(data) { var wrapper = app.construct.wrapper(); app.$body.css({'opacity': 0}); wrapper.appendTo(app.$body); + ITF.setSizes(); app.$body.animate({ 'opacity': 1 }, 2000); diff --git a/itf/static/js/itf/itf.js b/itf/static/js/itf/itf.js index 827ea0f..15781c9 100644 --- a/itf/static/js/itf/itf.js +++ b/itf/static/js/itf/itf.js @@ -1,12 +1,23 @@ var ITF = {}; + ITF.setSizes = function() { var mp = app.$ui.middlePanel; var winHeight = parseInt(mp.height()); - var winWidth = parseInt($(window).width()); + var winWidth = parseInt(mp.width()); var panelHeight = parseInt(winHeight / 3); + var panelWidth = parseInt(winWidth / 3); mp.size(0, panelHeight); mp.size(2, panelHeight); + mtp = app.$ui.middleTopPanel; + mmp = app.$ui.middleMiddlePanel; + mbp = app.$ui.middleBottomPanel; + mtp.size(0, panelWidth); + mtp.size(2, panelWidth); + mmp.size(0, panelWidth); + mmp.size(2, panelWidth); + mbp.size(0, panelWidth); + mbp.size(2, panelWidth); } diff --git a/itf/static/js/itf/widgets.js b/itf/static/js/itf/widgets.js index 5f1ba10..88dffc1 100644 --- a/itf/static/js/itf/widgets.js +++ b/itf/static/js/itf/widgets.js @@ -50,9 +50,18 @@ Ox.ItfBox = function(options, self) { if ($additionalButtons.length > 0) { $additionalButtons.appendTo($buttons); } + + var $maximizeBtn = new Ox.Button({ + id: options.id + "Maximize", + style: 'symbol', + title: 'add', + type: 'image', + tooltip: 'Maximize' + }).appendTo($buttons); + var $infoBtn = new Ox.Button({ id: options.id + "InfoBtn", - style: 'symbold', + style: 'symbol', title: 'info', type: 'image', tooltip: 'More info about ' + options.title @@ -95,7 +104,7 @@ Ox.ItfBox = function(options, self) { var $menuBtn = new Ox.Button({ id: options.id + 'MenuBtn', style: 'symbol', - title: 'collapse', + title: 'expand', type: 'image', tooltip: 'Show Menu' }).appendTo($buttons);