db changes

This commit is contained in:
sanj 2011-01-19 15:40:29 +05:30
parent b42709604f
commit 497d0f5197
7 changed files with 24 additions and 5 deletions

View File

@ -18,3 +18,5 @@ admin.site.register(BestPractice, BestPracticeAdmin)
admin.site.register(BestPracticeCategory) admin.site.register(BestPracticeCategory)
admin.site.register(BestPracticeImage) admin.site.register(BestPracticeImage)
admin.site.register(BestPracticeLink) admin.site.register(BestPracticeLink)
admin.site.register(Guideline)
admin.site.register(Glossary)

View File

@ -62,6 +62,7 @@ class BestPractice(ItfModel):
}) })
return images return images
class BestPracticeCategory(models.Model): class BestPracticeCategory(models.Model):
name = models.CharField(max_length=256) name = models.CharField(max_length=256)
description = models.TextField(blank=True) description = models.TextField(blank=True)

View File

@ -117,7 +117,7 @@ class Image(models.Model):
class Document(models.Model): class Document(models.Model):
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
intro = RichTextField(blank=True, null=True) 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) meeting = models.ForeignKey('Meeting', blank=True, null=True)
talk = models.ForeignKey('Talk', blank=True, null=True) talk = models.ForeignKey('Talk', blank=True, null=True)
is_resource = models.BooleanField() is_resource = models.BooleanField()

View File

@ -210,7 +210,7 @@ BEGIN mainPanel
elements: [ elements: [
{ {
element: app.construct.middleTopPanel(), element: app.construct.middleTopPanel(),
size: 128, size: 196,
resizable: true, resizable: true,
resize: [0, 64, 128, 196, 256], resize: [0, 64, 128, 196, 256],
// collapsible: true // collapsible: true
@ -221,7 +221,7 @@ BEGIN mainPanel
}, },
{ {
element: app.construct.middleBottomPanel(), element: app.construct.middleBottomPanel(),
size: 128, size: 196,
resizable: true, resizable: true,
resize: [0, 64, 128, 196, 256], resize: [0, 64, 128, 196, 256],
// collapsible: true // collapsible: true

View File

@ -1,7 +1,23 @@
var ITF = {}; 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, "<br />");
}
function tmplTrunc(s, count) {
return Ox.truncate(s, count, "...", "right");
}
/* /*
//FIXME: make sure to add a loading icon //FIXME: make sure to add a loading icon
Ox.Request.requests() && app.$ui.loadingIcon.start(); Ox.Request.requests() && app.$ui.loadingIcon.start();

View File

@ -230,7 +230,6 @@ Ox.ItfBox = function(options, self) {
Ox.ItfList = function(options, self) { Ox.ItfList = function(options, self) {
var self = self || {}; var self = self || {};
var that = new Ox.TextList(options, self); var that = new Ox.TextList(options, self);
@ -248,6 +247,7 @@ Ox.ItfList = function(options, self) {
}, function(response) { }, function(response) {
// alert(JSON.stringify(response.data.data)); // alert(JSON.stringify(response.data.data));
app.$ui[options.boxId].$loading.stop(); app.$ui[options.boxId].$loading.stop();
// var data = add_newlines(response['data']);
var html = $.tmpl(response['template'], response['data']); var html = $.tmpl(response['template'], response['data']);
app.$ui.previewBox.$content.html(html); app.$ui.previewBox.$content.html(html);
}); });

View File

@ -4,5 +4,5 @@
<div class="itfPreviewImages"> <div class="itfPreviewImages">
{{each images}} <img src="${$value.thumb}" width="200" title="${$value.caption}" /> {{/each}} {{each images}} <img src="${$value.thumb}" width="200" title="${$value.caption}" /> {{/each}}
</div> </div>
<span class="itfPreviewSub">Story: </span><span class="itfPreviewText">${story}</span> <span class="itfPreviewSub">Story: </span><span class="itfPreviewText">{{html tmplTrunc(tmplToHtml(story), 512)}}</span>
</div> </div>