Skip to content

Commit

Permalink
Add dir=auto to user generated content
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 19, 2022
1 parent 3a534ea commit 152fe4c
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions app/views/browse/changeset.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<span class="action-button" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_hide_url(comment.id) %>"><%= t("javascripts.changesets.show.hide_comment") %></span>
<% end %>
</small>
<%= comment.body.to_html %>
<div dir="auto"><%= comment.body.to_html %></div>
</li>
<% elsif current_user and current_user.moderator? %>
<li id="c<%= comment.id %>">
Expand All @@ -56,8 +56,8 @@
:exact_time => l(comment.created_at),
:user => link_to(comment.author.display_name, user_path(comment.author))) %>
<span class="action-button text-muted" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_unhide_url(comment.id) %>"><%= t("javascripts.changesets.show.unhide_comment") %></span>
</small>
<%= comment.body.to_html %>
</small>
<div dir="auto"><%= comment.body.to_html %></div>
</li>
<% end %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/browse/note.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div>
<h4><%= t(".description") %></h4>
<div class="note-description">
<div class="note-description" dir="auto">
<%= h(@note_comments.first.body.to_html) %>
</div>

Expand Down Expand Up @@ -38,7 +38,7 @@
<% @note_comments.drop(1).each do |comment| %>
<li id="c<%= comment.id %>">
<small class='text-muted'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
<%= comment.body.to_html %>
<div dir="auto"><%= comment.body.to_html %></div>
</li>
<% end %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/changeset_comments/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
:changeset_id => comment.changeset.id.to_s %></h2>
<div class="changeset-comment" style="margin-top: 5px">
<div class="changeset-comment-description" style="font-size: smaller; color: #999999"><%= t ".commented_at_by_html", :when => friendly_date_ago(comment.created_at), :user => comment.author.display_name %></div>
<div class="changeset-comment-text"><%= comment.body %></div>
<div class="changeset-comment-text" dir="auto"><%= comment.body %></div>
</div>
2 changes: 1 addition & 1 deletion app/views/diary_entries/_diary_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% end %>
</p>

<div class="richtext text-break"><%= diary_comment.body.to_html %></div>
<div class="richtext text-break" dir="auto"><%= diary_comment.body.to_html %></div>
<% if can? :hidecomment, DiaryEntry %>
<span>
<% if diary_comment.visible? %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/diary_entries/_diary_entry.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class='diary_post<%= " text-muted px-3 deleted" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
<div class='mb-3'>
<% if @user %>
<h2><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
<h2 dir="auto"><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
<% else %>
<div class="row">
<div class="col-auto">
<%= user_thumbnail diary_entry.user %>
</div>
<div class="col">
<h2><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
<h2 dir="auto"><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
</div>
</div>
<% end %>
Expand All @@ -22,7 +22,7 @@

</div>

