From d3a3b098c7d330f4f9bcf859f6005dcc6bd96176 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 13 Dec 2011 15:31:09 -0600 Subject: [PATCH] examples path, thanks Anthony --- VERSION | 2 +- applications/examples/controllers/default.py | 23 ++-- .../default/documentation/community.markmin | 2 +- .../content/en/default/what/whyweb2py.markmin | 7 +- applications/examples/static/css/examples.css | 116 ++++++++++++++++-- .../examples/views/default/download.html | 4 +- .../examples/views/default/index.html | 30 +++-- applications/examples/views/default/who.html | 1 + applications/examples/views/layout.html | 29 ++--- 9 files changed, 152 insertions(+), 62 deletions(-) diff --git a/VERSION b/VERSION index 55227d4b..c28cfc9a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.3 (2011-12-13 15:21:08) stable +Version 1.99.3 (2011-12-13 15:31:01) stable diff --git a/applications/examples/controllers/default.py b/applications/examples/controllers/default.py index 496f24a0..80f00979 100644 --- a/applications/examples/controllers/default.py +++ b/applications/examples/controllers/default.py @@ -7,12 +7,13 @@ response.keywords = T('web2py, Python, Web Framework') response.description = T('web2py Web Framework') session.forget() +cache_expire = not request.is_local and 300 or 0 -@cache('index') +@cache('index', time_expire=cache_expire) def index(): return response.render() -@cache('what') +@cache('what', time_expire=cache_expire) def what(): import urllib; try: @@ -21,30 +22,30 @@ def what(): images = [] return response.render(images=images) -@cache('download') +@cache('download', time_expire=cache_expire) def download(): return response.render() -@cache('who') +@cache('who', time_expire=cache_expire) def who(): return response.render() -@cache('support') +@cache('support', time_expire=cache_expire) def support(): return response.render() -@cache('documentation') +@cache('documentation', time_expire=cache_expire) def documentation(): return response.render() -@cache('usergroups') +@cache('usergroups', time_expire=cache_expire) def usergroups(): return response.render() def contact(): redirect(URL('default','usergroups')) -@cache('videos') +@cache('videos', time_expire=cache_expire) def videos(): return response.render() @@ -54,7 +55,7 @@ def security(): def api(): redirect('http://web2py.com/book/default/chapter/04#API') -@cache('license') +@cache('license', time_expire=cache_expire) def license(): import os filename = os.path.join(request.env.gluon_parent, 'LICENSE') @@ -63,11 +64,11 @@ def license(): def version(): return 'Version %s.%s.%s (%s) %s' % request.env.web2py_version -@cache('examples') +@cache('examples', time_expire=cache_expire) def examples(): return response.render() -@cache('changelog') +@cache('changelog', time_expire=cache_expire) def changelog(): import os filename = os.path.join(request.env.gluon_parent, 'CHANGELOG') diff --git a/applications/examples/private/content/en/default/documentation/community.markmin b/applications/examples/private/content/en/default/documentation/community.markmin index 97b250e4..6a9f2e46 100644 --- a/applications/examples/private/content/en/default/documentation/community.markmin +++ b/applications/examples/private/content/en/default/documentation/community.markmin @@ -1,4 +1,4 @@ -### Community Sources +### Community Documentation - [[web2pybrasil http://www.web2pybrasil.com.br popup]] - Apostila em português [[Download http://dl.dropbox.com/u/830444/apostila_web2py_basico.pdf popup]] e [[Online http://web2pybrasil.appspot.com/init/plugin_wiki/page/curso-web2py-000 popup]] diff --git a/applications/examples/private/content/en/default/what/whyweb2py.markmin b/applications/examples/private/content/en/default/what/whyweb2py.markmin index 3d8df34c..bb323fed 100644 --- a/applications/examples/private/content/en/default/what/whyweb2py.markmin +++ b/applications/examples/private/content/en/default/what/whyweb2py.markmin @@ -9,12 +9,9 @@ - **Secure** [[It prevents the most common types of vulnerabilities http://web2py.com/examples/default/security]] including Cross Site Scripting, Injection Flaws, and Malicious File Execution. - **Enforces good Software Engineering practices** (Model-View-Controller design, Server-side form validation, postbacks) that make the code more readable, scalable, and maintainable. - **Speaks multiple protocols** HTML/XML, RSS/ATOM, RTF, PDF, JSON, AJAX, XML-RPC, CSV, REST, WIKI, Flash/AMF, and Linked Data (RDF). -- **Includes** a SSL-enabled and streaming-capable web server, a relational database, a web-based integrated development environment and web-based management interface, a Database Abstraction Layer that writes SQL for you in real time, internationalization support, multiple authentication methods, role based access control, an error logging and ticketing system, multiple caching methods for scalability, the jQuery library for AJAX and effects. [[Read more... http://web2py.com/examples/default/what]] +- **Includes** a SSL-enabled and streaming-capable web server, a relational database, a web-based integrated development environment and web-based management interface, a Database Abstraction Layer that writes SQL for you in real time, internationalization support, multiple authentication methods, role based access control, an error logging and ticketing system, multiple caching methods for scalability, the jQuery library for AJAX and effects. -The best way to understand web2py is to try it. -You can try it online [[here http://www.web2py.com/demo_admin]]. - -This online version is identical to the actual web2py although some functions are disabled for security reasons. +The best way to understand web2py is to try it. You can try it online [[here http://www.web2py.com/demo_admin]] (this online version is identical to the actual web2py although some functions are disabled for security reasons). web2py was inspired by Ruby on Rails and, as Rails, it focuses on rapid development and follows a Model View Controller design. web2py differs from Rails because it is based on Python (thus it is faster and more scalable), because it provides a comprehensive web-based administrative interface (thus there is no need to ever type shell commands unless you wish), includes libraries to handle more protocols (for example XML-RPC and RSS feeds), and can run on the Google App Engine. diff --git a/applications/examples/static/css/examples.css b/applications/examples/static/css/examples.css index 3ffef015..32d71724 100644 --- a/applications/examples/static/css/examples.css +++ b/applications/examples/static/css/examples.css @@ -1,21 +1,117 @@ -.statusbar {padding-top: 2px; padding-bottom: 2px; border: 0; margin-bottom: 60px; -background: url('../images/menu.png') repeat-x; } -.statusbar a, .statusbar a:visited {color: #406361} +footer-content {position: relative; bottom: 0; width: 100%;} + +.statusbar { + padding: 2px 0; + border: 0; + margin-bottom: 15px; + background-color: #C1CDCD; + /*background: url('../images/menu.png') repeat-x;*/ +} +.statusbar a, .statusbar a:visited { + color: #406361; +} + +.footer { + position: relative; +} +.footer-content { + height: 100%; + position: absolute; +} + a, a:visited, a:hover, h1,h2,h3,h4,h5 {color: #658883} -.wrapper { background: url('../images/back-02.png') repeat-x; padding-top:10px;} +a.button {color: #658883} + +.sf-menu li, .sf-menu li a { border-radius: 5px;} + +.wrapper { + background: url('../images/back-02.png') repeat-x; + padding-top:10px; +} h1 { font-size: 32px } h2 { font-size: 24px } h3 { font-size: 20px } h4 { font-size: 14px } -sup { font-size: 0.5em; line-height: 2em; vertical-align: top;} -.frame { border: 3px solid #959595; margin-bottom: 5px; } +sup { + font-size: 0.5em; + line-height: 2em; + vertical-align: top; +} ul { list-style: circle outside;} -.announce { position:absolute;align:center;color:white;top:120px;font-weight:bold;text-align:center; - } -.announce a { color: white !important;} -input:focus,textarea:focus {background:#f0f0f0!important} +.frame { + border: 3px solid #959595; + margin-bottom: 5px; +} + +.header h5 { + float: left; +} +.logo: { + float:left; +} + +.announce { + text-align: center; + color: white; + top: 0; + font-weight: bold; + text-align: center; + left: 0; + position: relative; + background: #000; + border-radius: 5px; + margin: 7px 0 15px; +} +.announce a {color: white} + +input:focus, textarea:focus {background:#f0f0f0} + table.downloads { width:100%; } table.downloads th, table.downloads td {text-align:center;} table.downloads a.button { width: 150px; } th,td {padding-right: 10px;} + +p {text-align: left;} + +p + p { + margin-bottom: .75em; +} + +strong {color: inherit;} + +img.centered { + margin: 0 auto; + display: block; +} + +.tagCloud { + width: 100%; + max-width: 489px; +} +.mainbody { + margin-bottom: 20px; +} +.aboutW2P { + margin-top: 23px; + margin-bottom: 15px; +} +.aboutW2P p { + padding: 0 0.5em; + font-size: 1.15em; +} +.aboutW2P h3 { + padding: 0 0.3em; +} +.userQuotes { + /*border-top: #eee 2px solid;*/ + padding-top: 15px; +} +.userQuotes p { + text-align: left; + font-size: 111%; + color: #777; +} +#menu { + padding: 0.1em 0.5em; +} diff --git a/applications/examples/views/default/download.html b/applications/examples/views/default/download.html index 2b11676e..ad936745 100644 --- a/applications/examples/views/default/download.html +++ b/applications/examples/views/default/download.html @@ -5,6 +5,7 @@

