Changeset - 70c2750531d3
[Not reviewed]
default
0 5 0
Marcin Kuzminski - 15 years ago 2010-09-03 07:34:38
marcin@python-works.com
rewrote sorting on main page, to clickable headers.
Update my account with better repo list
some css fixes
5 files changed with 99 insertions and 91 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/hg.py
Show inline comments
 
@@ -34,24 +34,25 @@ class HgController(BaseController):
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        super(HgController, self).__before__()
 
        
 
    def index(self):
 
        c.current_sort = request.GET.get('sort', 'name')
 
        sort_by = c.current_sort
 
        sortables = ['name', 'description', 'last_change', 'tip', 'contact']
 
        current_sort = request.GET.get('sort', 'name')
 
        current_sort_slug = current_sort.replace('-', '')
 
        
 
        c.cs_slug = sort_by.replace('-', '')
 
        
 
        if c.cs_slug not in sortables:
 
            sort_by = 'name'
 
        
 
        if current_sort_slug not in sortables:
 
            c.sort_by = 'name'
 
            current_sort_slug = c.sort_by
 
        else:
 
            c.sort_by = current_sort
 
        c.sort_slug = current_sort_slug
 
        cached_repo_list = HgModel().get_repos()
 
        
 
        sort_key = c.cs_slug + '_sort'
 
        if sort_by.startswith('-'):
 
        sort_key = current_sort_slug + '_sort'
 
        if c.sort_by.startswith('-'):
 
            c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=True)
 
        else:
 
            c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=False)
 
            
 
        return render('/index.html')
pylons_app/public/css/style.css
Show inline comments
 
@@ -23,12 +23,16 @@ body
 
 
img
 
{
 
	border: none;	
 
}
 
 
img.icon{
 
    vertical-align: bottom;
 
 
}
 
/* -----------------------------------------------------------
 
	anchors
 
----------------------------------------------------------- */ 
 
 
a
 
