<commit_before><% title "Systèmes d'exploitation" %>

<div id="operating_systems" class="grid_5 center">
  
<%= action_links do %>
  <%= link_to "Nouveau système d'exploitation", new_operating_system_path %>
<% end %>

<script type="text/javascript"> 
  var serversmap = new Object;
</script>

<table class="list operating_systems">
  <tr>
    <th>
      <div class="contextual">Serveurs</div>
      Nom(total)
    </th>
  </tr>
  <tr>
    <td><%= nested_operating_systems @operating_systems %></td>
  </tr>
</table>

</div>

<div class="grid_4 center">
<% if @os_subtree.present? %>
  <div class="graph-links tiny">
  <% if @root_os.present? %>
    <%= link_to("Recentrer"+(@root_os.parent.present? ? " sur #{@root_os.parent}" : ""), operating_systems_path(:graph_subtree => @root_os.parent_id)) %>
  <% else %>
    &nbsp;
  <% end %>
  </div>
  <div class="graph-container">
    <script type="text/javascript" charset="utf-8"> 
      window.onload = function () {
        var r = Raphael("distribution", 300, 410);
        r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";

        var title = "Répartition des systèmes";
      <% if @root_os.present? %>
        title += " <%= @root_os.to_s %>";
      <% end %>
        r.g.text(150, 25, title).attr({"font-size": 16});

        var subtree = [];
        <% @os_subtree.each do |os,subos| %>
        subtree.push({ value: serversmap[<%= os.id %>], legend: "<%= %(%% #{os} [#{os.id}]) %>",
                       href: <%= subos.any? ? %("#{operating_systems_path(:graph_subtree => os.id)}").html_safe : "null" %> });
        <% end %>
        subtree.sort(function(a,b){return b.value - a.value});
        var pie = r.g.piechart(150, 155, 100, $.map(subtree, function(os,i){ return os.value}),
                    { legend: $.map(subtree, function(os,i){ return os.legend}), legendmark: "disc", legendpos: "south", 
                      href: $.map(subtree, function(os,i){ return os.href}), colors: ["#57f", "#5c5", "#f83", "#d49", "#fc4", "#f55"] });

        var legend_regex = /(.+) \[(\d+)\]$/;
        $.each(pie.labels, function() {<commit_msg>Fixed operating systems repartition chart generating wrong links when there's a non-clickable item between two clickable ones<commit_after><% title "Systèmes d'exploitation" %>

<div id="operating_systems" class="grid_5 center">
  
<%= action_links do %>
  <%= link_to "Nouveau système d'exploitation", new_operating_system_path %>
<% end %>

<script type="text/javascript"> 
  var serversmap = new Object;
</script>

<table class="list operating_systems">
  <tr>
    <th>
      <div class="contextual">Serveurs</div>
      Nom(total)
    </th>
  </tr>
  <tr>
    <td><%= nested_operating_systems @operating_systems %></td>
  </tr>
</table>

</div>

<div class="grid_4 center">
<% if @os_subtree.present? %>
  <div class="graph-links tiny">
  <% if @root_os.present? %>
    <%= link_to("Recentrer"+(@root_os.parent.present? ? " sur #{@root_os.parent}" : ""), operating_systems_path(:graph_subtree => @root_os.parent_id)) %>
  <% else %>
    &nbsp;
  <% end %>
  </div>
  <div class="graph-container">
    <script type="text/javascript" charset="utf-8"> 
      window.onload = function () {
        var r = Raphael("distribution", 300, 410);
        r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";

        var title = "Répartition des systèmes";
      <% if @root_os.present? %>
        title += " <%= @root_os.to_s %>";
      <% end %>
        r.g.text(150, 25, title).attr({"font-size": 16});

        var subtree = [];
        <% @os_subtree.each do |os,subos| %>
        subtree.push({ value: serversmap[<%= os.id %>], legend: "<%= %(%% #{os} [#{os.id}]) %>",
                       href: "<%= subos.any? ? operating_systems_path(:graph_subtree => os.id) : "" %>" });
        <% end %>
        subtree.sort(function(a,b){return b.value - a.value});
        var pie = r.g.piechart(150, 155, 100, $.map(subtree, function(os,i){ return os.value}),
                    { legend: $.map(subtree, function(os,i){ return os.legend}), legendmark: "disc", legendpos: "south", 
                      href: $.map(subtree, function(os,i){ return os.href}), colors: ["#57f", "#5c5", "#f83", "#d49", "#fc4", "#f55"] });

        var legend_regex = /(.+) \[(\d+)\]$/;
        $.each(pie.labels, function() {
{'fraction_non_alphanumeric': 0.20881402861098292, 'fraction_numerical': 0.01753576372865713, 'mean_word_length': 3.0476190476190474, 'pattern_counts': {'":': 2, '<': 81, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3094696', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1507, 'n_words': 311}