]> source.dussan.org Git - redmine.git/commitdiff
check that block is defined before rendering it (my/page)
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:36:21 +0000 (19:36 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:36:21 +0000 (19:36 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@243 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/my/page.rhtml

index 989d013976018e66c089458f99de2455745a1cf1..0c7920d6945f7e2ec55776eead8554c654c8fd3b 100644 (file)
@@ -5,7 +5,8 @@
 <h2><%=l(:label_my_page)%></h2>\r
 \r
 <div id="list-top">\r
-       <% @blocks['top'].each do |b| %>\r
+       <% @blocks['top'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b     %>\r
        <div class="mypage-box">        \r
                <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>\r
        </div>\r
@@ -13,7 +14,8 @@
 </div>\r
 \r
 <div id="list-left" class="splitcontentleft">\r
-       <% @blocks['left'].each do |b| %>\r
+       <% @blocks['left'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b %>\r
        <div class="mypage-box">        \r
                <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>\r
        </div>\r
@@ -21,7 +23,8 @@
 </div>\r
 \r
 <div id="list-right" class="splitcontentright">\r
-       <% @blocks['right'].each do |b| %>\r
+       <% @blocks['right'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b %>\r
        <div class="mypage-box">        \r
                <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>\r
        </div>\r