<%#-- copyright OpenProject is a project management system. Copyright (C) 2012-2015 the OpenProject Foundation (OPF) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3. OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: Copyright (C) 2006-2013 Jean-Philippe Lang Copyright (C) 2010-2013 the ChiliProject Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See doc/COPYRIGHT.rdoc for more details. ++#%> <% html_title t(:label_administration), t(:label_custom_style) %> <%= toolbar title: t(:label_custom_style) %> <%= error_messages_for 'custom_style' %> <%= form_for @custom_style, url: custom_style_path, html: { multipart: true, class: "form -vertical" } do |f| %>
<%= I18n.t(:label_custom_logo) %> <% if @custom_style.id && @custom_style.logo.present? %>
<%= tag('img', src: custom_style_logo_path(digest: @custom_style.digest, filename: @custom_style.logo_identifier), class: 'custom-logo-preview') %> <%= link_to t(:button_delete), custom_style_logo_delete_path, method: :delete, class: 'icon icon-delete confirm-form-submit' %>
<% end %>
<%= f.file_field :logo, required: true, class: "attachment_choose_file", size: "15" %>
<%= t('text_custom_logo_instructions') %>
<%= styled_button_tag l(@custom_style.logo.present? ? :button_replace : :button_upload), class: "button #{@custom_style.logo.blank? ? '-with-icon icon-add' : ''}" %>
<% end %> <%= form_for @custom_style, url: custom_style_path, html: { multipart: true, class: "form -vertical" } do |f| %>
<%= I18n.t(:label_custom_favicon) %> <% if @custom_style.id && @custom_style.favicon.present? %>
<%= 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' %>
<% end %>
<%= f.file_field :favicon, required: true, class: "attachment_choose_file", size: "15" %>
<%= t('text_custom_favicon_instructions') %>
<%= styled_button_tag t(@custom_style.favicon.present? ? :button_replace : :button_upload), class: "button #{@custom_style.favicon.blank? ? '-with-icon icon-add' : ''}" %>
<% end %> <%= form_for @custom_style, url: custom_style_path, html: { multipart: true, class: "form -vertical" } do |f| %>
<%= I18n.t(:label_custom_touch_icon) %> <% if @custom_style.id && @custom_style.touch_icon.present? %>
<%= 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' %>
<% end %>
<%= f.file_field :touch_icon, required: true, class: "attachment_choose_file", size: "15" %>
<%= t('text_custom_touch_icon_instructions') %>
<%= styled_button_tag t(@custom_style.touch_icon.present? ? :button_replace : :button_upload), class: "button #{@custom_style.touch_icon.blank? ? '-with-icon icon-add' : ''}" %>
<% end %> <%= form_tag update_design_colors_path, method: :post, class: "form -wide-labels" do %>
<%= I18n.t('admin.custom_styles.custom_colors') %> <% DesignColor.setables.each do |design_color| %>
<%= text_field_tag "design_colors[]" + design_color.variable, design_color.hexcode, placeholder: (DesignColor.defaults[design_color.variable] =~ /#[0-9A-F]{6}/ ? DesignColor.defaults[design_color.variable] : ''), maxlength: 7 %> <%= icon_for_color OpenStruct.new( variable: design_color.variable, hexcode: design_color.get_hexcode ), class: 'timelines-x-update-color color-preview', data: { target: "#design_colors_#{design_color.variable}" } %>
<%= t("admin.custom_styles.instructions.#{design_color.variable.tr('-', '_')}") %>
<% end %> <%= styled_button_tag l(:button_save), class: '-with-icon icon-checkmark' %>
<% end %>