web2pyTM Download

+
@@ -39,6 +40,7 @@
+

The source code version works on all supported platforms, including Linux, but it requires Python 2.5, 2.6, or 2.7. It runs on Windows and most Unix systems, including Linux and BSD. @@ -99,4 +101,4 @@ {{block sidebar}}{{end}} {{block leftbadges}}{{end}} - +

diff --git a/applications/examples/views/default/index.html b/applications/examples/views/default/index.html index 60eb93a3..09f15e2e 100644 --- a/applications/examples/views/default/index.html +++ b/applications/examples/views/default/index.html @@ -1,41 +1,40 @@ {{right_sidebar_enabled=True}} {{extend 'layout.html'}} -
- -
+

WEB2PYTM WEB FRAMEWORK

Free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications. Written and programmable in Python. LGPLv3 License. Current version: {{="%s.%s.%s (%s) %s" % request.env.web2py_version}}

{{block extra}} -
+
-
+ -
+ -
+
-
+ +
- + {{for k,quote in enumerate(quotes[:3]):}} -
+ {{pass}} @@ -44,12 +43,11 @@ Current version: {{="%s.%s.%s (%s) %s" % request.env.web2py_version}}

{{end}} {{block right_sidebar}} -
+ {{end}} - diff --git a/applications/examples/views/default/who.html b/applications/examples/views/default/who.html index a565d222..387a69ac 100644 --- a/applications/examples/views/default/who.html +++ b/applications/examples/views/default/who.html @@ -39,6 +39,7 @@
  • Carlos Galindo
  • Carsten Haese (Informix)
  • Chris Clark (Ingres, Jython support) +
  • Chris May (new website)
  • Chris Steel
  • Christian Foster Howes (GAE support)
  • Christopher Smiga (Informix) diff --git a/applications/examples/views/layout.html b/applications/examples/views/layout.html index 3b0882d2..bd813d77 100644 --- a/applications/examples/views/layout.html +++ b/applications/examples/views/layout.html @@ -55,11 +55,7 @@ {{ - # using sidebars need to know what sidebar you want to use - left_sidebar_enabled = globals().get('left_sidebar_enabled',False) right_sidebar_enabled = globals().get('right_sidebar_enabled',False) - middle_columns = {0:'sixteen',1:'ten',2:'eight'}[ - (left_sidebar_enabled and 1 or 0)+(right_sidebar_enabled and 1 or 0)] }} -
  • - - -
    +
    +
    +
    -
    +
    {{block center}} {{include}} {{end}}
    {{if right_sidebar_enabled:}} -
    +