Skip to content
Browse files

Restyling the templates for mako with bootstrap

  • Loading branch information...
1 parent aea11f7 commit 54270fe0d6a3de4836ebb291ad391dae0ecb4d92 @puria puria committed Apr 17, 2012
View
285 devtools/commands/quickstart_mako/about.mak
@@ -4,106 +4,187 @@
Learning TurboGears 2.1: Quick guide to the Quickstart pages.
</%def>
-${parent.sidebar_top()}
-${parent.sidebar_bottom()}
- <div id="getting_started">
- <h2>Architectural basics of a quickstart TG2 site.</h2>
- <p>The TG2 quickstart command produces this basic TG site. Here's how it works.</p>
- <ol id="getting_started_steps">
- <li class="getting_started">
- <h3>Code my data model</h3>
- <p> When you want a model for storing favorite links or wiki content,
- the <strong>/model</strong> folder in your site is ready to go.</p>
- <p> You can build a dynamic site without any data model at all. There
- still be a default data-model template for you if you didn't enable
- authentication and authorization in quickstart. If you have enabled
- authorization, the auth data-model is ready-made.</p>
- </li>
- <li class="getting_started">
- <h3>Design my URL structure</h3>
- <p> The "<span class="code">root.py</span>" file under the
- <strong>/controllers</strong> folder has your URLs. When you
- called the url or this page (<span class="code"><a href="${tg.url('/about')}">/about</a></span>),
- the command went through the RootController class to the
- <span class="code">about</span><span class="code">()</span> method.</p>
- <p> Those Python methods are responsible to create the dictionary of
- variables that will be used in your web views (template).</p>
- </li>
- <li class="getting_started">
+ <div class="row">
+ <div class="span12">
+ <div class="page-header">
+ <h2>Architectural basics of a quickstart TG2 site.</h2>
+ </div>
+
+ <p>The TG2 quickstart command produces this basic TG site. Here's how it works.</p>
+ </div>
+
+ <div class="span4">
+ <div class="well" style="padding: 8px 0;">
+ <ul class="nav nav-list">
+ <li class="nav-header">About Architecture</li>
+ <li><a href="#data-model">Data Model</a></li>
+ <li><a href="#url-structure">URL Structure</a></li>
+ <li><a href="#template-reuse">Web page element's reuse</a></li>
+ <li py:if="tg.auth_stack_enabled" class="nav-header">Authentication</li>
+ <li py:if="tg.auth_stack_enabled"><a href="#authentication">Authorization and Authentication</a></li>
+ </ul>
+ </div>
+
+ <div class="well" id="data-model">
+ <h3>Code my data model</h3>
+
+ <p>When you want a model for storing favorite links or wiki content, the
+ <code>/model</code> folder in your site is ready to go.</p>
+
+ <p>You can build a dynamic site without any data model at all. There still be a
+ default data-model template for you if you didn't enable authentication and
+ authorization in quickstart. If you have enabled authorization, the auth
+ data-model is ready-made.</p>
+ </div>
+
+ <div class="well" id="url-structure">
+ <h3>Design my URL structure</h3>
+
+ <p>The "<code>root.py</code>" file under the <code>/controllers</code> folder has
+ your URLs. When you called this url (<code><a href=
+ "${tg.url('/about')}">about</a></code>), the command went through the
+ RootController class to the <code>about()</code> method.</p>
+
+ <p>Those Python methods are responsible to create the dictionary of variables
+ that will be used in your web views (template).</p>
+ </div>
+ </div>
+
+ <div class="span8"><img src=
+ "http://www.turbogears.org/2.1/docs/_images/tg2_files.jpg" alt=
+ "TurboGears2 quickstarted project" /></div>
+ </div>
+
+ <div class="row">
+ <div class="span12" id="template-reuse">
<h3>Reuse the web page elements</h3>
- <p> A web page viewed by user could be constructed by single or
- several reusable templates under <strong>/templates</strong>.
- Take 'about' page for example, each reusable template generating
- a part of the page.</p>
-
- <p> <strong><span class="code">about.mak</span></strong> - This is the
- template that created this page. If you take a look at this template
- you will see that there are a lot of wacky symbols, if you are not familiar
- with <a href="http://www.makotemplates.org">Mako</a> you should probably
- check out the docs on their site. </p>
-
- <p>Let's take a look at what this template does in order of execution.
- The first thing this template does
- is inherit from <strong><span class="code">master.mak</span></strong>. We'll
- go into the details of this later, but for now just know that this
- template is allowed to both call on master.mak, and also override it's
- capabilites. This inheritance is what gives mako it's power to
- provide reusable templates.
- </p>
- <p>But um, whats that 'local:' stuff about? </p>
- <p>
- Well, TG wants to provide re-usable components like tgext.admin, and also
- provide a way for you to use your default site layouts. This is done
- easily by providing a shortcut to the namespace of your project, so the
- component template finder can find <strong>your</strong> master.html and format
- itself the way you want it to.
- </p>
- <p> The next thing about.mak does is to create a function called title()
- which provides the title for the document. This overrides the title
- method provided by master.mak, and therefore, when the template
- is rendered, it will use the title provided by this funciton.
-
- <p>
- Next, there are a couple of calls to the master template to set up the
- boxes you see in the page over on the right, We'll examine what
- these are in the master template in a second. Finally, we get to the meat
- of the document, and that's pretty much all about.mak does
- </p>
-
- <p> <strong><span class="code">master.mak</span></strong> -
- This template provides the overall layout for your project, and
- allows you to override different elements of the overall structure
- of your default look-and-feel. Let's take a look at this template
- from top to bottom again.</p>
- <p>The first 15 lines provide an overall layout for the document,
- with definitions for the header, title and body. Each one of these
- sections has been turned into a method that you can change within your
- child templates, but you do not have to provide any single one of them
- TurboGears extensions may however expect these methods to be provided
- to display their content properly. Keep this in mind if you decide
- to alter your master.mak. You are of course always free to modify
- your master template, but doing so can render your extensions useless,
- so tread carefully.</p>
-
- <p> The next section describes the overall layout for the body of the
- document, with flash messages appearing at the top, and self.body()
- appearing at the bottom. self.body will take whatever is not defined
- as a method in your child template and render it in this space. This
- is really useful because it allows you to be freestyle with your
- body definition. If you don't want to override any of the master
- template defines, all you have to do is inherit the master, and then
- provide the code you want to appear surrounded by your header and footer.
- </p>
-
- <p>
- Next are the title, header, footer and sidebar defines. These are all of
- course overriddable.
- </p>
-
- <p>The final define sets up the menubar. This provides some links,
- as well as a way of highlighing the page you are currently on.
- </p>
- </li>
- </ol>
- <p>Good luck with TurboGears 2!</p>
-</div
+
+ <p>A web page viewed by user could be constructed by single or several reusable
+ templates under <code>/templates</code>. Take 'about' page for example, each
+ reusable templates generating a part of the page. We'll cover them in the order of
+ where they are found, listed near the top of the about.html template</p>
+
+ <div class="row">
+ <div class="span6">
+ <p><strong><span class="label label-info">header.html</span></strong> - The
+ "header.html" template contains the HTML code to display the 'header': The div,
+ the h1 tag, and the subtitle are there, and the the blue gradient, TG2 logo,
+ are placed by way of the .css file (from style.css) are all at the top of every
+ page it is included on. When the "about.html" template is called, it includes
+ this "header.html" template (and the others) with a <code>&lt;xi:include
+ /&gt;</code> tag, part of the Genshi templating system. The "header.html"
+ template is not a completely static HTML -- it also includes (via
+ <code>&lt;xi:include/&gt;</code> tag) "master.html", which dynamically displays
+ the current page name with a Genshi template method called "replace" with the
+ code: <code>&lt;span py:replace="page"/&gt;</code>. It means replace this
+ <code>&lt;span /&gt;</code> region with the contents found in the variable
+ 'page' that has been sent in the dictionary to this "about.html" template, and
+ is available through that namespace for use by this "header.html" template.
+ That's how it changes in the header depending on what page you are
+ visiting.</p>
+
+ <p><strong><span class="label label-info">sidebars.html</span></strong> - The
+ sidebars (navigation areas on the right side of the page) are generated as two
+ separate <code>py:def</code> blocks in the "sidebars.html" template. The
+ <code>py:def</code> construct is best thought of as a "macro" code... a simple
+ way to separate and reuse common code snippets. All it takes to include these
+ on the "about.html" page template is to write</p>
+ <pre><span>$</span>{sidebar_top()}
+<span>$</span>{sidebar_bottom()}
+ </pre>in the page where they are wanted. CSS styling (in "/public/css/style.css") floats
+ them off to the right side. You can remove a sidebar or add more of them, and the CSS
+ will place them one atop the other.
+
+ <p>This is, of course, also exactly how the header and footer templates are
+ also displayed in their proper places, but we'll cover that in the
+ "master.html" template below.</p>
+
+ <p>Oh, and in sidebar_top we've added a dynamic menu that shows the link to
+ this page at the top when you're at the "index" page, and shows a link to the
+ Home (index) page when you're here. Study the "sidebars.html" template to see
+ how we used <code>py:choose</code> for that.</p>
+ </div>
+
+ <div class="span6">
+ <p><strong><span class="label label-info">footer.html</span></strong> - The
+ "footer.html" block is simple, but also utilizes a special "replace" method to
+ set the current YEAR in the footer copyright message. The code is:</p>
+ <pre>
+ &lt;span py:replace="now.strftime('%Y')"&gt;
+ </pre>and it uses the variable "now" that was passed in with the dictionary of variables.
+ But because "now" is a datetime object, we can use the Python <code>"strftime()"</code>
+ method with the "replace" call to say "Just Display The Year Here". Simple, elegant; we
+ format the date display in the template (the View in the Model/View/Controller
+ architecture) rather than formatting it in the Controller method and sending it to the
+ template as a string variable.
+
+ <p><strong><span class="label label-info">master.html</span></strong> - The
+ "master.html" template is called last, by design. The "master.html" template
+ controls the overall design of the page we're looking at, calling first the
+ "header" py:def macro, then the putting everything from this "about.html"
+ template into the "main_content" div, and then calling the "footer" macro at
+ the end. Thus the "master.html" template provides the overall architecture for
+ each page in this site.</p>
+
+ <p>But why then shouldn't we call it first? Isn't it the most important?
+ Perhaps, but that's precisely why we call it LAST. The "master.html" template
+ needs to know where to find everything else, everything that it will use in
+ py:def macros to build the page. So that means we call the other templates
+ first, and then call "master.html".</p>
+
+ <p>There's more to the "master.html" template... study it to see how the
+ &lt;title&gt; tags and static JS and CSS files are brought into the page.
+ Templating with Genshi is a powerful tool and we've only scratched the surface.
+ There are also a few little CSS tricks hidden in these pages, like the use of a
+ "clearingdiv" to make sure that your footer stays below the sidebars and always
+ looks right. That's not TG2 at work, just CSS. You'll need all your skills to
+ build a fine web app, but TG2 will make the hard parts easier so that you can
+ concentrate more on good design and content rather than struggling with
+ mechanics.</p>
+ </div>
+
+ <div class="span12" id="authentication" py:if="tg.auth_stack_enabled">
+ <h3>Authentication &amp; Authorization in a TG2 site.</h3>
+
+ <p>If you have access to this page, this means you have enabled authentication
+ and authorization in the quickstart to create your project.</p>
+
+ <p>The paster command will have created a few specific controllers for you. But
+ before you go to play with those controllers you'll need to make sure your
+ application has been properly bootstapped. This is dead easy, here is how to do
+ this:</p>
+ <pre>paster setup-app development.ini</pre>
+
+ <p>inside your application's folder and you'll get a database setup (using the
+ preferences you have set in your development.ini file). This database will also
+ have been prepopulated with some default logins/passwords so that you can test
+ the secured controllers and methods.</p>
+
+ <p>To change the comportement of this setup-app command you just need to edit
+ the <code>websetup.py</code> file.</p>
+
+ <p>Now try to visiting the <a href=
+ "${tg.url('/manage_permission_only')}">manage_permission_only</a> URL. You will
+ be challenged with a login/password form.</p>
+
+ <p>Only managers are authorized to visit this method. You will need to log-in
+ using:</p>
+ <pre>login: manager
+password: managepass</pre>
+
+ <p>Another protected resource is <a href=
+ "${tg.url('/editor_user_only')}">editor_user_only</a>. This one is protected by
+ a different set of permissions. You will need to be <code>editor</code> with a
+ password of <code>editpass</code> to be able to access it.</p>
+
+ <p>The last kind of protected resource in this quickstarted app is a full so
+ called <a href="${tg.url('/secc')}">secure controller</a>. This controller is
+ protected globally. Instead of having a @require decorator on each method, we
+ have set an allow_only attribute at the class level. All the methods in this
+ controller will require the same level of access. You need to be manager to
+ access <a href="${tg.url('/secc')}">secc</a> or <a href=
+ "${tg.url('/secc/some_where')}">secc/some_where</a>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
View
54 devtools/commands/quickstart_mako/authentication.mak
@@ -1,54 +0,0 @@
-<%inherit file="local:templates.master"/>
-<%def name="title()">Learning TurboGears 2.1: Quick guide to authentication.</%def>
-
-${parent.sidebar_top()}
-${parent.sidebar_bottom()}
- <div id="getting_started">
- <h2>Authentication &amp; Authorization in a TG2 site.</h2>
- <p>If you have access to this page, this means you have enabled authentication and authorization
- in the quickstart to create your project.</p>
- <p>
- The paster command will have created a few specific controllers for you. But before you
- go to play with those controllers you'll need to make sure your application has been
- properly bootstapped.
- This is dead easy, here is how to do this:
- </p>
-
- <span class="code">
- paster setup-app development.ini
- </span>
-
- <p>
- inside your application's folder and you'll get a database setup (using the preferences you have
- set in your development.ini file). This database will also have been prepopulated with some
- default logins/passwords so that you can test the secured controllers and methods.
- </p>
- <p>
- To change the comportement of this setup-app command you just need to edit the <span class="code">websetup.py</span> file.
- </p>
- <p>
- Now try to visiting the <a href="${tg.url('/manage_permission_only')}">manage_permission_only</a> URL. You will be challenged with a login/password form.
- </p>
- <p>
- Only managers are authorized to visit this method. You will need to log-in using:
- <p>
- <span class="code">
- login: manager
- </span>
- </p>
- <p>
- <span class="code">
- password: managepass
- </span>
- </p>
- </p>
- <p>
- Another protected resource is <a href="${tg.url('/editor_user_only')}">editor_user_only</a>. This one is protected by a different set of permissions.
- You will need to be <span class="code">editor</span> with a password of <span class="code">editpass</span> to be able to access it.
- </p>
- <p>
- The last kind of protected resource in this quickstarted app is a full so called <a href="${tg.url('/secc')}">secure controller</a>. This controller is protected globally.
- Instead of having a @require decorator on each method, we have set an allow_only attribute at the class level. All the methods in this controller will
- require the same level of access. You need to be manager to access <a href="${tg.url('/secc')}">secc</a> or <a href="${tg.url('/secc/some_where')}">secc/some_where</a>.
- </p>
- </div>
View
12 devtools/commands/quickstart_mako/data.mak
@@ -4,8 +4,6 @@
Welcome to TurboGears 2.1, standing on the shoulders of giants, since 2007
</%def>
-${parent.sidebar_top()}
-
<h2>Content Type Dispatch</h2>
<p>
This page shows how you can provide multiple pages
@@ -20,12 +18,10 @@ the entries as JSON. Here, try it out: <a href="/data.html?a=1&b=2">/data.html?
<p>The data provided in the template call is:
<table>
%for key, value in params.iteritems():
- <tr>
- <td>${key}</td>
- <td>${value}</td>
- </tr>
+ <tr>
+ <td>${key}</td>
+ <td>${value}</td>
+ </tr>
%endfor
</table>
-
-<%def name="sidebar_bottom()"></%def>
View
5 devtools/commands/quickstart_mako/environ.mak
@@ -4,14 +4,13 @@
Learning TurboGears 2.1: Information about TG and WSGI
</%def>
-${parent.sidebar_top()}
<h2>The WSGI nature of the framework</h2>
<p>In this page you can see all the WSGI variables your request object has,
the ones in capital letters are required by the spec, then a sorted by
component list of variables provided by the Components, and at last
the "wsgi." namespace with very useful information about your WSGI Server</p>
<p>The keys in the environment are:
- <table>
+ <table class="table">
%for key in sorted(environment):
<tr>
<td>${key}</td>
@@ -22,5 +21,3 @@ ${parent.sidebar_top()}
</p>
-
-<%def name="sidebar_bottom()"></%def>
View
8 devtools/commands/quickstart_mako/header.mak
@@ -1,8 +0,0 @@
-<%def name="header()">
- <div id="header">
- <h1>
- Welcome to TurboGears 2
- <span class="subtitle">The Python web metaframework</span>
- </h1>
- </div>
-</%def>
View
53 devtools/commands/quickstart_mako/index.mak
@@ -4,29 +4,42 @@
Welcome to TurboGears 2.1, standing on the shoulders of giants, since 2007
</%def>
-${parent.sidebar_top()}
+ <div class="row">
+ <div class="span8 hidden-phone hidden-tablet">
+ <div class="hero-unit">
+ <h1>Welcome to TurboGears 2.1</h1>
+ <p>If you see this page it means your installation was successful!</p>
+ <p>TurboGears 2 is rapid web application development toolkit designed to make your life easier.</p>
+ <p>
+ <a class="btn btn-primary btn-large" href="http://www.turbogears.org" target="_blank">
+ ${h.icon('book', True)} Learn more
+ </a>
+ </p>
+ </div>
+ </div>
+ <div class="span4">
+ <a class="btn btn-small" href="http://www.turbogears.org/2.1/docs/">${h.icon('book')} TG2 Documents</a> <span class="label label-success">new</span> Read everything in the Getting Started section<br/>
+ <a class="btn btn-small" href="http://docs.turbogears.org/1.0">${h.icon('book')} TG1 Documents</a> (still useful, although a lot has changed for TG2)<br/>
+ <a class="btn btn-small" href="http://groups.google.com/group/turbogears">${h.icon('comment')} Join the Mail List</a> for general TG use/topics
+ </div>
+ </div>
-<div id="getting_started">
- <h2>Presentation</h2>
- <p>TurboGears 2 is rapid web application development toolkit designed to make your life easier.</p>
- <ol id="getting_started_steps">
- <li class="getting_started">
+ <div class="row">
+ <div class="span4">
<h3>Code your data model</h3>
- <p> Design your data model, Create the database, and Add some bootstrap data.</p>
- </li>
- <li class="getting_started">
+ <p> Design your data <code>model</code>, Create the database, and Add some bootstrap data.</p>
+ </div>
+
+ <div class="span4">
<h3>Design your URL architecture</h3>
- <p> Decide your URLs, Program your controller methods, Design your
- templates, and place some static files (CSS and/or JavaScript). </p>
- </li>
- <li class="getting_started">
+ <p> Decide your URLs, Program your <code>controller</code> methods, Design your
+ <code>templates</code>, and place some static files (CSS and/or Javascript). </p>
+ </div>
+
+ <div class="span4">
<h3>Distribute your app</h3>
<p> Test your source, Generate project documents, Build a distribution.</p>
- </li>
- </ol>
-</div>
-<div class="clearingdiv" />
-<div class="notice"> Thank you for choosing TurboGears.
-</div>
+ </div>
+ </div>
-<%def name="sidebar_bottom()"></%def>
+ <div class="notice"> Thank you for choosing TurboGears.</div>
View
146 devtools/commands/quickstart_mako/master.mak
@@ -1,117 +1,73 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html>
<html>
<head>
${self.meta()}
<title>${self.title()}</title>
- <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/style.css')}" />
- <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/admin.css')}" />
+ <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/bootstrap.min.css')}" />
+ <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/bootstrap-responsive.min.css')}" />
+ <style>
+ .footer { margin-top: 45px; padding: 35px 0 36px; border-top: 1px solid #e5e5e5; }
+ .footer p { margin-bottom: 0; color: #555; }
+ </style>
</head>
<body class="${self.body_class()}">
- ${self.header()}
- ${self.main_menu()}
- ${self.content_wrapper()}
- ${self.footer()}
+ <div class="container">
+ ${self.main_menu()}
+ ${self.content_wrapper()}
+ ${self.footer()}
+ </div>
</body>
<%def name="content_wrapper()">
- <div id="content">
- <div>
- % if page:
- <div class="currentpage">
- Now Viewing: <span>${page}</page>
- </div>
- % endif
- <%
- flash=tg.flash_obj.render('flash', use_js=False)
- %>
- % if flash:
- ${flash | n}
- % endif
- ${self.body()}
- </div>
+ <%
+ flash=tg.flash_obj.render('flash', use_js=False)
+ %>
+ % if flash:
+ <div class="row"><div class="span8 offset2">
+ ${flash | n}
+ </div></div>
+ % endif
+ ${self.body()}
</%def>
-<%def name="body_class()">
-</%def>
+<%def name="body_class()"></%def>
<%def name="meta()">
- <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <meta charset="utf-8" />
</%def>
<%def name="title()"> </%def>
-<%def name="sidebar_top()">
- <div id="sb_top" class="sidebar">
- <h2>Get Started with TG2</h2>
- <ul class="links">
- <li>
- % if page == 'index':
- <span><a href="${tg.url('/about')}">About this page</a> A quick guide to this TG2 site </span>
- % else:
- <span><a href="${tg.url('/')}">Home</a> Back to your Quickstart Home page </span>
- % endif
- </li>
- <li><a href="http://www.turbogears.org/2.1/docs/">TG2 Documents</a> - Read everything in the Getting Started section</li>
- <li><a href="http://docs.turbogears.org/1.0">TG1 docs</a> (still useful, although a lot has changed for TG2) </li>
- <li><a href="http://groups.google.com/group/turbogears"> Join the TG Mail List</a> for general TG use/topics </li>
- </ul>
- </div>
-</%def>
-
-<%def name="sidebar_bottom()">
- <div id="sb_bottom" class="sidebar">
- <h2>Developing TG2</h2>
- <ul class="links">
- <li><a href="http://trac.turbogears.org/query?status=new&amp;status=assigned&amp;status=reopened&amp;group=type&amp;milestone=2.1&amp;order=priority">TG2 Trac tickets</a> What's happening now in TG2 development</li>
- <li><a href="http://trac.turbogears.org/timeline">TG Dev timeline</a> (recent ticket updates, svn checkins, wiki changes)</li>
- <li><a href="http://svn.turbogears.org/trunk">TG2 SVN repository</a> For checking out a copy</li>
- <li><a href="http://turbogears.org/2.1/docs/main/Contributing.html#installing-the-development-version-of-turbogears-2-from-source">Follow these instructions</a> For installing your copy</li>
- <li><a href="http://trac.turbogears.org/browser/trunk">TG2 Trac's svn view</a> In case you need a quick look</li>
- <li><a href="http://groups.google.com/group/turbogears-trunk"> Join the TG-Trunk Mail List</a> for TG2 discuss/dev </li>
- </ul>
- </div>
-</%def>
-<%def name="header()">
- <div id="header">
- <h1>
- Welcome to TurboGears 2
- <span class="subtitle">The Python web metaframework</span>
- </h1>
- </div>
-</%def>
<%def name="footer()">
- <div class="flogo">
- <img src="${tg.url('/images/under_the_hood_blue.png')}" alt="TurboGears" />
- <p><a href="http://www.turbogears.org/">Powered by TurboGears 2</a></p>
- </div>
- <div class="foottext">
- <p>TurboGears is a open source front-to-back web development
- framework written in Python. Copyright (c) 2005-2009 </p>
- </div>
- <div class="clearingdiv"></div>
-</div>
+ <footer class="footer hidden-tablet hidden-phone">
+ <a class="pull-right" href="http://www.turbogears.org/2.1/"><img style="vertical-align:middle;" src="${tg.url('/images/under_the_hood_blue.png')}" alt="TurboGears 2" /></a>
+ <p>Copyright &copy; ${getattr(tmpl_context, 'project_name', 'turbogears2')} ${h.current_year()}</p>
+ </footer>
</%def>
+
<%def name="main_menu()">
- <ul id="mainmenu">
- <li class="first"><a href="${tg.url('/')}" class="${('', 'active')[page=='index']}">Welcome</a></li>
- <li><a href="${tg.url('/about')}" class="${('', 'active')[page=='about']}">About</a></li>
- <li><a href="${tg.url('/environ')}" class="${('', 'active')[page=='environ']}">WSGI Environment</a></li>
- <li><a href="${tg.url('/data')}" class="${('', 'active')[page=='data']}">Content-Types</a></li>
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="#"><img src="${tg.url('/images/turbogears_logo.png')}" alt="TurboGears 2"/> ${getattr(tmpl_context, 'project_name', 'turbogears2')}</a>
+ <ul class="nav">
+ <li class="${('', 'active')[page=='index']}"><a href="${tg.url('/')}">Welcome</a></li>
+ <li class="${('', 'active')[page=='about']}"><a href="${tg.url('/about')}">About</a></li>
+ <li class="${('', 'active')[page=='environ']}"><a href="${tg.url('/environ')}">WSGI Environment</a></li>
+ </ul>
- % if tg.auth_stack_enabled:
- <li><a href="${tg.url('/auth')}" class="${('', 'active')[page=='auth']}">Authentication</a></li>
- % endif
- <li><a href="http://groups.google.com/group/turbogears">Contact</a></li>
- % if tg.auth_stack_enabled:
- <span>
- % if not request.identity:
- <li id="login" class="loginlogout"><a href="${tg.url('/login')}">Login</a></li>
- % else:
- <li id="login" class="loginlogout"><a href="${tg.url('/logout_handler')}">Logout</a></li>
- <li id="admin" class="loginlogout"><a href="${tg.url('/admin')}">Admin</a></li>
- % endif
- </span>
- % endif
- </ul>
+ % if tg.auth_stack_enabled:
+ <ul class="nav pull-right">
+ % if not request.identity:
+ <li><a href="${tg.url('/login')}">Login</a></li>
+ % else:
+ <li><a href="${tg.url('/logout_handler')}">Logout</a></li>
+ <li><a href="${tg.url('/admin')}">Admin</a></li>
+ % endif
+ </ul>
+ % endif
+ </div>
+ </div>
+ </div>
</%def>
+
</html>
View
6 devtools/commands/quickstart_mako/movie.mak
@@ -1,6 +0,0 @@
-<%inherit file="local:templates.master"/>
-
-<%def name="content()">
-${tmpl_context.form() |n}
-
-</%def>

0 comments on commit 54270fe

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