Commit 0652faeb authored by Enrico Zini's avatar Enrico Zini
Browse files

get_absolute_urls implemented, and s/nmstatus/process

parent 1895e230
......@@ -127,6 +127,10 @@ class Person(models.Model):
def __repr__(self):
return "%s <%s> [uid:%s, status:%s]" % (self.fullname.encode("unicode_escape"), self.email, self.uid, self.status)
@models.permalink
def get_absolute_url(self):
return ("public_person", (), dict(key=self.lookup_key))
@property
def active_process(self):
"""
......@@ -195,6 +199,10 @@ class AM(models.Model):
"d" if self.is_dam else "-",
self.slots)
@models.permalink
def get_absolute_url(self):
return ("public_person", (), dict(key=self.person.lookup_key))
def applicant_stats(self):
"""
Return 4 stats about the am (cur, max, hold, done).
......@@ -294,6 +302,10 @@ class Process(models.Model):
self.person.status,
self.applying_for)
@models.permalink
def get_absolute_url(self):
return ("public_process", (), dict(key=self.lookup_key))
@property
def lookup_key(self):
"""
......
......@@ -7,7 +7,7 @@
{% for p in progs %}
<tr>
<td>{{p.last_change.date}}</td>
<td><a href="{% url public_nmstatus key=p.lookup_key %}">{{p.person}}</a></td>
<td><a href="{{ p.get_absolute_url }}">{{p.person}}</a></td>
</tr>
{% endfor %}
</table>
......
......@@ -26,6 +26,7 @@ urlpatterns = patterns('public.views',
url(r'^people$', 'people', name="public_people"),
url(r'^person/(?P<key>[^/]+)$', 'person', name="public_person"),
url(r'^nmlist$', 'nmlist', name="public_nmlist"),
url(r'^nmstatus/(?P<key>[^/]+)$', 'nmstatus', name="public_nmstatus"),
url(r'^nmstatus/(?P<key>[^/]+)$', 'process', name="public_nmstatus"),
url(r'^process/(?P<key>[^/]+)$', 'process', name="public_process"),
url(r'^progress/(?P<progress>\w+)$', 'progress', name="public_progress"),
)
......@@ -85,7 +85,7 @@ def nmlist(request):
context,
context_instance=template.RequestContext(request))
def nmstatus(request, key):
def process(request, key):
process = bmodels.Process.lookup(key)
if process is None:
return redirect(reverse('root_faq') + "#process-lookup")
......
......@@ -5,7 +5,7 @@
{% block relatedpages %}
{{block.super}}
<a href="{% url public_nmstatus key=process.lookup_key %}">public version</a>
<a href="{% url public_process key=process.lookup_key %}">public version</a>
{% endblock %}
{% block head %}
......
......@@ -10,7 +10,7 @@
<h1>nm.debian.org Frequently Asked Questions</h1>
<h2 id="process-lookup">My email address does not work with "/public/nmstatus"</h2>
<h2 id="process-lookup">My email address does not work with "/public/process"</h2>
<p>The nmstatus page shows a process, that is, the path a person follows to
change their status in Debian.</p>
......@@ -20,7 +20,7 @@ login name, or an email address.</p>
<p>If you have a Debian account, the easiest way to lookup your information is
by using your account name, as in
<a href="{% url public_nmstatus key='enrico' %}">{% url public_nmstatus key='enrico' %}</a>.</p>
<a href="{% url public_process key='enrico' %}">{% url public_process key='enrico' %}</a>.</p>
<p>If you do not yet have a Debian account, then you can use the E-Mail address
that you used to enter NM.</p>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment