Mercurial > kallithea
changeset 4282:99997d8f31eb
pull requests: remove old 'my pull requests' code from the secret place under 'My Account'
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 14 Jun 2013 16:28:38 +0200 |
parents | 6564d82e1469 |
children | 8560e7a59352 |
files | kallithea/config/routing.py kallithea/controllers/admin/my_account.py kallithea/templates/admin/my_account/my_account.html kallithea/templates/admin/my_account/my_account_pullrequests.html kallithea/tests/functional/test_my_account.py |
diffstat | 5 files changed, 0 insertions(+), 97 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/config/routing.py Fri Jul 18 18:44:54 2014 +0200 +++ b/kallithea/config/routing.py Fri Jun 14 16:28:38 2013 +0200 @@ -367,9 +367,6 @@ m.connect("my_account_watched", "/my_account/watched", action="my_account_watched", conditions=dict(method=["GET"])) - m.connect("my_account_pullrequests", "/my_account/pull_requests", - action="my_account_pullrequests", conditions=dict(method=["GET"])) - m.connect("my_account_perms", "/my_account/perms", action="my_account_perms", conditions=dict(method=["GET"]))
--- a/kallithea/controllers/admin/my_account.py Fri Jul 18 18:44:54 2014 +0200 +++ b/kallithea/controllers/admin/my_account.py Fri Jun 14 16:28:38 2013 +0200 @@ -230,27 +230,6 @@ h.flash(_("Removed email from user"), category='success') return redirect(url('my_account_emails')) - def my_account_pullrequests(self): - c.active = 'pullrequests' - self.__load_data() - c.show_closed = request.GET.get('pr_show_closed') - - def _filter(pr): - s = sorted(pr, key=lambda o: o.created_on, reverse=True) - if not c.show_closed: - s = filter(lambda p: p.status != PullRequest.STATUS_CLOSED, s) - return s - - c.my_pull_requests = _filter(PullRequest.query()\ - .filter(PullRequest.user_id == - self.authuser.user_id)\ - .all()) - my_prs = [x.pull_request for x in PullRequestReviewers.query() - .filter(PullRequestReviewers.user_id == - self.authuser.user_id).all()] - c.participate_in_pull_requests = _filter(my_prs) - return render('admin/my_account/my_account.html') - def my_account_api_keys(self): c.active = 'api_keys' self.__load_data()
--- a/kallithea/templates/admin/my_account/my_account.html Fri Jul 18 18:44:54 2014 +0200 +++ b/kallithea/templates/admin/my_account/my_account.html Fri Jun 14 16:28:38 2013 +0200 @@ -41,7 +41,6 @@ <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('my_account_emails')}">${_('My Emails')}</a></li> <li class="${'active' if c.active=='repos' else ''}"><a href="${h.url('my_account_repos')}">${_('My Repositories')}</a></li> <li class="${'active' if c.active=='watched' else ''}"><a href="${h.url('my_account_watched')}">${_('Watched')}</a></li> - <li class="${'active' if c.active=='pullrequests' else ''}"><a href="${h.url('my_account_pullrequests')}">${_('Pull requests')}</a></li> <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('my_account_perms')}">${_('My permissions')}</a></li> </ul> </div>
--- a/kallithea/templates/admin/my_account/my_account_pullrequests.html Fri Jul 18 18:44:54 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -%if c.show_closed: - ${h.checkbox('show_closed',checked="checked", label=_('Show closed pull requests'))} -%else: - ${h.checkbox('show_closed',label=_('Show closed pull requests'))} -%endif -<div class="pullrequests_section_head">${_('Opened by me')}</div> -<ul> - %if c.my_pull_requests: - %for pull_request in c.my_pull_requests: - <li class="${'closed' if pull_request.is_closed() else ''}"> - <div style="height: 12px"> - <div style="float:left"> - <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" /> - <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}"> - ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))} - %if pull_request.is_closed(): - (${_('Closed')}) - %endif - </a> - </div> - <div style="float:left;padding:4px 0px 0px 5px"> - ${h.form(url('pullrequest_delete', repo_name=pull_request.other_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete')} - <i class="icon-remove-sign" style="color:#FF4444"></i> - ${h.submit('remove_%s' % pull_request.pull_request_id, _('delete'), - class_="action_button",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} - ${h.end_form()} - </div> - </div> - </li> - %endfor - %else: - <li><span class="empty_data">${_('Nothing here yet')}</span></li> - %endif -</ul> - -<div class="pullrequests_section_head" style="clear:both">${_('I participate in')}</div> -<ul> - %if c.participate_in_pull_requests: - %for pull_request in c.participate_in_pull_requests: - <li class="${'closed' if pull_request.is_closed() else ''}"> - <div style="height: 12px"> - <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" /> - <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}"> - ${_('Pull request #%s opened by %s on %s') % (pull_request.pull_request_id, pull_request.author.full_name, h.fmt_date(pull_request.created_on))} - </a> - %if pull_request.is_closed(): - (${_('Closed')}) - %endif - </div> - </li> - %endfor - %else: - <li><span class="empty_data">${_('Nothing here yet')}</span></li> - %endif -</ul> - -<script> - $('#show_closed').on('click', function(e){ - if($(this).is(":checked")){ - window.location = "${h.url('my_account_pullrequests', pr_show_closed=1)}"; - } - else{ - window.location = "${h.url('my_account_pullrequests')}"; - } - }) -</script>
--- a/kallithea/tests/functional/test_my_account.py Fri Jul 18 18:44:54 2014 +0200 +++ b/kallithea/tests/functional/test_my_account.py Fri Jun 14 16:28:38 2013 +0200 @@ -40,12 +40,6 @@ User.get_by_username(TEST_USER_ADMIN_LOGIN)).count() response.mustcontain('"totalRecords": %s' % cnt) - def test_my_account_my_pullrequests(self): - self.log_user() - response = self.app.get(url('my_account_pullrequests')) - - response.mustcontain('Nothing here yet') - def test_my_account_my_emails(self): self.log_user() response = self.app.get(url('my_account_emails'))