<div class="contextual" style="padding-right: 10px;">
	<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
	<%= call_hook(:view_my_account_contextual, :user => @user)%>
</div>

<h3 style="padding-left: 10px;"><%= l(:label_my_account)%></h3>




<fieldset class="box" style="margin:10px;">
	<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
		<legend onclick="toggleFieldset(this);">
			<%= "我的头像"%>
		</legend>
		<div>
		<!--upload profiles-->
			<%= render :partial=> "avatar/avatar_form", :locals=>{source:@user} %>
		<!--upload-->
		</div>
	</fieldset>
	<%= labelled_form_for :user, @user,
		:url => { :action => "account" },
		:html => { :id => 'my_account_form',
		:method => :post } do |f| %>
	<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
		<legend onclick="toggleFieldset(this);">
			<%= l(:label_information_plural)%>
		</legend>
		<p style="width:400px;padding-left: 26px;">
			<%= f.text_field :firstname, :required => true %>
		</p>
		<p style="width:400px;padding-left: 26px;">
			<%= f.text_field :lastname, :required => true %>
		</p>
		<p style="width:400px;">
			<%= f.text_field :mail, :required => true %>
		</p>
		<p style="width:413px;padding-left:36px;>
			<%= f.select :language, lang_options_for_select %>
		</p>
		<% if Setting.openid? %>
		<p>
			<%= f.text_field :identity_url  %>
		</p>
		<% end %>

		<% @user.custom_field_values.select(&:editable?).each do |value| %>
		<p>
			<%= custom_field_tag_with_label :user, value %>
		</p>
		<% end %>
		<%= call_hook(:view_my_account, :user => @user, :form => f) %>
	</fieldset>


	<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
		<legend onclick="toggleFieldset(this);">
			<%= l(:field_mail_notification)%>
		</legend>
		<p style="width:380px;>
		<%= render :partial => 'users/mail_notifications' %>
	    </p>
	</fieldset>

	<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
		<legend onclick="toggleFieldset(this);">
			<%= l(:label_preferences)%>
		</legend>
		<%= render :partial => 'users/preferences' %>
	</fieldset>
    <%= submit_tag l(:button_save) %>
</fieldset>
<% end %>
<%= error_messages_for 'user' %>
<% html_title(l(:label_my_account)) -%>
