Skip to content

Commit

Permalink
Blarg
Browse files Browse the repository at this point in the history
  • Loading branch information
silent1mezzo committed Apr 14, 2012
1 parent c3898f6 commit 28c4c5c
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 0 deletions.
Empty file.
43 changes: 43 additions & 0 deletions hackto/apps/around/templatetags/around.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from django import template
register = template.Library()

ICONS = {
'movers': 'mover',
'decorators': 'decorator',
'insurance': 'insurance',
'landscaping': 'lawn',
'post offices': 'postal',
'telcos': 'telephone',
'banks': 'bank',
'dry cleaners': 'dry cleaner',
'grocery stores': 'grocery',
'schools': 'school',
'day cares': 'day care',
'churches': 'church',
'gas stations': 'gas station',
'hospitals': 'hospital',
'mechanics': 'mechanic',
'restaurants': 'restaurant',
'shopping': 'plaza',
'hair dressers': 'hair',
'pharmacy': 'pharmacy',
}

def do_icon(parser, token):
try:
# split_contents() knows not to split quoted strings.
tag_name, category = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError("%r tag requires three arguments (Service Date, Departure Start Date, Departure End Date)" % token.contents.split()[0])
return Icon(category)

class Icon(template.Node):
def __init__(self, category):
self.category = template.Variable(category)

def render(self, context):
category = self.category.resolve(context)

return ICONS.get(category)

register.tag('icon', do_icon)
Binary file added hackto/static_media/img/icons/bank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/church.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/daycare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/drycleaner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/food.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/gasstation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/grocery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/hair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/hospital.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/mechanic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/pharmacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/plaza.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/school.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hackto/static_media/img/icons/telephone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28c4c5c

Please sign in to comment.