Skip to content

Commit

Permalink
清理练习的文件
Browse files Browse the repository at this point in the history
  • Loading branch information
toolib committed May 9, 2019
1 parent 52d91fd commit 2d4e802
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/
statics/

test/
13 changes: 13 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}Base{% end %}</title>
<link rel="shortcut icon" href="{{ static_url('images/favicon.ico') }}">
</head>

<body>
{% block body %} this is tornado{% end %}
</body>

</html>
8 changes: 8 additions & 0 deletions templates/explore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends 'base.html' %}

{% block title %}explore page{% end %}


{% block body %}
explore page
{% end %}
8 changes: 8 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends 'base.html' %}

{% block title %}index page{% end %}


{% block body %}
index
{% end %}
8 changes: 8 additions & 0 deletions templates/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends 'base.html' %}

{% block title %}post page{% end %}


{% block body %}
post id {{ post_id }}
{% end %}
Empty file added utils/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions utils/ui_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


def ui_methods1(self):
return 'methods 1'


def ui_methods2(self):
return 'methods 2'

24 changes: 24 additions & 0 deletions utils/uimodules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from tornado.web import UIModule


class UiModule(UIModule):
def render(self, *args, **kwargs):
return 'I am ui module'


class Advertisement(UIModule):
def render(self, *args, **kwargs):
s = 'hello world'
return self.render_string('06ad.html', up_string=self.upper(s))

def css_files(self):
return "/static/css/King_Chance_Layer7.css"

def javascript_files(self):
return [
"/static/js/jquery_1_7.js",
"/static/js/King_Chance_Layer.js",
"/static/js/King_layer_test.js", ]

def upper(self, word):
return word.upper()

0 comments on commit 2d4e802

Please sign in to comment.