Skip to content
Browse files

rm unused web.py code

  • Loading branch information...
1 parent c3b36c2 commit e039f347320a689495c58273ec65da84536804bd @alswl committed Jul 5, 2014
View
20 kuku/config.py
@@ -1,20 +0,0 @@
-# coding=utf-8
-
-import os
-
-DEBUG = True
-
-ADMIN = 'alswl'
-PASSWORD = '123456'
-
-ROOT_DIR = os.path.dirname(__file__)
-TEMPLATES_DIR = os.path.join(ROOT_DIR, 'templates')
-UPLOAD_DIR = os.path.join(ROOT_DIR, '..', 'upload')
-
-MAX_FILE_SIZE = 5 * 1024 * 1024 # 3 * 1024 * 1024 bytes
-ALLOWD_EXTENSIONS = ['jpg', 'png', 'gif', 'zip', 'rar', 'gz'] # TODO rename
-
-#DEFAULT_DIR_MODE = '755'
-#DEFAULT_FILE_MODE = '644'
-
-#NOT_ALLOWD_NAME = ['admin']
View
33 kuku/kuku.py
@@ -1,33 +0,0 @@
-# coding=utf-8
-
-import os
-
-import web
-
-import config
-
-re_safe_name = ur'[ \w\u2e80-\u9fff\-_\.,\[\]]'
-re_safe_name2 = ur'[ \w\u2e80-\u9fff\-_\.,\[\]/]'
-
-urls = (
- r'/_admin/login', 'views.admin.Login',
- r'/_admin/logout', 'views.admin.Logout',
- r'/_admin/upload', 'views.admin.Upload',
- r'/_admin/mkdir', 'views.admin.Mkdir',
- r'/_admin/delete', 'views.admin.Delete',
- r'/((?:%(name)s+/)*)' %{'name': re_safe_name}, 'views.item.Index',
- r'/(%(name)s+[^/])' %{'name': re_safe_name2}, 'views.item.Detail',
-)
-app = web.application(urls, globals())
-application = app.wsgifunc()
-
-if web.config.get('_session') is None:
- session = web.session.Session(app, web.session.DiskStore(
- os.path.join(config.ROOT_DIR, '..', 'sessions')), {})
- web.config._session = session
-else:
- session = web.config._session
-
-if __name__ == "__main__":
- web.config.debug = config.DEBUG
- app.run()
View
BIN kuku/static/favicon.png
Deleted file not rendered
View
BIN kuku/static/fonts/general_foundicons.eot
Binary file not shown.
View
15 kuku/static/fonts/general_foundicons.svg
@@ -1,15 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" > <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
-<defs >
-<font id="generalfoundicons" horiz-adv-x="955" ><font-face
- font-family="General Foundicons"
- units-per-em="1000"
- panose-1="0 0 0 0 0 0 0 0 0 0"
- ascent="1000"
- descent="0"
- alphabetic="0" />
-<missing-glyph horiz-adv-x="250" />
-<glyph unicode=" " glyph-name="space" horiz-adv-x="250" />
-<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1000" />
-</font>
-</defs>
-</svg>
View
BIN kuku/static/fonts/general_foundicons.ttf
Binary file not shown.
View
BIN kuku/static/fonts/general_foundicons.woff
Binary file not shown.
View
BIN kuku/static/images/loading.gif
Deleted file not rendered
View
82 kuku/static/javascripts/kuku.js
@@ -1,82 +0,0 @@
-(function ($, window, undefined) {
- 'use strict';
-
- var $doc = $(document),
- Modernizr = window.Modernizr;
-
- $.fn.foundationAlerts ? $doc.foundationAlerts() : null;
- $.fn.foundationAccordion ? $doc.foundationAccordion() : null;
- $.fn.foundationTooltips ? $doc.foundationTooltips() : null;
- $('input, textarea').placeholder();
- $.fn.foundationButtons ? $doc.foundationButtons() : null;
- $.fn.foundationNavigation ? $doc.foundationNavigation() : null;
- $.fn.foundationTopBar ? $doc.foundationTopBar() : null;
- $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null;
- $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
-
- // Hide address bar on mobile devices
- if (Modernizr.touch) {
- $(window).load(function () {
- setTimeout(function () {
- window.scrollTo(0, 1);
- }, 0);
- });
- }
-})(jQuery, this);
-
-window.$g = {}; // global variable
-
-$(function() {
- 'use strict';
-
- // upload
- var restricteduploader = new qq.FileUploaderBasic({
- button: $('#upload_btn')[0],
- action: '/_admin/upload',
- params: {'path': $g.page.path},
- debug: true,
- multiple: true,
- allowedExtensions: ['jpeg', 'jpg', 'txt', 'png'],
- sizeLimit: 3 * 1024 * 1024, // 3 * 1024 * 1024 bytes
- uploadButtonText: 'Upload',
- onSubmit: function(id, fileName) { // TODO
- },
- onUpload: function(id, fileName) {}, // TODO
- onProgress: function(id, fileName) {}, // TODO
- onComplete: function(id, fileName, responseJson) {
- window.location.reload(); // TODO
- },
- });
-
- // mkdir
- $('#mkdir_btn').click(function() {
- $('#mkdir_pnl').reveal();
- });
-
- $('#mkdir_pnl .submit').click(function() {
- var path = $g.page.path;
- var name = $('#mkdir_pnl input').val();
- $.post('/_admin/mkdir', {path: path, name: name},
- function(data) {
- window.location.reload();// TODO
- }
- ).error(function() {
- alert('Error'); // TODO
- });
- return false;
- });
-
- // delete
- $('.hover-toggle').hover(
- function() {$(this).find('.hover-toggle-btn').removeClass('hidden')},
- function() {$(this).find('.hover-toggle-btn').addClass('hidden')}
- );
- $('.hover-toggle-btn').click(function () {
- $.post('/_admin/delete', {path: $g.page.path, name: $(this).parents('.item').find('.name').html()},
- function(data) {
- window.location.reload();
- }
- );
- });
-
-});
View
216 kuku/static/stylesheets/general_foundicons.css
@@ -1,216 +0,0 @@
-/* font-face */
-@font-face {
- font-family: "GeneralFoundicons";
- src: url("../fonts/general_foundicons.eot");
- src: url("../fonts/general_foundicons.eot?#iefix") format("embedded-opentype"), url("../fonts/general_foundicons.woff") format("woff"), url("../fonts/general_foundicons.ttf") format("truetype"), url("../fonts/general_foundicons.svg#GeneralFoundicons") format("svg");
- font-weight: normal;
- font-style: normal;
-}
-
-/* global foundicon styles */
-[class*="foundicon-"] {
- display: inline;
- width: auto;
- height: auto;
- line-height: inherit;
- vertical-align: baseline;
- background-image: none;
- background-position: 0 0;
- background-repeat: repeat;
-}
-
-[class*="foundicon-"]:before {
- font-family: "GeneralFoundicons";
- font-weight: normal;
- font-style: normal;
- text-decoration: inherit;
-}
-
-/* icons */
-.foundicon-settings:before {
- content: "\f000";
-}
-
-.foundicon-heart:before {
- content: "\f001";
-}
-
-.foundicon-star:before {
- content: "\f002";
-}
-
-.foundicon-plus:before {
- content: "\f003";
-}
-
-.foundicon-minus:before {
- content: "\f004";
-}
-
-.foundicon-checkmark:before {
- content: "\f005";
-}
-
-.foundicon-remove:before {
- content: "\f006";
-}
-
-.foundicon-mail:before {
- content: "\f007";
-}
-
-.foundicon-calendar:before {
- content: "\f008";
-}
-
-.foundicon-page:before {
- content: "\f009";
-}
-
-.foundicon-tools:before {
- content: "\f00a";
-}
-
-.foundicon-globe:before {
- content: "\f00b";
-}
-
-.foundicon-home:before {
- content: "\f00c";
-}
-
-.foundicon-quote:before {
- content: "\f00d";
-}
-
-.foundicon-people:before {
- content: "\f00e";
-}
-
-.foundicon-monitor:before {
- content: "\f00f";
-}
-
-.foundicon-laptop:before {
- content: "\f010";
-}
-
-.foundicon-phone:before {
- content: "\f011";
-}
-
-.foundicon-cloud:before {
- content: "\f012";
-}
-
-.foundicon-error:before {
- content: "\f013";
-}
-
-.foundicon-right-arrow:before {
- content: "\f014";
-}
-
-.foundicon-left-arrow:before {
- content: "\f015";
-}
-
-.foundicon-up-arrow:before {
- content: "\f016";
-}
-
-.foundicon-down-arrow:before {
- content: "\f017";
-}
-
-.foundicon-trash:before {
- content: "\f018";
-}
-
-.foundicon-add-doc:before {
- content: "\f019";
-}
-
-.foundicon-edit:before {
- content: "\f01a";
-}
-
-.foundicon-lock:before {
- content: "\f01b";
-}
-
-.foundicon-unlock:before {
- content: "\f01c";
-}
-
-.foundicon-refresh:before {
- content: "\f01d";
-}
-
-.foundicon-paper-clip:before {
- content: "\f01e";
-}
-
-.foundicon-video:before {
- content: "\f01f";
-}
-
-.foundicon-photo:before {
- content: "\f020";
-}
-
-.foundicon-graph:before {
- content: "\f021";
-}
-
-.foundicon-idea:before {
- content: "\f022";
-}
-
-.foundicon-mic:before {
- content: "\f023";
-}
-
-.foundicon-cart:before {
- content: "\f024";
-}
-
-.foundicon-address-book:before {
- content: "\f025";
-}
-
-.foundicon-compass:before {
- content: "\f026";
-}
-
-.foundicon-flag:before {
- content: "\f027";
-}
-
-.foundicon-location:before {
- content: "\f028";
-}
-
-.foundicon-clock:before {
- content: "\f029";
-}
-
-.foundicon-folder:before {
- content: "\f02a";
-}
-
-.foundicon-inbox:before {
- content: "\f02b";
-}
-
-.foundicon-website:before {
- content: "\f02c";
-}
-
-.foundicon-smiley:before {
- content: "\f02d";
-}
-
-.foundicon-search:before {
- content: "\f02e";
-}
View
194 kuku/static/stylesheets/general_foundicons_ie7.css
@@ -1,194 +0,0 @@
-/* general icons for IE7 */
-[class*="foundicon-"] {
- font-family: "GeneralFoundicons";
- font-weight: normal;
- font-style: normal;
-}
-
-.foundicon-settings {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf000;");
-}
-
-.foundicon-heart {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf001;");
-}
-
-.foundicon-star {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf002;");
-}
-
-.foundicon-plus {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf003;");
-}
-
-.foundicon-minus {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf004;");
-}
-
-.foundicon-checkmark {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf005;");
-}
-
-.foundicon-remove {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf006;");
-}
-
-.foundicon-mail {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf007;");
-}
-
-.foundicon-calendar {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf008;");
-}
-
-.foundicon-page {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf009;");
-}
-
-.foundicon-tools {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00a;");
-}
-
-.foundicon-globe {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00b;");
-}
-
-.foundicon-home {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00c;");
-}
-
-.foundicon-quote {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00d;");
-}
-
-.foundicon-people {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00e;");
-}
-
-.foundicon-monitor {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf00f;");
-}
-
-.foundicon-laptop {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf010;");
-}
-
-.foundicon-phone {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf011;");
-}
-
-.foundicon-cloud {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf012;");
-}
-
-.foundicon-error {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf013;");
-}
-
-.foundicon-right-arrow {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf014;");
-}
-
-.foundicon-left-arrow {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf015;");
-}
-
-.foundicon-up-arrow {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf016;");
-}
-
-.foundicon-down-arrow {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf017;");
-}
-
-.foundicon-trash {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf018;");
-}
-
-.foundicon-add-doc {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf019;");
-}
-
-.foundicon-edit {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01a;");
-}
-
-.foundicon-lock {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01b;");
-}
-
-.foundicon-unlock {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01c;");
-}
-
-.foundicon-refresh {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01d;");
-}
-
-.foundicon-paper-clip {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01e;");
-}
-
-.foundicon-video {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf01f;");
-}
-
-.foundicon-photo {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf020;");
-}
-
-.foundicon-graph {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf021;");
-}
-
-.foundicon-idea {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf022;");
-}
-
-.foundicon-mic {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf023;");
-}
-
-.foundicon-cart {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf024;");
-}
-
-.foundicon-address-book {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf025;");
-}
-
-.foundicon-compass {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf026;");
-}
-
-.foundicon-flag {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf027;");
-}
-
-.foundicon-location {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf028;");
-}
-
-.foundicon-clock {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf029;");
-}
-
-.foundicon-folder {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf02a;");
-}
-
-.foundicon-inbox {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf02b;");
-}
-
-.foundicon-website {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf02c;");
-}
-
-.foundicon-smiley {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf02d;");
-}
-
-.foundicon-search {
- *zoom: expression(this.runtimeStyle['zoom'] = "1", this.innerHTML = "&#xf02e;");
-}
View
16 kuku/static/stylesheets/kuku.css
@@ -1,16 +0,0 @@
-[class*="foundicon-"]:after {
- position: relative;
- top: -8px;
- left: 10px;
- color: #888;
- font-size: 60%;
- font-style: normal;
-}
-
-.hidden {
- display: none;
-}
-
-.tc {
- text-align: center;
-}
View
41 kuku/templates/admin/login.html
@@ -1,41 +0,0 @@
-<%inherit file="/base.html"/>
-
-<form action="/_admin/login" method="post">
- <div class="row">
- <div class="six columns centered">
- <fieldset>
- <div class="row">
- <div class="four mobile-one columns">
- <label class="right inline">User name</label>
- </div>
- <div class="eight mobile-three columns">
- <input type="text" name="username"/>
- </div>
- </div>
- <div class="row">
- <div class="four mobile-one columns">
- <label class="right inline">Password</label>
- </div>
- <div class="eight mobile-three columns">
- <input type="password" name="password"/>
- </div>
- </div>
- <div class="row">
- <div class="four mobile-one columns centered">
- <input type="submit" class="button" value="Login"/>
- </div>
- </div>
- </fieldset>
- </div>
- </div>
-</form>
-
-<%block name="before_js">
-<script>
- $(function() {
- });
-</script>
-</%block>
-
-## vim: set ft=mako:
-
View
61 kuku/templates/base.html
@@ -1,61 +0,0 @@
-<html>
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
-<head>
- <meta charset="utf-8" />
-
- <!-- Set the viewport width to device width for mobile -->
- <meta name="viewport" content="width=device-width" />
-
- <title><%block name="title">KuKu - online image manager based on web.py</%block></title>
- <link rel="shortcut icon" href="/static/favicon.png" type="image/png">
-
- <!-- Included CSS Files (Compressed) -->
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/3.2.2/stylesheets/foundation.min.css">
- <link rel="stylesheet" href="/static/stylesheets/general_foundicons.css">
- <!--[if lt IE 8]>
- <link rel="stylesheet" href="/static/stylesheets/general_foundicons_ie7.css">
- <![endif]-->
- <link rel="stylesheet" href="/static/stylesheets/kuku.css">
- ##<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/file-uploader/2.1.2/fileuploader.css">
-
- ##<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
-
- <!-- IE Fix for HTML5 Tags -->
- <!--[if lt IE 9]>
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
- <%block name="css"></%block>
-
-</head>
-<body>
- <div class="row">
- <div class="twelve columns">
- <div class="eight columns">
- <h2>Welcome to KuKu</h2>
- </div>
- <div class="four columns right">
- <p>Powered by <a href="http://webpy.org/">web.py</a> &amp; <a href="http://log4d.com">alswl</a></p>
- </div>
- <hr>
- </div>
- </div>
-
- ${self.body()}
-
- <!-- Included JS Files (Compressed) -->
- ##<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
- <script src="//cdnjs.cloudflare.com/ajax/libs/foundation/3.2.2/javascripts/foundation.min.js"></script>
- <script src="//cdnjs.cloudflare.com/ajax/libs/file-uploader/2.1.2/fileuploader.min.js "></script>
-
- <!-- Initialize JS Plugins -->
- <%block name="before_js"></%block>
- <script src="/static/javascripts/kuku.js"></script>
- <%block name="after_js"></%block>
-</body>
-</html>
-
-## vim: set ft=mako:
View
189 kuku/templates/foundation.html
@@ -1,189 +0,0 @@
-<!DOCTYPE html>
-
-<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
-<head>
- <meta charset="utf-8" />
-
- <!-- Set the viewport width to device width for mobile -->
- <meta name="viewport" content="width=device-width" />
-
- <title>Welcome to Foundation</title>
-
- <!-- Included CSS Files (Uncompressed) -->
- <!--
- <link rel="stylesheet" href="stylesheets/foundation.css">
- -->
-
- <!-- Included CSS Files (Compressed) -->
- <link rel="stylesheet" href="/static/stylesheets/foundation.min.css">
- <link rel="stylesheet" href="/static/stylesheets/app.css">
-
- <script src="/static/javascripts/modernizr.foundation.js"></script>
-
- <!-- IE Fix for HTML5 Tags -->
- <!--[if lt IE 9]>
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
-</head>
-<body>
-
- <div class="row">
- <div class="twelve columns">
- <h2>Welcome to Foundation</h2>
- <p>This is version <strong>3.1.1</strong> generated on October 22, 2012.</p>
- <hr />
- </div>
- </div>
-
- <div class="row">
- <div class="eight columns">
- <h3>The Grid</h3>
-
- <!-- Grid Example -->
- <div class="row">
- <div class="twelve columns">
- <div class="panel">
- <p>This is a twelve column section in a row. Each of these includes a div.panel element so you can see where the columns are - it's not required at all for the grid.</p>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="six columns">
- <div class="panel">
- <p>Six columns</p>
- </div>
- </div>
- <div class="six columns">
- <div class="panel">
- <p>Six columns</p>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="four columns">
- <div class="panel">
- <p>Four columns</p>
- </div>
- </div>
- <div class="four columns">
- <div class="panel">
- <p>Four columns</p>
- </div>
- </div>
- <div class="four columns">
- <div class="panel">
- <p>Four columns</p>
- </div>
- </div>
- </div>
-
-
- <h3>Tabs</h3>
- <dl class="tabs">
- <dd class="active"><a href="#simple1">Simple Tab 1</a></dd>
- <dd><a href="#simple2">Simple Tab 2</a></dd>
- <dd><a href="#simple3">Simple Tab 3</a></dd>
- </dl>
-
- <ul class="tabs-content">
- <li class="active" id="simple1Tab">This is simple tab 1's content. Pretty neat, huh?</li>
- <li id="simple2Tab">This is simple tab 2's content. Now you see it!</li>
- <li id="simple3Tab">This is simple tab 3's content. It's, you know...okay.</li>
- </ul>
-
-
-
- <h3>Buttons</h3>
-
- <div class="row">
- <div class="six columns">
- <p><a href="#" class="small button">Small Button</a></p>
- <p><a href="#" class="button">Medium Button</a></p>
- <p><a href="#" class="large button">Large Button</a></p>
- </div>
- <div class="six columns">
- <p><a href="#" class="small alert button">Small Alert Button</a></p>
- <p><a href="#" class="success button">Medium Success Button</a></p>
- <p><a href="#" class="large secondary button">Large Secondary Button</a></p>
- </div>
- </div>
-
- </div>
-
- <div class="four columns">
- <h4>Getting Started</h4>
- <p>We're stoked you want to try Foundation! To get going, this file (index.html) includes some basic styles you can modify, play around with, or totally destroy to get going.</p>
-
- <h4>Other Resources</h4>
- <p>Once you've exhausted the fun in this document, you should check out:</p>
- <ul class="disc">
- <li><a href="http://foundation.zurb.com/docs">Foundation Documentation</a><br />Everything you need to know about using the framework.</li>
- <li><a href="http://github.com/zurb/foundation">Foundation on Github</a><br />Latest code, issue reports, feature requests and more.</li>
- <li><a href="http://twitter.com/foundationzurb">@foundationzurb</a><br />Ping us on Twitter if you have questions. If you build something with this we'd love to see it (and send you a totally boss sticker).</li>
- </ul>
- </div>
- </div>
-
-
-
-
- <div class="row">
- <div class="twelve columns">
- <h3>Reveal</h3>
- <p><a href="#" data-reveal-id="exampleModal" class="button">Example modal</a></p>
- </div>
- </div>
-
- <div id="exampleModal" class="reveal-modal">
- <h2>This is a modal.</h2>
- <p>
- Reveal makes these very easy to summon and dismiss. The close button is simple an anchor with a unicode
- character icon and a class of <code>close-reveal-modal</code>. Clicking anywhere outside the modal will
- also dismiss it.
- </p>
- <a class="close-reveal-modal">×</a>
- </div>
-
-
- <!-- Included JS Files (Uncompressed) -->
- <!--
-
- <script src="javascripts/jquery.js"></script>
-
- <script src="javascripts/jquery.foundation.mediaQueryToggle.js"></script>
-
- <script src="javascripts/jquery.foundation.forms.js"></script>
-
- <script src="javascripts/jquery.foundation.reveal.js"></script>
-
- <script src="javascripts/jquery.foundation.navigation.js"></script>
-
- <script src="javascripts/jquery.foundation.buttons.js"></script>
-
- <script src="javascripts/jquery.foundation.tabs.js"></script>
-
- <script src="javascripts/jquery.foundation.tooltips.js"></script>
-
- <script src="javascripts/jquery.foundation.accordion.js"></script>
-
- <script src="javascripts/jquery.placeholder.js"></script>
-
- <script src="javascripts/jquery.foundation.alerts.js"></script>
-
- <script src="javascripts/jquery.foundation.topbar.js"></script>
-
- -->
-
- <!-- Included JS Files (Compressed) -->
- <script src="/static/javascripts/jquery.js"></script>
- <script src="/static/javascripts/foundation.min.js"></script>
-
- <!-- Initialize JS Plugins -->
- <script src="/static/javascripts/app.js"></script>
-</body>
-</html>
View
104 kuku/templates/item/index.html
@@ -1,104 +0,0 @@
-<%inherit file="/base.html"/>
-
-<div class="row">
- <div class="twelve columns">
- <ul class="breadcrumbs">
- % for (name, url) in page.breadcrumbs[:-1]:
- <li><a href="${url}">${name}</a></li>
- % endfor
- <li class="current"><a href="${page.breadcrumbs[-1][1]}">${page.breadcrumbs[-1][0]}</a></li>
- </ul>
- </div>
-</div>
-
-<div class="row">
- <div class="ten columns">
- <table class="twelve">
- <thead>
- <th></th>
- <th>File Name</th>
- <th>Size</th>
- <th>Last Modified Time</th>
- <th class="tc">Delete</th>
- </thead>
- <tbody>
- % for d in page.dirs:
- <tr class="hover-toggle dir item">
- <td><i class="foundicon-folder"></i></td>
- <td><a class="name" href="/${page.relative_path}/${d}/">${d}/</a></td>
- <td></td>
- <td></td>
- <td class="tc">
- <a href="javascript:;" class="hidden hover-toggle-btn"><i class="foundicon-trash">delete</i></a>
- </td>
- </tr>
- % endfor
- % for f in page.files:
- <tr class="hover-toggle item file">
- <td><i class="foundicon-page"></i></td>
- <td><a class="name" href="/${page.relative_path}/${f}">${f}</a></td>
- <td></td>
- <td></td>
- <td class="tc">
- <a href="javascript:;" class="hidden hover-toggle-btn tc"><i class="foundicon-trash">delete</i></a>
- </td>
- </tr>
- % endfor
- </tbody>
- </table>
- </div>
- <div class="two columns">
- <div class="panel">
- <ul class="nav-bar vertical">
- <li>
- <a id="upload_btn" href="javascript:;" class="tc" title="Upload files">
- <i class="foundicon-page"></i>
- </a>
- </li>
- <li>
- <a id="mkdir_btn" href="javascript:;" class="tc" title="Create directory">
- <i class="foundicon-folder"></i>
- </a>
- </li>
- <li>
- <a href="/_admin/logout" class="tc" title="Logout">
- <i class="foundicon-error"></i>
- </a>
- </li>
- </ul>
- </div>
- </div>
-</div>
-
-<div id="mkdir_pnl" class="reveal-modal medium">
- <h2>Create Directory</h2>
-
- <div class="row">
- <div class="two columns">
- <label class="right inline">Name: </label>
- </div>
- <div class="ten columns">
- <div class="row collapse">
- <div class="eight mobile-three columns">
- <input type="text" placeholder="eg. travel picture" />
- </div>
- <div class="four mobile-one columns">
- <a href="javascript:;" class="postfix button expand submit">Create</a>
- </div>
- </div>
- </div>
- </div>
-
-</div>
-
-
-<%block name="before_js">
-<script>
- $(function() {
- $g.page = {};
- $g.page.path = '${page.relative_path}';
- });
-</script>
-</%block>
-
-## vim: set ft=mako:
View
99 kuku/views/__init__.py
@@ -1,99 +0,0 @@
-# coding=utf-8
-
-import os
-import json
-import mimetypes
-
-import web
-from web.contrib.template import render_mako
-
-import config
-import lib
-
-mimetypes.init()
-
-class Base(object):
- def __init__(self):
- web.header('Content-Type', 'text/html')
-
-class MyRenderMako(render_mako):
- def __getattr__(self, name):
- path = name + ".html"
- if not os.path.isfile(path):
- path = name.replace('_', '/') + ".html"
- t = self._lookup.get_template(path)
- return t.render
-
-render = MyRenderMako(
- directories=[config.TEMPLATES_DIR],
- input_encoding='utf-8',
- output_encoding='utf-8',
-) # TODO +web.contrib.template.cache
-
-class JsonResult(object):
-
- @classmethod
- def json(cls, success, data=None, message=None):
- result = { 'success': success, }
- if not data is None:
- result['data'] = data
- if not message is None:
- result['message'] = data
- return json.dumps(result)
-
- @classmethod
- def json_true(cls, data=None, message=None):
- return cls.json(True, data, message)
-
- @classmethod
- def json_false(cls, data=None, message=None):
- return cls.json(False, data, message)
-
- @classmethod
- def json_illegal(cls, data=None, message=None):
- return cls.json(False, message='illegal parameters')
-
-def require_post_params(*args):
- """decorator: check param in request"""
- def wrapper(func):
- def __wrapper(*fun_args, **kwargs):
- input = web.input()
- for arg in args:
- if not input.has_key(arg):
- return web.BadRequest()
- return func(*fun_args, **kwargs)
- return __wrapper
- return wrapper
-
-def check_path(key_indexs=[], key_words={}, post_params={}):
- """decorator: check path"""
- def wrapper(func):
- def __wrapper(*args, **kwargs):
- need_checks = []
- for i in key_indexs:
- need_checks.append(args[i])
- for path in need_checks:
- if not lib.secure_check_path(path):
- return web.BadRequest()
- return func(*args, **kwargs)
- return __wrapper
- return wrapper
-
-def require_login(func):
- def wrapper(*args, **kwargs):
- if not is_login():
- return web.seeother('/_admin/login')
- return func(*args, **kwargs)
- return wrapper
-
-def is_login():
- if web.config._session.get('is_login', False) == True:
- return True
- else:
- return False
-
-def login():
- web.config._session.is_login = True
-
-def logout():
- web.config._session.is_login = None
View
39 kuku/views/item.py
@@ -1,39 +0,0 @@
-# coding=utf-8
-
-import os
-import logging
-import mimetypes
-
-import web
-from web import webapi
-
-import config
-import lib
-from models import Page, Item
-from views import Base, render, JsonResult
-from views import check_path, require_post_params, require_login
-
-logger = logging.getLogger(__name__)
-
-class Detail(Base):
- @check_path(key_indexs=[1])
- def GET(self, path):
- web.header('Content-Type', mimetypes.guess_type(path)[0]) # TODO
- try:
- item = Item(path)
- except lib.NotFoundError:
- return webapi.NotFound()
- logger.info('Need nginx cache file, path: %s' %path)
-
- return item.get_content()
-
-class Index(Base):
- @require_login
- @check_path(key_indexs=[1])
- def GET(self, path):
- try:
- page = Page.get(path)
- except lib.NotFoundError:
- return webapi.NotFound()
-
- return render.item_index(page=page)

0 comments on commit e039f34

Please sign in to comment.
Something went wrong with that request. Please try again.