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

This commit is contained in:
Tom Hughes 2021-03-03 18:43:34 +00:00
commit dfeb93c9f8
10 changed files with 4 additions and 89 deletions

View file

@ -83,13 +83,6 @@ a {
/* Utility for de-emphasizing content */
.deemphasize {
color: $darkgrey;
a {
color: $blue;
}
}
.text-muted a {
color: $blue;
}
@ -1253,11 +1246,6 @@ tr.turn:hover {
img.user_thumbnail {
float: left;
}
small.deemphasize {
float: left;
display: block;
}
}
/* Rules for the diary entry page */
@ -1707,13 +1695,8 @@ div.secondary-actions {
}
}
.diary_post .richtext {
margin-top: $lineheight;
}
.comments .richtext {
margin-left: 70px;
margin-top: 0;
}
/* Rules for the user notes list */

View file

@ -17,26 +17,6 @@ module ApplicationHelper
link_to(image_tag("RSS.png", :size => "16x16", :border => 0), args, :class => "rsssmall")
end
def richtext_area(object_name, method, options = {})
id = "#{object_name}_#{method}"
type = options.delete(:format) || "markdown"
tag.div(:id => "#{id}_container", :class => "richtext_container") do
output_buffer << tag.div(:id => "#{id}_content", :class => "richtext_content") do
output_buffer << text_area(object_name, method, options.merge("data-preview-url" => preview_url(:type => type)))
output_buffer << tag.div("", :id => "#{id}_preview", :class => "richtext_preview richtext text-break")
end
output_buffer << tag.div(:id => "#{id}_help", :class => "richtext_help") do
output_buffer << render("site/#{type}_help")
output_buffer << tag.div(:class => "buttons") do
output_buffer << submit_tag(I18n.t("site.richtext_area.edit"), :id => "#{id}_doedit", :class => "richtext_doedit deemphasize", :disabled => true)
output_buffer << submit_tag(I18n.t("site.richtext_area.preview"), :id => "#{id}_dopreview", :class => "richtext_dopreview deemphasize")
end
end
end
end
def dir
if dir = params[:dir]
dir == "rtl" ? "rtl" : "ltr"

View file

@ -51,7 +51,7 @@
:when => friendly_date_ago(comment.created_at),
:exact_time => l(comment.created_at),
:user => link_to(comment.author.display_name, user_path(comment.author))) %>
— <span class="action-button deemphasize" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_unhide_url(comment.id) %>"><%= t("javascripts.changesets.show.unhide_comment") %></span>
— <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 %>
</li>

View file

@ -3,7 +3,7 @@
<%= render @changesets %>
</ol>
<% if @changesets.size == 20 -%>
<div class="changeset_more text-center">
<div class="changeset_more mt-3 text-center">
<%= link_to t(".load_more"), url_for(@params.merge(:max_id => @changesets.last.id - 1)), :class => "btn btn-primary" %>
<div class="loader"><%= image_tag "searching.gif" %></div>
</div>

View file

@ -11,7 +11,7 @@
</tr>
</thead>
<% @comments.each do |comment| -%>
<tr class="<%= "deemphasize" unless comment.visible? %>">
<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>

View file

@ -1,26 +0,0 @@
<h4 class='heading'><%= t ".title_html" %></h4>
<ul class='list-unstyled'>
<li>
<h4><%= t ".headings" %></h4>
<p># <%= t ".heading" %><br>
## <%= t ".subheading" %></p>
</li>
<li>
<h4><%= t ".unordered" %></h4>
<p>* <%= t ".first" %><br>
* <%= t ".second" %></p>
</li>
<li>
<h4><%= t ".ordered" %></h4>
<p>1. <%= t ".first" %><br>
2. <%= t ".second" %></p>
</li>
<li>
<h4><%= t ".link" %></h4>
<span>[<%= t ".text" %>](<%= t ".url" %>)</span>
</li>
<li>
<h4><%= t ".image" %></h4>
<span>![<%= t ".alt" %>](<%= t ".url" %>)</span>
</li>
</ul>

View file

@ -94,7 +94,7 @@
<fieldset>
<legend><%= t ".home location" -%></legend>
<div id="homerow" <% unless current_user.home_lat and current_user.home_lon %> class="nohome"<% end %>>
<p class="message form-help deemphasize"><%= t ".no home location" %></p>
<p class="message text-muted"><%= t ".no home location" %></p>
<div class="form-row">
<%= f.text_field :home_lat, :wrapper_class => "col-sm-4", :id => "home_lat" %>
<%= f.text_field :home_lon, :wrapper_class => "col-sm-4", :id => "home_lon" %>

View file

@ -1995,23 +1995,6 @@ en:
bicycle_shop: "Bicycle shop"
bicycle_parking: "Bicycle parking"
toilets: "Toilets"
richtext_area:
edit: Edit
preview: Preview
markdown_help:
title_html: Parsed with <a href="https://kramdown.gettalong.org/quickref.html">kramdown</a>
headings: Headings
heading: Heading
subheading: Subheading
unordered: Unordered list
ordered: Ordered list
first: First item
second: Second item
link: Link
text: Text
image: Image
alt: Alt text
url: URL
welcome:
title: Welcome!
introduction_html: |

View file

@ -47,11 +47,6 @@ class ApplicationHelperTest < ActionView::TestCase
assert_dom_equal "<a class=\"rsssmall\" href=\"/history/feed\"><img border=\"0\" height=\"16\" src=\"/images/RSS.png\" width=\"16\" /></a>", link
end
def test_richtext_area
html = richtext_area(:message, :body, :cols => 40, :rows => 20)
assert_not_nil html
end
def test_dir
assert_equal "ltr", dir