Skip to content

Commit

Permalink
Show kind on detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jan 28, 2011
1 parent 2f97d94 commit 8326353
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def kind_symbol(self):
return '-'
return '?'

@property
def is_happy(self):
return self.kind == self.HAPPY

def to_json(self):
return {
'kind': self.kind_symbol,
Expand Down
1 change: 1 addition & 0 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ p { line-height: 1.4; }
.message { margin: 30px 0; }
.message h2 { font-style: italic; font-size: 46px; text-align: center; }
.message .meta { color: #666; margin-top: 30px; text-align: right; }
.message p.kind { margin: 15px 0 30px 0; font-size: 20px; }

/* faq */
dl.qa dt { margin: 15px 0 10px 0; font-style: italic; }
Expand Down
2 changes: 2 additions & 0 deletions templates/show_message.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{% block title %}Single Message{% endblock %}
{% block body %}
<div class=message>
<p class=kind>{% if feedback.is_happy %}A happy{%
else %}An unhappy{% endif %} user said:
<h2>“{{ feedback.text }}”</h2>
<p class=meta>
written on {{ feedback.pub_date.strftime('%Y-%m-%d at %H:%M') }}
Expand Down

0 comments on commit 8326353

Please sign in to comment.