From 9d99d340cfd3c55f21d38c1ba9f3f4574e40c46c Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 9 Dec 2012 13:19:54 +0100 Subject: basic form added to user settings, simple model created --- users/app/views/users/_email_aliases.html.haml | 10 ++++++++++ users/app/views/users/edit.html.haml | 1 + 2 files changed, 11 insertions(+) create mode 100644 users/app/views/users/_email_aliases.html.haml (limited to 'users/app/views') diff --git a/users/app/views/users/_email_aliases.html.haml b/users/app/views/users/_email_aliases.html.haml new file mode 100644 index 0000000..54eac0f --- /dev/null +++ b/users/app/views/users/_email_aliases.html.haml @@ -0,0 +1,10 @@ +%legend= t(:email_aliases) +%ul + - @user.email_aliases.each do |email| + %li= email += email_alias_form do |f| + =f.input :email, :placeholder => "alias@#{request.domain}" + .pull-right + %button{:type => :submit, :class => 'btn'} + %i.icon-plus + Add Email Alias diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml index b33c19b..eb1bca4 100644 --- a/users/app/views/users/edit.html.haml +++ b/users/app/views/users/edit.html.haml @@ -14,3 +14,4 @@ .tab-pane#email = user_form_with 'email_field', :legend => :set_email_address = user_form_with 'email_forward_field', :legend => :forward_email + = render 'email_aliases' -- cgit v1.2.3 From e4c7f2fb8fa2833037508f1b88f802944855fd77 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 10 Dec 2012 10:38:48 +0100 Subject: actually allow adding email aliases --- users/app/views/users/_email_aliases.html.haml | 20 ++++++++++---------- users/app/views/users/edit.html.haml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'users/app/views') diff --git a/users/app/views/users/_email_aliases.html.haml b/users/app/views/users/_email_aliases.html.haml index 54eac0f..41d4f9e 100644 --- a/users/app/views/users/_email_aliases.html.haml +++ b/users/app/views/users/_email_aliases.html.haml @@ -1,10 +1,10 @@ -%legend= t(:email_aliases) -%ul - - @user.email_aliases.each do |email| - %li= email -= email_alias_form do |f| - =f.input :email, :placeholder => "alias@#{request.domain}" - .pull-right - %button{:type => :submit, :class => 'btn'} - %i.icon-plus - Add Email Alias +.span6 + %ul.unstyled + - @user.email_aliases.each do |email_alias| + %li.pull-right + %code= email_alias.email + %i.icon-remove + .clearfix +.clearfix += f.simple_fields_for :email_aliases, EmailAlias.new do |e| + = e.input :email, :placeholder => "alias@#{request.domain}" diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml index eb1bca4..92ab71b 100644 --- a/users/app/views/users/edit.html.haml +++ b/users/app/views/users/edit.html.haml @@ -14,4 +14,4 @@ .tab-pane#email = user_form_with 'email_field', :legend => :set_email_address = user_form_with 'email_forward_field', :legend => :forward_email - = render 'email_aliases' + = user_form_with 'email_aliases', :legend => :add_email_alias -- cgit v1.2.3 From 28b21959f39b0e28c450bba54b8696632a0187fa Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 10 Dec 2012 11:00:24 +0100 Subject: created generic Email class and use it with EmailAliases --- users/app/views/emails/_email.html.haml | 4 ++++ users/app/views/users/_email_aliases.html.haml | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 users/app/views/emails/_email.html.haml (limited to 'users/app/views') diff --git a/users/app/views/emails/_email.html.haml b/users/app/views/emails/_email.html.haml new file mode 100644 index 0000000..f182ed9 --- /dev/null +++ b/users/app/views/emails/_email.html.haml @@ -0,0 +1,4 @@ +%li.pull-right + %code= email + %i.icon-remove +.clearfix diff --git a/users/app/views/users/_email_aliases.html.haml b/users/app/views/users/_email_aliases.html.haml index 41d4f9e..646480e 100644 --- a/users/app/views/users/_email_aliases.html.haml +++ b/users/app/views/users/_email_aliases.html.haml @@ -1,10 +1,6 @@ .span6 %ul.unstyled - - @user.email_aliases.each do |email_alias| - %li.pull-right - %code= email_alias.email - %i.icon-remove - .clearfix + =render @user.email_aliases .clearfix -= f.simple_fields_for :email_aliases, EmailAlias.new do |e| += f.simple_fields_for :email_aliases, Email.new do |e| = e.input :email, :placeholder => "alias@#{request.domain}" -- cgit v1.2.3