Changeset 84ed773


Ignore:
Timestamp:
Feb 23, 2009, 4:26:36 PM (16 years ago)
Author:
Edward Z. Yang <edwardzyang@…>
Branches:
master, debian, mac, no-cups, web
Children:
77aa4c8
Parents:
973dd91
git-author:
Edward Z. Yang <edwardzyang@…> (02/23/09 16:26:36)
git-committer:
Edward Z. Yang <edwardzyang@…> (02/23/09 16:26:36)
Message:

Remove scaffolding we don't know, implement volume output.

Signed-off-by: Edward Z. Yang <edwardzyang@…>

Location:
gutenbach-web
Files:
1 added
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • gutenbach-web/footer.html

    r973dd91 r84ed773  
    55<div id="footer">
    66  <div class="flogo">
    7     <img src="${tg.url('/images/under_the_hood_blue.png')}" alt="TurboGears" />
    87    <p><a href="http://www.turbogears.org/2.0/">Powered by TurboGears 2</a></p>
    9   </div>
    10   <div class="foottext">
    11     <p>TurboGears is a open source front-to-back web development
    12       framework written in Python. Copyright (c) 2005-2008 </p>
    138  </div>
    149  <div class="clearingdiv"></div>
  • gutenbach-web/header.html

    r973dd91 r84ed773  
    55  <div id="header">
    66        <h1>
    7                 Welcome to TurboGears 2
    8                 <span class="subtitle">The Python web metaframework</span>
     7                sipbmp3 web
    98        </h1>
     9                <div class="subtitle">what's playing?</div>
    1010  </div>
    1111</py:def>
  • gutenbach-web/index.html

    r973dd91 r84ed773  
    99<head>
    1010  <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
    11   <title>Welcome to TurboGears 2.0, standing on the
    12   shoulders of giants, since 2007</title>
     11  <title>sipbmp3 web</title>
    1312</head>
    1413
    1514<body>
    16     ${sidebar_top()}
    17   <div id="getting_started">
    18     <h2>Presentation</h2>
    19     <p>TurboGears 2 is rapid web application development toolkit designed to make your life easier.</p>
    20     <ol id="getting_started_steps">
    21       <li class="getting_started">
    22         <h3>Code your data model</h3>
    23         <p> Design your data model, Create the database, and Add some bootstrap data.</p>
    24       </li>
    25       <li class="getting_started">
    26         <h3>Design your URL architecture</h3>
    27         <p> Decide your URLs, Program your controller methods, Design your
    28             templates, and place some static files (CSS and/or JavaScript). </p>
    29       </li>
    30       <li class="getting_started">
    31         <h3>Distribute your app</h3>
    32         <p> Test your source, Generate project documents, Build a distribution.</p>
    33       </li>
    34     </ol>
    35   </div>
    36   <div class="clearingdiv" />
    37   <div class="notice"> Thank you for choosing TurboGears.
    38   </div>
     15    <div id="status">
     16        <h2>Status</h2>
     17        <p>The volume is: $volume</p>
     18    </div>
     19    <div class="clearingdiv" />
    3920</body>
    4021</html>
  • gutenbach-web/master.html

    r973dd91 r84ed773  
    66      py:strip="">
    77    <xi:include href="header.html" />
    8     <xi:include href="sidebars.html" />
    98    <xi:include href="footer.html" />
    109<head py:match="head" py:attrs="select('@*')">
     
    2019    <li class="first"><a href="${tg.url('/')}" class="${('', 'active')[defined('page') and page==page=='index']}">Welcome</a></li>
    2120        <li><a href="${tg.url('/about')}" class="${('', 'active')[defined('page') and page==page=='about']}">About</a></li>
    22         <li py:if="tg.auth_stack_enabled"><a href="${tg.url('/auth')}" class="${('', 'active')[defined('page') and page==page=='auth']}">Authentication</a></li>
    2321        <li><a href="http://groups.google.com/group/turbogears">Contact</a></li>
    24     <span py:if="tg.auth_stack_enabled" py:strip="True">
    25         <li py:if="not request.identity" id="login" class="loginlogout"><a href="${tg.url('/login')}">Login</a></li>
    26         <li py:if="request.identity" id="login" class="loginlogout"><a href="${tg.url('/logout_handler')}">Logout</a></li>
    27         <li py:if="request.identity" id="admin" class="loginlogout"><a href="${tg.url('/admin')}">Admin</a></li>
    28     </span>
    2922  </ul>
    3023  <div id="content">
    31     <py:if test="defined('page')">
    32     <div class="currentpage">
    33      Now Viewing: <span py:replace="page"/>
    34      </div>
    35     </py:if>
    3624    <py:with vars="flash=tg.flash_obj.render('flash', use_js=False)">
    3725        <div py:if="flash" py:content="XML(flash)" />
  • gutenbach-web/root.py

    r973dd91 r84ed773  
    1010from repoze.what import predicates
    1111from sipbmp3web.controllers.secure import SecureController
     12from remctl import remctl
    1213
    1314class RootController(BaseController):
     
    1718    @expose('sipbmp3web.templates.index')
    1819    def index(self):
    19         return dict(page='index')
     20        out = dict()
     21        out["volume"] = remctl("zsr", command=["v", "get"]).stdout
     22        return out
    2023
    2124    @expose('sipbmp3web.templates.about')
    2225    def about(self):
    23         return dict(page='about')
     26        return dict()
    2427
    25     @expose('sipbmp3web.templates.authentication')
    26     def auth(self):
    27         return dict(page='auth')
    28 
    29     @expose('sipbmp3web.templates.index')
    30     @require(predicates.has_permission('manage', msg=_('Only for managers')))
    31     def manage_permission_only(self, **kw):
    32         return dict(page='managers stuff')
    33 
    34     @expose('sipbmp3web.templates.index')
    35     @require(predicates.is_user('editor', msg=_('Only for the editor')))
    36     def editor_user_only(self, **kw):
    37         return dict(page='editor stuff')
    38 
    39     @expose('sipbmp3web.templates.login')
    40     def login(self, came_from=url('/')):
    41         login_counter = request.environ['repoze.who.logins']
    42         if login_counter > 0:
    43             flash(_('Wrong credentials'), 'warning')
    44         return dict(page='login', login_counter=str(login_counter),
    45                     came_from=came_from)
    46 
    47     @expose()
    48     def post_login(self, came_from=url('/')):
    49         if not request.identity:
    50             login_counter = request.environ['repoze.who.logins'] + 1
    51             redirect(url('/login', came_from=came_from, __logins=login_counter))
    52         userid = request.identity['repoze.who.userid']
    53         flash(_('Welcome back, %s!') % userid)
    54         redirect(came_from)
    55 
    56     @expose()
    57     def post_logout(self, came_from=url('/')):
    58         flash(_('We hope to see you soon!'))
    59         redirect(came_from)
  • gutenbach-web/style.css

    r973dd91 r84ed773  
    1 html {
    2         background: #555555 url('../images/pagebg.png') top left repeat-x;
    3         text-align: center;
    4         margin: 0;
    5         padding: 0;
    6 }
    71
    8 body {
    9         text-align: left;
    10         width: 960px;
    11         margin: 0 auto;
    12         padding: 0;
    13         font-size: 12px;
    14         font-family:"Lucida Grande","Lucida Sans Unicode",geneva,verdana,sans-serif;
    15 }
    16 
    17 a {
    18         color: #286571;
    19 }
    20 
    21 #header {
    22         height: 132px;
    23         margin: 10px 10px 0 10px;
    24         background: url('../images/headerbg.png') top left no-repeat;
    25 }
    26 
    27 #header h1 {
    28         padding: 0;
    29         margin: 0;
    30         padding-top: 30px;
    31         padding-left: 180px;
    32         color: #fff;
    33         position: relative;
    34         font-size: 36px;
    35 }
    36 
    37 #header h1 .subtitle {
    38         font-size: 60%;
    39         position: absolute;
    40         left: 240px;
    41         top: 70px;
    42 }
    43 
    44 ul#mainmenu {
    45         margin: 0;
    46         padding: 0 10px;
    47         background: url('../images/menubg.png') top left no-repeat;
    48         height: 38px;
    49 }
    50 
    51 ul#mainmenu li {
    52         list-style-type: none;
    53         margin: 0;
    54         padding: 0;
    55         position: relative;
    56         display: inline;
    57         float: left;
    58 }
    59 
    60 ul#mainmenu li a {
    61         color: #fff;
    62         float: left;
    63         height: 31px;
    64         display: block;
    65         line-height: 30px;
    66         vertical-align: middle;
    67         padding: 0 10px;
    68         font-size: 12px;
    69         text-decoration: none;
    70         background: url('../images/menu-item-border.png') left top no-repeat;
    71 }
    72 
    73 ul#mainmenu li a:hover, ul#mainmenu li a.active {
    74         background: url('../images/menu-item-actibg.png') left top no-repeat;
    75 }
    76 
    77 ul#mainmenu li.first a {
    78         background: none;
    79 }
    80 
    81 ul#mainmenu li.first a:hover, ul#mainmenu li.first a.active {
    82         background: url('../images/menu-item-actibg-first.png') left top no-repeat;
    83 }
    84 
    85 ul#mainmenu li.loginlogout
    86 {
    87     float: right;
    88     right: 10px;
    89 }
    90 
    91 ul#mainmenu li.loginlogout a:hover
    92 {
    93     background: url('../images/menu-item-border.png') left top no-repeat;
    94 }
    95 
    96 #content {
    97         background: #fff url('../images/contentbg.png') left bottom no-repeat;
    98         margin : 0 10px 10px 10px;
    99         padding: 0 10px;
    100 }
    101 
    102 #content .currentpage {
    103         margin-top: 0;
    104 }
    105 
    106 /* Login form*/
    107 
    108 #loginform
    109 {
    110     text-align: center;
    111 }
    112 
    113 form.loginfields
    114 {
    115     text-align: left;
    116     width: 270px;
    117     background: url('../images/loginbg.png') top left no-repeat;
    118     padding: 0;
    119     margin: 0 auto;
    120     border: 0;
    121 }
    122 
    123 form.loginfields h2
    124 {
    125     font-size: 16px;
    126     float: left;
    127     padding: 0;
    128     margin: 5px;
    129     margin-top: 0;
    130     background: url('../images/loginheader-left.png') top left no-repeat;
    131 }
    132 
    133 * html form.loginfields h2
    134 {
    135     margin-left: 3px;
    136     width: 80px;
    137     text-align: center;
    138 }
    139 
    140 form.loginfields h2 span
    141 {
    142     background: url('../images/loginheader-right.png') right top no-repeat;
    143     height: 30px;
    144     line-height: 30px;
    145     display: block;
    146     font-size: 100%;
    147     font-weight: normal;
    148     color: #fff;
    149     padding: 0 10px;
    150 }
    151 
    152 *+html form.loginfields h2 span
    153 {
    154     padding: 0 20px;
    155 }
    156 
    157 form.loginfields label
    158 {
    159     clear: left;
    160     float: left;
    161     margin-top: 5px;
    162     margin-left: 10px;
    163     width: 65px;
    164     line-height: 31px;
    165     vertical-align: middle;
    166 }
    167 
    168 form.loginfields input.text
    169 {
    170     float: left;
    171     margin-left: 10px;
    172     margin-top: 5px;
    173     width: 165px;
    174     height: 21px;
    175     padding: 5px;
    176     border: 0;
    177     background: url('../images/inputbg.png') top left no-repeat;
    178     color: #fff;
    179 }
    180 
    181 form.loginfields input#submit
    182 {
    183     background: url('../images/loginbottombg.png') bottom left no-repeat;
    184     width: 270px;
    185     height: 61px;
    186     border: 0;
    187     margin-top: 10px;
    188     color: #fff;
    189     padding: 10px 140px 20px 10px;
    190 }
    191 
    192 * html form.loginfields input#submit
    193 {
    194     clear: both;
    195     margin-left: -10px;
    196 }
    197 
    198 /* Sidebar */
    199 .sidebar {
    200   border: 1px solid #cce;
    201   background-color: #eee;
    202   margin: 0.5em;
    203   margin-left: 1.5em;
    204   padding: 1em;
    205   float: right;
    206   width: 200px;
    207   font-size: 88%;
    208   background-color: #fffe1;
    209   background-repeat:repeat-x;
    210 }
    211 
    212 .sidebar h2 {
    213   margin-top: 0;
    214   color: black;
    215 }
    216 
    217 .sidebar ul {
    218   margin-left: 1.5em;
    219   padding-left: 0;
    220 }
    221 
    222 
    223 
    224 #sb_top {
    225   clear: right;
    226 }
    227 
    228 #sb_bottom {
    229   clear: right;
    230 }
    231 
    232 #getting_started {
    233   margin-left: 20px;
    234 }
    235 
    236 #getting_started_steps a {
    237   text-decoration: none;
    238 }
    239 
    240 #getting_started_steps a:hover {
    241   text-decoration: underline;
    242 }
    243 
    244 #getting_started_steps li {
    245   margin-bottom: 0.5em;
    246 }
    247 
    248 /* Other and footer */
    249 #footer {
    250         background: #fff;
    251         padding: 10px;
    252         color:#888888;
    253         font-size:90%;
    254 }
    255 .flogo {
    256         float:left;
    257         margin-bottom:0px;
    258         padding-left:20px;
    259         padding-right:20px;
    260         padding-top:0px;
    261 }
    262 .foottext p {
    263         margin: 0; padding: 0;
    264 }
    265 .code {
    266 font-family:monospace;
    267 font-size:127%;
    268 }
    269 span.code {
    270 background:#EEEEEE none repeat scroll 0% 0%;
    271 font-weight:bold;
    272 }
    273 #flash {
    274 font-size:120%;
    275 font-weight:bolder;
    276 margin:0pt auto 0.5em;
    277 width:680px;
    278 }
    279 #flash div {
    280 padding:5px 15px 15px 55px;
    281 }
    282 #flash .ok {
    283 background:#EEEEFF url(../images/ok.png) no-repeat scroll left center;
    284 border:1px solid #CCCCEE;
    285 }
    286 #flash .warning {
    287 background:#FF9999 url(../images/error.png) no-repeat scroll left center;
    288 border:1px solid #FF3333;
    289 }
    290 #flash .alert {
    291 background:#FFFF99 url(../images/info.png) no-repeat scroll left center;
    292 border:1px solid #FFFF00;
    293 }
    294 .notice {
    295 background:#EEEEFF url(../images/info.png) no-repeat scroll left center;
    296 border:1px solid #CCCCEE;
    297 margin:0.5em auto;
    298 padding:15px 10px 15px 55px;
    299 width:680px;
    300 }
    301 .fielderror {
    302 color:red;
    303 font-weight:bold;
    304 }
    305 div.clearingdiv {
    306 clear:both;
    307 }
Note: See TracChangeset for help on using the changeset viewer.