OSDN Git Service

fix show token in profile
authorValery Sizov <vsv2711@gmail.com>
Sun, 18 Dec 2011 16:09:59 +0000 (18:09 +0200)
committerValery Sizov <vsv2711@gmail.com>
Sun, 18 Dec 2011 16:09:59 +0000 (18:09 +0200)
app/views/profile/password.html.haml

index 18bae4b..0fd20ce 100644 (file)
 = form_for @user, :url => profile_reset_private_token_path, :method => :put do |f|
   %p
     Current private token:
-    %strong
-      = current_user.private_token
-    %em.cred
-      keep it in secret!
+    - if current_user.private_token
+      %strong
+        = current_user.private_token
+      %em.cred
+        keep it in secret!
+    - else
+      %strong don`t have
   .actions
-    = f.submit 'Reset', :confirm => "Are you sure?", :class => "grey-button"
+    - if current_user.private_token
+      = f.submit 'Reset', :confirm => "Are you sure?", :class => "grey-button"
+    - else
+      = f.submit 'Generate', :class => "grey-button"
+