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

30 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

<div class="control-group">
<div class="controls">
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<span class="show_span"><%= t('cancerpredict.sort_num')+': ' %></span>
<%= f.text_field 'sort_number',{:class=>'sort_num',:value=>((image_form['sort_number'] == nil) ? i+1 : image_form['sort_number'] ),:style=>'float: left;width: 3em;'} %>
<span class="show_span"><%= t('cancerpredict.logo')+': ' %></span>
<div class="fileupload-new thumbnail pull-left">
<% if image_form.temp_file.file.present? %>
<%= image_tag( image_form.temp_file, :size=>"120x120") rescue ''%>
<% else %>
<%= image_tag "/assets/site-logo.png", :class => "pull-left upload-picture"%>
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<% if image_form.temp_file.file.present?%>
<span class="btn btn-file">
<%= f.file_field :temp_file, {:id => "input-upload", :class => 'fileupload-new', :accept=> 'image/png,image/gif,image/jpeg'} %><%= t('preferences.change') %>
</span>
<%= f.check_box :remove_image,{:checked=>false} %>
<%= t(:remove) %> <%= (I18n.locale.to_s == 'en') ? ' this logo' : '該logo' %>
<%else%>
<span class="btn btn-file">
<%= f.file_field :temp_file,{ :id => "input-upload", :class => 'fileupload-new', :accept=> 'image/png,image/gif,image/jpeg'} %><%= t('preferences.select_image') %>
</span>
<%end%>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
</div>
</div>
</div>