Permalink
Browse files

Hide source section if no source for var.

  • Loading branch information...
1 parent 4f47ce2 commit ece4a31958fab3fb73b19e148e69a66d3a3ef56a @zk committed Oct 25, 2010
Showing with 4 additions and 3 deletions.
  1. +3 −2 app/views/main/function.html.erb
  2. +1 −1 test/functional/application_controller_test.rb
@@ -30,7 +30,7 @@ $(document).ready(function() {
<a name="top"></a>
<div class="function_links">
<a href="#doc" class="scroll">doc</a>
- <a href="#source" class="scroll">source</a>
+ <% if @function.source %><a href="#source" class="scroll">source</a><% end %>
<a href="#examples" class="scroll">examples</a>
<a href="#comments" class="scroll">comments</a>
</div>
@@ -187,7 +187,7 @@ $(document).ready(function() {
<% end %>
<div class="clear"></div>
</div>
-
+ <% if @function.source %>
<div class="source">
<h3 style="margin: 0px; padding: 0px;">
<%= image_tag "plus_12x12.png", :id => "expand_source", :width => 12, :height => 12 %>
@@ -237,6 +237,7 @@ $(document).ready(function() {
</div>
</div>
</div>
+ <% end %>
<div class="comments">
<h3><a class="internal_nav scroll" href="#comments" name="comments">Comments</a> <a class="top scroll" href="#top">top</a></h3>
@@ -39,7 +39,7 @@ class ApplicationControllerTest < ActionController::TestCase
context "from all libraries" do
should "give recent updates of the types SeeAlso, Example, Comment" do
recent = @app_controller.send(:find_recently_updated, 10)
- assert_equal recent.size, 4
+ assert_equal 3, recent.size
assert recent[0].instance_of? SeeAlso
assert recent[1].instance_of? Example
assert recent[2].instance_of? Comment

0 comments on commit ece4a31

Please sign in to comment.