123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- demeter load
- author:rabin
- """
- from demeter.web import *
- class Load(Base):
- KEYS = ('user', 'farm')
- def setting(self):
- self.info()
- def info(self):
- ajax = self.input('ajax')
- if ajax:
- self.data['ajax'] = True
- else:
- self.data['ajax'] = False
- self.data['auth'] = True
- if 'user' in self.data['setting'] and self.data['setting']['user'] > 0:
- self.data['setting']['userInfo'] = self.service('common').one('farm_user', id=self.data['setting']['user'])
- self.data['setting']['web'] = self.service('common').one('web_set', id=1)
- self.data['setting']['menu'] = self.service('common').list('web_menu')
- self.data['setting']['footer'] = self.service('common').list('web_article', search={'category_id':1})
- self.data['setting']['front'] = Demeter.config['front']['url']
- cur = 'main'
- if '/' in self.request.uri:
- temp = self.request.uri.split('?')
- temp = temp[0].split('/')
- slen = len(temp)
- if slen > 1 and temp[1]:
- cur = temp[1]
- self.data['setting']['cur'] = cur
|