]> git.openstreetmap.org Git - rails.git/commitdiff
Remove the old richtext_area helper
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 3 Mar 2021 15:34:16 +0000 (15:34 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 3 Mar 2021 15:34:16 +0000 (15:34 +0000)
This has been superseded by the `f.richtext_field` custom form builder.

app/helpers/application_helper.rb
app/views/site/_html_help.erb [deleted file]
app/views/site/_markdown_help.html.erb [deleted file]
config/locales/en.yml
test/helpers/application_helper_test.rb

index c8473adfc3d777f72f65d6c69f207e0e20721966..ed01ad89b927ac4e6c4dcf59b31fc50a3d4e8164 100644 (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"
diff --git a/app/views/site/_html_help.erb b/app/views/site/_html_help.erb
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/views/site/_markdown_help.html.erb b/app/views/site/_markdown_help.html.erb
deleted file mode 100644 (file)
index 7dbadef..0000000
+++ /dev/null
@@ -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>
index 298369c22be4fb16d6af1e5b07b23732459edeed..f7ee6d04a5822234ed598383e0d835056ff50766 100644 (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: |
index fe4587b87c50455d7d936ef21ea2d32fe26baa75..90fbaebc29b926a1a666baa6a3b05cdba71d8e35 100644 (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