{
pylons_app/templates/admin/users/user_edit_my_account.html
Show inline comments
 
@@ -11,99 +11,101 @@
 

	
 
<%def name="page_nav()">
 
	${self.menu('admin')}
 
</%def>
 

	
 
<%def name="main()">
 

	
 
<div class="box box-left">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}       
 
    </div>
 
    <!-- end box / title -->
 
    <div class="ui-tabs-panel ui-widget-content ui-corner-bottom">
 
    ${h.form(url('admin_settings_my_account_update'),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label">
 
                    <label for="username">${_('Username')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('username')}
 
                </div>
 
             </div>
 
            
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_password">${_('New password')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.password('new_password')}
 
                </div>
 
             </div>
 
            
 
             <div class="field">
 
                <div class="label">
 
                    <label for="name">${_('Name')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('name')}
 
                </div>
 
             </div>
 
            
 
             <div class="field">
 
                <div class="label">
 
                    <label for="lastname">${_('Lastname')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('lastname')}
 
                </div>
 
             </div>
 
            
 
             <div class="field">
 
                <div class="label">
 
                    <label for="email">${_('Email')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('email')}
 
                </div>
 
             </div>
 
            
 
            <div class="buttons">
 
              ${h.submit('save','save',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 
            </div>             
 
    	</div>    
 
	    <div class="form">
 
	        <div class="fields">
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="username">${_('Username')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.text('username')}
 
	                </div>
 
	             </div>
 
	            
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="new_password">${_('New password')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.password('new_password')}
 
	                </div>
 
	             </div>
 
	            
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="name">${_('Name')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.text('name')}
 
	                </div>
 
	             </div>
 
	            
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="lastname">${_('Lastname')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.text('lastname')}
 
	                </div>
 
	             </div>
 
	            
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="email">${_('Email')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.text('email')}
 
	                </div>
 
	             </div>
 
	            
 
	            <div class="buttons">
 
	              ${h.submit('save','save',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 
	            </div>             
 
	    	</div>
 
	    </div>    	
 
    ${h.end_form()}
 
    </div>
 
    ${h.end_form()}
 
</div>    
 

	
 
<div class="box box-right">
 
    <!-- box / title -->
 
    <div class="title">
 
        <h5>${_('My repositories')}</h5>   
 
    </div>
 
    <!-- end box / title -->
 
    <div class="table">
 
    <table>
 
     <tbody>
 
     %for repo in c.user_repos:
 
        <tr>
 
            <td>
 
             %if repo.dbrepo.private:
 
                <img alt="${_('private')}" src="/images/icons/lock.png"/>
 
             %else:
 
                <img alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
             %endif
 
                                             
 
            ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}</td> 
 
            ##<td>${_('created')} ${repo.dbrepo.}</td>
 
            <td>${_('last changed')}  ${h.age(repo.last_change)}</td>
 
            <td>${h.link_to(_('[edit]'),h.url('edit_repo',repo_name=repo.name))}</td>
 
        </tr>
 
     %endfor
 
     </tbody>
 
     </table>
 
	    <table>
 
	     <tbody>
 
	     %for repo in c.user_repos:
 
	        <tr>
 
	            <td>
 
	             %if repo.dbrepo.private:
 
	                <img class="icon" alt="${_('private')}" src="/images/icons/lock.png"/>
 
	             %else:
 
	                <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
	             %endif
 
	                                             
 
	            ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}</td> 
 
	            <td>${_('revision')}: ${repo.revisions[-1]}</td>
 
	            <td>${_('last changed')}: ${h.age(repo.last_change)}</td>
 
	            <td><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/> ${h.link_to(_('edit'),h.url('edit_repo',repo_name=repo.name))}</td>
 
	        </tr>
 
	     %endfor
 
	     </tbody>
 
	     </table>
 
    </div>
 
    
 
</div>
 
</%def>  
 
\ No newline at end of file
pylons_app/templates/index.html
Show inline comments
 
@@ -9,23 +9,24 @@
 
<%def name="page_nav()">
 
	${self.menu('home')}
 
</%def>
 
<%def name="main()">
 
	<%def name="get_sort(name)">
 
		<%name_slug = name.lower().replace(' ','_') %>
 
		%if name_slug == c.cs_slug:
 
			<span style="font-weight: bold;text-decoration: underline;">${name}</span>
 
		
 
		%if name_slug == c.sort_slug:
 
		  %if c.sort_by.startswith('-'):
 
		    <a href="?sort=${name_slug}">${name}&uarr;</a>
 
		  %else:
 
		    <a href="?sort=-${name_slug}">${name}&darr;</a>
 
		  %endif:
 
		%else:
 
			<span style="font-weight: bold">${name}</span>
 
		    <a href="?sort=${name_slug}">${name}</a>
 
		%endif
 
		<a href="?sort=${name_slug}">&darr;</a>
 
		<a href="?sort=-${name_slug}">&uarr;</a>
 
	</%def>
 
	
 
	
 
	
 
    <div class="box">
 
	    <!-- box / title -->
 
	    <div class="title">
 
	        <h5>${_('Dashboard')}</h5>
 
	        %if h.HasPermissionAny('hg.admin','hg.create.repository')():
 
	        <ul class="links">
 
@@ -52,15 +53,15 @@
 
                        <tbody>
 
					    %for cnt,repo in enumerate(c.repos_list):
 
					        %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(repo['name'],'main page check'):
 
					        <tr class="parity${cnt%2}">
 
					            <td>
 
					             %if repo['repo'].dbrepo.private:
 
					                <img alt="${_('private')}" src="/images/icons/lock.png"/>
 
					                <img class="icon" alt="${_('private')}" src="/images/icons/lock.png"/>
 
					             %else:
 
					                <img alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
					                <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
					             %endif  
 
					            ${h.link_to(repo['name'],
 
					                h.url('summary_home',repo_name=repo['name']))}</td>
 
					            <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
 
					            <td>${h.age(repo['last_change'])}</td>
 
					            <td>${h.link_to_if(repo['rev']>=0,'r%s:%s' % (repo['rev'],repo['tip']),
pylons_app/templates/summary/summary.html
Show inline comments
 
@@ -39,13 +39,13 @@ E.onDOMReady(function(e){
 
		 
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Name')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      ${c.repo_info.name}
 
			      <span style="font-size: 1.6em;font-weight: bold">${c.repo_info.name}</span>
 
			  </div>
 
			 </div>
 
			
 
			
 
			 <div class="field">
 
			  <div class="label">
0 comments (0 inline, 0 general)