view pylons_app/templates/admin/admin.html @ 159:96285f905073

fixed bug in admin template
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 17 May 2010 03:06:12 +0200
parents 20dc7a5eb748
children fec7d0707e72
line wrap: on
line source

## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
 <%def name="get_form_error(element)">
 	%if hasattr(c,'form_errors'):
	    %if type(c.form_errors) == dict:
	        %if c.form_errors.get(element,False):
	            <span class="error-message">
	                ${c.form_errors.get(element,'')}
	            </span>
	        %endif
	    %endif
	%endif           
 </%def>
<%def name="title()">
    ${_('Repository managment')}
</%def>
<%def name="breadcrumbs()">
	${h.link_to(u'Home',h.url('/'))}
	 / 
	${h.link_to(u'Admin',h.url('admin_home'))}
</%def>
<%def name="page_nav()">
<ul class="page-nav">
	<li>${h.link_to(u'Home',h.url('/'))}</li>
	<li class="current">${_('Admin')}</li>
</ul>
</%def>
<%def name="main()">
    %if c.admin_user:
    <ul class="submenu">
        <li>
            ${h.link_to(u'Repos',h.url('repos'))}
        </li>
        <li>
            ${h.link_to(u'Users',h.url('users'))}
        </li>
    </ul>
    <br/>
    <div>
        <h2>Welcome ${c.admin_username}</h2>
		    <div id="user_log">
				${c.log_data}
			</div>
    </div>
    %else:
        <div>
        <br />
        <h2>${_('Login')}</h2>
        ${h.form(h.url.current())}
        <table>
            <tr>
                <td>${_('Username')}</td>
                <td>${h.text('username')}</td>
                <td>${get_form_error('username')} </td>
            </tr>
            <tr>
                <td>${_('Password')}</td>
                <td>${h.password('password')}</td>
                <td>${get_form_error('password')}</td> 
            </tr>
            <tr>
                <td></td>
                <td>${h.submit('login','login')}</td>
            </tr>            
        </table>
        ${h.end_form()}
        </div>
    %endif
    
</%def>