Skip to content

Commit

Permalink
added templating
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvika Markfeld authored and Zvika Markfeld committed Mar 9, 2010
1 parent 56a3ffb commit efa03e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tcdjango/community/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class Post(models.Model):
sticky = models.BooleanField(_('sticky'), default = False)
published = models.BooleanField(_('published'), default = True)

def get_absolute_url(self):
return "http://localhost:8000/article/%s" %self.slug


def __unicode__(self):
return self.title
Expand Down
2 changes: 1 addition & 1 deletion tcdjango/community/templates/content_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>Domains<h1>
<h1>Articles</h1>
<ul>
{% for article in articles %}
<li>{{ article.title }}</li>
<li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></li>
{% endfor %}
</ul>
{% endblock content %}
1 change: 1 addition & 0 deletions tcdjango/community/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
urlpatterns = patterns('',
# Example:
(r'domain/(?P<domain>\w+)/$', 'tcdjango.community.views.home'),
(r'article/(?P<slug>\w+)/$', 'tcdjango.community.views.view_article'),
(r'', 'tcdjango.community.views.home'),


Expand Down
9 changes: 7 additions & 2 deletions tcdjango/templates/admin/base_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
{% block title %} Tikal Community Site :: {{ title }} {% endblock %}
{% block branding %}
<table>
<tr><td><img src='/static/img/tikal_marina_logo.png'></td></tr>
<tr></tr>
<tr>
<td width="80%"><img src='/static/img/tikal_marina_logo.png'></td>
<td><a href="why.html">Why Community?</a></td>
<td><a href="about.html">About</a></td>
<td><a href="careers.html">Careers</a></td>
<td><a href="contact.html">Contact</a></td>
</tr>
</table>
{% endblock %}
{% block nav-global %} {% endblock %}

0 comments on commit efa03e6

Please sign in to comment.