Changeset - fec7d0707e72
[Not reviewed]
default
1 6 1
Marcin Kuzminski - 15 years ago 2010-05-21 20:27:28
marcin@python-works.com
fixed html in admin templates. Litle refactors
7 files changed with 4 insertions and 15 deletions:
0 comments (0 inline, 0 general)
pylons_app/templates/admin/admin.html
Show inline comments
 
## -*- 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'))}
 
	 / 
 
	${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>
 
\ No newline at end of file
pylons_app/templates/admin/repos/repo_add.html
Show inline comments
 
file renamed from pylons_app/templates/admin/add.html to pylons_app/templates/admin/repos/repo_add.html
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Add new repository')}
 
</%def>
 

	
 
<%def name="breadcrumbs()">
 
	${h.link_to(u'Home',h.url('/'))}
 
	${h.link_to(u'Admin',h.url('admin_home'))}
 
	 / 
 
	${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()">
 
     <table cellspacing="0">
 
        <tr>
 
            <td><h1>${c.msg}</h1></td>
 
        </tr>
 
        <tr>
 
            <td><h2>${c.new_repo}</h2></td>
 
        </tr>
 
    </table>   
 
</%def>
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
pylons_app/templates/admin/repos/repo_edit.html
Show inline comments
 
<%inherit file="base/base.html"/>
 
<%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'))}
 
    /
 
    ${h.link_to(u'Repos managment',h.url('repos'))}
 
</%def>
 
<%def name="page_nav()">
 
	<li>${h.link_to(u'Home',h.url('/'))}</li>
 
	<li class="current">${_('Admin')}</li>
 
</%def>
 
<%def name="main()">
 
    <ul class="submenu">
 
        <li class="current_submenu">
 
            ${h.link_to(u'Repos',h.url('repos'))}
 
        </li>
 
        <li>
 
            ${h.link_to(u'Users',h.url('users'))}
 
        </li>
 
    </ul>
 
	<div>
 
        <h2>${_('Mercurial repos')}</h2>
 
    </div>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/admin/repos/repos.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%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'))}
 
    /
 
    ${h.link_to(u'Repos managment',h.url('repos'))}
 
</%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()">
 
    <ul class="submenu">
 
        <li>
 
            ${h.link_to(u'Repos',h.url('repos'), class_="current_submenu")}
 
        </li>
 
        <li>
 
            ${h.link_to(u'Users',h.url('users'))}
 
        </li>
 
    </ul>
 
	<div>
 
        <h2>${_('Mercurial repos')}</h2>
 
        <table>
 
	        %for cnt,repo in enumerate(c.repos_list):
 
	 		<tr class="parity${cnt%2}">
 
			    <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
 
		        <td>r${repo['rev']}:${repo['tip']}</td>
 
                <td>
 
                  ${h.form(url('repo', id=repo['name']),method='delete')}
 
                  	${h.submit('remove','remove',class_="submit",onclick="return confirm('Confirm to delete this repository');")}
 
                  ${h.end_form()}
 
     			</td>
 
			</tr>
 
			%endfor
 
		</table>
 
    </div>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/admin/users/user_add.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('User')} - ${_('add new')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(u'Admin',h.url('admin_home'))}
 
    /
 
    ${h.link_to(u'Users',h.url('users'))}
 
</%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()">
 
    <ul class="submenu">
 
        <li>
 
            ${h.link_to(u'Repos',h.url('repos'))}
 
        </li>
 
        <li class="current_submenu">
 
            ${h.link_to(u'Users',h.url('users'))}
 
        </li>
 
    </ul>
 
	<div>
 
        <h2>${_('User')} - ${_('add new')}</h2>
 
        ${h.form(url('users'))}
 
        <table>
 
        	<tr>
 
        		<td>${_('Username')}</td>
 
        		<td>${h.text('username')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('password')}</td>
 
        		<td>${h.text('password')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('Active')}</td>
 
        		<td>${h.checkbox('active')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td></td>
 
        		<td>${h.submit('add','add')}</td>
 
        	</tr>
 
        	        	        	
 
        </table>
 
        	
 
        ${h.end_form()}
 
    </div>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/admin/users/user_edit.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('User')} - ${c.user.username}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(u'Admin',h.url('admin_home'))}
 
    /
 
    ${h.link_to(u'Users',h.url('users'))}
 
</%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()">
 
    <ul class="submenu">
 
        <li>
 
            ${h.link_to(u'Repos',h.url('repos'))}
 
        </li>
 
        <li class="current_submenu">
 
            ${h.link_to(u'Users',h.url('users'))}
 
        </li>
 
    </ul>
 
	<div>
 
        <h2>${_('User')} - ${c.user.username}</h2>
 
        ${h.form(url('user', id=c.user.user_id),method='put')}
 
        <table>
 
        	<tr>
 
        		<td>${_('Username')}</td>
 
        		<td>${h.text('username')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('New password')}</td>
 
        		<td>${h.text('new_password')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('Active')}</td>
 
        		<td>${h.checkbox('active',value=True)}</td>
 
        	</tr>
 
        	<tr>
 
        		<td></td>
 
        		<td>${h.submit('save','save')}</td>
 
        	</tr>
 
        	        	        	
 
        </table>
 
        	
 
        ${h.end_form()}
 
    </div>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/admin/users/users.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('Repository managment')}
 
    ${_('Users managment')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(u'Admin',h.url('admin_home'))}
 
    /
 
    ${h.link_to(u'Users managment',h.url('users'))}
 
</%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()">
 
    <ul class="submenu">
 
        <li>
 
            ${h.link_to(u'Repos',h.url('repos'))}
 
        </li>
 
        <li>
 
            ${h.link_to(u'Users',h.url('users'), class_="current_submenu")}
 
        </li>
 
    </ul>
 
	<div>
 
        <h2>${_('Mercurial users')}</h2>
 
        <table>
 
         <tr>
 
            <th>Id</th>
 
            <th>Username</th>
 
            <th>Active</th>
 
            <th>Admin</th>
 
            <th>Action</th>
 
         </tr>
 
            %for user in c.users_list:
 
                <tr>
 
                    <td>${user.user_id}</td>
 
                    <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td>
 
                    <td>${user.active}</td>
 
                    <td>${user.admin}</td>
 
                    <td>
 
	                    ${h.form(url('user', id=user.user_id),method='delete')}
 
	                    	${h.submit('remove','remove',class_="submit")}
 
	                    ${h.end_form()}
 
        			</td>
 
                </tr>
 
            %endfor
 
        </table>
 
        <h3>${h.link_to(u'Add user',h.url('new_user'))}</h3>        
 
    </div>
 

	
 
</%def>    
 
\ No newline at end of file
0 comments (0 inline, 0 general)