Permalink
Browse files

Merge branch 'multiple-urls'

  • Loading branch information...
2 parents 65b3f06 + 00501a3 commit 769938344c99c313da0273f1ee4ec0a9cc58fd39 Alexey Ilyichev committed Nov 9, 2010
@@ -5,29 +5,29 @@ module BaseHelper
# Adds additional test that only includes Objects that contain a URL tag
def run_verifier(list)
-
+
if options[:verifier]
- list.reject! {|item| options[:verifier].call(item).is_a?(FalseClass) }
+ list.reject! { |item| options[:verifier].call(item).is_a?(FalseClass) }
end
- reject_module(list)
+ reject_module(list)
reject_without_url(list)
reject_without_topic(list)
-
+
list
end
def reject_module(list)
- list.reject! { |object| [:root, :module].include?(object.type) }
- end
-
+ list.reject! { |object| [:root, :module].include?(object.type) }
+ end
+
def reject_without_url(list)
- list.reject! { |object| [:class,:method].include?(object.type) and object.tags("url").empty? }
+ list.reject! { |object| [:class, :method].include?(object.type) and object.tags("url").empty? }
end
def reject_without_topic(list)
- list.reject! { |object| [:class].include?(object.type) and object.tags("topic").empty? }
+ list.reject! { |object| [:class].include?(object.type) and object.tags("topic").empty? }
end
-
+
end
end
@@ -1,7 +1,18 @@
<div class="service">
- <h1><span class="minor_heading">Resource: </span><%= object.tag("url").text %></h1>
+ <h1>
+ <span class="minor_heading">Resource: </span>
+ <% if object.tags("url").size <= 1 %>
+ <%= object.tag("url").text %>
+ <% else %>
+ <ul>
+ <% object.tags("url").each do |url_tag| %>
+ <li><%= url_tag.text %></li>
+ <% end %>
+ </ul>
+ <% end %>
+ </h1>
<% unless object.tags("topic").empty? %>
- <h3 class="topic">Topics:</h3>
+ <h3 class="topic">Topics:</h3>
<ul class="box">
<% object.tags("topic").each do |topic| %>
<li><%= topic.text %></li>
@@ -1,8 +1,8 @@
<li><a href="<%= url_for('_index.html') %>">Index</a></li>
<% n = 1 %>
-<% @items.sort_by {|s| s.name.to_s }.each do |resource| %>
-<% unless resource.tags("url").first.nil? %>
- <li class="r<%= n %>"><%= linkify(resource, resource.tags("url").first.text) %></li>
-<% end %>
-<% n = n == 2 ? 1 : 2 %>
+<% @items.sort_by { |s| s.name.to_s }.each do |resource| %>
+ <% resource.tags("url").each do |url_tag| %>
+ <li class="r<%= n %>"><%= linkify(resource, url_tag.text) %></li>
+ <% end %>
+ <% n = n == 2 ? 1 : 2 %>
<% end %>
@@ -4,7 +4,9 @@
<li class="r<%= n %>"><%= topic%></li>
<% unless objects.empty? %>
<% objects.each do |object| %>
- <li class="r<%= n %>"><%= linkify(object, object.tag("url").text) %></li>
+ <% object.tags("url").each do |url_tag| %>
+ <li class="r<%= n %>"><%= linkify(object, url_tag.text) %></li>
+ <% end %>
<% end%>
<% end %>
<% n = n == 2 ? 1 : 2 %>
@@ -1,14 +1,14 @@
<div id="listing">
<h1 class="noborder title"><%= options[:title] %></h1>
-
+
<% if @files && @files.size > 0 %>
<h2>Files A-Z</h2>
<ul id="files">
- <% n = 1 %>
- <% @files.each_with_index do |file, i| %>
- <li class="r<%= n %>"><%= link_file(file, File.basename(file).gsub(/\.[^.]+$/, '')) %></li>
- <% n = n == 2 ? 1 : 2 %>
- <% end %>
+ <% n = 1 %>
+ <% @files.each_with_index do |file, i| %>
+ <li class="r<%= n %>"><%= link_file(file, File.basename(file).gsub(/\.[^.]+$/, '')) %></li>
+ <% n = n == 2 ? 1 : 2 %>
+ <% end %>
</ul>
<% end %>
<div class="clear"></div>
@@ -18,38 +18,35 @@
<table>
<tr>
<td valign='top' width="33%">
- <% @topics.sort_by {|t,o| t.to_s }.each do |topic, objects| %>
+ <% @topics.sort_by { |t, o| t.to_s }.each do |topic, objects| %>
<% if (i += 1) % 8 == 0 %>
- </td><td valign='top' width="33%">
- <% i = 0 %>
+ </td>
+ <td valign='top' width="33%">
+ <% i = 0 %>
<% end %>
<ul id="alpha_<%= topic %>" class="alpha">
<li class="letter"><%= topic %></li>
<ul>
<% objects.each do |obj| %>
- <% unless obj.tags("url").first.nil? %>
- <li>
- <%= linkify(obj, obj.tags("url").first.text) %>
- </li>
+ <% obj.tags("url").each do |url_tag| %>
+ <li><%= linkify(obj, url_tag.text) %></li>
<% end %>
<% end %>
</ul>
</ul>
<% end %>
- </td>
- </tr>
+ </td>
+ </tr>
</table>
<h2>Resources A-Z</h2>
<ul>
- <% @objects.each do |object| %>
- <% unless object.tags("url").first.nil? %>
- <li>
- <%= linkify(object, object.tags("url").first.text) %>
- </li>
+ <% @objects.each do |object| %>
+ <% object.tags("url").each do |url_tag| %>
+ <li><%= linkify(object, url_tag.text) %></li>
+ <% end %>
<% end %>
- <% end %>
</ul>
</div>

0 comments on commit 7699383

Please sign in to comment.