using helper throughout

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@104 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2008-02-01 05:21:09 +00:00
parent 044824947b
commit 790f9fb3de
5 changed files with 16 additions and 3 deletions

View File

@ -112,6 +112,15 @@ module ApplicationHelper
block_to_partial('shared/lightbox', options, &block)
end
##
# Renders everything you need to display the TagImage browser.
#
def tagged_image_browser(obj)
javascript_include_tag('control.modal.js') +
render(:partial => 'shared/tagged_image_browser',
:locals => { :obj => obj })
end
##
# Pagination link image browser thingey for the tagged image lightbox.
#

View File

@ -1,4 +1,4 @@
<%= render :partial => 'shared/tagged_image_browser', :locals => { :obj => @beer } %>
<%= tagged_image_browser(@beer) %>
<%= render :partial => 'pages/page' %>

View File

@ -1,8 +1,10 @@
<%= tagged_image_browser(@brewery) %>
<%= render :partial => 'pages/page' %>
<% content_for :sidebar do -%>
<%= new_brewery_link -%><br />
<%= edit_brewery_link(@brewery) -%><br />
<%= link_to 'Destroy', brewery_path(@brewery.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %><br />
<%= tagged_image_browser_link -%><br />
<% unless @brewery.tagged_images.empty? -%><%= tagged_image_browser_link -%><br /><% end -%>
<% end -%>

View File

@ -5,7 +5,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<%= stylesheet_link_tag 'application', :media => 'all' %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'control.modal.js' %>
<script type="text/javascript">
<%= yield :script %>
</script>

View File

@ -1,7 +1,10 @@
<%= tagged_image_browser(@people) %>
<%= render :partial => 'pages/page' %>
<% content_for :sidebar do -%>
<%= new_people_link -%><br />
<%= edit_people_link(@people) %><br />
<%= link_to 'Destroy', people_path(@people.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %><br />
<% unless @people.tagged_images.empty? -%><%= tagged_image_browser_link -%><br /><% end -%>
<% end -%>