<commit_before>  <%= form.fieldset 'Item discovery' do %>
    <% if can? :update_access_control, object %>
      <%= label_tag :hidden do %>
        <%= check_box_tag 'hidden', '1', hidden %>
        Hide this item from search results 
      <% end %>
    <% else %>
      <%= hidden ? "Item is hidden from search results" : "Item is not hidden from search results" %>
    <% end %>
  <% end %>
    
  <%= form.fieldset 'Item access' do %>
    <% if can? :update_access_control, object %>
      <%= form.hidden_field :pid %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'public', (access == 'public') %>
        Available to the general public
      <% end %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'restricted', (access == 'restricted') %>
        Logged in users only
      <% end %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'private', (access == 'private') %>
        Collection staff only
      <% end %>
    
      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'limited', (access == 'limited') %>
        Limit access to specified users and/or groups
      <% end %>
 
      <div id="groups-ex" class="span5">
        <%= text_field_tag "new_user" %>
        <%= submit_tag "Add User", class: "btn" %>

        <table class="table table-striped table-hover">
          <% unless @user_exceptions.empty? %>
          <thead>
            <th class="info">User name</th>
            <th/>
          </thead>
          <tbody>
            <% @user_exceptions.each do |user| %>
            <tr>
              <td>
                <%= label_tag do %>
                  <%= user %>
                <% end %>
              </td>
              <td>
                <%= link_to "×", 
                            polymorphic_path(object, delete_user: user, step: @active_step, donot_advance: true),
                            method: :put, class: "close" %>
              </td>
            </tr>
            <% end %>
          </tbody>
          <% end %>
        </table>
      
        <!-- Opaque layer to disable content underneath -->
        <% if access == 'limited' %>
          <div class="overlay" style="display:none"></div>
        <% else %>
          <div class="overlay"></div>
        <% end %>
      </div>

      <div id="users-ex" class="span5">
        <%= select_tag "new_group", options_from_collection_for_select(@addable_groups, "name", "name") %>
        <%= submit_tag "Add Group", class: "btn" %>
  
        <table class="table table-striped table-hover">
          <% unless @group_exceptions.empty? %>
            <thead>
              <th>Group name</th>
              <th/> 
            </thead>
            <tbody>
              <% @group_exceptions.each do |group| %>
                <tr>
                  <td>
                    <%= label_tag do %>
                      <%= link_to group, edit_admin_group_path(group) %>
                    <% end %>
                  </td>
                  <td>
                     <%= link_to "×", 
                                 polymorphic_path(object, delete_group: group, step: @active_step, donot_advance: true),
                                 method: :put, class: "close" %>
                  </td>
                </tr>
              <% end %>
            </tbody>
          <% end %>
        </table>

        <!-- Opaque layer to disable content underneath -->
        <% if access == 'limited' %>
          <div class="overlay" style="display:none"></div>
        <% else %>
          <div class="overlay"></div>
        <% end %>
      </div>
    <% else %>
      Item is viewable by
      <% case access %>
      <% when "public" %>
        the general public
      <% when "restricted" %>
        logged in users only
      <% when "private" %>
        collection members only
      <% when "limited" %>
        limited users
      <% end %>  
    <% end %>  
  <% end %>  

<% content_for :page_scripts do %>
  <script>
    $("#access_limited").change(function() { 
      $(".overlay").hide(); 
    });
    
    $("#access_public, #access_restricted, #access_private").change(function() { $(".overlay").show(); });
  </script>
<% end %><commit_msg>Change wording to reflect current status of the system<commit_after>  <%= form.fieldset 'Item discovery' do %>
    <% if can? :update_access_control, object %>
      <%= label_tag :hidden do %>
        <%= check_box_tag 'hidden', '1', hidden %>
        Hide this item from search results 
      <% end %>
    <% else %>
      <%= hidden ? "Item is hidden from search results" : "Item is not hidden from search results" %>
    <% end %>
  <% end %>
    
  <%= form.fieldset 'Item access' do %>
    <% if can? :update_access_control, object %>
      <%= form.hidden_field :pid %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'public', (access == 'public') %>
        Available to the general public
      <% end %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'restricted', (access == 'restricted') %>
        Logged in users only
      <% end %>

      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'private', (access == 'private') %>
        Collection staff only
      <% end %>
    
      <%= label_tag :access do %>
      <%= radio_button_tag :access, 'limited', (access == 'limited') %>
        Limit access to specified users and/or groups
      <% end %>
 
      <div id="groups-ex" class="span5">
        <%= text_field_tag "new_user" %>
        <%= submit_tag "Add User", class: "btn" %>

        <table class="table table-striped table-hover">
          <% unless @user_exceptions.empty? %>
          <thead>
            <th class="info">User name</th>
            <th/>
          </thead>
          <tbody>
            <% @user_exceptions.each do |user| %>
            <tr>
              <td>
                <%= label_tag do %>
                  <%= user %>
                <% end %>
              </td>
              <td>
                <%= link_to "×", 
                            polymorphic_path(object, delete_user: user, step: @active_step, donot_advance: true),
                            method: :put, class: "close" %>
              </td>
            </tr>
            <% end %>
          </tbody>
          <% end %>
        </table>
      
        <!-- Opaque layer to disable content underneath -->
        <% if access == 'limited' %>
          <div class="overlay" style="display:none"></div>
        <% else %>
          <div class="overlay"></div>
        <% end %>
      </div>

      <div id="users-ex" class="span5">
        <%= select_tag "new_group", options_from_collection_for_select(@addable_groups, "name", "name") %>
        <%= submit_tag "Add Group", class: "btn" %>
  
        <table class="table table-striped table-hover">
          <% unless @group_exceptions.empty? %>
            <thead>
              <th>Group name</th>
              <th/> 
            </thead>
            <tbody>
              <% @group_exceptions.each do |group| %>
                <tr>
                  <td>
                    <%= label_tag do %>
                      <%= link_to group, edit_admin_group_path(group) %>
                    <% end %>
                  </td>
                  <td>
                     <%= link_to "×", 
                                 polymorphic_path(object, delete_group: group, step: @active_step, donot_advance: true),
                                 method: :put, class: "close" %>
                  </td>
                </tr>
              <% end %>
            </tbody>
          <% end %>
        </table>

        <!-- Opaque layer to disable content underneath -->
        <% if access == 'limited' %>
          <div class="overlay" style="display:none"></div>
        <% else %>
          <div class="overlay"></div>
        <% end %>
      </div>
    <% else %>
      Item is viewable by
      <% case access %>
      <% when "public" %>
        the general public
      <% when "restricted" %>
        logged in users only
      <% when "private" %>
        collection staff only
      <% when "limited" %>
        limited users
      <% end %>  
    <% end %>  
  <% end %>  

<% content_for :page_scripts do %>
  <script>
    $("#access_limited").change(function() { 
      $(".overlay").hide(); 
    });
    
    $("#access_public, #access_restricted, #access_private").change(function() { $(".overlay").show(); });
  </script>
<% end %>
{'fraction_non_alphanumeric': 0.15741935483870967, 'fraction_numerical': 0.0007038123167155425, 'mean_word_length': 1.5382554331646323, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3736523', 'n_tokens_mistral': 2681, 'n_tokens_neox': 2354, 'n_words': 590}