• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修订版7add61dd973057b91ddefef3f85c3c0276ec914c (tree)
时间2012-05-11 06:40:41
作者bolkimen <bolkimen@yaho...>
CommiterCory Johns

Log Message

ticket:46 add profile menu

更改概述

差异

--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -415,6 +415,10 @@ class Project(MappedClass):
415415
416416 if neighborhood_admin_mode and h.has_access(self.neighborhood, 'admin'):
417417 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")})
418422
419423 entries = sorted(entries, key=lambda e: e['ordinal'])
420424 for e in entries:
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -609,3 +609,8 @@ class TestNeighborhood(TestController):
609609 def test_help(self):
610610 r = self.app.get('/p/_admin/help/', extra_environ=dict(username='root'))
611611 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