Changeset - 2889a4446960
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2010-11-28 21:06:16
marcin@python-works.com
when new repo is created make user follow it automatically,
add tilte to currently logged in user.
2 files changed with 35 insertions and 25 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/repo.py
Show inline comments
 
#!/usr/bin/env python
 
# encoding: utf-8
 
# model for handling repositories actions
 
# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
 
# -*- coding: utf-8 -*-
 
"""
 
    package.rhodecode.model.repo
 
    ~~~~~~~~~~~~~~
 

	
 
    Repository model for rhodecode
 
    
 
    :created_on: Jun 5, 2010
 
    :author: marcink
 
    :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>    
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software; you can redistribute it and/or
 
# modify it under the terms of the GNU General Public License
 
# as published by the Free Software Foundation; version 2
 
@@ -16,23 +24,22 @@
 
# along with this program; if not, write to the Free Software
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
# MA  02110-1301, USA.
 
"""
 
Created on Jun 5, 2010
 
model for handling repositories actions
 
:author: marcink
 
"""
 
from vcs.backends import get_backend
 
import os
 
import shutil
 
import logging
 
import traceback
 
from datetime import datetime
 

	
 
from pylons import app_globals as g
 

	
 
from rhodecode.model import BaseModel
 
from rhodecode.model.caching_query import FromCache
 
from rhodecode.model.db import Repository, RepoToPerm, User, Permission, \
 
    Statistics
 
from rhodecode.model import BaseModel
 
from rhodecode.model.user import UserModel
 
from rhodecode.model.caching_query import FromCache
 
import logging
 
import os
 
import shutil
 
import traceback
 

	
 
from vcs.backends import get_backend
 

	
 
log = logging.getLogger(__name__)
 

	
 
class RepoModel(BaseModel):
 
@@ -158,6 +165,13 @@ class RepoModel(BaseModel):
 

	
 
            self.sa.add(repo_to_perm)
 
            self.sa.commit()
 

	
 

	
 
            #now automatically start following this repository as owner
 
            from rhodecode.model.scm import ScmModel
 
            ScmModel(self.sa).toggle_following_repo(new_repo.repo_id,
 
                                             cur_user.user_id)
 

	
 
            if not just_db:
 
                self.__create_repo(repo_name, form_data['repo_type'])
 
        except:
rhodecode/templates/base/base.html
Show inline comments
 
@@ -22,11 +22,9 @@
 
	                </div>
 
		            <div class="account">
 
		            %if c.rhodecode_user.username == 'default':
 
                        ##${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('register'))}<br/>
 
                        ${h.link_to('anonymous',h.url('register'))}
 
                        ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
 
                    %else:                        		            
 
		            	##${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('admin_settings_my_account'))}<br/>
 
		            	${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'))}
 
		            	${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
 
		            %endif
 
		            </div>	
 
	            </li>
 
@@ -36,14 +34,12 @@
 
                <li>
 
                   <a href="${h.url('journal')}">${_('Journal')}</a> 
 
                   ##(${c.unread_journal})</a>
 
                </li>	         
 
                </li>
 
                %if c.rhodecode_user.username == 'default':
 
                    <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
 
                %else:                                          
 
                %else:
 
                    <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
 
                %endif                   
 
	            
 
	            
 
                %endif
 
        </ul>
 
        <!-- end user -->
 
        <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
0 comments (0 inline, 0 general)