changeset 446:a0a93357f954

started my page rewrite
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 03 Sep 2010 00:46:07 +0200
parents 946d8a680a1d
children 70c2750531d3
files pylons_app/controllers/admin/settings.py pylons_app/templates/admin/users/user_edit_my_account.html
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/controllers/admin/settings.py	Thu Sep 02 21:37:52 2010 +0200
+++ b/pylons_app/controllers/admin/settings.py	Fri Sep 03 00:46:07 2010 +0200
@@ -225,6 +225,11 @@
         """
         # url('admin_settings_my_account')
         c.user = self.sa.query(User).get(c.hg_app_user.user_id)
+        c.user_repos = []
+        for repo in c.cached_repo_list.values():
+            if repo.dbrepo.user.username == c.user.username:
+                c.user_repos.append(repo)
+                
         if c.user.username == 'default':
             h.flash(_("You can't edit this user since it's" 
               " crucial for entire application"), category='warning')
--- a/pylons_app/templates/admin/users/user_edit_my_account.html	Thu Sep 02 21:37:52 2010 +0200
+++ b/pylons_app/templates/admin/users/user_edit_my_account.html	Fri Sep 03 00:46:07 2010 +0200
@@ -14,7 +14,7 @@
 </%def>
 
 <%def name="main()">
-<div class="box">
+<div class="box box-left">
     <!-- box / title -->
     <div class="title">
         ${self.breadcrumbs()}       
@@ -76,4 +76,34 @@
     </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>
+    </div>
+    
+</div>
 </%def>  
\ No newline at end of file