]> git.openstreetmap.org Git - rails.git/blob - app/views/site/key.html.erb
Avoid integer overflow when computing shortcodes
[rails.git] / app / views / site / key.html.erb
1 <div id="mapkey">
2   <table class="mapkey-table">
3     <% YAML.load_file("#{RAILS_ROOT}/config/key.yml").each do |name,data| %>
4       <% if params[:layer] == name %>
5         <% data.each do |entry| %>
6           <% if params[:zoom].to_i >= entry['min_zoom'] && params[:zoom].to_i <= entry['max_zoom'] %>
7             <tr>
8               <td class="mapkey-table-key" align="center">
9                 <%= image_tag "key/#{name}/#{entry['image']}" %>
10               </td>
11               <td class="mapkey-table-value">
12                 <%= [*t("site.key.table.entry.#{entry['name']}")].to_sentence %>
13               </td>
14             </tr>
15           <% end %>
16         <% end %>
17       <% end %>
18     <% end %>
19   </table>
20 </div>