Hi,

I decided to go with a different solution and am trying to modify a twitter 
bootstrap tabbable nav html.  But I have a question about it. How do I 
associate the
div id #2 in example below with a web2py url ? I made many attempts but 
haven't made it work yet. Thanks for any suggestions or help.

Margaret

Here is the view I am trying.

{{extend 'layout.welcome.html'}}  <!-- this is the outside menu -->
{{left_sidebar_enabled = globals().get('left_sidebar_enabled',True)}}

<!DOCTYPE html> 
<html lang="en"> 
<head> 
<meta charset="utf-8"> 
<title>Example tabable nav with Twitter Bootstrap</title> 
<meta name="description" content="Example tabable nav with Twitter 
Bootstrap">
<link href="../static/assets/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container" width="100%">
<row class="span9">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#1" data-toggle="tab">Power Production</a></li>
<li class=""><a href="#2" data-toggle="tab">Today's Energy</a></li>
<li class=""><a href="#3" data-toggle="tab">Past Seven Days</a></li>
<li class=""><a href="#4" data-toggle="tab">This Month's Energy</a></li>
<li class=""><a href="#5" data-toggle="tab">Test section</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="1">
<p>Content section 1</p>
 <!-- CONTENT -->
<p>
    {{if 'watts' in globals(): }}
    <h3> {{=watts.tenergy}} W </h3>
    <h6> Today's Peak {{=watts.tenergy}} W </h6>
    
    {{pass }}
 </p>

</div> <!--end of section 1 -->

<div class="tab-pane" id="2" >

<!-- Here are a few attempts below, all had errors -->
<!-- {{LI(A("Today's Energy", _href=URL('addstats','sumstats')}} -->
<!--{{include 'addstats/sumstats.html' }} causes python to quit -->
   <!-- {{=URL('addstats','sumstats')}} shows the path but doesn't load 
anything-->
<!-- how do I link the url with the div id=2, or some other solution? -->

</div>

<div class="tab-pane" id="3">
<p>Content Section 3.</p>
</div>
<div class="tab-pane" id="4">
<p>Content  Section 4.</p>
</div>
<div class="tab-pane" id="5">
<p>Content  Section 5.</p>
<div>
<p>
     {{=watts}} 
      <h3> 
      {{pass}}
</div>
 </p>
</div>
</div>
</div>
</div>
</div>
<script src="../static/assets/js/jquery.js"></script>
<script src="../static/assets/js/bootstrap-tab.js"></script>
</body>
</html>



On Wednesday, May 29, 2013 10:08:45 AM UTC-5, Niphlod wrote:
>
> uhm. a function defined in a controller is not available "globally". it's 
> a mere "structure" to have something that "replies" to a request.
> why can't you "move" that controller function to models ?
> I mean....
>
> in a controller you have
> def yourfunction():
>       return 'a'
>
>
> but in the menu you can't "fetch" that easily.
> The first thing that comes to mind is putting that function in a model, so
> def yourfunction_helper():
>     return 'a'
>
>
> in your menu is now simple to fetch the result, and in your controller you 
> can do
> def yourfunction():
>      return yourfunction_helper()
>
>
>
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to