<commit_before>%p.lead Delayed Jobs
%ul.nav.nav-tabs
  %li.active
    = link_to "All", "#all", "data-toggle" => "tab"
  %li
    = link_to "Failed", "#failed", "data-toggle" => "tab"
  %li
    = link_to "Queued", "#queued", "data-toggle" => "tab"
  %li
    = link_to "Active", "#active", "data-toggle" => "tab"

.tab-content
  .tab-pane#all.active{ 'data-url'   => all_dj_reports_url }
  .tab-pane#failed{ 'data-url'=> failed_dj_reports_url }
  .tab-pane#active{ 'data-url'=> active_dj_reports_url }
  .tab-pane#queued{ 'data-url'=> queued_dj_reports_url }

%script#dj_reports_template{ :type=> "text/x-handlebars-template" }
  %table.table.table-striped#jobs-table
    %thead
      %tr
        %th
          Queue
        %th
          ID
        %th
          Priority
        %th
          Attempts
        %th
          Last Error
        %th.date
          Run at
        %th.date
          Created at
        %th.date
          Failed at

    %tbody
      {{#.}}
      %tr
        %td
          .label.label-info
            {{queue}}
        %td
          <a href="#" data-content="<code class='block'>{{payload}}</code>" rel='popover' title='Payload'> {{id}} </a>
        %td
          {{priority}}
        %td
          {{attempts}}
        %td
          <a href="#last_error_template" data-content="{{last_error}}" rel='modal' title='Last Error'> {{last_error_summary}} </a>
        %td.date
          {{run_at}}
        %td.date
          {{created_at}}
        %td.date
          {{#failed}}
          {{failed_at}}
          
          = form_tag '/dj_mon/dj_reports/{{id}}/retry', method: :post, class: 'form-inline' do
            = submit_tag 'Retry', class: 'btn btn-info btn-mini'

          = form_tag '/dj_mon/dj_reports/{{id}}', method: :delete, class: 'form-inline' do
            = submit_tag 'Delete', class: 'btn btn-danger btn-mini'

          {{/failed}}

      {{/.}}

%script#last_error_template{ :type=> "text/x-handlebars-template" }
  .modal.hide
    .modal-header
      %button{ type: "button", class: "close", 'data-dismiss' => "modal" }
        ×
      %h3
        Last Error
    .modal-body
      %code
        {{content}}
    .modal-footer
      = link_to "Close", '#', class: 'btn btn-primary', 'data-dismiss'=> 'modal'
<commit_msg>use url helpers for "Retry" and "Delete" button in dj_reports/index<commit_after>%p.lead Delayed Jobs
%ul.nav.nav-tabs
  %li.active
    = link_to "All", "#all", "data-toggle" => "tab"
  %li
    = link_to "Failed", "#failed", "data-toggle" => "tab"
  %li
    = link_to "Queued", "#queued", "data-toggle" => "tab"
  %li
    = link_to "Active", "#active", "data-toggle" => "tab"

.tab-content
  .tab-pane#all.active{ 'data-url'   => all_dj_reports_url }
  .tab-pane#failed{ 'data-url'=> failed_dj_reports_url }
  .tab-pane#active{ 'data-url'=> active_dj_reports_url }
  .tab-pane#queued{ 'data-url'=> queued_dj_reports_url }

%script#dj_reports_template{ :type=> "text/x-handlebars-template" }
  %table.table.table-striped#jobs-table
    %thead
      %tr
        %th
          Queue
        %th
          ID
        %th
          Priority
        %th
          Attempts
        %th
          Last Error
        %th.date
          Run at
        %th.date
          Created at
        %th.date
          Failed at

    %tbody
      {{#.}}
      %tr
        %td
          .label.label-info
            {{queue}}
        %td
          <a href="#" data-content="<code class='block'>{{payload}}</code>" rel='popover' title='Payload'> {{id}} </a>
        %td
          {{priority}}
        %td
          {{attempts}}
        %td
          <a href="#last_error_template" data-content="{{last_error}}" rel='modal' title='Last Error'> {{last_error_summary}} </a>
        %td.date
          {{run_at}}
        %td.date
          {{created_at}}
        %td.date
          {{#failed}}
          {{failed_at}}
          
          = form_tag CGI.unescape(retry_dj_report_url(:id => "{{id}}")), method: :post, class: 'form-inline' do
            = submit_tag 'Retry', class: 'btn btn-info btn-mini'

          = form_tag CGI.unescape(dj_report_url(:id => "{{id}}")), method: :delete, class: 'form-inline' do
            = submit_tag 'Delete', class: 'btn btn-danger btn-mini'

          {{/failed}}

      {{/.}}

%script#last_error_template{ :type=> "text/x-handlebars-template" }
  .modal.hide
    .modal-header
      %button{ type: "button", class: "close", 'data-dismiss' => "modal" }
        ×
      %h3
        Last Error
    .modal-body
      %code
        {{content}}
    .modal-footer
      = link_to "Close", '#', class: 'btn btn-primary', 'data-dismiss'=> 'modal'

{'fraction_non_alphanumeric': 0.17250324254215305, 'fraction_numerical': 0.00043233895373973193, 'mean_word_length': 1.9928848641655885, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 41, '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': '4141961', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1575, 'n_words': 321}