##// END OF EJS Templates
admin path fix
admin path fix

File last commit:

r305:61be6dcd default
r306:43b229a8 default
Show More
admin.py
52 lines | 1.9 KiB | text/x-python | PythonLexer
licensing updates, code cleanups
r252 #!/usr/bin/env python
# encoding: utf-8
# admin controller for pylons
# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License or (at your opinion) any later version of the license.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
"""
Created on April 7, 2010
admin controller for pylons
@author: marcink
"""
changed for pylons 0.1 / 1.0...
r43 import logging
licensing updates, code cleanups
r252 from pylons import request, response, session, tmpl_context as c
changed for pylons 0.1 / 1.0...
r43 from pylons_app.lib.base import BaseController, render
Marcin Kuzminski
Updated admin to show last 5 actions + updated db model
r62 from pylons_app.model import meta
changed naming convention for db modules.
r234 from pylons_app.model.db import UserLog
Marcin Kuzminski
Implemented paging to admin user acion log
r78 from webhelpers.paginate import Page
protected admin controllers
r305 from pylons_app.lib.auth import LoginRequired, HasPermissionAllDecorator
moved cache invalidating to utils, as seperate function. Implemented invalidating in
r140
changed for pylons 0.1 / 1.0...
r43 log = logging.getLogger(__name__)
class AdminController(BaseController):
Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user....
r191
@LoginRequired()
changed for pylons 0.1 / 1.0...
r43 def __before__(self):
Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user....
r191 super(AdminController, self).__before__()
protected admin controllers
r305
@HasPermissionAllDecorator('hg.admin')
changed for pylons 0.1 / 1.0...
r43 def index(self):
Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user....
r191 sa = meta.Session
changed naming convention for db modules.
r234 users_log = sa.query(UserLog).order_by(UserLog.action_date.desc())
Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user....
r191 p = int(request.params.get('page', 1))
c.users_log = Page(users_log, page=p, items_per_page=10)
c.log_data = render('admin/admin_log.html')
if request.params.get('partial'):
return c.log_data
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 return render('admin/admin.html')
Changed creation of repository to vcs implementation,...
r133