Skip to content

Commit

Permalink
show entries list in admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
btbytes committed Mar 17, 2009
1 parent df79fed commit 19ccd16
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
5 changes: 4 additions & 1 deletion admin.py
Expand Up @@ -13,6 +13,7 @@
from google.appengine.ext.webapp import template
from google.appengine.api import users
from utils import TehRequestHandler, administrator
from blog import Entry

class AdminHandler(TehRequestHandler):
@administrator
Expand All @@ -22,7 +23,9 @@ def get(self):
class EntryListHandler(TehRequestHandler):
@administrator
def get(self):
self.render("templates/admin_entrylist.html")
entries = Entry.all().order("-published")
self.render("templates/admin_entrylist.html",
entries=entries)

class ConfigHandler(TehRequestHandler):
@administrator
Expand Down
2 changes: 1 addition & 1 deletion static/css/base.css
Expand Up @@ -185,4 +185,4 @@ ul li {
.entry h1 a:visited{
text-decoration:none;
color: #222222;
}
}
2 changes: 1 addition & 1 deletion templates/admin.html
Expand Up @@ -7,7 +7,7 @@ <h2>Entries</h2>
</ul>
<h2>Manage Entries</h2>
<ul>
<li><a href="/admin/entrylist"> x.Entry List</a></li>
<li><a href="/admin/entrylist">Entries</a></li>
</ul>
<h2>Configuration</h2>
<ul>
Expand Down
31 changes: 30 additions & 1 deletion templates/admin_entrylist.html
@@ -1,6 +1,35 @@
{% extends "formbase.html" %}

{% block title %}Entries {% endblock %}
{% block content %}
<h2>Entries</h2>
<h2>Entries</h2>
<table id="entries" width="100%">
<tr>
<td>Edit</td>
<td>Published date</td>
<td>View</td>
</tr>
{% for entry in entries %}
<tr>
<td>
{% if entry.static %}
<a href="/{{entry.slug}}/edit">{{entry.title}}</a>
{% endif %}
{% if not entry.static %}
<a href="/entry/{{entry.slug}}/edit">{{entry.title}}</a>
{% endif %}
</td>
<td>{{entry.published|date:"Y-m-d"}}</td>
<td>
{% if entry.static %}
<a href="/{{entry.slug}}">&raquo;</a>
{% endif %}
{% if not entry.static %}
<a href="/entry/{{entry.slug}}">&raquo;</a>
{% endif %}
</td>

</tr>
{% endfor %}
</table>
{% endblock %}

0 comments on commit 19ccd16

Please sign in to comment.