Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aaronmerriam/Placenoun
Browse files Browse the repository at this point in the history
  • Loading branch information
mosyadmin committed Jul 15, 2011
2 parents 758e477 + 28d4987 commit e5997af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions placenoun/pn/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def get_by_id(request, id):
return this_image.http_image

def noun_static(request, noun, width, height):
noun = noun.lstrip('+').rstrip('+')
width = min(MAX_IMAGE_WIDTH, int(width))
height = min(MAX_IMAGE_HEIGHT, int(height))

Expand Down Expand Up @@ -92,6 +93,7 @@ def noun_static(request, noun, width, height):
return this_image.http_image_resized(size=(width, height))

def noun(request, noun):
noun = noun.lstrip('+').rstrip('+')
noun_query = NounExternal.objects.filter(noun = noun, status__lte = 30)
if noun_query.exists():
if noun_query.count() > 100:
Expand Down
16 changes: 16 additions & 0 deletions placenoun/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Placenoun</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
$(function() {
$("form").submit(function() {
var query = $("#search").val();
query = query.replace(' ','+');
query = query.replace(/[^a-zA-Z+]/g,'');
window.location = query;
return false;
});
});
</script>
</head>
<body>
<div>
Expand All @@ -14,6 +26,10 @@ <h1>PlaceNoun</h1>

<div id="main">
<p>Placenoun is the combination of <a href="http://www.fuckyeahnouns.com" target="_blank">FuckYeahNouns.com</a> and <a href="http://www.placekitten.com" target="_blank">PlaceKitten.com</a></p>
<form>
<label for="search">Show me a</label>
<input id="search" type="text">
</form>
</div>

<div class="clear"></div>
Expand Down

0 comments on commit e5997af

Please sign in to comment.