<commit_before><% provide(:title, 'List') %>
<h1><%= @path %></h1>


<div class="row">
  <div class="span6">
    <div class="btn-group">
      <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
        Action <i class="icon-cog"></i>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
        <% unless @list.nil? %>
          <li>
          <% if @list.parent.nil? %>
            <%= link_to "Go back to /", lists_path %>
          <% else %>
            <%= link_to "Go back to #{@list.parent.path}", @list.parent %>
          <% end %>
          </li>
          <% unless @moving %>
            <li>
            <%= link_to "Move", list_moving_path(@list) %>
            </li>
          <% end %>
          <li>
          <%= link_to "Export", list_export_path(@list) %>
          </li>
        <% end %>
        <% if @new_list.nil? %>
          <li>
          <%= link_to 'New list here', path_for_new_list(@list) %>
          </li>
        <% end %>
      </ul>
    </div>

    <% if @moving %>
      <%= form_for :dest, url: list_move_path(@list) do |f| %>
        <%= f.label :list_id, "Destination" %>
        <% if @list.parent.nil? %>
          <%= f.collection_select("list_id", current_user.lists_outside(@list), :id, :path) %>
        <% else %>
          <%= f.collection_select("list_id", current_user.lists_outside(@list), :id, :path, prompt: "/") %>
      <% end %>
        <br />
        <%= f.submit "Move", class: "btn" %>
      <% end %>
    <% end %>
    <% unless @new_list.nil? %>
      <%= form_for @new_list, url: path_to_create_list(@list) do |f| %>
        <%= f.label :name %>
        <%= f.text_field :name %>
        <br />
        <%= f.submit "Create list here", class: "btn" %>
      <% end %>
    <% end %>

    <h2>Sublists</h2>
    <% if @lists.empty? %>
      <p>No sublist.</p>
    <% else %>
      <ul>
        <% @lists.each do |list| %>
          <li>
          <%= link_to list.name, list %>
          </li>
        <% end %>
      </ul>
    <% end %>
    <% if @path != '/' %>
      <h2>Words</h2>
      <% if @words.empty? %>
        <p>No word.</p>
      <% else %>
        <%= will_paginate @words %>
        <ul>
          <% @words.each do |word| %>
            <li>
            <%= link_to word.content, word %>
            <% if @list.owner == current_user %>
              <%= link_to "", list_word_path(@list, word), method: :delete, class: "icon-remove" %>
            <% end %>
            </li>
          <% end %>
        </ul>
        <%= will_paginate @words %>
      <% end %>

      <%= link_to "Train on this list", new_list_train_path(@list),
        class: 'btn' %>
      <%= link_to "Train on this list and its sublists", new_list_train_path(@list, rec: true),
        class: 'btn btn-primary' %>
    <% end %>
  </div>

  <% if @list.owner == current_user %>
    <% unless @list.nil? %>
      <div class="span6">
        <h2>New links</h2>
        <p>
        Quickly add new words to this list while ensuring your
        requested link is present.
        If the words or the link doesn't exist, it will be added.
        </p>
        <%= render 'links/new' %>
      </div>
    <% end %>
  <% end %>
</div><commit_msg>Fix bug in root list show<commit_after><% provide(:title, 'List') %>
<h1><%= @path %></h1>


<div class="row">
  <div class="span6">
    <div class="btn-group">
      <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
        Action <i class="icon-cog"></i>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
        <% unless @list.nil? %>
          <li>
          <% if @list.parent.nil? %>
            <%= link_to "Go back to /", lists_path %>
          <% else %>
            <%= link_to "Go back to #{@list.parent.path}", @list.parent %>
          <% end %>
          </li>
          <% unless @moving %>
            <li>
            <%= link_to "Move", list_moving_path(@list) %>
            </li>
          <% end %>
          <li>
          <%= link_to "Export", list_export_path(@list) %>
          </li>
        <% end %>
        <% if @new_list.nil? %>
          <li>
          <%= link_to 'New list here', path_for_new_list(@list) %>
          </li>
        <% end %>
      </ul>
    </div>

    <% if @moving %>
      <%= form_for :dest, url: list_move_path(@list) do |f| %>
        <%= f.label :list_id, "Destination" %>
        <% if @list.parent.nil? %>
          <%= f.collection_select("list_id", current_user.lists_outside(@list), :id, :path) %>
        <% else %>
          <%= f.collection_select("list_id", current_user.lists_outside(@list), :id, :path, prompt: "/") %>
      <% end %>
        <br />
        <%= f.submit "Move", class: "btn" %>
      <% end %>
    <% end %>
    <% unless @new_list.nil? %>
      <%= form_for @new_list, url: path_to_create_list(@list) do |f| %>
        <%= f.label :name %>
        <%= f.text_field :name %>
        <br />
        <%= f.submit "Create list here", class: "btn" %>
      <% end %>
    <% end %>

    <h2>Sublists</h2>
    <% if @lists.empty? %>
      <p>No sublist.</p>
    <% else %>
      <ul>
        <% @lists.each do |list| %>
          <li>
          <%= link_to list.name, list %>
          </li>
        <% end %>
      </ul>
    <% end %>
    <% unless @list.nil? %>
      <h2>Words</h2>
      <% if @words.empty? %>
        <p>No word.</p>
      <% else %>
        <%= will_paginate @words %>
        <ul>
          <% @words.each do |word| %>
            <li>
            <%= link_to word.content, word %>
            <% if @list.owner == current_user %>
              <%= link_to "", list_word_path(@list, word), method: :delete, class: "icon-remove" %>
            <% end %>
            </li>
          <% end %>
        </ul>
        <%= will_paginate @words %>
      <% end %>

      <%= link_to "Train on this list", new_list_train_path(@list),
        class: 'btn' %>
      <%= link_to "Train on this list and its sublists", new_list_train_path(@list, rec: true),
        class: 'btn btn-primary' %>
    <% end %>
  </div>

  <% if not @list.nil? and @list.owner == current_user %>
    <div class="span6">
      <h2>New links</h2>
      <p>
      Quickly add new words to this list while ensuring your
      requested link is present.
      If the words or the link doesn't exist, it will be added.
      </p>
      <%= render 'links/new' %>
    </div>
  <% end %>
</div>
{'fraction_non_alphanumeric': 0.19670346757891463, 'fraction_numerical': 0.0031099362463069507, 'mean_word_length': 1.693467336683417, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 217, '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': '216937', 'n_tokens_mistral': 2393, 'n_tokens_neox': 2134, 'n_words': 488}