Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kfischer-okarin committed Nov 21, 2020
1 parent d6f5a00 commit 13004b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/wiki/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
<% @redirects_to_self.map { |redirect| %>
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", {} , :class => 'icon icon-link-break') %>
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", project_redirect_path(@project, redirect), :class => 'icon icon-link-break') %>
<% } %>
<%= 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') %>
<% else %>
Expand Down
3 changes: 2 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@
match 'preview', :via => [:post, :put, :patch]
post 'protect'
post 'add_attachment'

resources :redirects, controller: 'wiki_redirects', only: :destroy
end
collection do
get 'export'
get 'date_index'
post 'new'
resources :redirects, controller: 'wiki_redirects', only: :destroy
end
end
match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
Expand Down
4 changes: 2 additions & 2 deletions test/functional/wiki_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def test_show_delete_redirect_links
get :show, :params => {:project_id => 1, :id => new_title}

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

Expand Down

0 comments on commit 13004b5

Please sign in to comment.