<commit_before>
<script type="text/javascript"><!--

$(document).ready(function() {
  
  function dialog_fork(title) {  
    var html = cd.divPanel(
        'Create a new cyber-dojo, with a new id, '
      + "with starting files copied from traffic-light <%= @now_tag %>.");
      
    return $('<div class="dialog">')
      .html(html)
      .dialog({
        autoOpen: false,
        width: 500,
        title: cd.dialogTitle(title),
        modal: true,
        buttons: {
          ok: function() {
            cd.postTo('/forker/fork', {
              id: "<%= @kata.id %>",
              avatar: "<%= @avatar.name %>",
              tag: "<%= @now_tag %>"
            }, '_blank');
            $(this).dialog('close');
          },
          cancel: function() {
            $(this).dialog('close');
          }
        }
      });
  };
  
  $('#fork').click(function() {
    var title = $(this).text();        
    dialog_fork(title).dialog('open');
  });

});

//--></script>

<div class="button"
     title="Fork a new dojo from traffic-light <%= @now_tag %>"
     id="fork">
  <%= t("views.buttons.fork") %>
</div>

<commit_msg>i18n work on diff-view fork button<commit_after>
<script type="text/javascript"><!--

$(document).ready(function() {
  
  function dialog_fork(title, ok, cancel) {  
    var html = cd.divPanel(
        'Create a new cyber-dojo, with a new id, '
      + "with starting files copied from traffic-light <%= @now_tag %>.");
    var i18nButtons = { };
    i18nButtons[ok] = function() {
      cd.postTo('/forker/fork', {
        id: "<%= @kata.id %>",
        avatar: "<%= @avatar.name %>",
        tag: "<%= @now_tag %>"
      }, '_blank');
      $(this).dialog('close');    
    };
    i18nButtons[cancel] = function() {
      $(this).dialog('close');      
    };    
    return $('<div class="dialog">')
      .html(html)
      .dialog({
        autoOpen: false,
        width: 500,
        title: cd.dialogTitle(title),
        modal: true,
        buttons: i18nButtons
      });
  };
  
  $('#fork').click(function() {
    var title = $(this).text();
    var ok = $(this).data('ok');
    var cancel = $(this).data('cancel');
    dialog_fork(title, ok, cancel).dialog('open');
  });

});

//--></script>

<div class="button"
     title="Fork a new dojo from traffic-light <%= @now_tag %>"
     data-ok="<%= t('views.buttons.ok') %>"
     data-cancel="<%= t('views.buttons.cancel') %>"
     id="fork">
  <%= t("views.buttons.fork") %>
</div>


{'fraction_non_alphanumeric': 0.20806451612903226, 'fraction_numerical': 0.0064516129032258064, 'mean_word_length': 2.1168341708542715, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '1670315', 'n_tokens_mistral': 855, 'n_tokens_neox': 812, 'n_words': 162}