]> git.openstreetmap.org Git - rails.git/blob - app/views/users/_heatmap.html.erb
Merge remote-tracking branch 'upstream/pull/5998'
[rails.git] / app / views / users / _heatmap.html.erb
1 <h2 class="text-body-secondary fs-5 mt-4">
2   <%= t("users.show.contributions", :count => data[:total]) %>
3 </h2>
4 <div class="row">
5   <div class="col overflow-auto">
6     <div class="heatmap d-none align-items-center mb-1 text-center" data-max-per-day="<%= data[:max_per_day] %>">
7       <!-- Months -->
8       <% data[:months].each do |month| %>
9         <span class="mb-1 mx-n2" data-month="<%= month %>"><%= t("date.abbr_month_names")[((month - 1) % 12) + 1] %></span>
10       <% end %>
11       <!-- Days -->
12       <% (0..6).each do |day| %>
13         <span class="me-1 my-n1" data-weekday="<%= day %>"><%= t("date.abbr_day_names")[day] %></span>
14       <% end %>
15       <!-- Heatmap -->
16       <% data[:days].each do |day| %>
17         <% if day[:total_changes] == 0 %>
18           <span data-date="<%= day[:date] %>"></span>
19         <% else %>
20           <a href="<%= user_history_path @user, :before => day[:max_id] + 1 %>" data-date="<%= day[:date] %>" data-count="<%= day[:total_changes] %>"><div></div></a>
21         <% end %>
22       <% end %>
23     </div>
24   </div>
25 </div>