GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit 18b5ed60 authored by jplang's avatar jplang

Adds a link to container on attachments edit form.

git-svn-id: https://svn.redmine.org/redmine/trunk@17722 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 72ff7a85
......@@ -164,8 +164,10 @@ class AttachmentsController < ApplicationController
# Returns the menu item that should be selected when viewing an attachment
def current_menu_item
if @attachment
case @attachment.container
container = @attachment.try(:container) || @container
if container
case container
when WikiPage
:wiki
when Message
......@@ -173,7 +175,7 @@ class AttachmentsController < ApplicationController
when Project, Version
:files
else
@attachment.container.class.name.pluralize.downcase.to_sym
container.class.name.pluralize.downcase.to_sym
end
end
end
......
<h2><%= l(:label_edit_attachments) %></h2>
<h2>
<%= safe_join([link_to_attachment_container(@container), l(:label_edit_attachments)].compact, ' » ') %>
</h2>
<%= error_messages_for *@attachments %>
......
......@@ -463,6 +463,9 @@ class AttachmentsControllerTest < Redmine::ControllerTest
assert_select 'input[name=?][value=?]', 'attachments[4][description]', 'This is a Ruby source file'
end
end
# Link to the container in heading
assert_select 'h2 a', :text => "Feature request #2"
end
def test_edit_all_with_invalid_container_class_should_return_404
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment