diff --git a/pylons_app/controllers/admin.py b/pylons_app/controllers/admin.py --- a/pylons_app/controllers/admin.py +++ b/pylons_app/controllers/admin.py @@ -59,6 +59,9 @@ class AdminController(BaseController): .order_by(UserLogs.action_date.desc()) p = int(request.params.get('page', 1)) c.users_log = Page(users_log, page=p, items_per_page=10) + c.log_data = render('admin_log.html') + if request.params.get('partial'): + return c.log_data return render('/admin.html') def hgrc(self, dirname): diff --git a/pylons_app/templates/admin.html b/pylons_app/templates/admin.html --- a/pylons_app/templates/admin.html +++ b/pylons_app/templates/admin.html @@ -34,31 +34,9 @@

Welcome ${c.admin_username}

-
${_('Last 10 user actions')}
- %if c.users_log: - - - - - - - - %for cnt,l in enumerate(c.users_log): - - - - - - - %endfor - - - -
${_('Username')}${_('Repository')}${_('Action')}${_('Date')}
${l.user.username}${l.repository}${l.action}${l.action_date}
${c.users_log.pager('$link_previous ~2~ $link_next')}
- %else: - ${_('No actions yet')} - %endif - +
+ ${c.log_data} +
%else:
diff --git a/pylons_app/templates/admin_log.html b/pylons_app/templates/admin_log.html new file mode 100644 --- /dev/null +++ b/pylons_app/templates/admin_log.html @@ -0,0 +1,29 @@ +%if c.users_log: + + + + + + + + + %for cnt,l in enumerate(c.users_log): + + + + + + + %endfor + + + + +
${_('Username')}${_('Repository')}${_('Action')}${_('Date')}
${l.user.username}${l.repository}${l.action}${l.action_date}
${c.users_log.pager('$link_previous ~2~ $link_next', + onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ + success:function(o){YAHOO.util.Dom.get('user_log').innerHTML=o.responseText;} + },null); return false;""")}
+ +%else: + ${_('No actions yet')} +%endif diff --git a/pylons_app/templates/base/base.html b/pylons_app/templates/base/base.html --- a/pylons_app/templates/base/base.html +++ b/pylons_app/templates/base/base.html @@ -9,6 +9,7 @@ ${next.title()} + ${self.js()} @@ -40,4 +41,9 @@
- \ No newline at end of file + + + +<%def name="js()"> + + \ No newline at end of file