<commit_before><?php use_helper('I18N', 'Date', 'rtText', 'rtForm', 'rtDate', 'rtSite') ?>
<?php $class = isset($class) ? $class : 'rt-admin-edit-tools-panel-small'?>
<?php if ($snippets): ?>
  <div class="rt-snippet rt-show rt-primary-container rt-admin-edit-tools-panel <?php echo $class ?>">
    <?php $referer = url_for($sf_request->getParameter('module').DIRECTORY_SEPARATOR.$sf_request->getParameter('action'),true); ?>
    <?php if($snippets->count()): ?>
      <?php foreach($snippets as $snippet): ?>
        <?php $sf_user->getAttributeHolder()->remove('referer'); ?>
        <?php echo link_to(__('Edit'), 'rtSnippetAdmin/edit?id='.$snippet->getId(), array('class' => 'rt-admin-edit-tools-trigger')) ?>
        <a href="<?php echo url_for('rtSnippetAdmin/edit?id='.$snippet->getId()) . '?referer='.  urlencode($referer) ?>" class="rt-admin-edit-tools-trigger"><?php echo __('Edit') ?></a>
        <?php echo markdown_to_html($snippet->getContent(), $snippet); ?>
      <?php endforeach; ?>
    <?php else: ?>
      <a href="<?php echo url_for('rtSnippetAdmin/new?collection='.$collection) . '?referer='.  urlencode($referer) ?>" class="rt-admin-edit-tools-trigger"><?php echo __('Edit') ?></a>
      <?php echo isset($default) ? markdown_to_html($default) : '';  ?>
    <?php endif; ?>
  </div>
<?php endif; ?><commit_msg>Added javascript function to snippet panel template to populate the edit link to prevent cache issues<commit_after><?php use_helper('I18N', 'Date', 'rtText', 'rtForm', 'rtDate', 'rtSite') ?>
<?php $class = isset($class) ? $class : 'rt-admin-edit-tools-panel-small'?>
<?php if ($snippets): ?>
  <div class="rt-snippet rt-show rt-primary-container rt-admin-edit-tools-panel <?php echo $class ?>">
    <?php $referer = url_for($sf_request->getParameter('module').DIRECTORY_SEPARATOR.$sf_request->getParameter('action'),true); ?>
    <?php if($snippets->count()): ?>
      <?php foreach($snippets as $snippet): ?>
        <?php $sf_user->getAttributeHolder()->remove('referer'); ?>
        <?php echo link_to(__('Edit'), 'rtSnippetAdmin/edit?id='.$snippet->getId(), array('class' => 'rt-admin-edit-tools-trigger')) ?>
        <a href="<?php echo url_for('rtSnippetAdmin/edit?id='.$snippet->getId()) ?>" class="rt-admin-edit-tools-trigger"><?php echo __('Edit') ?></a>
        <?php echo markdown_to_html($snippet->getContent(), $snippet); ?>
      <?php endforeach; ?>
    <?php else: ?>
      <a href="<?php echo url_for('rtSnippetAdmin/new?collection='.$collection) ?>" class="rt-admin-edit-tools-trigger"><?php echo __('Edit') ?></a>
      <?php echo isset($default) ? markdown_to_html($default) : '';  ?>
    <?php endif; ?>
  </div>
<script type="text/javascript">
  $(function() {
    $("a.rt-admin-edit-tools-trigger").click(function(){
      $("a.rt-admin-edit-tools-trigger").attr("href", $(this).attr('href') + '?referer=' + window.location);
    })
  });
</script>
<?php endif; ?>
{'fraction_non_alphanumeric': 0.2321917808219178, 'fraction_numerical': 0.0013698630136986301, 'mean_word_length': 4.727450980392157, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 73, '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': '1206347', 'n_tokens_mistral': 971, 'n_tokens_neox': 987, 'n_words': 174}