# HG changeset patch # User Daniel Dourvaris # Date 2019-07-23 12:25:33 # Node ID 18ef8156a58544d805e63abb224b9aef05c07fa3 # Parent 46105c640d4d349ec2895ce7fbe833d0928a247f pull-requests: add indication of state change in list of pull-requests and actually show them in the list. diff --git a/rhodecode/apps/my_account/views/my_account.py b/rhodecode/apps/my_account/views/my_account.py --- a/rhodecode/apps/my_account/views/my_account.py +++ b/rhodecode/apps/my_account/views/my_account.py @@ -669,8 +669,7 @@ class MyAccountView(BaseAppView, DataGri 'name_raw': pr.pull_request_id, 'status': _render('pullrequest_status', pr.calculated_review_status()), - 'title': _render( - 'pullrequest_title', pr.title, pr.description), + 'title': _render('pullrequest_title', pr.title, pr.description), 'description': h.escape(pr.description), 'updated_on': _render('pullrequest_updated_on', h.datetime_to_time(pr.updated_on)), @@ -678,6 +677,7 @@ class MyAccountView(BaseAppView, DataGri 'created_on': _render('pullrequest_updated_on', h.datetime_to_time(pr.created_on)), 'created_on_raw': h.datetime_to_time(pr.created_on), + 'state': pr.pull_request_state, 'author': _render('pullrequest_author', pr.author.full_contact, ), 'author_raw': pr.author.full_name, diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -112,8 +112,7 @@ class RepoPullRequestsView(RepoAppView, 'name_raw': pr.pull_request_id, 'status': _render('pullrequest_status', pr.calculated_review_status()), - 'title': _render( - 'pullrequest_title', pr.title, pr.description), + 'title': _render('pullrequest_title', pr.title, pr.description), 'description': h.escape(pr.description), 'updated_on': _render('pullrequest_updated_on', h.datetime_to_time(pr.updated_on)), @@ -121,6 +120,7 @@ class RepoPullRequestsView(RepoAppView, 'created_on': _render('pullrequest_updated_on', h.datetime_to_time(pr.created_on)), 'created_on_raw': h.datetime_to_time(pr.created_on), + 'state': pr.pull_request_state, 'author': _render('pullrequest_author', pr.author.full_contact, ), 'author_raw': pr.author.full_name, diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -139,7 +139,7 @@ class PullRequestModel(BaseModel): def _prepare_get_all_query(self, repo_name, source=False, statuses=None, opened_by=None, order_by=None, - order_dir='desc', only_created=True): + order_dir='desc', only_created=False): repo = None if repo_name: repo = self._get_repo(repo_name) diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -333,10 +333,18 @@ ul.auth_plugins { margin: 0 1em 0 0; } -.pullrequestlist { +#pull_request_list_table { .closed { background-color: @grey6; } + + .state-creating, + .state-updating, + .state-merging + { + background-color: @grey6; + } + .td-status { padding-left: .5em; } diff --git a/rhodecode/templates/admin/my_account/my_account_pullrequests.mako b/rhodecode/templates/admin/my_account/my_account_pullrequests.mako --- a/rhodecode/templates/admin/my_account/my_account_pullrequests.mako +++ b/rhodecode/templates/admin/my_account/my_account_pullrequests.mako @@ -77,6 +77,9 @@ if (data['owned']) { $(row).addClass('owned'); } + if (data['state'] !== 'created') { + $(row).addClass('state-' + data['state']); + } } }); $pullRequestListTable.on('xhr.dt', function(e, settings, json, xhr){ diff --git a/rhodecode/templates/pullrequests/pullrequests.mako b/rhodecode/templates/pullrequests/pullrequests.mako --- a/rhodecode/templates/pullrequests/pullrequests.mako +++ b/rhodecode/templates/pullrequests/pullrequests.mako @@ -98,7 +98,10 @@ }, "createdRow": function ( row, data, index ) { if (data['closed']) { - $(row).addClass('closed'); + $(row).addClass('closed'); + } + if (data['state'] !== 'created') { + $(row).addClass('state-' + data['state']); } } });