From 222e8fd48972996f7b0f092fa832eb5fbe520695 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 28 Sep 2011 22:18:29 +0530 Subject: [PATCH] search foo --- itf/insidepages/models.py | 1 + itf/insidepages/views.py | 2 +- itf/static/js/insidepage.js | 14 +++++++++----- itf/templates/noel/insidepage.html | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/itf/insidepages/models.py b/itf/insidepages/models.py index 8e438d1..57fe9b5 100644 --- a/itf/insidepages/models.py +++ b/itf/insidepages/models.py @@ -5,6 +5,7 @@ from django.contrib.contenttypes.models import ContentType class Module(models.Model): title = models.CharField(max_length=255, help_text="Title of Module. eg. Best Practices") slug = models.SlugField(help_text="short name of module to be used for url. eg. bestpractices") + about = models.TextField(blank=True) def __unicode__(self): return self.title diff --git a/itf/insidepages/views.py b/itf/insidepages/views.py index a009b25..775f706 100644 --- a/itf/insidepages/views.py +++ b/itf/insidepages/views.py @@ -44,7 +44,7 @@ def get_list(request): 'search': request.GET.get("search", ""), 'sort': sortArray, 'page': request.GET.get("page", 1), -# 'count': request.GET.get("count", 12) #FIXME: make list_length either in settings.py or config per model + 'count': request.GET.get("count", 12) #FIXME: make list_length either in settings.py or config per model } object_list = tab.get_list(list_options) return render_to_json_response(object_list) diff --git a/itf/static/js/insidepage.js b/itf/static/js/insidepage.js index c505213..59a4a58 100644 --- a/itf/static/js/insidepage.js +++ b/itf/static/js/insidepage.js @@ -117,22 +117,24 @@ $(function() { }); $('#orderBySelect').change(function(e) { - $('.selectMenu').submit(); + $('#listForm').submit(); }); $('#searchListIcon').click(function() { - $('.selectMenu').submit(); + $('#listForm').submit(); }); +/* $('.searchListField').keyup(function(e) { e.preventDefault(); if (e.keyCode == 13) { - $('.selectMenu').submit(); + $('#listForm').submit(); } }); +*/ - $('.selectMenu').submit(function(e) { + $('#listForm').submit(function(e) { e.preventDefault(); var sortString = $('#orderBySelect').val(); var searchTerm = $('.searchListField').val(); @@ -167,8 +169,8 @@ function displayList(items) { } function doListLoading() { - $('#loadingList').show(); $('.tabListItem').remove(); + $('#loadingList').show(); } function stopListLoading(page) { @@ -223,6 +225,7 @@ function getNoListHtml(items) { return $rhs; } + function getNoListItemHtml(item) { if (item.hasOwnProperty("url")) { var $ret = $('
').addClass("noListItem"); @@ -237,6 +240,7 @@ function getNoListItemHtml(item) { return $ret; } + jQuery.fn.formatTitle = function() { var txt = $(this).text(); var fontSize; diff --git a/itf/templates/noel/insidepage.html b/itf/templates/noel/insidepage.html index 79348f7..3da8031 100644 --- a/itf/templates/noel/insidepage.html +++ b/itf/templates/noel/insidepage.html @@ -50,7 +50,7 @@ {{ t.text }}
{% endfor %} -
+ Order by