Description:
disable fullname editing
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@47 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r23:6beb043d888f - - 3 files changed: 12 inserted, 8 deleted
@@ -5,7 +5,6 | |||
|
5 | 5 | verify :method => :post, :only => [:chg_passwd], |
|
6 | 6 | :redirect_to => { :action => :index } |
|
7 | 7 | |
|
8 | - in_place_edit_for :user, :full_name | |
|
9 | 8 | in_place_edit_for :user, :alias_for_editing |
|
10 | 9 | in_place_edit_for :user, :email_for_editing |
|
11 | 10 |
@@ -6,6 +6,7 | |||
|
6 | 6 | |
|
7 | 7 | validates_presence_of :login |
|
8 | 8 | validates_presence_of :full_name |
|
9 | + validates_length_of :full_name, :minimum => 1 | |
|
9 | 10 | |
|
10 | 11 | validates_presence_of :password, :if => :password_required? |
|
11 | 12 | validates_length_of :password, :within => 4..20, :if => :password_required? |
@@ -29,10 +30,12 | |||
|
29 | 30 | end |
|
30 | 31 | |
|
31 | 32 | def email_for_editing |
|
32 |
- if self.email |
|
|
33 | + if self.email==nil | |
|
34 | + "(unknown)" | |
|
35 | + elsif self.email=='' | |
|
36 | + "(blank)" | |
|
37 | + else | |
|
33 | 38 | self.email |
|
34 | - else | |
|
35 | - "unknown" | |
|
36 | 39 | end |
|
37 | 40 | end |
|
38 | 41 | |
@@ -41,10 +44,12 | |||
|
41 | 44 | end |
|
42 | 45 | |
|
43 | 46 | def alias_for_editing |
|
44 |
- if self.alias |
|
|
47 | + if self.alias==nil | |
|
48 | + "(unknown)" | |
|
49 | + elsif self.alias=='' | |
|
50 | + "(blank)" | |
|
51 | + else | |
|
45 | 52 | self.alias |
|
46 | - else | |
|
47 | - "unknown" | |
|
48 | 53 | end |
|
49 | 54 | end |
|
50 | 55 |
You need to be logged in to leave comments.
Login now