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

Commit df753bbb authored by jplang's avatar jplang

For 3 comments or more, show reply link at top of comments as well (#24089).

Patch by Jan Schulz-Hofen.

git-svn-id: https://svn.redmine.org/redmine/trunk@16539 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 4e300e21
......@@ -237,6 +237,7 @@ module ApplicationHelper
def toggle_link(name, id, options={})
onclick = "$('##{id}').toggle(); "
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll]
onclick << "return false;"
link_to(name, "#", :onclick => onclick)
end
......
......@@ -35,6 +35,9 @@
<% unless @replies.empty? %>
<h3 class="comments icon icon-comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
<% if !@topic.locked? && authorize_for('messages', 'reply') && @replies.size >= 3 %>
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content', :scroll => "message_content" %></p>
<% end %>
<% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>">
<div class="contextual">
......
......@@ -33,6 +33,9 @@
<div id="comments" style="margin-bottom:16px;">
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
<% if @news.commentable? && @comments.size >= 3 %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %></p>
<% end %>
<% @comments.each do |comment| %>
<% next if comment.new_record? %>
<div class="contextual">
......
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