diff --git a/rhodecode/controllers/compare.py b/rhodecode/controllers/compare.py --- a/rhodecode/controllers/compare.py +++ b/rhodecode/controllers/compare.py @@ -120,7 +120,8 @@ class CompareController(BaseRepoControll c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in c.cs_ranges]) - + if request.environ.get('HTTP_X_PARTIAL_XHR'): + return render('compare/compare_cs.html') c.org_ref = org_ref[1] c.other_ref = other_ref[1] diff --git a/rhodecode/controllers/pullrequests.py b/rhodecode/controllers/pullrequests.py --- a/rhodecode/controllers/pullrequests.py +++ b/rhodecode/controllers/pullrequests.py @@ -31,7 +31,7 @@ from pylons.i18n.translation import _ from rhodecode.lib.base import BaseRepoController, render from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator -from webob.exc import HTTPNotFound +from rhodecode.model.db import User log = logging.getLogger(__name__) @@ -44,12 +44,15 @@ class PullrequestsController(BaseRepoCon def __before__(self): super(PullrequestsController, self).__before__() - def _get_repo_refs(self,repo): + def _get_repo_refs(self, repo): hist_l = [] - branches_group = ([(k, k) for k in repo.branches.keys()], _("Branches")) - bookmarks_group = ([(k, k) for k in repo.bookmarks.keys()], _("Bookmarks")) - tags_group = ([(k, k) for k in repo.tags.keys()], _("Tags")) + branches_group = ([('branch:' + k, k) for k in repo.branches.keys()], + _("Branches")) + bookmarks_group = ([('book:' + k, k) for k in repo.bookmarks.keys()], + _("Bookmarks")) + tags_group = ([('tag:' + k, k) for k in repo.tags.keys()], + _("Tags")) hist_l.append(bookmarks_group) hist_l.append(branches_group) @@ -58,8 +61,30 @@ class PullrequestsController(BaseRepoCon return hist_l def index(self): + org_repo = c.rhodecode_db_repo c.org_refs = self._get_repo_refs(c.rhodecode_repo) - c.sources = [] - c.sources.append('%s/%s' % (c.rhodecode_db_repo.user.username, - c.repo_name)) + c.org_repos = [] + c.other_repos = [] + c.org_repos.append((org_repo.repo_name, '%s/%s' % ( + org_repo.user.username, c.repo_name)) + ) + + c.other_refs = c.org_refs + c.other_repos.extend(c.org_repos) + + #gather forks and add to this list + for fork in org_repo.forks: + c.other_repos.append((fork.repo_name, '%s/%s' % ( + fork.user.username, fork.repo_name)) + ) + #add parents of this fork also + c.other_repos.append((org_repo.parent.repo_name, '%s/%s' % ( + org_repo.parent.user.username, + org_repo.parent.repo_name)) + ) + + #TODO: maybe the owner should be default ? + c.review_members = [] + c.available_members = [(x.user_id, x.username) for x in + User.query().filter(User.username != 'default').all()] return render('/pullrequests/pullrequest.html') diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -603,6 +603,20 @@ class Repository(Base, BaseModel): return q.one().ui_value @property + def forks(self): + """ + Return forks of this repo + """ + return Repository.get_repo_forks(self.repo_id) + + @property + def parent(self): + """ + Returns fork parent + """ + return self.fork + + @property def just_name(self): return self.repo_name.split(Repository.url_sep())[-1] diff --git a/rhodecode/templates/compare/compare_cs.html b/rhodecode/templates/compare/compare_cs.html new file mode 100644 --- /dev/null +++ b/rhodecode/templates/compare/compare_cs.html @@ -0,0 +1,23 @@ +## Changesets table ! +
${_('No changesets')} | |||||
+ | + %if cs.raw_id in c.statuses: + + %endif + | +${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | ++ | ${cs.date} | ++ |
- | - %if cs.raw_id in c.statuses: - - %endif - | -${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | -- | ${cs.date} | -- |
+
+
+
+
+ ${_('Choosen reviewers')}
+ ${h.select('review_members',[x[0] for x in c.review_members],c.review_members,multiple=True,size=8,style="min-width:210px")}
+
+ ${_('Remove all elements')}
+
+
+
+
+
+ + +
+
+ ${_('Available reviewers')}
+ ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
+
+
+ ${_('Add all elements')}
+
+ |
+