Merge pull request #6340 from opf/fix/readd-favicon-and-touch-icon-form

Fix: Re-add forms for uploading favicon and touch icon.

[ci skip]
pull/6342/head
Oliver Günther 7 years ago committed by GitHub
commit 9a25e49217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 68
      app/views/custom_styles/show.html.erb

@ -68,6 +68,74 @@ See docs/COPYRIGHT.rdoc for more details.
</section> </section>
<% end %> <% end %>
<%= form_for @custom_style, url: custom_style_path, html: { multipart: true, class: "form -vertical" } do |f| %>
<section class="form--section">
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= I18n.t(:label_custom_favicon) %></legend>
<% if @custom_style.id && @custom_style.favicon.present? %>
<div>
<%= tag('img', src: custom_style_favicon_path(digest: @custom_style.digest, filename: @custom_style.favicon_identifier), class: 'custom-favicon-preview') %>
<%= link_to t(:button_delete),
custom_style_favicon_delete_path,
method: :delete,
class: 'icon icon-delete confirm-form-submit' %>
</div>
<% end %>
<div class="grid-block">
<div class="form--field -required">
<div class="attachment_field form--field-container -vertical -shrink">
<div class="form--file-container">
<%= f.file_field :favicon, required: true, class: "attachment_choose_file", size: "15" %>
</div>
</div>
<div class="form--field-instructions">
<%= t('text_custom_favicon_instructions') %>
</div>
</div>
</div>
<%= styled_button_tag t(@custom_style.favicon.present? ? :button_replace : :button_upload), class: "button #{@custom_style.favicon.blank? ? '-with-icon icon-add' : ''}" %>
</fieldset>
</section>
<% end %>
<%= form_for @custom_style, url: custom_style_path, html: { multipart: true, class: "form -vertical" } do |f| %>
<section class="form--section">
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= I18n.t(:label_custom_touch_icon) %></legend>
<% if @custom_style.id && @custom_style.touch_icon.present? %>
<div>
<%= tag('img', src: custom_style_touch_icon_path(digest: @custom_style.digest, filename: @custom_style.touch_icon_identifier), class: 'custom-touch-icon-preview') %>
<%= link_to t(:button_delete),
custom_style_touch_icon_delete_path,
method: :delete,
class: 'icon icon-delete confirm-form-submit' %>
</div>
<% end %>
<div class="grid-block">
<div class="form--field -required">
<div class="attachment_field form--field-container -vertical -shrink">
<div class="form--file-container">
<%= f.file_field :touch_icon, required: true, class: "attachment_choose_file", size: "15" %>
</div>
</div>
<div class="form--field-instructions">
<%= t('text_custom_touch_icon_instructions') %>
</div>
</div>
</div>
<%= styled_button_tag t(@custom_style.touch_icon.present? ? :button_replace : :button_upload), class: "button #{@custom_style.touch_icon.blank? ? '-with-icon icon-add' : ''}" %>
</fieldset>
</section>
<% end %>
<%= form_tag update_design_colors_path, method: :post, class: "form" do %> <%= form_tag update_design_colors_path, method: :post, class: "form" do %>
<section class="form--section"> <section class="form--section">
<fieldset class="form--fieldset"> <fieldset class="form--fieldset">

Loading…
Cancel
Save