foodsoft/app/views/home/profile.html.haml
Patrick Gansterer e16a0fb336 Add config option to disable the invites
Some foodcoops require that an admin adds all users to have more control
over the users.
2016-03-06 13:56:33 +01:00

37 lines
1.6 KiB
Text

- title t('.title'), false
.row-fluid
.span7
%h3
= h(t('.user.title', user: show_user))
%small= t '.user.since', when: distance_of_time_in_words(Time.now, @current_user.created_on)
= simple_form_for(@current_user, :url => update_profile_path) do |f|
= render :partial => 'shared/user_form_fields', :locals => {:f => f, :password_autocomplete => 'store-only', with_address: true}
.form-actions
= submit_tag t('ui.save'), class: 'btn'
.span5
- if @current_user.ordergroup
%h3= User.human_attribute_name(:ordergroup, count: 1)
%table.table.table-striped
%tr
%td
- if @current_user.ordergroup.users.count > 1
%strong= @current_user.ordergroup.name + ':'
= @current_user.ordergroup.users.map{|u| show_user u}.join(', ')
- else
= @current_user.ordergroup.name
%td.right
- unless FoodsoftConfig[:disable_invite]
= link_to t('.groups.invite'), new_invite_path(id: @current_user.ordergroup),
remote: true, class: 'btn btn-success btn-small'
- if @current_user.workgroups.any?
%h3= User.human_attribute_name(:workgroup, count: 2)
%table.table.table-striped
- @current_user.workgroups.each do |workgroup|
%tr
%td= workgroup.name
%td.right
= link_to t('.groups.cancel'), cancel_membership_path(group_id: workgroup),
:data => {confirm: t('.groups.cancel_confirm')}, method: :post,
class: 'btn btn-danger btn-small'