增加修改昵称功能以及昵称是否重复的判断

This commit is contained in:
sw 2014-05-28 17:07:23 +08:00
parent 218fb3f831
commit 3546355f70
2 changed files with 18 additions and 12 deletions

View File

@ -54,6 +54,7 @@ class MyController < ApplicationController
@user.safe_attributes = params[:user]
@user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
@user.login = params[:login]
unless @user.user_extensions.nil?
if @user.user_extensions.identity == 2
@user.firstname = params[:enterprise_name]

View File

@ -55,20 +55,25 @@
<legend onclick="toggleFieldset(this);">
<%= l(:label_information_plural) %>
</legend>
<!-- 昵称 -->
<p style="width:630px;padding-left: 26px;">
<%= f.text_field :login, :required => true, :name => "login"%>
<span class='font_lighter'><%= l(:label_max_number) %></span>
<br/>
</p>
<div>
<span id='name' style='display:none'>
<p style="width:630px;padding-left: 26px;">
<%= f.text_field :login, :required => true %>
<span class='font_lighter'><%= l(:label_max_number) %></span>
</p>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %>
<span class='font_lighter'><%= l(:field_lastname_eg) %></span>
</p>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :firstname, :required => true %>
<span class='font_lighter'><%= l(:field_firstname_eg) %></span>
</p>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %>
<span class='font_lighter'><%= l(:field_lastname_eg) %></span>
</p>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :firstname, :required => true %>
<span class='font_lighter'><%= l(:field_firstname_eg) %></span>
</p>
</span>
<span id='enterprise' style='display:none'>