rabin 7 år sedan
förälder
incheckning
ded27abb31

+ 0 - 1
front/__init__.py

@@ -1 +0,0 @@
-# -*- coding: utf-8 -*-

BIN
front/__init__.pyc


+ 0 - 4
front/main.py

@@ -1,4 +0,0 @@
-# -*- coding: utf-8 -*-
-from demeter.web import *
-import front.page
-Web.start(application=[front.page,])

BIN
front/main.pyc


+ 0 - 1
front/page/__init__.py

@@ -1 +0,0 @@
-# -*- coding: utf-8 -*-

BIN
front/page/__init__.pyc


+ 0 - 39
front/page/__load__.py

@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    demeter load
-    author:rabin
-"""
-from demeter.web import *
-
-#可以在此定义一些核心类库
-
-# 这个是基类
-class Load(Base):
-	# user是权限
-	KEYS = ('user',)
-
-	def setting(self):
-		self.user()
-
-	def user(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'])
-		else:
-			# 没有权限
-			return
-
-		if '/' in self.request.uri:
-			temp = self.request.uri.split('/')
-			slen = len(temp)
-			if slen > 1 and temp[1]:
-				cur = temp[1]
-		self.data['setting']['cur'] = cur
-

BIN
front/page/__load__.pyc


+ 0 - 75
front/page/main.py

@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    demeter web page
-    name:work.py
-    author:rabin
-"""
-from .__load__ import *
-
-class index_path(Load):
-	#权限控制,需要在Load类中自行做判断
-	#@Web.auth
-	#异步加载,增加执行效率
-	@Web.setting
-	def get(self):
-		self.view("index.html")
-
-# 测试数据库 查询 /main/select
-class select_path(Load):
-	@Web.setting
-	def get(self):
-		# 从get、post获取数据,默认值为1
-		id = int(self.input('site', 1))
-		site = Demeter.model('site')
-		site.id = id
-		self.data['site'] = site.select(type='fetchone')
-
-		product = Demeter.model('product')
-		product.site_id = id
-		self.data['product'] = product.select(col = '*', order = 'cda2te desc', group = '', limit = '0,100')
-		if not self.data['product']:
-			Demeter.echo(product.sql)
-			Demeter.echo(product.bind)
-			Demeter.echo(product.log)
-		self.view('index.html')
-
-# 测试数据库 更新和插入 /main/update
-class update_path(Load):
-	@Web.setting
-	def get(self):
-		id = int(self.input('site', 1))
-		name = self.input('name', 'tests')
-		site = Demeter.model('site')
-		site.id = id
-		state = site.update(name=name)
-
-		self.data['site'] = site.select(type='fetchone')
-
-		self.view('index.html')
-
-# 测试json  /main/json
-class json_path(Load):
-	@Web.setting
-	def get(self):
-		id = int(self.input('site', 1))
-		name = self.input('name', 'tests')
-		site = Demeter.model('site')
-		site.id = id
-		state = site.update(name=name)
-
-		data = site.select(type='fetchone')
-		
-		self.out('yes', data)
-
-# 测试数据库 使用sql(不建议使用) /main/sql.html
-class sql_html(Load):
-	@Web.setting
-	def get(self):
-		id = int(self.input('site', 1))
-		name = self.input('name', 'tests')
-		site = Demeter.model('site')
-		state = site.query('update demeter_site set name = %s where id = %s', (name,id))
-
-		self.data['site'] = site.query('select * from demeter_site where id = %s', (id))
-
-		self.view('index.html')

BIN
front/page/main.pyc


+ 0 - 1
front/static/mobile/css/index.css

@@ -1 +0,0 @@
-.h1{font-size:.56rem;line-height:2.853333rem;background-color:#4a7cf9;text-align:center;color:#fff}

+ 0 - 1
front/static/pc/css/index.css

@@ -1 +0,0 @@
-.h1{font-size:.56rem;line-height:2.853333rem;background-color:#4a7cf9;text-align:center;color:#fff}

+ 0 - 9
front/templates/mobile/inc/header.html

@@ -1,9 +0,0 @@
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
-<meta content="yes" name="apple-mobile-web-app-capable">
-<meta content="black" name="apple-mobile-web-app-status-bar-style">
-<meta content="telephone=no" name="format-detection">
-<title>{{data['setting']['name']}}</title>
-<meta name="Keywords" content="" />
-<meta name="Description" content="" />
-<link href="{{static_url('mobile/css/index.css')}}" rel="stylesheet">

+ 0 - 10
front/templates/mobile/index.html

@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-{%include 'inc/header.html'%}
-</head>
-<body>
-mobile
-</body>
-
-</html>

+ 0 - 9
front/templates/pc/inc/header.html

@@ -1,9 +0,0 @@
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
-<meta content="yes" name="apple-mobile-web-app-capable">
-<meta content="black" name="apple-mobile-web-app-status-bar-style">
-<meta content="telephone=no" name="format-detection">
-<title>{{data['setting']['name']}}</title>
-<meta name="Keywords" content="" />
-<meta name="Description" content="" />
-<link href="{{static_url('pc/css/index.css')}}" rel="stylesheet">

+ 0 - 18
front/templates/pc/index.html

@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-{%include 'inc/header.html'%}
-</head>
-<body>
-<h1>
-pc{% if 'site' in data and data['site'] %}:{{data['site']['name']}}{% end %}
-</h1>
-{% if 'product' in data and data['product'] %}
-<ul>
-	{% for v in data['product'] %}
-    <li><a href="#"><p>{{v['name']}}</p></a></li>
-    {% end %}
-</ul>
-{% end %}
-</body>
-</html>