added text for search pages

This commit is contained in:
Karen 2011-09-28 22:30:25 +05:30
commit 1cf6f64fb4
5 changed files with 17 additions and 10 deletions

View File

@ -5,6 +5,7 @@ from django.contrib.contenttypes.models import ContentType
class Module(models.Model): class Module(models.Model):
title = models.CharField(max_length=255, help_text="Title of Module. eg. Best Practices") 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") slug = models.SlugField(help_text="short name of module to be used for url. eg. bestpractices")
about = models.TextField(blank=True)
def __unicode__(self): def __unicode__(self):
return self.title return self.title

View File

@ -44,7 +44,7 @@ def get_list(request):
'search': request.GET.get("search", ""), 'search': request.GET.get("search", ""),
'sort': sortArray, 'sort': sortArray,
'page': request.GET.get("page", 1), '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) object_list = tab.get_list(list_options)
return render_to_json_response(object_list) return render_to_json_response(object_list)

View File

@ -188,7 +188,8 @@ outline:none;} /*placeholder input text supported by html5 for FF3.7 and webkit
{border:1px solid #999; } {border:1px solid #999; }
#searchListIcon #searchListIcon
{cursor:pointer;} {cursor:pointer;
margin-right:18px;}
#searchListIcon:hover #searchListIcon:hover
{box-shadow:1px 1px 1px 3px #e3e3e3;} {box-shadow:1px 1px 1px 3px #e3e3e3;}

View File

@ -117,22 +117,24 @@ $(function() {
}); });
$('#orderBySelect').change(function(e) { $('#orderBySelect').change(function(e) {
$('.selectMenu').submit(); $('#listForm').submit();
}); });
$('#searchListIcon').click(function() { $('#searchListIcon').click(function() {
$('.selectMenu').submit(); $('#listForm').submit();
}); });
/*
$('.searchListField').keyup(function(e) { $('.searchListField').keyup(function(e) {
e.preventDefault(); e.preventDefault();
if (e.keyCode == 13) { if (e.keyCode == 13) {
$('.selectMenu').submit(); $('#listForm').submit();
} }
}); });
*/
$('.selectMenu').submit(function(e) { $('#listForm').submit(function(e) {
e.preventDefault(); e.preventDefault();
var sortString = $('#orderBySelect').val(); var sortString = $('#orderBySelect').val();
var searchTerm = $('.searchListField').val(); var searchTerm = $('.searchListField').val();
@ -167,8 +169,8 @@ function displayList(items) {
} }
function doListLoading() { function doListLoading() {
$('#loadingList').show();
$('.tabListItem').remove(); $('.tabListItem').remove();
$('#loadingList').show();
} }
function stopListLoading(page) { function stopListLoading(page) {
@ -223,6 +225,7 @@ function getNoListHtml(items) {
return $rhs; return $rhs;
} }
function getNoListItemHtml(item) { function getNoListItemHtml(item) {
if (item.hasOwnProperty("url")) { if (item.hasOwnProperty("url")) {
var $ret = $('<div />').addClass("noListItem"); var $ret = $('<div />').addClass("noListItem");
@ -237,11 +240,12 @@ function getNoListItemHtml(item) {
return $ret; return $ret;
} }
jQuery.fn.formatTitle = function() { jQuery.fn.formatTitle = function() {
var txt = $(this).text(); var txt = $(this).text();
var fontSize; var fontSize;
// alert(txt.length); // alert(txt.length);
if (txt.length < 36) { if (txt.length < 32) {
fontSize = 50; fontSize = 50;
} else if (txt.length < 60) { } else if (txt.length < 60) {
fontSize = 40; fontSize = 40;

View File

@ -56,7 +56,7 @@
{{ t.text }} {{ t.text }}
</div> </div>
{% endfor %} {% endfor %}
<!--is this select okay, my forms are a bit weak, do we need action and method here?--><form class="selectMenu" action="" method="post"> <!--is this select okay, my forms are a bit weak, do we need action and method here?--><form class="selectMenu" id="listForm" method="post" action="">
<span>Order by</span><!--Can i avoid a p tag here to keep it inline--> <span>Order by</span><!--Can i avoid a p tag here to keep it inline-->
<select id="orderBySelect">Select <select id="orderBySelect">Select
{% for s in default_sorts %} {% for s in default_sorts %}
@ -72,8 +72,9 @@
<input type="text" placeholder="search list" name="field" class="searchListField"/> <input type="text" placeholder="search list" name="field" class="searchListField"/>
<img src="/static/images/noel/search-icon.png" width="18" height="14" alt="search-icon" id="searchListIcon"> <img src="/static/images/noel/search-icon.png" width="18" height="14" alt="search-icon" id="searchListIcon">
Page <span id="pageSearch">1</span> of <span id="ofpageSearch">10</span>
</form> </form>
</div> </div>
</div> </div>