%h1 Convidar um usuário = simple_form_for @user_invitation, role: "form", :url => create_invite_path(@account.id), :method => :post do |f| - if @user_invitation.errors.any? .notice.notice-red{ :style => "margin-bottom: 15px" } %ul - @user_invitation.errors.full_messages.each do |msg| %li = msg .form-group = f.email_field :email, :placeholder => "e-mail", :class => "form-control" %div %h4 Permissões - if current_user.is?(:owner, @account) - APP_ROLES['roles'].each do |role| - unless role == APP_ROLES['owner_role'] %div{ :style => "margin-bottom: 5px" } = check_box_tag "user_invitation[roles][]", role, false, :id => "#{role}_checkbox" = label_tag "#{role}_checkbox", I18n.t("iugu.#{role}") - elsif current_user.is?(:admin, @account) - APP_ROLES['roles'].each do |role| - unless role == APP_ROLES['owner_role'] || role == APP_ROLES['admin_role'] %div{ :style => "margin-bottom: 5px" } = check_box_tag "user_invitation[roles][]", role, false, :id => "#{role}_checkbox" = label_tag "#{role}_checkbox", I18n.t("iugu.#{role}") %div{ :style => "margin-top: 10px" } = f.submit I18n.t("iugu.invite"), :class => "btn btn-primary btn-block" %br = link_to I18n.t("iugu.back"), account_users_index_path(account_id: params[:account_id]), class: "btn btn-primary btn-block"