项目主页添加“路线图”“文件”;用户主页定义“最新反馈”菜单路径;进一步修改上传头像按钮

This commit is contained in:
zhangyang 2013-08-02 10:41:12 +08:00
parent bb34453a87
commit c4b4460df9
3 changed files with 63 additions and 23 deletions

View File

@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class VersionsController < ApplicationController class VersionsController < ApplicationController
layout "base_projects"
menu_item :roadmap menu_item :roadmap
model_object Version model_object Version
before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] before_filter :find_model_object, :except => [:index, :new, :create, :close_completed]

View File

@ -1,29 +1,68 @@
<style type="text/css">
a, a:hover {text-decoration:none;width:50px;}
.btn_addPic
{
position: relative;
left: 85px;
height: 17px;
width: 50px;
overflow: hidden;
padding: 2px 8px;
border: 1px solid #EBEBEB;
background: none repeat scroll 0 0 #F3F3F3;
color: #999999;
font: 12px 'Simhei';
cursor: pointer;
text-align: center;
}
.btn_addPic em
{
width: 40px;
height: 17px;
overflow: hidden;
margin: 0;
line-height: 20em;
vertical-align: middle;
}
.btn_addPic:hover em
{
background-position: 0;
}
.file_selector
{
position: relative;
width:0px;
padding-left:0;
opacity: 0;
filter: alpha(opacity:0);
}
</style>
<span id="avatar_fields"> <span id="avatar_fields">
<%= image_tag(url_to_avatar(source), id: "avatar_image", size: AvatarHelper::AVATAR_SIZE)%> <%= image_tag(url_to_avatar(source), id: "avatar_image", size: AvatarHelper::AVATAR_SIZE)%>
<span id="avatar_file"> <span id="avatar_file">
</span> </span>
</span> </span>
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
<span>上传图片</span>
</a>
<span class="add_avatar"> <span class="add_avatar">
<a href="javascript:void(0);" class="btn_addPic"> <%= file_field_tag 'avatar[image]',
<spam><em>+</em>上传图片</span> :id => nil,
<%= file_field_tag 'avatar[image]', :class => 'file_selector',
:id => nil, :size => "1",
:class => 'file_selector', :multiple => false,
:multiple => false, :onchange => 'addInputAvatar(this);',
:onchange => 'addInputAvatar(this);', :data => {
:data => { :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
: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_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,
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, :upload_path => upload_avatar_path(:format => 'js'),
:upload_path => upload_avatar_path(:format => 'js'), :description_placeholder => nil ,# l(:label_optional_description)
:description_placeholder => nil ,# l(:label_optional_description) :source_type => source.class.to_s,
:source_type => source.class.to_s, :source_id => source.id.to_s
:source_id => source.id.to_s } %>
} %>
<input type="file" tabindex="3" title="支持jpg、jpeg、gif、png格式文件小于5M" size="3" name="pic" class="filePrew">
</a>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span> </span>
<% content_for :header_tags do %> <% content_for :header_tags do %>

View File

@ -245,7 +245,7 @@ end
Redmine::MenuManager.map :project_menu do |menu| Redmine::MenuManager.map :project_menu do |menu|
menu.push :overview, { :controller => 'projects', :action => 'show' } menu.push :overview, { :controller => 'projects', :action => 'show' }
# menu.push :activity, { :controller => 'activities', :action => 'index' } # 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? } # :if => Proc.new { |p| p.shared_versions.any? }
menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural 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, # 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? } # :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
# menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, # menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id,
# :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural # :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 }, menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil },
:if => Proc.new { |p| p.repository && !p.repository.new_record? } :if => Proc.new { |p| p.repository && !p.repository.new_record? }
menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true
@ -267,7 +267,7 @@ end
Redmine::MenuManager.map :user_menu do |menu| Redmine::MenuManager.map :user_menu do |menu|
menu.push :activity, {:controller => 'users', :action => 'show' } menu.push :activity, {:controller => 'users', :action => 'show' }
menu.push :project, {:controller => 'users', :action => 'user_projects'} 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'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'}
end end
#end #end