<commit_before><% if f.object.can_manage? %>
  <% title_and_help = capture do %>
        <%= help_icon("Here you can create temporary access links for visitors and others who would not normally be allowed to view/download this asset") %>
        Temporary Access Links
  <% end %>

  <% content = capture do %>
        <% f.fields_for :special_auth_codes, f.object.special_auth_codes + [SpecialAuthCode.new.tap(&:mark_for_destruction)] do |sub_form|%>
            <fieldset <%= sub_form.object.new_record? ? "id='new_temporary_link_form' style='display: none'" : ''%> >
              <p>
                  <% temporary_link = url_for :action => :show, :only_path => false, :code => sub_form.object.code, :escape => false %>
                  Visitors can view this <%= f.object.class.name.underscore.humanize %> with: <%= link_to temporary_link, temporary_link %>
                  <%= sub_form.hidden_field :code %>
              </p>
              <p>
                <%= sub_form.label :expiration_date %>
                <%= sub_form.calendar_date_select :expiration_date %>
              </p>
              <%= sub_form.subform_delete_link 'Revoke', {}, :class => 'hidden_destroy_field' %>
            </fieldset>
        <% end %>
        <%= link_to_function "Add a Temporary Link", "$('new_temporary_link_form').show();$('new_temporary_link_form').select('.hidden_destroy_field')[0].setValue('false');$(this).hide()" %>
   <% end %>
  <%= render :partial => 'assets/folding_box', :locals => {:hidden => true, :fold_id => 'temporary_links', :fold_title => title_and_help, :contents => content} %>
<% end %><commit_msg>Reappear -Add a Temporary Link- when revoking the link<commit_after><% if f.object.can_manage? %>
  <% title_and_help = capture do %>
        <%= help_icon("Here you can create temporary access links for visitors and others who would not normally be allowed to view/download this asset") %>
        Temporary Access Links
  <% end %>

  <% content = capture do %>
        <% f.fields_for :special_auth_codes, f.object.special_auth_codes + [SpecialAuthCode.new.tap(&:mark_for_destruction)] do |sub_form|%>
            <fieldset <%= sub_form.object.new_record? ? "id='new_temporary_link_form' style='display: none'" : ''%> >
              <p>
                  <% temporary_link = url_for :action => :show, :only_path => false, :code => sub_form.object.code, :escape => false %>
                  Visitors can view this <%= f.object.class.name.underscore.humanize %> with: <%= link_to temporary_link, temporary_link %>
                  <%= sub_form.hidden_field :code %>
              </p>
              <p>
                <%= sub_form.label :expiration_date %>
                <%= sub_form.calendar_date_select :expiration_date %>
              </p>
              <%= sub_form.subform_delete_link 'Revoke', {:onclick => "$('add_a_temporary_link').show()"}, :class => 'hidden_destroy_field' %>
            </fieldset>
        <% end %>
        <%= link_to_function "Add a Temporary Link", "$('new_temporary_link_form').show();$('new_temporary_link_form').select('.hidden_destroy_field')[0].setValue('false');$(this).hide()",  :id => "add_a_temporary_link" %>
   <% end %>
  <%= render :partial => 'assets/folding_box', :locals => {:hidden => true, :fold_id => 'temporary_links', :fold_title => title_and_help, :contents => content} %>
<% end %>
{'fraction_non_alphanumeric': 0.15939447907390916, 'fraction_numerical': 0.0005936479667557139, 'mean_word_length': 2.9647058823529413, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3864153', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1008, 'n_words': 212}