From c4b4460df9ba3c81fcd905b8554bc72e7756775b Mon Sep 17 00:00:00 2001 From: zhangyang Date: Fri, 2 Aug 2013 10:41:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=BB=E9=A1=B5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E2=80=9C=E8=B7=AF=E7=BA=BF=E5=9B=BE=E2=80=9D=E2=80=9C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E2=80=9D=EF=BC=9B=E7=94=A8=E6=88=B7=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E5=AE=9A=E4=B9=89=E2=80=9C=E6=9C=80=E6=96=B0=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E2=80=9D=E8=8F=9C=E5=8D=95=E8=B7=AF=E5=BE=84=EF=BC=9B?= =?UTF-8?q?=E8=BF=9B=E4=B8=80=E6=AD=A5=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/versions_controller.rb | 1 + app/views/avatar/_avatar_form.html.erb | 79 +++++++++++++++++++------- lib/redmine.rb | 6 +- 3 files changed, 63 insertions(+), 23 deletions(-) diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index f159f7ec..1eeecf56 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class VersionsController < ApplicationController + layout "base_projects" menu_item :roadmap model_object Version before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb index 0c243aa5..c8d92b30 100644 --- a/app/views/avatar/_avatar_form.html.erb +++ b/app/views/avatar/_avatar_form.html.erb @@ -1,29 +1,68 @@ + + <%= image_tag(url_to_avatar(source), id: "avatar_image", size: AvatarHelper::AVATAR_SIZE)%> - - - +上传图片 - <%= file_field_tag 'avatar[image]', - :id => nil, - :class => 'file_selector', - :multiple => false, - :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)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => upload_avatar_path(:format => 'js'), - :description_placeholder => nil ,# l(:label_optional_description) - :source_type => source.class.to_s, - :source_id => source.id.to_s - } %> - - -(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + 上传图片 + + + <%= file_field_tag 'avatar[image]', + :id => nil, + :class => 'file_selector', + :size => "1", + :multiple => false, + :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)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => upload_avatar_path(:format => 'js'), + :description_placeholder => nil ,# l(:label_optional_description) + :source_type => source.class.to_s, + :source_id => source.id.to_s + } %> <% content_for :header_tags do %> diff --git a/lib/redmine.rb b/lib/redmine.rb index 3ff39067..2c8edd90 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -245,7 +245,7 @@ end Redmine::MenuManager.map :project_menu do |menu| menu.push :overview, { :controller => 'projects', :action => 'show' } # menu.push :activity, { :controller => 'activities', :action => 'index' } -# menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, + menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id # :if => Proc.new { |p| p.shared_versions.any? } menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural # menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, @@ -258,7 +258,7 @@ Redmine::MenuManager.map :project_menu do |menu| # :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } # menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, # :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural -# menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id + menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil }, :if => Proc.new { |p| p.repository && !p.repository.new_record? } menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true @@ -267,7 +267,7 @@ end Redmine::MenuManager.map :user_menu do |menu| menu.push :activity, {:controller => 'users', :action => 'show' } menu.push :project, {:controller => 'users', :action => 'user_projects'} - menu.push :requirement_focus, {} + menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} end #end