-
Notifications
You must be signed in to change notification settings - Fork 154
/
show.html.haml
57 lines (52 loc) · 2.3 KB
/
show.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
- main_toolbar do |t|
-# [:qualify, :evaluate, :quote, :negociate, :win, :lose].each do |event|
- if resource.send("can_#{event}?")
= t.send(event, resource, method: :post)
= t.edit resource
= main_state_bar(resource)
= main_informations attachment: true do
.pull-right
- if resource.dead_line_at
.med-info
%span.title= SaleOpportunity.human_attribute_name(:timeleft)
%span.value= human_interval(resource.timeleft, display: 2)
.med-info
%span.title= SaleOpportunity.human_attribute_name(:age)
%span.value= human_interval(resource.age, display: 2)
.pull-right
.med-info
%span.title= SaleOpportunity.human_attribute_name(:probability_percentage)
%span.value= resource.probability_percentage
- if resource.pretax_amount
.med-info
%span.title= SaleOpportunity.human_attribute_name(:pretax_amount)
%span.value= resource.pretax_amount.l(currency: resource.currency)
= attributes_list stamps: false do |l|
- l.attribute :client, label: :label, url: true
- l.attribute :number
- l.attribute :responsible, label: :full_name, url: true
- l.attribute :created_at
- l.attribute :dead_line_at if resource.dead_line_at?
- l.attribute :pretax_amount, currency: true
- l.attribute :description if resource.description?
- l.attribute :origin
= janus do |j|
- j.face :timeline do
= timeline(resource) do |l|
- l.side :observations, at: :observed_at
- l.side :events, at: :started_at, params: {controller: :events, nature: :meeting, participations: {"0" => {participant_id: resource.third_id, state: :accepted}, "1" => {participant_id: current_user.person_id, state: :accepted}}}
- l.side :sales, new: false
- l.side :purchases, new: false
- l.side :incoming_payments, new: false
- l.side :outgoing_payments, new: false
- l.side :gaps, new: false
- l.side :tasks, at: :due_at
- l.side :versions, new: false
- j.face :cobbles do
= cobbles do |c|
- c.cobble :deals do
= affair_deals(resource)
- c.cobble :tasks, title: :x_tasks.tl(count: resource.tasks.count) do
= cobble_toolbar do |t|
= t.new(params: {controller: :tasks, entity_id: resource.third_id, executor_id: current_user.id, state: :todo})
= cobble_list(:tasks)