forked from atdt/marcel
/
gift_detail.html
57 lines (52 loc) · 1.91 KB
/
gift_detail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{% extends 'base.html' %}
{% load gravatar %}
{% block extracss %}
<link rel="stylesheet" href="/static/css/compose.css">
{% endblock %}
{% block content %}
<div style="padding-top:200px;padding-bottom:10px;">
<h1>Gift: {{ gift.title }}</h1>
</div>
<img src="{{ gift.picture }}" width=100px height=100px>
{% gravatar gift.user.user 40 %}
<h1>
<a href="{{ gift.user.get_absolute_url }}">{{ gift.user.user.username }}</a> is offering
<span style="color: #ccc;">{{ gift.title|lower }}</span>
</h1>
<p>{{ gift.description }}</p>
<p>
{% if user == gift.user.user %}
<p>
You posted this! <a href="{{ gift.get_absolute_url}}/update"> Edit </a> <br />
</p>
<p>
{% if gift.status_name == 'Active' %}
<strong><a href="/welcome?record={{ gift.pk }}">Request a thank-you note</a></strong>
{% else %}
<strong>{{ gift.status_name }}</strong>
{% endif %}
</p>
{# TODO: Show messages for this wish? #}
{% else %}
{% if user.is_authenticated %}
{% if gift.status_name == 'Active' %}
<p>
<strong><a href="/thank?record={{ gift.pk }}&other_user={{ gift.user.pk }}">Write a thank-you note</a></strong>
</p>
{% endif %}
<p>
<strong><a href="#" onclick="$('#send_message_form').toggle();">Send a message about this gift</a></strong>
</p>
<div id="send_message_form" style="display: none;">
<form method="post">
{% csrf_token %}
<textarea rows="4" cols="55" name="body"></textarea>
<input type="submit" value="Send">
</form>
</div>
{% else %}
<a href="{% url openid-login %}">Log in</a> to send a message about this item!
{% endif %}
{% endif %}
</p>
{% endblock %}