2022-04-08 03:20:21 +00:00
|
|
|
<% active_expanded = @custom_data_field[:expanded] rescue nil %>
|
|
|
|
<div class="control-group input-content hide archive_expanded">
|
|
|
|
<label class="control-label muted" for="custom_expanded"><%=t("archive.expanded")%> :</label>
|
|
|
|
<div class="controls">
|
|
|
|
<%= select_tag("#{@field_name}[custom_data_field][expanded]", options_for_select(["yes","no"].map{|opt| [t("archive.#{opt}"),opt]},active_expanded),{:id=>"custom_expanded"})%>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
2023-01-03 15:51:53 +00:00
|
|
|
var has_expanded_layouts = ['archive_index2', 'archive_index4', 'archive_index12', 'archive_index14'];
|
|
|
|
if($.inArray($("#page_layout").val(), has_expanded_layouts) != -1){
|
2022-04-08 03:20:21 +00:00
|
|
|
$(".archive_expanded").addClass("show").removeClass("hide");
|
|
|
|
}
|
|
|
|
$("#page_layout").change(function(){
|
|
|
|
var value = $(this).val();
|
2023-01-03 15:51:53 +00:00
|
|
|
if($.inArray(value, has_expanded_layouts) != -1){
|
2022-04-08 03:20:21 +00:00
|
|
|
$(".archive_expanded").addClass("show").removeClass("hide");
|
|
|
|
}else{
|
|
|
|
$(".archive_expanded").removeClass("show").addClass("hide");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|