cancer_predict/app/views/admin/cancerpredicts/index.html.erb

142 lines
4.2 KiB
Plaintext
Raw Normal View History

2019-11-15 00:44:28 +00:00
<div style="clear:both;"></div>
<% @i = 0 %>
<%=form_for @form_to_show ,:url=>{:controller=>"cancerpredicts" ,:action=>"edit"} do |form|%>
<table>
<thead>
<tr>
<% @form_to_show.form_show.values[1].each do |key,vlaue|%>
<th><%=key%></th>
<%end%>
</tr>
</thead>
2019-11-23 08:14:56 +00:00
<tbody>
<%= form.fields_for :form_show do |formfield|%>
<% @form_to_show.form_show.each do |num,property| %>
<%=formfield.fields_for num.to_s do |make_fields|%>
<tr>
<% property.each do |key,value|%>
<% @value= value %>
<% if @value.class == BSON::Document || @value.class == Hash %>
<% @disp_value = @value[I18n.locale.to_s] rescue "" %>
<%else%>
<% @disp_value = @value %>
<%end%>
<% if @value.class == Fixnum %>
<% if @value == 1%>
<td><%= make_fields.check_box key,{:checked=>true,:class=>"checkbox",:style=>"float:left;"}%></td>
<% else%>
<td><%= make_fields.check_box key,{:checked=>false,:class=>"checkbox",:style=>"float:left;"}%></td>
<%end%>
<% elsif @value.class == BSON::Document || @value.class == Hash %>
<%=make_fields.fields_for I18n.locale.to_s do |locale_fields|%>
<td><%= locale_fields.text_field key,{:value=>@disp_value}%></td>
<%end%>
<% else %>
<td><%= make_fields.text_field key,{:value=>@disp_value}%></td>
<%end%>
2019-11-23 08:14:56 +00:00
<%end%>
</tr>
2019-11-23 08:14:56 +00:00
<%end%>
<%end%>
<%end%>
</tbody>
</table>
<span class="show_span"><%=t('cancerpredict.table.Results')%></span>
<div style="clear:both;"></div>
<label for="form_result_is_right" style="float: left;">結果在右邊</label>
<% if @form_to_show.form_result_is_right.to_i == 1%>
<div><%= form.check_box "form_result_is_right",{:checked=>true,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%></div>
<% else%>
<div><%= form.check_box "form_result_is_right",{:checked=>false,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%></div>
2019-11-15 00:44:28 +00:00
<%end%>
<table>
<thead>
<tr>
<% @form_to_show.form_show_in_result.values[1].each do |key,vlaue|%>
<th><%=key%></th>
<%end%>
</tr>
</thead>
<tbody>
<%= form.fields_for :form_show_in_result do |formfield|%>
<% @form_to_show.form_show_in_result.each do |num,property| %>
<%=formfield.fields_for num.to_s do |make_fields|%>
<tr>
<% property.each do |key,value|%>
<% @value= value %>
<% if @value.class == BSON::Document || @value.class == Hash %>
<% @disp_value = @value[I18n.locale.to_s] rescue "" %>
<%else%>
<% @disp_value = @value %>
<%end%>
<% if @value.class == Fixnum %>
<% if @value == 1%>
<td><%= make_fields.check_box key,{:checked=>true,:class=>"checkbox",:style=>"float:left;"}%></td>
<% else%>
<td><%= make_fields.check_box key,{:checked=>false,:class=>"checkbox",:style=>"float:left;"}%></td>
<%end%>
<% elsif @value.class == BSON::Document || @value.class == Hash %>
<%=make_fields.fields_for I18n.locale.to_s do |locale_fields|%>
<td><%= locale_fields.text_field key,{:value=>@disp_value}%></td>
<%end%>
<% else %>
<td><%= make_fields.text_field key,{:value=>@disp_value}%></td>
<%end%>
<%end%>
</tr>
<%end%>
<%end%>
<%end%>
</tbody>
</table>
<%=form.submit "#{t(:updatefont)}",{:id=>"updatebtn"}%>
<%end%>
2019-11-15 00:44:28 +00:00
<style type="text/css">
2019-11-23 08:14:56 +00:00
thead > tr > th{
border:1px solid;
background: bisque;
}
tbody{
background:white;
}
tbody > tr > td{
border:1px solid;
position: relative;
2019-11-23 08:14:56 +00:00
}
2019-11-15 00:44:28 +00:00
.show_li,.show_li *{
list-style:none;
color:balck;
}
.show_li ul{
display:none;
}
#clicktosee{
color:blue;
cursor:pointer;
}
.checkbox{
left: 50%;
position: absolute;
transform: translate(-50%, -50%) !important;
top: 50%;
}
#updatebtn{
margin-top: 1em;
right: 1em;
background-color: rgb(210, 105, 0);
color: white;
border: 0em;
padding: 0.125em 0.5em;
border-radius: 0.5em;
}
.show_span{
margin: 1em;
float: left;
background-color: rgb(210, 105, 0);
color: white;
border: 0em;
padding: 0.125em 0.5em;
border-radius: 0.5em;
width: fit-content;
}
2019-11-23 08:14:56 +00:00
</style>