Skip to content

Commit e628c74

Browse files
committed
Made show hooks into block hooks
1 parent 52b9c77 commit e628c74

File tree

3 files changed

+39
-36
lines changed

3 files changed

+39
-36
lines changed

app/views/accounts/show.html.haml

+17-16
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
= render "comments/new", :commentable => @account
1212
= render :partial => "common/timeline", :collection => @timeline
1313

14-
= section(@account, :tasks)
15-
.log#tasks
16-
= render "common/tasks"
14+
= hook(:show_account_bottom, self) do
1715

18-
= section(@account, :contacts)
19-
.list#contacts
20-
- @contacts = @account.contacts.paginate(:page => 1, :per_page => 20)
21-
= render :partial => "contacts/contact", :collection => @contacts
22-
= will_paginate @contacts, :id => true, :params => {:action => :contacts}
16+
= section(@account, :tasks)
17+
.log#tasks
18+
= render "common/tasks"
2319

24-
%br( style="clear:both" )
20+
= section(@account, :contacts)
21+
.list#contacts
22+
- @contacts = @account.contacts.paginate(:page => 1, :per_page => 20)
23+
= render :partial => "contacts/contact", :collection => @contacts
24+
= will_paginate @contacts, :id => true, :params => {:action => :contacts}
2525

26-
= section(@account, :opportunities)
27-
.list#opportunities
28-
- @opportunities = @account.opportunities.paginate(:page => 1, :per_page => 20)
29-
= render :partial => "opportunities/opportunity", :collection => @opportunities
30-
= will_paginate @opportunities, :id => true, :params => {:action => :opportunities}
26+
%br( style="clear:both" )
3127

32-
= load_select_popups_for(@account, :tasks, :contacts, :opportunities)
28+
= section(@account, :opportunities)
29+
.list#opportunities
30+
- @opportunities = @account.opportunities.paginate(:page => 1, :per_page => 20)
31+
= render :partial => "opportunities/opportunity", :collection => @opportunities
32+
= will_paginate @opportunities, :id => true, :params => {:action => :opportunities}
33+
34+
= load_select_popups_for(@account, :tasks, :contacts, :opportunities)
3335

34-
= hook(:show_account_bottom, self)

app/views/contacts/show.html.haml

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
= render "comments/new", :commentable => @contact
1212
= render :partial => "common/timeline", :collection => @timeline
1313

14-
= section(@contact, :tasks)
15-
.log#tasks
16-
= render "common/tasks"
14+
= hook(:show_contact_bottom, self) do
1715

18-
= section(@contact, :opportunities)
19-
.list#opportunities
20-
- @opportunities = @contact.opportunities.paginate(:page => 1, :per_page => 20)
21-
= render :partial => "opportunities/opportunity", :collection => @contact.opportunities.paginate(:page => 1, :per_page => 20)
22-
= will_paginate @opportunities, :id => true, :params => {:action => :opportunities}
16+
= section(@contact, :tasks)
17+
.log#tasks
18+
= render "common/tasks"
2319

24-
= load_select_popups_for(@contact, :tasks, :opportunities)
20+
= section(@contact, :opportunities)
21+
.list#opportunities
22+
- @opportunities = @contact.opportunities.paginate(:page => 1, :per_page => 20)
23+
= render :partial => "opportunities/opportunity", :collection => @contact.opportunities.paginate(:page => 1, :per_page => 20)
24+
= will_paginate @opportunities, :id => true, :params => {:action => :opportunities}
25+
26+
= load_select_popups_for(@contact, :tasks, :opportunities)
2527

26-
= hook(:show_contact_bottom, self)

app/views/opportunities/show.html.haml

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
= render "comments/new", :commentable => @opportunity
1212
= render :partial => "common/timeline", :collection => @timeline
1313

14-
= section(@opportunity, :tasks)
15-
.log#tasks
16-
= render "common/tasks"
14+
= hook(:show_opportunity_bottom, self) do
1715

18-
= section(@opportunity, :contacts)
19-
.list#contacts
20-
- @contacts = @opportunity.contacts.paginate(:page => 1, :per_page => 20)
21-
= render :partial => "contacts/contact", :collection => @opportunity.contacts.paginate(:page => 1, :per_page => 20)
22-
= will_paginate @contacts, :id => true, :params => {:action => :contacts}
16+
= section(@opportunity, :tasks)
17+
.log#tasks
18+
= render "common/tasks"
2319

24-
= load_select_popups_for(@opportunity, :tasks, :contacts)
20+
= section(@opportunity, :contacts)
21+
.list#contacts
22+
- @contacts = @opportunity.contacts.paginate(:page => 1, :per_page => 20)
23+
= render :partial => "contacts/contact", :collection => @opportunity.contacts.paginate(:page => 1, :per_page => 20)
24+
= will_paginate @contacts, :id => true, :params => {:action => :contacts}
25+
26+
= load_select_popups_for(@opportunity, :tasks, :contacts)
2527

26-
= hook(:show_opportunity_bottom, self)

0 commit comments

Comments
 (0)