archive/app/views/archives/custom_widget_data.html.erb

21 lines
987 B
Plaintext

<% 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">
var has_expanded_layouts = ['archive_index2', 'archive_index4', 'archive_index12', 'archive_index14'];
if($.inArray($("#page_layout").val(), has_expanded_layouts) != -1){
$(".archive_expanded").addClass("show").removeClass("hide");
}
$("#page_layout").change(function(){
var value = $(this).val();
if($.inArray(value, has_expanded_layouts) != -1){
$(".archive_expanded").addClass("show").removeClass("hide");
}else{
$(".archive_expanded").removeClass("show").addClass("hide");
}
})
</script>