Remove translation logic for group names from form-configuration form

pull/5212/head
Wieland Lindenthal 8 years ago committed by Oliver Günther
parent 8c5be6eda7
commit b187a9b129
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 13
      app/helpers/types_helper.rb
  2. 8
      app/views/types/form/_form_configuration.html.erb

@ -75,11 +75,8 @@ module ::TypesHelper
} }
end end
extended_group = { key: group[0], translation: group_translate(group[0]) } [group[0], extended_attributes]
[extended_group, extended_attributes]
end end
inactives = inactive_attributes.map do |key, attribute| inactives = inactive_attributes.map do |key, attribute|
{ {
key: key, key: key,
@ -109,14 +106,6 @@ module ::TypesHelper
end end
end end
def group_translate(name)
if ['details', 'estimates_and_time', 'other', 'people'].include? name
I18n.t("label_#{name}")
else
name
end
end
def translated_attribute_name(name, attr) def translated_attribute_name(name, attr)
if attr[:name_source] if attr[:name_source]
attr[:name_source].call attr[:name_source].call

@ -71,14 +71,14 @@ See doc/COPYRIGHT.rdoc for more details.
<div id="draggable-groups" dragula='"groups"'> <div id="draggable-groups" dragula='"groups"'>
<% form_configuration_groups(@type)[:actives].each do |group, attributes| %> <% form_configuration_groups(@type)[:actives].each do |group, attributes| %>
<div class="type-form-conf-group" data-original-key="<%= group[:key] %>" data-key="<%= group[:key] %>"> <div class="type-form-conf-group" data-original-key="<%= group %>" data-key="<%= group %>">
<div class="group-head"> <div class="group-head">
<span class="group-handle">&#xe0b5;</span> <span class="group-handle">&#xe0b5;</span>
<group-edit-in-place <group-edit-in-place
name="<%= group[:translation] %>" name="<%= group %>"
key="<%= group[:key] %>" key="<%= group %>"
onvaluechange="groupNameChange"> onvaluechange="groupNameChange">
<%= group[:translation] %> <%= group %>
</group-edit-in-place> </group-edit-in-place>
<div class="attribute-visibility"> <div class="attribute-visibility">
<%= I18n.t('label_always_visible') %> <%= I18n.t('label_always_visible') %>

Loading…
Cancel
Save