comparison pylons_app/controllers/admin.py @ 127:20dc7a5eb748

Html changes and cleanups, made folders for html templates, implemented tags and branches pages
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 03 May 2010 19:07:54 +0200
parents 2811259dc12d
children 919b5bcd8630
comparison
equal deleted inserted replaced
126:cfddee9d3693 127:20dc7a5eb748
41 'password':'invalid password'}) 41 'password':'invalid password'})
42 42
43 except formencode.Invalid, error: 43 except formencode.Invalid, error:
44 c.form_result = error.value 44 c.form_result = error.value
45 c.form_errors = error.error_dict or {} 45 c.form_errors = error.error_dict or {}
46 html = render('/admin.html') 46 html = render('admin/admin.html')
47 47
48 return htmlfill.render( 48 return htmlfill.render(
49 html, 49 html,
50 defaults=c.form_result, 50 defaults=c.form_result,
51 encoding="UTF-8" 51 encoding="UTF-8"
55 55
56 users_log = sa.query(UserLogs)\ 56 users_log = sa.query(UserLogs)\
57 .order_by(UserLogs.action_date.desc()) 57 .order_by(UserLogs.action_date.desc())
58 p = int(request.params.get('page', 1)) 58 p = int(request.params.get('page', 1))
59 c.users_log = Page(users_log, page=p, items_per_page=10) 59 c.users_log = Page(users_log, page=p, items_per_page=10)
60 c.log_data = render('admin_log.html') 60 c.log_data = render('admin/admin_log.html')
61 if request.params.get('partial'): 61 if request.params.get('partial'):
62 return c.log_data 62 return c.log_data
63 return render('/admin.html') 63 return render('admin/admin.html')
64 64
65 def hgrc(self, dirname): 65 def hgrc(self, dirname):
66 filename = os.path.join(dirname, '.hg', 'hgrc') 66 filename = os.path.join(dirname, '.hg', 'hgrc')
67 return filename 67 return filename
68 68