<%=tra("Language Case Rule Definition")%>
<%=tra("Token Gender:")%> | <%=select_tag("#{rule_prefix}[definition][gender]", options_for_select(@rule.class.gender_options, @rule.definition[:gender]), :style => "width:150px")%> |
<%=tra("Conditions:") %> |
<%=select_tag("#{rule_prefix}[definition][part1]", tr8n_options_for_select(@rule.class.condition_options, @rule.definition[:part1]), :style => "width:150px")%>
<%=text_field_tag("#{rule_prefix}[definition][value1]", @rule.humanize_values(@rule.definition[:value1]), :style => "width:150px")%>
<%=hidden_field_tag("#{rule_prefix}[definition][operator]", 'and')%>
<%=hidden_field_tag("#{rule_prefix}[definition][multipart]", @rule.definition[:multipart].to_s, :id => 'edit_rule_multipart')%>
<% multipart = (@rule.definition[:multipart].to_s == "true") %>
<% rule_key = "case_#{@case_index}_rule_#{@rule_index}" %>
<% more_link_style = 'display:none' if multipart %>
<% less_link_style = 'display:none' unless multipart %>
<%=link_to_function(tra('+ Add condition'), "Tr8n.Effects.show('rule_#{rule_key}_second_part'); Tr8n.Effects.hide('add_condition_link'); Tr8n.element('edit_rule_multipart').value='true';", :style => more_link_style)%>
<% second_part_style = 'display:none' unless multipart %>
<%=select_tag("#{rule_prefix}[definition][part2]", tr8n_options_for_select(@rule.class.condition_options, @rule.definition[:part2]), :style => "width:150px")%>
<%=text_field_tag("#{rule_prefix}[definition][value2]", @rule.humanize_values(@rule.definition[:value2]), :style => "width:150px")%>
<%=link_to_function('- Remove condition', "Tr8n.Effects.hide('rule_#{rule_key}_second_part'); Tr8n.Effects.show('add_condition_link'); Tr8n.element('edit_rule_multipart').value='false';")%>
|
<%=tra("Operation:") %> | <%=select_tag("#{rule_prefix}[definition][operation]", tr8n_options_for_select(@rule.class.operation_options, @rule.definition[:operation]), :style => "width:150px")%> <%=text_field_tag("#{rule_prefix}[definition][operation_value]", @rule.humanize_values(@rule.definition[:operation_value]), :style => "width:150px")%> |
<%=link_to_function("#{trla(@new_rule ? "Add Rule" : "Update Rule", "Tr8n lightbox close button")}".html_safe, "tr8nLightbox.hide(); updateLanguageCaseRule();", :class => "tr8n_grey_button tr8n_pcb") %>
<%=tra("or")%>
<%=link_to_function(trla("Cancel", "Tr8n lightbox close button"), "tr8nLightbox.hide()") %>