Skip to content

Commit 13004b5

Browse files
WIP
1 parent d6f5a00 commit 13004b5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/views/wiki/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
1717
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
1818
<% @redirects_to_self.map { |redirect| %>
19-
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", {} , :class => 'icon icon-link-break') %>
19+
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", project_redirect_path(@project, redirect), :class => 'icon icon-link-break') %>
2020
<% } %>
2121
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
2222
<% else %>

config/routes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,13 @@
190190
match 'preview', :via => [:post, :put, :patch]
191191
post 'protect'
192192
post 'add_attachment'
193+
194+
resources :redirects, controller: 'wiki_redirects', only: :destroy
193195
end
194196
collection do
195197
get 'export'
196198
get 'date_index'
197199
post 'new'
198-
resources :redirects, controller: 'wiki_redirects', only: :destroy
199200
end
200201
end
201202
match 'wiki', :controller => 'wiki', :action => 'show', :via => :get

test/functional/wiki_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def test_show_delete_redirect_links
201201
get :show, :params => {:project_id => 1, :id => new_title}
202202

203203
assert_select '.drdn-items' do
204-
assert_select 'a.icon-link-break', text: 'Delete redirect from CookBook documentation'
205-
assert_select 'a.icon-link-break', text: 'Delete redirect from Old Cookbook'
204+
assert_select 'a.icon-link-break[href=?]', '/projects/ecookbook/wiki/redirects/', text: 'Delete redirect from CookBook documentation'
205+
assert_select 'a.icon-link-break[href=?]', '/projects/ecookbook/wiki/redirects/', text: 'Delete redirect from Old Cookbook'
206206
end
207207
end
208208

0 commit comments

Comments
 (0)