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 33 insertions and 25 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/hg.py
Show inline comments
 
@@ -37,19 +37,20 @@ class HgController(BaseController):
 
        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)
pylons_app/public/css/style.css
Show inline comments
 
@@ -26,6 +26,10 @@ img
 
	border: none;	
 
}
 
 
img.icon{
 
    vertical-align: bottom;
 
 
}
 
/* -----------------------------------------------------------
 
	anchors
 
----------------------------------------------------------- */ 
pylons_app/templates/admin/users/user_edit_my_account.html
Show inline comments
 
@@ -14,15 +14,16 @@
 
</%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">
 
@@ -76,6 +77,7 @@
 
    </div>
 
    ${h.end_form()}
 
</div>    
 
</div>    
 

	
 
<div class="box box-right">
 
    <!-- box / title -->
 
@@ -90,15 +92,15 @@
 
        <tr>
 
            <td>
 
             %if 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>${_('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>
 
	            <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>
pylons_app/templates/index.html
Show inline comments
 
@@ -12,17 +12,18 @@
 
<%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:
 
			<span style="font-weight: bold">${name}</span>
 
		    <a href="?sort=-${name_slug}">${name}&darr;</a>
 
		  %endif:
 
		%else:
 
		    <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">
 
@@ -55,9 +56,9 @@
 
					        <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>
pylons_app/templates/summary/summary.html
Show inline comments
 
@@ -42,7 +42,7 @@ E.onDOMReady(function(e){
 
			      <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>
 
			
0 comments (0 inline, 0 general)