From efe76ee1d9badbad12b0cc42affb7b3d0572797c Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 22 Jan 2013 15:09:54 -0800 Subject: Rough way to allow user to paste in their key, but certainly we will want different display. --- users/app/models/user.rb | 2 +- users/app/views/users/_public_key_field.html.haml | 1 + users/app/views/users/edit.html.haml | 1 + users/config/locales/en.yml | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 users/app/views/users/_public_key_field.html.haml diff --git a/users/app/models/user.rb b/users/app/models/user.rb index eff7abd..80d49a3 100644 --- a/users/app/models/user.rb +++ b/users/app/models/user.rb @@ -9,7 +9,7 @@ class User < CouchRest::Model::Base property :email_forward, String, :accessible => true property :email_aliases, [LocalEmail] - property :public_key + property :public_key, :accessible => true validates :login, :password_salt, :password_verifier, :presence => true diff --git a/users/app/views/users/_public_key_field.html.haml b/users/app/views/users/_public_key_field.html.haml new file mode 100644 index 0000000..af88cbd --- /dev/null +++ b/users/app/views/users/_public_key_field.html.haml @@ -0,0 +1 @@ += f.input :public_key, :as => :text, :hint => t(:use_ascii_key), :input_html => {:class => "span5", :rows => 20} # will want to tweak this to be wide enough (maybe smaller text?) diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml index 03088d8..d1c19ee 100644 --- a/users/app/views/users/edit.html.haml +++ b/users/app/views/users/edit.html.haml @@ -8,6 +8,7 @@ %legend=t :email_address Your email address is = render user.email_address, :as => :span + = user_form_with 'public_key_field', :legend => :public_key = user_form_with 'email_forward_field', :legend => :forward_email = user_form_with 'email_aliases', :legend => :add_email_alias = render 'tabs/tabs', :tabs => [:account, :email] diff --git a/users/config/locales/en.yml b/users/config/locales/en.yml index 7a6ab90..493b5db 100644 --- a/users/config/locales/en.yml +++ b/users/config/locales/en.yml @@ -13,10 +13,12 @@ en: set_email_address: "Set email address" forward_email: "Forward email" email_aliases: "Email aliases" + public_key: "Public Key" add_email_alias: "Add email alias" user_updated_successfully: "Settings have been updated successfully." user_created_successfully: "Successfully created your account." email_alias_destroyed_successfully: "Successfully removed the alias '%{alias}'." + use_ascii_key: "Use ASCII-armored PGP key" activemodel: models: -- cgit v1.2.3