masq2 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +83 -0
- data/CODE_OF_CONDUCT.md +135 -0
- data/CONTRIBUTING.md +151 -0
- data/LICENSE.txt +22 -0
- data/README.md +426 -0
- data/SECURITY.md +23 -0
- data/app/assets/images/masq/favicon.ico +0 -0
- data/app/assets/images/masq/openid_symbol.png +0 -0
- data/app/assets/images/masq/seatbelt_icon.png +0 -0
- data/app/assets/images/masq/seatbelt_icon_gray.png +0 -0
- data/app/assets/images/masq/seatbelt_icon_high.png +0 -0
- data/app/assets/stylesheets/masq/application.css.erb +61 -0
- data/app/controllers/masq/accounts_controller.rb +132 -0
- data/app/controllers/masq/base_controller.rb +78 -0
- data/app/controllers/masq/consumer_controller.rb +144 -0
- data/app/controllers/masq/info_controller.rb +23 -0
- data/app/controllers/masq/passwords_controller.rb +42 -0
- data/app/controllers/masq/personas_controller.rb +75 -0
- data/app/controllers/masq/server_controller.rb +247 -0
- data/app/controllers/masq/sessions_controller.rb +58 -0
- data/app/controllers/masq/sites_controller.rb +60 -0
- data/app/controllers/masq/yubikey_associations_controller.rb +25 -0
- data/app/helpers/masq/application_helper.rb +57 -0
- data/app/helpers/masq/personas_helper.rb +15 -0
- data/app/helpers/masq/server_helper.rb +15 -0
- data/app/mailers/masq/account_mailer.rb +17 -0
- data/app/models/masq/account.rb +245 -0
- data/app/models/masq/open_id_request.rb +42 -0
- data/app/models/masq/persona.rb +61 -0
- data/app/models/masq/release_policy.rb +11 -0
- data/app/models/masq/site.rb +68 -0
- data/app/views/layouts/masq/base.html.erb +70 -0
- data/app/views/layouts/masq/consumer.html.erb +30 -0
- data/app/views/masq/account_mailer/forgot_password.html.erb +3 -0
- data/app/views/masq/account_mailer/forgot_password.text.erb +3 -0
- data/app/views/masq/account_mailer/signup_notification.html.erb +5 -0
- data/app/views/masq/account_mailer/signup_notification.text.erb +5 -0
- data/app/views/masq/accounts/_hcard.html.erb +29 -0
- data/app/views/masq/accounts/edit.html.erb +100 -0
- data/app/views/masq/accounts/new.html.erb +27 -0
- data/app/views/masq/accounts/show.html.erb +4 -0
- data/app/views/masq/accounts/show.xrds.builder +40 -0
- data/app/views/masq/consumer/index.html.erb +31 -0
- data/app/views/masq/consumer/start.html.erb +2 -0
- data/app/views/masq/info/help.html.erb +8 -0
- data/app/views/masq/info/index.html.erb +5 -0
- data/app/views/masq/info/safe_login.html.erb +24 -0
- data/app/views/masq/passwords/edit.html.erb +13 -0
- data/app/views/masq/passwords/new.html.erb +11 -0
- data/app/views/masq/personas/_form.html.erb +159 -0
- data/app/views/masq/personas/edit.html.erb +9 -0
- data/app/views/masq/personas/index.html.erb +17 -0
- data/app/views/masq/personas/new.html.erb +9 -0
- data/app/views/masq/server/decide.html.erb +146 -0
- data/app/views/masq/server/index.xrds.builder +19 -0
- data/app/views/masq/server/seatbelt_config.xml.builder +24 -0
- data/app/views/masq/server/seatbelt_login_state.xml.builder +4 -0
- data/app/views/masq/sessions/new.html.erb +27 -0
- data/app/views/masq/shared/_error_messages.html.erb +12 -0
- data/app/views/masq/sites/edit.html.erb +42 -0
- data/app/views/masq/sites/index.html.erb +20 -0
- data/config/initializers/configuration.rb +5 -0
- data/config/initializers/mime_types.rb +1 -0
- data/config/initializers/requires.rb +6 -0
- data/config/locales/de.yml +281 -0
- data/config/locales/en.yml +271 -0
- data/config/locales/es.yml +254 -0
- data/config/locales/nl.yml +258 -0
- data/config/locales/rails.de.yml +225 -0
- data/config/locales/ru.yml +272 -0
- data/config/masq.example.yml +132 -0
- data/config/routes.rb +41 -0
- data/db/migrate/20120312120000_masq_schema.rb +152 -0
- data/db/migrate/20130626220915_remame_last_authenticated_with_yubikey_on_masq_accounts.rb +11 -0
- data/db/migrate/20130704205532_add_first_and_lastname_columns_to_personas.rb +11 -0
- data/db/migrate/20130807060329_change_open_id_associations_server_url_column_type.rb +22 -0
- data/lib/masq/active_record_openid_store/association.rb +16 -0
- data/lib/masq/active_record_openid_store/nonce.rb +9 -0
- data/lib/masq/active_record_openid_store/openid_ar_store.rb +58 -0
- data/lib/masq/authenticated_system.rb +136 -0
- data/lib/masq/engine.rb +12 -0
- data/lib/masq/openid_server_system.rb +110 -0
- data/lib/masq/signup.rb +53 -0
- data/lib/masq/version.rb +5 -0
- data/lib/masq.rb +50 -0
- data/lib/masq2.rb +1 -0
- data/lib/tasks/masq_tasks.rake +58 -0
- data.tar.gz.sig +2 -0
- metadata +377 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%=t :openid_consumer_testsuite_title %></title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<%= stylesheet_link_tag 'masq/application' %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="head">
|
11
|
+
<h1><%=t :relying_party_title %></h1>
|
12
|
+
</div>
|
13
|
+
<div id="main">
|
14
|
+
<div class="wrap">
|
15
|
+
<h2><%=t :openid_consumer_testsuite_title %></h2>
|
16
|
+
<% if flash[:notice] %><div class="notice"><%=simple_format h flash[:notice] %></div><% end %>
|
17
|
+
<% if flash[:alert] %><div class="error"><%=simple_format h flash[:alert] %></div><% end %>
|
18
|
+
<%= yield %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div id="foot">
|
22
|
+
<div class="wrap">
|
23
|
+
<span class="note">
|
24
|
+
powered by <%= link_to "masq2", 'https://github.com/oauth-xx/masq2' %>
|
25
|
+
and <%= link_to image_tag('masq/openid_symbol.png') + " OpenID", 'https://openid.net/' %>
|
26
|
+
</span>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div id="hcard-<%= persona.fullname.gsub(/\s/, '-') if persona.fullname %>" class="vcard">
|
2
|
+
<% if persona.web_blog and !persona.web_blog.empty? %>
|
3
|
+
<a class="url fn" href='<%= persona.web_blog %>' ><%= persona.fullname %></a>
|
4
|
+
<% else %>
|
5
|
+
<span class="fn"><%= persona.fullname %></span>
|
6
|
+
<% end %>
|
7
|
+
<% if persona.company_name%>
|
8
|
+
<div class="org"><%= persona.company_name %></div>
|
9
|
+
<% end %>
|
10
|
+
<% if persona.email %>
|
11
|
+
<a class="email" href="mailto:<%= persona.email %>"><%= persona.email %></a>
|
12
|
+
<% end %>
|
13
|
+
<% if persona.address %>
|
14
|
+
<div class="adr">
|
15
|
+
<div class="street-address"><%= persona.address %></div>
|
16
|
+
<span class="locality"><%= persona.city %></span>
|
17
|
+
,
|
18
|
+
<span class="region"><%= persona.state %></span>
|
19
|
+
,
|
20
|
+
<span class="postal-code"><%= persona.postcode %></span>
|
21
|
+
|
22
|
+
<span class="country-name"><%= persona.country %></span>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
<% if persona.phone_mobile%>
|
27
|
+
<div class="tel"><%= persona.phone_mobile%></div>
|
28
|
+
<% end %>
|
29
|
+
</div>
|
@@ -0,0 +1,100 @@
|
|
1
|
+
<h2><%=t :my_profile %></h2>
|
2
|
+
|
3
|
+
<%= error_messages_for current_account %>
|
4
|
+
|
5
|
+
<%= form_for current_account, :url => account_path, :html => { :method => :put } do |f| %>
|
6
|
+
<% unless email_as_login? -%>
|
7
|
+
<div class="row">
|
8
|
+
<%= f.label :email, t(:email) %>
|
9
|
+
<%= f.text_field :email %>
|
10
|
+
</div>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<div class="row">
|
14
|
+
<%= f.label :public_persona_id, t(:public_persona) %>
|
15
|
+
<%= f.select :public_persona_id, current_account.personas.map{ |p| [ p.title, p.id ]}, :include_blank => !Masq::Engine.config.masq['force_default_persona'] %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div>
|
19
|
+
<%= f.submit t(:submit_update) %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<% if Masq::Engine.config.masq['can_change_password'] %>
|
24
|
+
<h2><%=t :my_password %></h2>
|
25
|
+
<%= form_tag change_password_account_path, :method => :put do %>
|
26
|
+
<div class="row">
|
27
|
+
<%= label_tag :old_password, t(:old_password) %>
|
28
|
+
<%= password_field_tag :old_password %>
|
29
|
+
</div>
|
30
|
+
<div class="row">
|
31
|
+
<%= label_tag :password, t(:new_password_minimum_6_characters).html_safe %>
|
32
|
+
<%= password_field_tag :password %>
|
33
|
+
</div>
|
34
|
+
<div class="row">
|
35
|
+
<%= label_tag :password_confirmation, t(:password_confirmation) %>
|
36
|
+
<%= password_field_tag :password_confirmation %>
|
37
|
+
</div>
|
38
|
+
<div>
|
39
|
+
<%= submit_tag t(:submit_update) %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
|
44
|
+
<% if Masq::Engine.config.masq['can_use_yubikey'] %>
|
45
|
+
<h2><%=t :my_yubikey %></h2>
|
46
|
+
<% if current_account.yubico_identity? %>
|
47
|
+
<%= form_tag account_yubikey_association_path, :method => :delete do %>
|
48
|
+
<div class="row">
|
49
|
+
<p><%=t :your_account_is_associated_with_the_yubico_identity %> <strong><%= current_account.yubico_identity %></strong></p>
|
50
|
+
<p class="note"><%=t :yubikey_how_to_use %></p>
|
51
|
+
</div>
|
52
|
+
<div>
|
53
|
+
<%= submit_tag t(:remove_association) %>
|
54
|
+
</div>
|
55
|
+
<% end %>
|
56
|
+
|
57
|
+
<%= form_for :account, :url => account_path, :html => { :method => :put } do |f| %>
|
58
|
+
<div>
|
59
|
+
<p>
|
60
|
+
<% if current_account.yubikey_mandatory? %>
|
61
|
+
<%=t :your_yubikey_is_mandatory_for_login %>
|
62
|
+
<% else %>
|
63
|
+
<%=t :your_yubikey_is_optional_for_login %>
|
64
|
+
<% end %>
|
65
|
+
</p>
|
66
|
+
<div>
|
67
|
+
<%= f.hidden_field :yubikey_mandatory, :value => (current_account.yubikey_mandatory ? 0 : 1) %>
|
68
|
+
<%= submit_tag( current_account.yubikey_mandatory ? t(:make_my_yubikey_optional) : t(:make_my_yubikey_mandatory) ) %>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<% end %>
|
72
|
+
|
73
|
+
<% else %>
|
74
|
+
<%= form_tag account_yubikey_association_path do %>
|
75
|
+
<div class="row">
|
76
|
+
<%= label_tag :yubico_otp, t(:your_yubikey_a_one_time_password).html_safe %>
|
77
|
+
<%= password_field_tag :yubico_otp %>
|
78
|
+
</div>
|
79
|
+
<div>
|
80
|
+
<%= submit_tag t(:associate_account_with_yubikey) %>
|
81
|
+
</div>
|
82
|
+
<% end %>
|
83
|
+
<% end %>
|
84
|
+
<% end %>
|
85
|
+
|
86
|
+
<% if Masq::Engine.config.masq['can_disable_account'] %>
|
87
|
+
<h2><%=t :disable_my_account %></h2>
|
88
|
+
|
89
|
+
<%= form_tag account_path, :method => :delete do %>
|
90
|
+
<p><%=t :wont_be_possible_to_reclaim_identifier %> <%= identifier(current_account) %></p>
|
91
|
+
<div class="row">
|
92
|
+
<%= label_tag :confirmation_password, t(:confirm_by_entering_password) %>
|
93
|
+
<%= password_field_tag :confirmation_password, '' %>
|
94
|
+
</div>
|
95
|
+
<div>
|
96
|
+
<%= submit_tag t(:delete_my_account_and_data) %>
|
97
|
+
</div>
|
98
|
+
<% end %>
|
99
|
+
<% end %>
|
100
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h2><%=t :signup_title %></h2>
|
2
|
+
|
3
|
+
<%= error_messages_for @account %>
|
4
|
+
|
5
|
+
<%= form_for @account, :url => account_path do |f| -%>
|
6
|
+
<% unless email_as_login? -%>
|
7
|
+
<div class="row">
|
8
|
+
<%= f.label :login, t(:login) %>
|
9
|
+
<%= f.text_field :login %>
|
10
|
+
</div>
|
11
|
+
<% end -%>
|
12
|
+
<div class="row">
|
13
|
+
<%= f.label :email, t(:email) %>
|
14
|
+
<%= f.text_field :email %>
|
15
|
+
</div>
|
16
|
+
<div class="row">
|
17
|
+
<%= f.label :password, t(:password) %>
|
18
|
+
<%= f.password_field :password %>
|
19
|
+
</div>
|
20
|
+
<div class="row">
|
21
|
+
<%= f.label :password_confirmation, t(:password_confirmation) %>
|
22
|
+
<%= f.password_field :password_confirmation %>
|
23
|
+
</div>
|
24
|
+
<div>
|
25
|
+
<%= f.submit t(:signup) %>
|
26
|
+
</div>
|
27
|
+
<% end -%>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
xml.instruct!
|
2
|
+
xml.xrds(
|
3
|
+
:XRDS,
|
4
|
+
"xmlns:openid" => OpenID::OPENID_1_0_NS,
|
5
|
+
"xmlns:xrds" => "xri://$xrds",
|
6
|
+
"xmlns" => "xri://$xrd*($v*2.0)",
|
7
|
+
) do
|
8
|
+
xml.XRD do
|
9
|
+
xml.Service(priority: 1) do
|
10
|
+
xml.Type(OpenID::OPENID_2_0_TYPE)
|
11
|
+
xml.Type(OpenID::SReg::NS_URI_1_1)
|
12
|
+
xml.Type(OpenID::SReg::NS_URI_1_0)
|
13
|
+
xml.Type(OpenID::AX::AXMessage::NS_URI)
|
14
|
+
xml.Type(OpenID::PAPE::AUTH_MULTI_FACTOR) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
15
|
+
xml.Type(OpenID::PAPE::AUTH_PHISHING_RESISTANT) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
16
|
+
xml.URI(endpoint_url)
|
17
|
+
xml.LocalID(identity_url(account: @account, protocol: scheme))
|
18
|
+
end
|
19
|
+
xml.Service(priority: 2) do
|
20
|
+
xml.Type(OpenID::OPENID_1_1_TYPE)
|
21
|
+
xml.Type(OpenID::SReg::NS_URI_1_1)
|
22
|
+
xml.Type(OpenID::SReg::NS_URI_1_0)
|
23
|
+
xml.Type(OpenID::AX::AXMessage::NS_URI)
|
24
|
+
xml.Type(OpenID::PAPE::AUTH_MULTI_FACTOR) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
25
|
+
xml.Type(OpenID::PAPE::AUTH_PHISHING_RESISTANT) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
26
|
+
xml.URI(endpoint_url)
|
27
|
+
xml.tag!("openid:Delegate", identity_url(account: @account, protocol: scheme))
|
28
|
+
end
|
29
|
+
xml.Service(priority: 3) do
|
30
|
+
xml.Type(OpenID::OPENID_1_0_TYPE)
|
31
|
+
xml.Type(OpenID::SReg::NS_URI_1_1)
|
32
|
+
xml.Type(OpenID::SReg::NS_URI_1_0)
|
33
|
+
xml.Type(OpenID::AX::AXMessage::NS_URI)
|
34
|
+
xml.Type(OpenID::PAPE::AUTH_MULTI_FACTOR) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
35
|
+
xml.Type(OpenID::PAPE::AUTH_PHISHING_RESISTANT) if Masq::Engine.config.masq["use_ssl"] && @account.has_otp_device?
|
36
|
+
xml.URI(endpoint_url)
|
37
|
+
xml.tag!("openid:Delegate", identity_url(account: @account, protocol: scheme))
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<%= form_tag consumer_start_path do %>
|
2
|
+
<div class="row">
|
3
|
+
<%= label_tag :openid_identifier, t(:identifier) + ':', :class => 'check' %>
|
4
|
+
<%= text_field_tag :openid_identifier, Masq::Engine.config.masq['host'] %>
|
5
|
+
<%= submit_tag t(:verify) %>
|
6
|
+
</div>
|
7
|
+
<div class="row">
|
8
|
+
<%= check_box_tag :immediate %>
|
9
|
+
<%= label_tag :immediate, t(:use_immediate_mode), :class => 'check' %>
|
10
|
+
</div>
|
11
|
+
<div class="row">
|
12
|
+
<%= check_box_tag :use_sreg, params[:did_sreg] %>
|
13
|
+
<%= label_tag :use_sreg, t(:request_registration_data), :class => 'check' %>
|
14
|
+
</div>
|
15
|
+
<div class="row">
|
16
|
+
<%= check_box_tag :use_ax_fetch, params[:did_ax_fetch] %>
|
17
|
+
<%= label_tag :use_ax_fetch, t(:request_attribute_exchange_data), :class => 'check' %>
|
18
|
+
</div>
|
19
|
+
<div class="row">
|
20
|
+
<%= check_box_tag :use_ax_store, params[:did_ax_store] %>
|
21
|
+
<%= label_tag :use_ax_store, t(:store_attribute_exchange_data), :class => 'check' %>
|
22
|
+
</div>
|
23
|
+
<div class="row">
|
24
|
+
<%= check_box_tag :use_pape, params[:did_pape] %>
|
25
|
+
<%= label_tag :use_pape, t(:request_pape), :class => 'check' %>
|
26
|
+
</div>
|
27
|
+
<div class="row">
|
28
|
+
<%= check_box_tag :force_post, params[:force_post] %>
|
29
|
+
<%= label_tag :force_post, t(:force_post), :class => 'check' %>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2><%= t(:questions_answers) %></h2>
|
2
|
+
<p><%=t :here_we_cover_openid_topics %></p>
|
3
|
+
<h3><%=t :openid_delegation %></h3>
|
4
|
+
<%=simple_format t(:delegation_explanation) %>
|
5
|
+
<pre>
|
6
|
+
<link rel="openid2.provider openid.server" href="<%= endpoint_url %>" />
|
7
|
+
<link rel="openid2.local_id openid.delegate" href="<%= identifier(logged_in? ? current_account : 'YOUR_LOGIN') %>" />
|
8
|
+
</pre>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%=h page_title %></title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
|
7
|
+
<link rel="icon" href="/favicon.ico" type="image/ico" />
|
8
|
+
<%= stylesheet_link_tag 'masq/application' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="head">
|
12
|
+
<h1><%= Masq::Engine.config.masq['name'] %></h1>
|
13
|
+
</div>
|
14
|
+
<div id="main">
|
15
|
+
<div class="wrap">
|
16
|
+
<h2><%=t :login_to_proceed %></h2>
|
17
|
+
<% if checkid_request %>
|
18
|
+
<p><%=t :host_requests_identification_you_need_to_login, :host => extract_host(checkid_request.trust_root) %></p>
|
19
|
+
<% end %>
|
20
|
+
<%=simple_format t(:login_intro, :login_url => login_url(:protocol => scheme)) %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_tag password_path(:id => @reset_code), :method => 'put' do %>
|
2
|
+
<div class="row">
|
3
|
+
<%= label_tag :password, t(:password) %>
|
4
|
+
<%= password_field_tag :password %>
|
5
|
+
</div>
|
6
|
+
<div class="row">
|
7
|
+
<%= label_tag :password_confirmation, t(:password_confirmation) %>
|
8
|
+
<%= password_field_tag :password_confirmation %>
|
9
|
+
</div>
|
10
|
+
<div>
|
11
|
+
<%= submit_tag t(:reset_password) %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h2><%=t :forgot_password_title %></h2>
|
2
|
+
|
3
|
+
<%= form_tag password_path do %>
|
4
|
+
<div class="row">
|
5
|
+
<%= content_tag :label, t(:please_enter_email), :for => 'email' %>
|
6
|
+
<%= text_field_tag :email, params[:email] %>
|
7
|
+
</div>
|
8
|
+
<div>
|
9
|
+
<%= submit_tag t(:submit_send) %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
@@ -0,0 +1,159 @@
|
|
1
|
+
<%- attributes = Masq::Engine.config.masq['attribute_mappings'].symbolize_keys.keys %>
|
2
|
+
<%- phone = [:phone_home, :phone_mobile, :phone_fax, :phone_work] %>
|
3
|
+
<%- instant_messaging = [:im_aim, :im_icq, :im_msn, :im_yahoo, :im_jabber, :im_skype] %>
|
4
|
+
<%- other_information = [:biography, :image_default, :web_default, :web_blog] %>
|
5
|
+
|
6
|
+
<div class="row inline space">
|
7
|
+
<%= form.label :title, t(:title) %>
|
8
|
+
<%= form.text_field :title %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%- if attributes.include? :nickname %>
|
12
|
+
<h3><%=t :personal_information %></h3>
|
13
|
+
<div class="row inline">
|
14
|
+
<%= form.label :nickname, property_label_text(:nickname) %>
|
15
|
+
<%= form.text_field :nickname %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
<%- if attributes.include? :fullname %>
|
19
|
+
<div class="row inline">
|
20
|
+
<%= form.label :fullname, property_label_text(:fullname) %>
|
21
|
+
<%= form.text_field :fullname %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
<%- if attributes.include? :email %>
|
25
|
+
<div class="row inline">
|
26
|
+
<%= form.label :email, property_label_text(:email) %>
|
27
|
+
<%= form.text_field :email %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
<%- if attributes.include? :address %>
|
31
|
+
<div class="row inline">
|
32
|
+
<%= form.label :address, property_label_text(:address) %>
|
33
|
+
<%= form.text_field :address %>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
<%- if attributes.include? :address_additional %>
|
37
|
+
<div class="row inline">
|
38
|
+
<%= form.label :address_additional, property_label_text(:address_additional) %>
|
39
|
+
<%= form.text_field :address_additional %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
<%- if attributes.include? :postcode %>
|
43
|
+
<div class="row inline">
|
44
|
+
<%= form.label :postcode, property_label_text(:postcode) %>
|
45
|
+
<%= form.text_field :postcode %>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
48
|
+
<%- if attributes.include? :city %>
|
49
|
+
<div class="row inline">
|
50
|
+
<%= form.label :city, property_label_text(:city) %>
|
51
|
+
<%= form.text_field :city %>
|
52
|
+
</div>
|
53
|
+
<% end %>
|
54
|
+
<%- if attributes.include? :state %>
|
55
|
+
<div class="row inline">
|
56
|
+
<%= form.label :state, property_label_text(:state) %>
|
57
|
+
<%= form.text_field :state %>
|
58
|
+
</div>
|
59
|
+
<% end %>
|
60
|
+
<%- if attributes.include? :country %>
|
61
|
+
<div class="row inline">
|
62
|
+
<%= form.label :country, property_label_text(:country) %>
|
63
|
+
<%= form.select :country, countries_for_select, { :include_blank => true } %>
|
64
|
+
</div>
|
65
|
+
<% end %>
|
66
|
+
<%- if attributes.include? :language %>
|
67
|
+
<div class="row inline">
|
68
|
+
<%= form.label :language, property_label_text(:language) %>
|
69
|
+
<%= form.select :language, languages_for_select, { :include_blank => true } %>
|
70
|
+
</div>
|
71
|
+
<% end %>
|
72
|
+
<%- if attributes.include? :timezone %>
|
73
|
+
<div class="row inline">
|
74
|
+
<%= form.label :timezone, property_label_text(:timezone) %>
|
75
|
+
<%= form.select :timezone, ActiveSupport::TimeZone::MAPPING.values.sort, { :include_blank => true } %>
|
76
|
+
</div>
|
77
|
+
<% end %>
|
78
|
+
<%- if attributes.include? :gender %>
|
79
|
+
<div class="row inline">
|
80
|
+
<%= form.label :gender, property_label_text(:gender) %>
|
81
|
+
<%= form.select :gender, [['Male', 'M'], ['Female', 'F']], { :include_blank => true } %>
|
82
|
+
</div>
|
83
|
+
<% end %>
|
84
|
+
<%- if attributes.include? :date_of_birth %>
|
85
|
+
<div class="row inline space">
|
86
|
+
<%= form.label :dob_day, property_label_text(:dob) %>
|
87
|
+
<%= select_day persona.dob_day, :prefix => 'persona', :field_name => 'dob_day', :include_blank => true %>
|
88
|
+
<%= select_month persona.dob_month, :prefix => 'persona', :field_name => 'dob_month', :include_blank => true %>
|
89
|
+
<%= select_year persona.dob_year, :prefix => 'persona', :field_name => 'dob_year', :include_blank => true, :start_year => (Date.today.year - 100), :end_year => Date.today.year %>
|
90
|
+
</div>
|
91
|
+
<% end %>
|
92
|
+
|
93
|
+
<%- if attributes.include? :company_name %>
|
94
|
+
<h3><%=t :professional_information %></h3>
|
95
|
+
<div class="row inline">
|
96
|
+
<%= form.label :company_name, property_label_text(:company_name) %>
|
97
|
+
<%= form.text_field :company_name %>
|
98
|
+
</div>
|
99
|
+
<% end %>
|
100
|
+
<%- if attributes.include? :job_title %>
|
101
|
+
<div class="row inline">
|
102
|
+
<%= form.label :job_title, property_label_text(:job_title) %>
|
103
|
+
<%= form.text_field :job_title %>
|
104
|
+
</div>
|
105
|
+
<% end %>
|
106
|
+
<%- if attributes.include? :address_business %>
|
107
|
+
<div class="row inline">
|
108
|
+
<%= form.label :address_business, property_label_text(:address_business) %>
|
109
|
+
<%= form.text_field :address_business %>
|
110
|
+
</div>
|
111
|
+
<% end %>
|
112
|
+
<%- if attributes.include? :address_additional_business %>
|
113
|
+
<div class="row inline">
|
114
|
+
<%= form.label :address_additional_business, property_label_text(:address_additional_business) %>
|
115
|
+
<%= form.text_field :address_additional_business %>
|
116
|
+
</div>
|
117
|
+
<% end %>
|
118
|
+
<%- if attributes.include? :postcode_business %>
|
119
|
+
<div class="row inline">
|
120
|
+
<%= form.label :postcode_business, property_label_text(:postcode_business) %>
|
121
|
+
<%= form.text_field :postcode_business %>
|
122
|
+
</div>
|
123
|
+
<% end %>
|
124
|
+
<%- if attributes.include? :city_business %>
|
125
|
+
<div class="row inline">
|
126
|
+
<%= form.label :city_business, property_label_text(:city_business) %>
|
127
|
+
<%= form.text_field :city_business %>
|
128
|
+
</div>
|
129
|
+
<% end %>
|
130
|
+
<%- if attributes.include? :state_business %>
|
131
|
+
<div class="row inline">
|
132
|
+
<%= form.label :state_business, property_label_text(:state_business) %>
|
133
|
+
<%= form.text_field :state_business %>
|
134
|
+
</div>
|
135
|
+
<% end %>
|
136
|
+
<%- if attributes.include? :country_business %>
|
137
|
+
<div class="row inline space">
|
138
|
+
<%= form.label :country_business, property_label_text(:country_business) %>
|
139
|
+
<%= form.select :country_business, countries_for_select, { :include_blank => true } %>
|
140
|
+
</div>
|
141
|
+
<% end %>
|
142
|
+
|
143
|
+
<%- {:phone => phone,
|
144
|
+
:instant_messaging => instant_messaging,
|
145
|
+
:other_information => other_information}.each do |title,attrs| %>
|
146
|
+
<%- if (attributes - attrs).size != attributes.size %>
|
147
|
+
|
148
|
+
<h3><%=t title %></h3>
|
149
|
+
<%- attrs.each do |attr| %>
|
150
|
+
<%- if attributes.include? attr %>
|
151
|
+
<div class="row inline">
|
152
|
+
<%= form.label attr, property_label_text(attr) %>
|
153
|
+
<%= form.text_field attr %>
|
154
|
+
</div>
|
155
|
+
<% end %>
|
156
|
+
<% end %>
|
157
|
+
|
158
|
+
<% end %>
|
159
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h2><%=t :edit_your_persona, :title => h(persona.title) %></h2>
|
2
|
+
<%= error_messages_for persona %>
|
3
|
+
|
4
|
+
<%= form_for [:account, persona] do |f| %>
|
5
|
+
<%= render :partial => 'form', :object => f %>
|
6
|
+
<div>
|
7
|
+
<%= f.submit t(:submit_update), :class => 'labelspace' %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h2><%=t :my_personas_title %></h2>
|
2
|
+
|
3
|
+
<p><%=t :personas_intro %></p>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
<% @personas.each do |persona| %>
|
7
|
+
<li>
|
8
|
+
<h3><%=h persona.title%></h3>
|
9
|
+
<div class="options">
|
10
|
+
<%= link_to t(:edit), edit_account_persona_path(persona) %>
|
11
|
+
<%= link_to t(:delete), account_persona_path(persona), :data => { :confirm => t(:really_want_to_delete_persona, :title => h(persona.title))}, :method => :delete %>
|
12
|
+
</div>
|
13
|
+
</li>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
<%= link_to t(:create_a_new_persona), new_account_persona_path %>
|