foodsoft/app/views/home/profile.html.haml

38 lines
1.6 KiB
Text
Raw Permalink Normal View History

2013-02-04 00:46:22 +01:00
- title t('.title'), false
.row-fluid
.span7
%h3
2013-09-20 22:40:13 +02:00
= h(t('.user.title', user: show_user))
2013-02-04 00:46:22 +01:00
%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'
2014-12-16 21:09:04 +01:00
.span5
2014-12-16 21:09:04 +01:00
- if @current_user.ordergroup
%h3= User.human_attribute_name(:ordergroup, count: 1)
%table.table.table-striped
%tr
2014-12-16 21:09:04 +01:00
%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'
2016-03-04 17:39:06 +01:00
- if @current_user.workgroups.any?
2014-12-16 21:09:04 +01:00
%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'