~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/browser/branchmergeproposal.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-09-09 02:18:01 UTC
  • mfrom: (9327.2.8 resubmit-link)
  • Revision ID: launchpad@pqm.canonical.com-20090909021801-b39wcqguz7acca8a
[r=bac][ui=rockstar,
        sinzui] Make resubmit an action that re-requests reviews

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
        text = 'Resubmit proposal'
223
223
        enabled = self._enabledForStatus(
224
224
            BranchMergeProposalStatus.SUPERSEDED)
225
 
        return Link('+resubmit', text, enabled=enabled)
 
225
        return Link('+resubmit', text, enabled=enabled, icon='edit')
226
226
 
227
227
 
228
228
class UnmergedRevisionsMixin:
1028
1028
            BranchMergeProposalStatus.REJECTED,
1029
1029
            # BranchMergeProposalStatus.QUEUED,
1030
1030
            BranchMergeProposalStatus.MERGED,
1031
 
            BranchMergeProposalStatus.SUPERSEDED,
1032
1031
            )
1033
1032
        terms = []
1034
1033
        for status in possible_next_states:
1035
1034
            if not self.context.isValidTransition(status, self.user):
1036
1035
                continue
1037
 
            if status == BranchMergeProposalStatus.SUPERSEDED:
1038
 
                title = 'Resubmit'
1039
1036
            else:
1040
1037
                title = status.title
1041
1038
            terms.append(SimpleTerm(status, status.name, title))
1067
1064
        if new_status == curr_status:
1068
1065
            return
1069
1066
 
1070
 
        if new_status == BranchMergeProposalStatus.SUPERSEDED:
1071
 
            # Redirect the user to the resubmit view.
1072
 
            self.next_url = canonical_url(self.context, view_name="+resubmit")
1073
 
        else:
1074
 
            self.context.setStatus(new_status, self.user, rev_id)
 
1067
        assert new_status != BranchMergeProposalStatus.SUPERSEDED, (
 
1068
            'Superseded is done via an action, not by setting status.')
 
1069
        self.context.setStatus(new_status, self.user, rev_id)
1075
1070
 
1076
1071
 
1077
1072
class IAddVote(Interface):