From 497d0f5197f694cf97851eff21d338961fbe3d52 Mon Sep 17 00:00:00 2001 From: sanj Date: Wed, 19 Jan 2011 15:40:29 +0530 Subject: [PATCH] db changes --- itf/bestpractices/admin.py | 2 ++ itf/bestpractices/models.py | 1 + itf/festival/models.py | 2 +- itf/static/js/itf/construct.js | 4 ++-- itf/static/js/itf/itf.js | 16 ++++++++++++++++ itf/static/js/itf/widgets.js | 2 +- .../bestpractices/BestPractice/preview.html | 2 +- 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/itf/bestpractices/admin.py b/itf/bestpractices/admin.py index 70c6104..1a0ae99 100644 --- a/itf/bestpractices/admin.py +++ b/itf/bestpractices/admin.py @@ -18,3 +18,5 @@ admin.site.register(BestPractice, BestPracticeAdmin) admin.site.register(BestPracticeCategory) admin.site.register(BestPracticeImage) admin.site.register(BestPracticeLink) +admin.site.register(Guideline) +admin.site.register(Glossary) diff --git a/itf/bestpractices/models.py b/itf/bestpractices/models.py index 4ab3a8b..c7e5bf0 100644 --- a/itf/bestpractices/models.py +++ b/itf/bestpractices/models.py @@ -62,6 +62,7 @@ class BestPractice(ItfModel): }) return images + class BestPracticeCategory(models.Model): name = models.CharField(max_length=256) description = models.TextField(blank=True) diff --git a/itf/festival/models.py b/itf/festival/models.py index f47982f..30a6ec2 100644 --- a/itf/festival/models.py +++ b/itf/festival/models.py @@ -117,7 +117,7 @@ class Image(models.Model): class Document(models.Model): title = models.CharField(max_length=255) intro = RichTextField(blank=True, null=True) - file = models.FileField(upload_to='upload/docs') + file = models.FileField(upload_to='upload/docs', blank=True, null=True) meeting = models.ForeignKey('Meeting', blank=True, null=True) talk = models.ForeignKey('Talk', blank=True, null=True) is_resource = models.BooleanField() diff --git a/itf/static/js/itf/construct.js b/itf/static/js/itf/construct.js index 1b59afb..9100336 100644 --- a/itf/static/js/itf/construct.js +++ b/itf/static/js/itf/construct.js @@ -210,7 +210,7 @@ BEGIN mainPanel elements: [ { element: app.construct.middleTopPanel(), - size: 128, + size: 196, resizable: true, resize: [0, 64, 128, 196, 256], // collapsible: true @@ -221,7 +221,7 @@ BEGIN mainPanel }, { element: app.construct.middleBottomPanel(), - size: 128, + size: 196, resizable: true, resize: [0, 64, 128, 196, 256], // collapsible: true diff --git a/itf/static/js/itf/itf.js b/itf/static/js/itf/itf.js index 0daa4ef..827ea0f 100644 --- a/itf/static/js/itf/itf.js +++ b/itf/static/js/itf/itf.js @@ -1,7 +1,23 @@ var ITF = {}; +ITF.setSizes = function() { + var mp = app.$ui.middlePanel; + var winHeight = parseInt(mp.height()); + var winWidth = parseInt($(window).width()); + var panelHeight = parseInt(winHeight / 3); + mp.size(0, panelHeight); + mp.size(2, panelHeight); +} +function tmplToHtml(s) { + return s.replace(/\n/g, "
"); +} + +function tmplTrunc(s, count) { + return Ox.truncate(s, count, "...", "right"); +} + /* //FIXME: make sure to add a loading icon Ox.Request.requests() && app.$ui.loadingIcon.start(); diff --git a/itf/static/js/itf/widgets.js b/itf/static/js/itf/widgets.js index 8ab6757..5f1ba10 100644 --- a/itf/static/js/itf/widgets.js +++ b/itf/static/js/itf/widgets.js @@ -230,7 +230,6 @@ Ox.ItfBox = function(options, self) { - Ox.ItfList = function(options, self) { var self = self || {}; var that = new Ox.TextList(options, self); @@ -248,6 +247,7 @@ Ox.ItfList = function(options, self) { }, function(response) { // alert(JSON.stringify(response.data.data)); app.$ui[options.boxId].$loading.stop(); +// var data = add_newlines(response['data']); var html = $.tmpl(response['template'], response['data']); app.$ui.previewBox.$content.html(html); }); diff --git a/itf/templates/bestpractices/BestPractice/preview.html b/itf/templates/bestpractices/BestPractice/preview.html index dbd5a47..9a36606 100644 --- a/itf/templates/bestpractices/BestPractice/preview.html +++ b/itf/templates/bestpractices/BestPractice/preview.html @@ -4,5 +4,5 @@
{{each images}} {{/each}}
- Story: ${story} + Story: {{html tmplTrunc(tmplToHtml(story), 512)}}