<commit_before>%h1 Petitions dashboard

%p
  - today = Date.today
  Since #{link_to_self_with_param :since, {'today' => today, 'yesterday' => today - 1.day, 'a week ago' => today - 1.week, 'a month ago' => today - 1.month, 'a year ago' => today - 1.year, 'forever' => nil}, " | "}

<button style="float: right" class="btn btn-success" onClick="$('table').dataTable().fnDraw()">Reload</button>

%table#petitions.bordered-table.table-striped.dataTable{"data-source" => admin_petitions_url(format: "json", since: params[:since])}
  %thead
    %tr
      %th Title
      %th Sent
      %th Open
      %th Sign
      %th Like
      %th <acronym title="Hits Per Sent email">HPS</acronym>
      %th <acronym title="New members Per Sent email">NPS</acronym>
      %th Unsub
      %th Created
  %tbody

%p
  Redis space used:
  = float_to_percentage @redis_used
  - if @redis_used > 0.85
    %b{style: "color: red"}
      SPACE RUNNING LOW!!<commit_msg>changed label 'Since' to 'Activity since'<commit_after>%h1 Petitions dashboard

%p
  - today = Date.today
  Activity since #{link_to_self_with_param :since, {'today' => today, 'yesterday' => today - 1.day, 'a week ago' => today - 1.week, 'a month ago' => today - 1.month, 'a year ago' => today - 1.year, 'forever' => nil}, " | "}

<button style="float: right" class="btn btn-success" onClick="$('table').dataTable().fnDraw()">Reload</button>

%table#petitions.bordered-table.table-striped.dataTable{"data-source" => admin_petitions_url(format: "json", since: params[:since])}
  %thead
    %tr
      %th Title
      %th Sent
      %th Open
      %th Sign
      %th Like
      %th <acronym title="Hits Per Sent email">HPS</acronym>
      %th <acronym title="New members Per Sent email">NPS</acronym>
      %th Unsub
      %th Created
  %tbody

%p
  Redis space used:
  = float_to_percentage @redis_used
  - if @redis_used > 0.85
    %b{style: "color: red"}
      SPACE RUNNING LOW!!
{'fraction_non_alphanumeric': 0.16016640665626625, 'fraction_numerical': 0.008320332813312533, 'mean_word_length': 3.402745995423341, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, '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': '6069922', 'n_tokens_mistral': 715, 'n_tokens_neox': 688, 'n_words': 179}