Users now have a profile rather than a home

Wolf Wolf 2010-02-16

removed pyforge/pyforge/ext/user_home
changed pyforge/pyforge/controllers/project.py
changed pyforge/pyforge/model/project.py
changed pyforge/setup.py
copied pyforge/pyforge/ext/user_home/static/home/css/user_home.css -> pyforge/pyforge/ext/user_profile/static/home/css/user_home.css
copied pyforge/pyforge/ext/user_home/templates/__init__.py -> pyforge/pyforge/ext/user_profile/templates/__init__.py
copied pyforge/pyforge/ext/user_home/templates/user_dashboard_configuration.html -> pyforge/pyforge/ext/user_profile/templates/user_dashboard_configuration.html
copied pyforge/pyforge/ext/user_home/templates/user_index.html -> pyforge/pyforge/ext/user_profile/templates/user_index.html
copied pyforge/pyforge/ext/user_home/__init__.py -> pyforge/pyforge/ext/user_profile/__init__.py
copied pyforge/pyforge/ext/user_home/user_main.py -> pyforge/pyforge/ext/user_profile/user_main.py
copied pyforge/pyforge/tests/functional/test_user_home.py -> pyforge/pyforge/tests/functional/test_user_profile.py
pyforge/pyforge/ext/user_home
File was removed.
pyforge/pyforge/controllers/project.py Diff Switch to side-by-side view
Loading...
pyforge/pyforge/model/project.py Diff Switch to side-by-side view
Loading...
pyforge/setup.py Diff Switch to side-by-side view
Loading...
pyforge/pyforge/ext/user_home/__init__.py to pyforge/pyforge/ext/user_profile/__init__.py
--- a/pyforge/pyforge/ext/user_home/__init__.py
+++ b/pyforge/pyforge/ext/user_profile/__init__.py
@@ -1 +1 @@
-from .user_main import UserHomeApp
+from .user_main import UserProfileApp
pyforge/pyforge/ext/user_home/user_main.py to pyforge/pyforge/ext/user_profile/user_main.py
--- a/pyforge/pyforge/ext/user_home/user_main.py
+++ b/pyforge/pyforge/ext/user_profile/user_main.py
@@ -27,16 +27,16 @@
     def welcome(self):
         return self.portlet('<h1>Please configure your widgets </h1>')
 
-class UserHomeApp(Application):
+class UserProfileApp(Application):
     __version__ = version.__version__
     widget = UserWidgets
     installable = False
 
     def __init__(self, user, config):
         Application.__init__(self, user, config)
-        self.root = UserHomeController()
+        self.root = UserProfileController()
         self.templates = pkg_resources.resource_filename(
-            'pyforge.ext.user_home', 'templates')
+            'pyforge.ext.user_profile', 'templates')
 
     @property
     def sitemap(self):
@@ -59,13 +59,13 @@
     def uninstall(self, project): # pragma no cover
         raise NotImplementedError, "uninstall"
 
-class UserHomeController(object):
+class UserProfileController(object):
 
     def _check_security(self):
         require(has_project_access('read'),
                 'Read access required')
 
-    @expose('pyforge.ext.user_home.templates.user_index')
+    @expose('pyforge.ext.user_profile.templates.user_index')
     def index(self):
         username = c.project.shortname[len('users/'):]
         user = User.query.find({'username':username}).first()
@@ -75,7 +75,7 @@
             layout_class=config.layout_class,
             layout=config.rendered_layout())
 
-    @expose('pyforge.ext.user_home.templates.user_dashboard_configuration')
+    @expose('pyforge.ext.user_profile.templates.user_dashboard_configuration')
     def configuration(self):
         config = M.PortalConfig.current()
         mount_points = [
@@ -113,7 +113,7 @@
                 mp,wn = w['widget'].split('/')
                 content.append(dict(mount_point=mp, widget_name=wn))
             if div.get('new_widget'):
-                content.append(dict(mount_point='home', widget_name='welcome'))
+                content.append(dict(mount_point='profile', widget_name='welcome'))
             config.layout.append(dict(
                     name=div['name'],
                     content=content))
pyforge/pyforge/tests/functional/test_user_home.py to pyforge/pyforge/tests/functional/test_user_profile.py
--- a/pyforge/pyforge/tests/functional/test_user_home.py
+++ b/pyforge/pyforge/tests/functional/test_user_profile.py
@@ -6,11 +6,11 @@
 from pyforge.tests import TestController
 from pyforge import model as M
 
-class TestUserHome(TestController):
+class TestUserProfile(TestController):
 
-    def test_home(self):
-        r0 = str(self.app.get('/home/'))
-        r = self.app.get('/home/configuration')
+    def test_profile(self):
+        r0 = str(self.app.get('/profile/'))
+        r = self.app.get('/profile/configuration')
         selects = r.html.findAll('select')
         options = selects[-1].findAll('option')
         wnames = [
@@ -20,14 +20,14 @@
                     dict(name='content',
                          content=[ dict(widget=wn) for wn in wnames ])
                     ]))
-        self.app.post('/home/update_configuration', params=params)
-        r1 = str(self.app.get('/home/'))
+        self.app.post('/profile/update_configuration', params=params)
+        r1 = str(self.app.get('/profile/'))
         assert r0 != r1
 
-    def test_neighborhood_home(self):
-        r0 = str(self.app.get('/users/test_admin/home/'))
-        r2 = self.app.get('/users/no_such_user/home/', status=404)
-        r = self.app.get('/users/test_admin/home/configuration')
+    def test_neighborhood_profile(self):
+        r0 = str(self.app.get('/users/test_admin/profile/'))
+        r2 = self.app.get('/users/no_such_user/profile/', status=404)
+        r = self.app.get('/users/test_admin/profile/configuration')
         selects = r.html.findAll('select')
         options = selects[-1].findAll('option')
         wnames = [
@@ -37,12 +37,12 @@
                     dict(name='content',
                          content=[ dict(widget=wn) for wn in wnames ])
                     ]))
-        self.app.post('/users/test_admin/home/update_configuration', params=params)
-        r1 = str(self.app.get('/home/'))
+        self.app.post('/users/test_admin/profile/update_configuration', params=params)
+        r1 = str(self.app.get('/profile/'))
         assert r0 != r1
 
     def test_seclusion(self):
-        response = self.app.get('/users/test_admin/home/')
+        response = self.app.get('/users/test_admin/profile/')
         assert 'Email Addresses' in response
-        response = self.app.get('/users/test_user/home/')
+        response = self.app.get('/users/test_user/profile/')
         assert 'Email Addresses' not in response