Skip to content

Commit

Permalink
create link on gift/wish detail view to mark fulfilled
Browse files Browse the repository at this point in the history
  • Loading branch information
djudd committed Jan 13, 2012
1 parent cce37ac commit 8f9f564
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions records/models.py
Expand Up @@ -94,6 +94,10 @@ def child(self):
else:
return self.wish

@property
def status_name(self):
return Record.status_choices[self.status]

@property
def short_title(self):
return self.title[:17] + '...' if len(self.title) > 20 else self.title
Expand Down
11 changes: 10 additions & 1 deletion templates/records/gift_detail.html
Expand Up @@ -19,7 +19,16 @@ <h1>

<p>
{% if user == gift.user.user %}
You posted this! <a href="{{ gift.get_absolute_url}}/update"> Edit </a>
<p>
You posted this! <a href="{{ gift.get_absolute_url}}/update"> Edit </a> <br />
</p>
<p>
{% if gift.status_name == 'Active' %}
<strong><a href="fulfill/{{ gift.pk }}">Mark taken.</a></strong>
{% else %}
<strong>{{ gift.status_name }}</strong>
{% endif %}
</p>
{# TODO: Show messages for this wish? #}
{% else %}
{% if user.is_authenticated %}
Expand Down
11 changes: 10 additions & 1 deletion templates/records/wish_detail.html
Expand Up @@ -27,7 +27,16 @@ <h3><p>{{ wish.description }}</p></h3>

<p>
{% if user == wish.user.user %}
You posted this! <a href="{{ wish.get_absolute_url }}/update">Edit</a>
<p>
You posted this! <a href="{{ wish.get_absolute_url }}/update">Edit</a>
</p>
<p>
{% if wish.status_name == 'Active' %}
<strong><a href="fulfill/{{ wish.pk }}">Mark fulfilled!</a></strong>
{% else %}
<strong>{{ wish.status_name }}</strong>
{% endif %}
</p>
{# TODO: Show messages for this wish? #}
{% else %}
{% if user.is_authenticated %}
Expand Down

0 comments on commit 8f9f564

Please sign in to comment.