<div class="richtext text-break" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
<div class="richtext text-break" dir="auto" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
<%= diary_entry.body.to_html %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/diary_entries/comments.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<tr class="<%= "text-muted" unless comment.visible? %>">
<td width="25%"><%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %></td>
<td width="25%"><span title="<%= l comment.created_at, :format => :friendly %>"><%= time_ago_in_words(comment.created_at, :scope => :"datetime.distance_in_words_ago") %></span></td>
<td width="50%" class="richtext text-break"><%= comment.body.to_html %></td>
<td width="50%" class="richtext text-break" dir="auto"><%= comment.body.to_html %></td>
</tr>
<% end -%>
</table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_message_summary.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" unless message_summary.message_read? %>">
<td class="inbox-sender"><%= link_to message_summary.sender.display_name, user_path(message_summary.sender) %></td>
<td class="inbox-subject"><%= link_to message_summary.title, message_path(message_summary) %></td>
<td class="inbox-subject" dir="auto"><%= link_to message_summary.title, message_path(message_summary) %></td>
<td class="inbox-sent"><%= l message_summary.sent_on, :format => :friendly %></td>
<td class="inbox-mark-unread"><%= button_to t(".unread_button"), message_mark_path(message_summary, :mark => "unread"), :remote => true, :class => "btn btn-sm btn-primary" %></td>
<td class="inbox-mark-read"><%= button_to t(".read_button"), message_mark_path(message_summary, :mark => "read"), :remote => true, :class => "btn btn-sm btn-primary" %></td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_sent_message_summary.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr class="inbox-row">
<td class="inbox-sender"><%= link_to sent_message_summary.recipient.display_name, user_path(sent_message_summary.recipient) %></td>
<td class="inbox-subject"><%= link_to sent_message_summary.title, message_path(sent_message_summary) %></td>
<td class="inbox-subject" dir="auto"><%= link_to sent_message_summary.title, message_path(sent_message_summary) %></td>
<td class="inbox-sent"><%= l sent_message_summary.sent_on, :format => :friendly %></td>
<td class="inbox-destroy"><%= button_to t(".destroy_button"), message_path(sent_message_summary, :referer => request.fullpath), :method => :delete, :remote => true, :class => "btn btn-sm btn-danger" %></td>
</tr>
6 changes: 3 additions & 3 deletions app/views/messages/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :heading do %>
<h1><%= @message.title %></h1>
<h1 dir="auto"><%= @message.title %></h1>
<% end %>
<% if current_user == @message.recipient %>
Expand All @@ -11,7 +11,7 @@
</div>
</div>

<div class="richtext text-break"><%= @message.body.to_html %></div>
<div class="richtext text-break" dir="auto"><%= @message.body.to_html %></div>

<div>
<%= link_to t(".reply_button"), message_reply_path(@message), :class => "btn btn-primary" %>
Expand All @@ -28,7 +28,7 @@
</div>
</div>

<div class="richtext text-break"><%= @message.body.to_html %></div>
<div class="richtext text-break" dir="auto"><%= @message.body.to_html %></div>

<div>
<%= link_to t(".destroy_button"), message_path(@message), :method => "delete", :class => "btn btn-danger" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/notes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</td>
<td><%= link_to note.id, browse_note_path(note) %></td>
<td><%= note_author(note.author) %></td>
<td><%= note.comments.first.body.to_html %></td>
<td dir="auto"><%= note.comments.first.body.to_html %></td>
<td><%= friendly_date_ago(note.created_at) %></td>
<td><%= friendly_date_ago(note.updated_at) %></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_blocks/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
<dt class="col-sm-3"><%= t ".status" %></dt>
<dd class="col-sm-9"><%= block_status(@user_block) %></dd>
<dt class="col-sm-3"><%= t ".reason" %></dt>
<dd class="col-sm-9"><div class="richtext text-break"><%= @user_block.reason.to_html %></div></dd>
<dd class="col-sm-9"><div class="richtext text-break" dir="auto"><%= @user_block.reason.to_html %></div></dd>
</dl>
2 changes: 1 addition & 1 deletion app/views/user_mailer/_message_body.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:target => "_blank", :rel => "noopener"
) %>
</td>
<td style="text-align: <%= style_left %>; vertical-align: top; padding-<%= style_right %>: 10px; width: 100%">
<td dir="auto" style="text-align: <%= style_left %>; vertical-align: top; padding-<%= style_right %>: 10px; width: 100%">
<%= body %>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_user.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:date => l(user.created_at, :format => :friendly) %>
<% end %>
</p>
<div class="richtext text-break"><%= user.description.to_html %></div>
<div class="richtext text-break" div="auto"><%= user.description.to_html %></div>
</td>
<td>
<%= check_box_tag "user_#{user.id}", "", false, :name => "user[#{user.id}]" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
</div>
<% end %>

<div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
<div class="richtext text-break clearfix" dir="auto"><%= @user.description.to_html %></div>

<% if current_user and @user.id == current_user.id %>
<div class="my-3">
Expand Down

0 comments on commit 152fe4c

Please sign in to comment.