patch_file/app/views/admin/patchfiles/editckeditor.html.erb

44 lines
1.6 KiB
Plaintext

<h3 title="CKEDITOR現有字形">CKEDITOR現有字形</h3>
<%=form_for @field,:url=>{:controller=>"patchfiles" ,:action=>"newfont"} do |f|%>
<div style="padding-left:1em">
<%= f.fields_for :font_array do |fontfield|%>
<% @arr = @field.font_array.keys %>
<% for @i in @arr %>
<div style="float:left;">
<% if @field.font_array[@i.to_s].values.first == true%>
<%=fontfield.check_box @field.font_array[@i.to_s].keys.first,{:checked=>true,:id=>"checkbox"+@i.to_s,:style=>"float:left;"} %>
<% else %>
<%=fontfield.check_box @field.font_array[@i.to_s].keys.first,{:id=>"checkbox"+@i.to_s,:style=>"float:left;"} %>
<% end %>
<%=fontfield.label @field.font_array[@i.to_s].keys.first,{:for=>"checkbox"+@i.to_s,:style=>"float:right;"}%>
</div>
<%end%>
<%end%>
</div>
<div style="clear:both;"></div>
<div style="padding-left:1em"><label for="newfont" style="float:left;"><%=t(:newfont)%>:</label><%=f.text_field :new_add_font,{:id=>"newfont",:placeholder=>t(:newfont)}%></div>
<%=f.submit "#{t(:updatefont)}",{:id=>"submitbtn"}%>
<button id="initialbtn"><%= (I18n.locale.to_s == "zh_tw") ? "點擊來恢復初始狀態" : "click to recovery initial state" %></button>
<%=f.text_field :initial_btn, {:id=>"hidden-initial",:type => "hidden",:value=>"false"} %>
<%end%>
<style type="text/css">
.show_li,.show_li *{
list-style:none;
color:black;
}
.show_li ul{
display:none;
}
#clicktosee{
color:blue;
cursor:pointer;
}
</style>
<script>
$("#initialbtn").off("click").on("click",function(){
$("#hidden-initial").val("true");
$("#submitbtn").click();
});
</script>