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

66 lines
2.6 KiB
Text
Raw Normal View History

- title t('.title'), false
2009-01-06 11:49:19 +01:00
- content_for(:sidebar) do
= render :partial => 'start_nav'
- unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks.size == 0
%section.row-fluid
2012-10-09 02:31:10 +02:00
- unless @next_tasks.empty?
.span3.well
2013-02-04 00:46:22 +01:00
%h4= t '.your_tasks'
%dl
- @next_tasks.each do |task|
2013-02-04 00:46:22 +01:00
%dt= l task.due_date, format: t('.due_date_format')
%dd= link_to task.name, task_path(task)
- unless @unaccepted_tasks.empty?
.span3.well
2013-02-04 00:46:22 +01:00
%h4= t '.tasks_move.title'
= t '.tasks_move.desc'
= link_to t('.tasks_move.action'), user_tasks_path
- unless @unassigned_tasks.size == 0
.span3.well
2013-02-04 00:46:22 +01:00
%h4= t '.tasks_open.title'
= t '.tasks_open.desc', size: @unassigned_tasks.size
= link_to t('.tasks_open.action'), tasks_path
2009-01-06 11:49:19 +01:00
- if current_user.ordergroup
= render :partial => 'shared/open_orders', :locals => {:ordergroup => current_user.ordergroup}
2009-01-06 11:49:19 +01:00
// Stats
- if current_user.ordergroup and FoodsoftConfig[:use_apple_points]
%section
2013-02-04 00:46:22 +01:00
%h2= t '.ordergroup.title'
= render :partial => "apple_bar", :locals => {:apple_bar => AppleBar.new(current_user.ordergroup)}
- unless Message.public.empty?
%section
2013-02-04 00:46:22 +01:00
%h2= t '.messages.title'
2012-10-08 21:52:03 +02:00
= render 'messages/messages', messages: Message.public.order('created_at DESC').limit(5), pagination: false
2013-02-04 00:46:22 +01:00
%p= link_to t('.messages.view_all'), messages_path
2009-01-15 20:10:50 +01:00
- if current_user.ordergroup
// Ordergroup overview
%section
2013-02-04 00:46:22 +01:00
%h2= t '.my_ordergroup.title'
%p
%b= current_user.ordergroup.name
2013-02-04 00:46:22 +01:00
= t '.my_ordergroup.funds'
= number_to_currency(current_user.ordergroup.get_available_funds)
2013-02-04 00:46:22 +01:00
%small= t '.my_ordergroup.last_update', when: distance_of_time_in_words(Time.now, current_user.ordergroup.account_updated)
%h3= t '.my_ordergroup.transactions.title'
%table.table.table-striped
%tr
2013-11-23 12:05:29 +01:00
%th= heading_helper FinancialTransaction, :created_on
%th= heading_helper FinancialTransaction, :user
%th= heading_helper FinancialTransaction, :note
%th= heading_helper FinancialTransaction, :amount
- for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC')
2009-02-01 21:08:04 +01:00
%tr
%td= format_time(ft.created_on)
2013-09-20 22:40:13 +02:00
%td= h(show_user(ft.user))
%td= h(ft.note)
- color = ft.amount < 0 ? 'red' : 'black'
%td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount)
%br/
2013-02-04 00:46:22 +01:00
%p= link_to t('.my_ordergroup.transactions.view'), my_ordergroup_path