123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- demeter web page
- name:content.py 内容相关页面
- author:rabin
- """
- from __load__ import *
- class set_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/web/set'
- ,label = (u'标题',u'子标题',u'关键词',u'描述',u'icp备案号',u'联系电话',u'视频地址',u'微信图片',u'微信文字',u'微信链接')
- ,update = ('name-input-required','subname-input-required','keywords-input-required','description-input-required','icp-input-required','tel-input-required',u'video-input-required',u'wx_pic-pic-required-',u'wx_text-editor-',u'wx_link-input-')
- )
- self.commonOne('web_set', id=1)
- self.commonView('set')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('web_set',id=1)
- class article_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- name = u'文章'
- ,path = '/web/article'
- ,width = '800'
- ,height = '700'
- ,search = (('label-1','cdate-time-start','cdate-time-end','category_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'文章分类',u'文章标题'))
- ,thead = (u'文章标题', u'文章分类', u'更新时间')
- ,tbody = ('name', 'category', 'cdate')
- ,state = True
- )
- self.data['common']['search_category_id-select-'] = self.service('common').list('web_article_category')
- self.commonList('web_article')
- if self.data['list']:
- for key, value in enumerate(self.data['list']):
- category = self.service('common').one('web_article_category', id=value['category_id'])
- self.data['list'][key]['category'] = category['name']
- self.commonView('list')
- class article_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/web/article'
- ,width = '800'
- ,height = '700'
- ,label = (u'文章标题',u'文章分类',u'文章链接',u'文章图片',u'文章内容')
- ,update = ('name-input-required','category_id-select-required','link-input-','pic-pic-',u'content-editor--请输入内容')
- ,update_category_id = self.service('common').list('web_article_category')
- )
- self.commonOne('web_article')
- self.commonView('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('web_article')
- @Web.auth
- @Web.setting
- def delete(self):
- self.commonDelete('web_article')
- class category_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- name = u'分类'
- ,path = '/web/category'
- ,width = '600'
- ,height = '300'
- ,search = (('label-1','cdate-time-start','cdate-time-end','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'分类名称'))
- ,thead = (u'分类名称', u'更新时间')
- ,tbody = ('name', 'cdate')
- ,state = True
- )
- self.commonList('web_article_category')
- self.commonView('list')
- class category_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/web/category'
- ,label = (u'分类名称',)
- ,update = ('name-input-required',)
- )
- self.commonOne('web_article_category')
- self.commonView('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('web_article_category')
- @Web.auth
- @Web.setting
- def delete(self):
- self.commonDelete('web_article_category')
- class menu_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- name = u'菜单'
- ,path = '/web/menu'
- ,width = '600'
- ,height = '300'
- ,search = (('label-1','cdate-time-start','cdate-time-end','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'菜单名称'))
- ,thead = (u'菜单名称',u'菜单链接', u'更新时间')
- ,tbody = ('name', 'link', 'cdate')
- ,state = True
- )
- self.commonList('web_menu')
- self.commonView('list')
- class menu_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/web/menu'
- ,label = (u'菜单名称',u'菜单链接')
- ,update = ('name-input-required','link-input-required')
- )
- self.commonOne('web_menu')
- self.commonView('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('web_menu')
- @Web.auth
- @Web.setting
- def delete(self):
- self.commonDelete('web_menu')
|