Skip to content

Commit

Permalink
Fix second view with blocked form
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmus committed Jun 1, 2021
1 parent 6af2673 commit 18cfd9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/Resources/public/js/mass-edit/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ define([
locales: locales,
channels: channels,
attributes: attributes,
translatedAttributes: model.actions[0].translatedAttributes,
sourceChannel: model.actions[0].sourceChannel,
sourceLocale: model.actions[0].sourceLocale,
targetChannel: model.actions[0].targetChannel,
Expand Down
42 changes: 21 additions & 21 deletions src/Resources/public/templates/mass-edit/translate.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</div>
<div class="AknFieldContainer-inputContainer">
<select name="translatedAttributes[]" id="translated-attributes" class="select2 label-field AknSettingField"
multiple="multiple">
<% _.each(attributes, function (attribute){ %>
<option value="<%= attribute.code %>"><%- i18n.getLabel(attribute.labels, uiLocale, attribute.code) %>
</option>
<% }); %>
multiple="multiple" <% if(translatedAttributes.length > 0){ %> readonly="true"<% } %>>
<% _.each(attributes, function (attribute){ %>
<option value="<%= attribute.code %>" <% if(translatedAttributes.includes(attribute.code)){ %>selected="selected"<% } %>><%- i18n.getLabel(attribute.labels, uiLocale, attribute.code) %>
</option>
<% }); %>
</select>
</div>
</div>
Expand All @@ -22,10 +22,10 @@
</label>
</div>
<div class="AknFieldContainer-inputContainer">
<select name="sourceChannel" id="source-channel" class="select2 form-field label-field AknSettingField">
<% _.each(channels, function (channel, key){ %>
<option value="<%= channel.code %>"><%- i18n.getLabel(channel.labels, uiLocale, channel.code) %></option>
<% }); %>
<select name="sourceChannel" id="source-channel" class="select2 form-field label-field AknSettingField" <% if(translatedAttributes.length > 0){ %> readonly="true"<% } %>>
<% _.each(channels, function (channel, key){ %>
<option value="<%= channel.code %>" <% if(channel.code == sourceChannel){ %>selected="selected"<% } %>><%- i18n.getLabel(channel.labels, uiLocale, channel.code) %></option>
<% }); %>
</select>
</div>
</div>
Expand All @@ -36,10 +36,10 @@
</label>
</div>
<div class="AknFieldContainer-inputContainer">
<select name="sourceLocale" id="source-locale" class="select2 form-field label-field AknSettingField">
<% _.each(locales, function (locale, key){ %>
<option value="<%= locale.code %>"><%= locale.label %></option>
<% }); %>
<select name="sourceLocale" id="source-locale" class="select2 form-field label-field AknSettingField" <% if(translatedAttributes.length > 0){ %> readonly="true"<% } %>>
<% _.each(locales, function (locale, key){ %>
<option value="<%= locale.code %>" <% if(locale.code == sourceLocale){ %>selected="selected"<% } %>><%= locale.label %></option>
<% }); %>
</select>
</div>
</div>
Expand All @@ -50,10 +50,10 @@
</label>
</div>
<div class="AknFieldContainer-inputContainer">
<select name="targetChannel" id="target-channel" class="select2 form-field label-field AknSettingField">
<% _.each(channels, function (channel, key){ %>
<option value="<%= channel.code %>"><%- i18n.getLabel(channel.labels, uiLocale, channel.code) %></option>
<% }); %>
<select name="targetChannel" id="target-channel" class="select2 form-field label-field AknSettingField" <% if(translatedAttributes.length > 0){ %> readonly="true"<% } %>>
<% _.each(channels, function (channel, key){ %>
<option value="<%= channel.code %>" <% if(channel.code == targetChannel){ %>selected="selected"<% } %>><%- i18n.getLabel(channel.labels, uiLocale, channel.code) %></option>
<% }); %>
</select>
</div>
</div>
Expand All @@ -64,10 +64,10 @@
</label>
</div>
<div class="AknFieldContainer-inputContainer">
<select name="targetLocale" id="target-locale" class="select2 form-field label-field AknSettingField">
<% _.each(locales, function (locale, key){ %>
<option value="<%= locale.code %>"><%= locale.label %></option>
<% }); %>
<select name="targetLocale" id="target-locale" class="select2 form-field label-field AknSettingField" <% if(translatedAttributes.length > 0){ %> readonly="true"<% } %>>
<% _.each(locales, function (locale, key){ %>
<option value="<%= locale.code %>" <% if(locale.code == targetLocale){ %>selected="selected"<% } %>><%= locale.label %></option>
<% }); %>
</select>
</div>
</div>

0 comments on commit 18cfd9f

Please sign in to comment.