Skip to content

Commit

Permalink
[webui] support re-open of declined requests and also offer to use "r…
Browse files Browse the repository at this point in the history
…evoke" directly on self-directed requests
  • Loading branch information
adrianschroeter committed Dec 15, 2011
1 parent 2706479 commit 6f5cee7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/webui/app/controllers/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def changerequest
end

changestate = nil
['accepted', 'declined', 'revoked'].each do |s|
['accepted', 'declined', 'revoked', 'new'].each do |s|
if params.has_key? s
changestate = s
break
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def modifyReview(id, changestate, opts)

def modify(id, changestate, opts)
opts = {:superseded_by => nil, :force => false, :reason => ''}.merge opts
if ["accepted", "declined", "revoked", "superseded"].include?(changestate)
if ["accepted", "declined", "revoked", "superseded", "new"].include?(changestate)
transport ||= ActiveXML::Config::transport_for :bsrequest
path = "/request/#{id}?newstate=#{changestate}&cmd=changestate"
path += "&superseded_by=#{opts[:superseded_by]}" unless opts[:superseded_by].blank?
Expand Down
6 changes: 5 additions & 1 deletion src/webui/app/views/request/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@
<%= submit_tag "Accept request", :name => 'accepted' %>
<% end %>
<% end %>
<%= submit_tag "Decline request", :name => 'declined' %>
<% if @is_author %>
<%= submit_tag "Revoke request", :name => 'revoked' %>
<% else %>
<%= submit_tag "Decline request", :name => 'declined' %>
<% end %>
<% elsif @is_author %>
<%= submit_tag "Revoke request", :name => 'revoked' %>
<% end %>
Expand Down

0 comments on commit 6f5cee7

Please sign in to comment.