Simplify footer text when everything is identical.
[homepage.git] / layouts / copyright.xml
1 <%
2 s = ' ' * (@indent || 2)
3 copyyears = {}
4 copyauthors = {}
5 [@item.fetch(:copyright, [])].flatten.each do |copyright| %>
6 <%=s%><copyright><%= copyright %></copyright><%
7 x = expand_copyright(copyright)
8 x[:years].each do |y| copyyears[y] = 1 end
9 copyauthors[x[:name]] = 1
10 end
11 copyyears.keys.sort.each do |y| %>
12 <%=s%><copyright-year><%= y %></copyright-year><%
13 end
14 copyauthors.keys.sort.each do |i| %>
15 <%=s%><copyright-holder><%= i %></copyright-holder><%
16 end
17   if @item[:license] then
18     licref = @item[:license].split
19     lic = find_license(licref[0]) %>
20 <%=s%><license>
21 <%=s%>  <identifier><%= File::basename(lic.identifier.without_ext) %></identifier>
22 <%=s%>  <shortname><%= license_shortname(lic) %></shortname>
23 <%=s%>  <name><%= [lic[:title], licref[1..-1]].compact.join(" ").strip %></name>
24 <%=s%>  <uri><%= item_uri(lic) %></uri>
25 <%=s%>  <modification-allowed><%=
26       lic[:"modification-allowed"] == true ? "yes" : "no"
27     %></modification-allowed>
28 <%=s%></license><%
29 end %>