2014-07-15 16:13:50 +08:00
|
|
|
<div id="avatardiv">
|
2013-08-02 10:41:12 +08:00
|
|
|
<style type="text/css">
|
2013-08-03 22:18:30 +08:00
|
|
|
a, a:hover {text-decoration:none;}
|
2013-08-02 10:41:12 +08:00
|
|
|
.btn_addPic
|
|
|
|
{
|
|
|
|
position: relative;
|
2013-08-12 22:05:27 +08:00
|
|
|
left: 15px;
|
2013-08-02 10:41:12 +08:00
|
|
|
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;
|
2013-08-12 22:05:27 +08:00
|
|
|
opacity: 0;
|
2013-08-02 10:41:12 +08:00
|
|
|
filter: alpha(opacity:0);
|
|
|
|
}
|
|
|
|
</style>
|
2013-08-13 11:31:27 +08:00
|
|
|
<div style="padding-left:60px;">
|
2013-08-12 22:05:27 +08:00
|
|
|
<span id="attachments_fields">
|
|
|
|
<%= image_tag(url_to_avatar(source), id: "avatar_image", size: AvatarHelper::AVATAR_SIZE,:class=>"avatar")%>
|
|
|
|
<div id="avatar_file" style="width: 100px">
|
|
|
|
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
|
|
|
|
</div>
|
2013-08-01 10:33:49 +08:00
|
|
|
</span>
|
2015-05-15 17:36:18 +08:00
|
|
|
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
|
2014-07-15 16:13:50 +08:00
|
|
|
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
|
2014-07-05 11:20:59 +08:00
|
|
|
<span><%= l(:button_upload_photo) %></span>
|
2015-04-21 17:56:01 +08:00
|
|
|
</a>
|
2014-07-10 10:15:20 +08:00
|
|
|
<!-- :accept => 'image/png,image/gif,image/jpeg', -->
|
2014-07-05 11:20:59 +08:00
|
|
|
<span class="add_avatar" style="margin-left: -55px;width: 70px">
|
2013-08-02 10:41:12 +08:00
|
|
|
<%= file_field_tag 'avatar[image]',
|
|
|
|
:id => nil,
|
|
|
|
:class => 'file_selector',
|
2013-08-04 08:55:39 +08:00
|
|
|
:style => 'width:70px;',#added by young
|
2013-08-02 10:41:12 +08:00
|
|
|
:size => "1",
|
|
|
|
:multiple => false,
|
2014-07-05 11:20:59 +08:00
|
|
|
:onchange => 'addInputAvatar(this);',
|
2013-08-02 10:41:12 +08:00
|
|
|
: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,
|
2014-07-10 10:15:20 +08:00
|
|
|
:file_type => Redmine::Configuration['pic_types'].to_s,
|
|
|
|
:type_support_message => l(:error_pic_type),
|
2013-08-02 10:41:12 +08:00
|
|
|
: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
|
2014-07-05 11:20:59 +08:00
|
|
|
} %>
|
2013-08-01 10:33:49 +08:00
|
|
|
</span>
|
2015-04-22 15:49:38 +08:00
|
|
|
|
2013-08-12 22:05:27 +08:00
|
|
|
</div>
|
2013-08-01 10:33:49 +08:00
|
|
|
<% content_for :header_tags do %>
|
|
|
|
<%= javascript_include_tag 'avatars' %>
|
|
|
|
<% end %>
|
2015-05-08 14:28:17 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|