Project

General

Profile

Feature #39529 » feature-39529.patch

Mizuki ISHIKAWA, 2023-11-08 09:45

View differences:

app/helpers/application_helper.rb
end
css_classes += " #{options[:class]}" if css_classes && options[:class].present?
url ? link_to(name, url, :class => css_classes) : name
url ? link_to(name, url, :class => css_classes, :data => options[:data]) : name
end
# Displays a link to edit group page if current user is admin
......
elsif sep == "@"
name = remove_double_quotes(identifier)
u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
link = link_to_user(u, :only_path => only_path, :class => 'user-mention', :mention => true) if u
if u && obj && !obj.visible?(u)
data = {warning_tooltip: l(:error_not_mentioned)}
end
link = link_to_user(u, :only_path => only_path, :class => 'user-mention', :mention => true, :data => data) if u
end
end
(leading + (link || "#{project_prefix}#{prefix}#{repo_prefix}#{sep}#{identifier}#{comment_suffix}"))
config/locales/en.yml
error_invalid_size_parameter: "Invalid size parameter"
error_attachment_not_found: "Attachment %{name} not found"
error_invalid_authenticity_token: "Invalid form authenticity token."
error_not_mentioned: "You cannot mention this user because they do not have access rights."
error_query_statement_invalid: "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
mail_subject_lost_password: "Your %{value} password"
public/javascripts/application.js
at: "center top"
}
});
$("[data-warning-tooltip]:not(.no-tooltip)").tooltip({
items: '[data-warning-tooltip]',
content: function() {
return $(this).data('warning-tooltip');
},
tooltipClass: 'warning',
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
});
function inlineAutoComplete(element) {
public/stylesheets/application.css
box-shadow: none;
white-space: pre-wrap;
}
.ui-tooltip.warning {
background-color: #F3EDD1;
border-color: #eadbbc;
color: #A6750C;
}
/***** Icons *****/
.icon {
test/helpers/application_helper_test.rb
end
end
def test_mention_link_to_users_who_are_not_authorised_to_view_the_object
set_language_if_valid 'en'
with_settings :text_formatting => 'textile' do
issue = Issue.find(4)
assert_not issue.visible?(User.find(3))
assert_equal "<p>#{link_to_user(User.find(3), only_path: true, class: 'user-mention', mention: true, data: {warning_tooltip: 'You cannot mention this user because they do not have access rights.'})}</p>", textilizable("@#{User.find(3).login}", :object => issue)
journal = Journal.find(2)
assert_equal '<p><a href="#note-2">#note-2</a></p>', textilizable('#note-2', :object => journal)
end
end
def test_link_to_note_within_the_same_page
with_settings :text_formatting => 'textile' do
issue = Issue.find(1)
(2-2/7)