Merge remote-tracking branch 'upstream/pull/4608'

This commit is contained in:
Tom Hughes 2024-03-21 16:30:21 +00:00
commit dd27022a35
7 changed files with 20 additions and 17 deletions

View file

@ -3,7 +3,7 @@
<%= user_thumbnail diary_comment.user %>
</div>
<div class="col">
<p class="text-muted m-0" id="comment<%= diary_comment.id %>"><%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %>
<p class="text-muted m-0" id="comment<%= diary_comment.id %>"><%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, diary_comment.user), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %>
<% if current_user and diary_comment.user.id != current_user.id %>
| <%= report_link(t(".report"), diary_comment) %>
<% end %>
@ -13,9 +13,9 @@
<% if can? :hidecomment, DiaryEntry %>
<span>
<% if diary_comment.visible? %>
<%= link_to t(".hide_link"), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".hide_link"), hide_diary_comment_path(diary_comment.diary_entry.user, diary_comment.diary_entry, diary_comment), :method => :post, :data => { :confirm => t(".confirm") } %>
<% else %>
<%= link_to t(".unhide_link"), unhide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".unhide_link"), unhide_diary_comment_path(diary_comment.diary_entry.user, diary_comment.diary_entry, diary_comment), :method => :post, :data => { :confirm => t(".confirm") } %>
<% end %>
</span>
<% end %>

View file

@ -24,7 +24,7 @@
<% end %>
<% if current_user && current_user == diary_entry.user %>
<li><%= link_to t(".edit_link"), :action => "edit", :display_name => diary_entry.user.display_name, :id => diary_entry.id %></li>
<li><%= link_to t(".edit_link"), edit_diary_entry_path(diary_entry.user, diary_entry) %></li>
<% end %>
<% if current_user and diary_entry.user != current_user %>
@ -36,9 +36,9 @@
<% if can? :hide, DiaryEntry %>
<li>
<% if diary_entry.visible %>
<%= link_to t(".hide_link"), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".hide_link"), hide_diary_entry_path(diary_entry.user, diary_entry), :method => :post, :data => { :confirm => t(".confirm") } %>
<% else %>
<%= link_to t(".unhide_link"), unhide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".unhide_link"), unhide_diary_entry_path(diary_entry.user, diary_entry), :method => :post, :data => { :confirm => t(".confirm") } %>
<% end %>
</li>
<% end %>

View file

@ -13,7 +13,7 @@
<% end %>
<small class='text-muted'>
<%= t("diary_entries.diary_entry.posted_by_html", :link_user => (link_to diary_entry.user.display_name, user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %>
<%= t("diary_entries.diary_entry.posted_by_html", :link_user => (link_to diary_entry.user.display_name, diary_entry.user), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %>
<% if (l(diary_entry.updated_at, :format => :blog) != l(diary_entry.created_at, :format => :blog)) %>
<%= t("diary_entries.diary_entry.updated_at_html", :updated => l(diary_entry.updated_at, :format => :blog)) %>
<% end %>

View file

@ -1,7 +1,9 @@
<%= t ".location" %>
<a href="<%= url_for :controller => "site", :action => "index", :anchor => "map=14/#{location.latitude}/#{location.longitude}" %>">
<abbr class="geo" title="<%= t ".coordinates", :latitude => number_with_precision(location.latitude, :precision => 4), :longitude => number_with_precision(location.longitude, :precision => 4) %>">
<%= describe_location location.latitude, location.longitude, 14, location.language_code %>
</abbr>
</a>
<%= link_to root_path(:anchor => "map=14/#{location.latitude}/#{location.longitude}") do
tag.abbr :class => "geo",
:title => t(".coordinates", :latitude => number_with_precision(location.latitude, :precision => 4),
:longitude => number_with_precision(location.longitude, :precision => 4)) do
describe_location location.latitude, location.longitude, 14, location.language_code
end
end %>

View file

@ -1,6 +1,6 @@
<% content_for :heading do %>
<h1><%= t ".heading", :user => @user.display_name %></h1>
<p><%= t ".subheading_html", :user => link_to(@user.display_name, user_path(@user)) %></p>
<p><%= t ".subheading_html", :user => link_to(@user.display_name, @user) %></p>
<% end %>
<% if @comments.empty? %>

View file

@ -19,9 +19,9 @@
<% if current_user %>
<div class="col-auto">
<% if @entry.subscribers.exists?(current_user.id) %>
<%= link_to t("javascripts.changesets.show.unsubscribe"), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => "btn btn-sm btn-primary" %>
<%= link_to t("javascripts.changesets.show.unsubscribe"), diary_entry_unsubscribe_path(@entry.user, @entry), :method => :post, :class => "btn btn-sm btn-primary" %>
<% else %>
<%= link_to t("javascripts.changesets.show.subscribe"), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => "btn btn-sm btn-primary" %>
<%= link_to t("javascripts.changesets.show.subscribe"), diary_entry_subscribe_path(@entry.user, @entry.id), :method => :post, :class => "btn btn-sm btn-primary" %>
<% end %>
</div>
<% end %>

View file

@ -886,8 +886,9 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
get diary_comments_path(:display_name => other_user.display_name)
assert_response :success
assert_template :comments
assert_select "table.table-striped" do
assert_select "tr", :count => 2 # header and one comment
assert_dom "a[href='#{user_path(other_user)}']", :text => other_user.display_name
assert_select "table.table-striped tbody" do
assert_select "tr", :count => 1
end
# Test a suspended user