# HG changeset patch # User Marcin Kuzminski # Date 2013-03-24 19:24:17 # Node ID 7b9d4f6bb04e2322f3295f7e7153fc778be1fa1e # Parent 11feddcd75bb636731e1280a61847a4ebb1c1540 show only open pull requests in the counter, and use repo context bar in pull requests view diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -266,8 +266,7 @@ class BaseController(WSGIController): c.visual.lightweight_dashboard = str2bool(rc_config.get('rhodecode_lightweight_dashboard')) c.visual.lightweight_dashboard_items = safe_int(config.get('dashboard_items', 100)) c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields')) - - c.repo_name = get_repo_slug(request) + c.repo_name = get_repo_slug(request) # can be empty c.backends = BACKENDS.keys() c.unread_notifications = NotificationModel()\ .get_unread_cnt_for_user(c.rhodecode_user.user_id) diff --git a/rhodecode/model/scm.py b/rhodecode/model/scm.py --- a/rhodecode/model/scm.py +++ b/rhodecode/model/scm.py @@ -393,7 +393,8 @@ class ScmModel(BaseModel): def get_pull_requests(self, repo): repo = self._get_repo(repo) return self.sa.query(PullRequest)\ - .filter(PullRequest.other_repo == repo).count() + .filter(PullRequest.other_repo == repo)\ + .filter(PullRequest.status != PullRequest.STATUS_CLOSED).count() def mark_as_fork(self, repo, fork, user): repo = self.__get_repo(repo) diff --git a/rhodecode/templates/pullrequests/pullrequest.html b/rhodecode/templates/pullrequests/pullrequest.html --- a/rhodecode/templates/pullrequests/pullrequest.html +++ b/rhodecode/templates/pullrequests/pullrequest.html @@ -13,7 +13,7 @@ <%def name="main()"> - +${self.context_bar('showpullrequest')}
diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -13,7 +13,7 @@ <%def name="main()"> - +${self.context_bar('showpullrequest')}
diff --git a/rhodecode/templates/pullrequests/pullrequest_show_all.html b/rhodecode/templates/pullrequests/pullrequest_show_all.html --- a/rhodecode/templates/pullrequests/pullrequest_show_all.html +++ b/rhodecode/templates/pullrequests/pullrequest_show_all.html @@ -35,6 +35,4 @@
- -