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):
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

View File

@ -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)

View File

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

View File

@ -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 = $('<div />').addClass("noListItem");
@ -237,11 +240,12 @@ function getNoListItemHtml(item) {
return $ret;
}
jQuery.fn.formatTitle = function() {
var txt = $(this).text();
var fontSize;
// alert(txt.length);
if (txt.length < 36) {
if (txt.length < 32) {
fontSize = 50;
} else if (txt.length < 60) {
fontSize = 40;

View File

@ -56,7 +56,7 @@
{{ t.text }}
</div>
{% 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-->
<select id="orderBySelect">Select
{% for s in default_sorts %}
@ -72,6 +72,7 @@
<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">
Page <span id="pageSearch">1</span> of <span id="ofpageSearch">10</span>
</form>