allura
修订版 | 7add61dd973057b91ddefef3f85c3c0276ec914c (tree) |
---|---|
时间 | 2012-05-11 06:40:41 |
作者 | bolkimen <bolkimen@yaho...> |
Commiter | Cory Johns |
ticket:46 add profile menu
@@ -415,6 +415,10 @@ class Project(MappedClass): | ||
415 | 415 | |
416 | 416 | if neighborhood_admin_mode and h.has_access(self.neighborhood, 'admin'): |
417 | 417 | entries.append({'ordinal': max_ordinal + 1,'entry':SitemapEntry('Moderate', "%s_moderate/" % self.neighborhood.url(), ui_icon="tool-admin")}) |
418 | + max_ordinal += 1 | |
419 | + | |
420 | + if self.is_user_project: | |
421 | + entries.append({'ordinal': max_ordinal + 1,'entry':SitemapEntry('Profile', "%sprofile/" % self.url(), ui_icon="tool-home")}) | |
418 | 422 | |
419 | 423 | entries = sorted(entries, key=lambda e: e['ordinal']) |
420 | 424 | for e in entries: |
@@ -609,3 +609,8 @@ class TestNeighborhood(TestController): | ||
609 | 609 | def test_help(self): |
610 | 610 | r = self.app.get('/p/_admin/help/', extra_environ=dict(username='root')) |
611 | 611 | assert 'macro' in r |
612 | + | |
613 | + @td.with_user_project('test-user') | |
614 | + def test_profile_topnav_menu(self): | |
615 | + r = self.app.get('/u/test-user/', extra_environ=dict(username='test-user')).follow() | |
616 | + assert '<a href="/u/test-user/profile/" class="ui-icon-tool-home">' in r |