From f1b8b7caedb7fdb4317353a046156c7c1fc20faa Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 5 Jul 2014 11:20:59 +0800 Subject: [PATCH] t --- app/controllers/avatar_controller.rb | 4 ++-- app/views/avatar/_avatar_form.html.erb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index 3b43fec9c..73c1dbd90 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -25,7 +25,7 @@ class AvatarController < ApplicationController end end end - if @temp_file && (@temp_file.size > 0) + if @temp_file && (@temp_file.size > 0) diskfile=disk_filename(@source_type,@source_id) @urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file)) logger.info("Saving avatar '#{diskfile}' (#{@temp_file.size} bytes)") @@ -55,7 +55,7 @@ class AvatarController < ApplicationController # saved = @avatar.save begin f = Magick::ImageList.new(diskfile) - width = 300.0; + width = 300.0 proportion = (width/f[0].columns) height = (f[0].rows*proportion) f.resize_to_fill!(width,height) diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb index fc55bd2ef..272397c62 100644 --- a/app/views/avatar/_avatar_form.html.erb +++ b/app/views/avatar/_avatar_form.html.erb @@ -42,17 +42,17 @@
- - <%= l(:button_upload_photo) %> + + <%= l(:button_upload_photo) %> - + <%= file_field_tag 'avatar[image]', :id => nil, :class => 'file_selector', :style => 'width:70px;',#added by young :size => "1", :multiple => false, - :onchange => 'addInputAvatar(this);', + :onchange => 'addInputAvatar(this);', :data => { :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), @@ -61,7 +61,7 @@ :description_placeholder => nil ,# l(:label_optional_description) :source_type => source.class.to_s, :source_id => source.id.to_s - } %> + } %> <% content_for :header_tags do %>