<commit_before><% if @current_user.is_contributor_or_higher? %>
<% content_for("post_cookie_javascripts") do %>
<script type="text/javascript">
  var def = [];

  var account_menu = [];
  <% if @current_user.is_anonymous? %>
    account_menu.push(<%= make_sub_item("Login", {:controller => :user, :action => "login"}, :level => :member) %>);
    account_menu.push(<%= make_sub_item("Reset&nbsp;Password", :controller => :user, :action => "reset_password") %>);
  <% else %>
    account_menu.push(<%= make_sub_item("Logout", :controller => :user, :action => "logout") %>);

    if(Cookie.get("user_id"))
    {
      var profile_item = <%= make_sub_item("My&nbsp;Profile", :controller => :user, :action => "show") %>;
      profile_item.dest += "/" + Cookie.get("user_id")
      account_menu.push(profile_item);
    }

    account_menu.push(<%= make_sub_item("My&nbsp;Mail", :controller => "dmail", :action => "inbox") %>);

    if(Cookie.get("login"))
    {
      var favorites_item = <%= make_sub_item("My&nbsp;Favorites", :controller => "post", :action => "index", :tags => "order:vote vote:3:") %>;
      favorites_item.dest += Cookie.get("login")
      account_menu.push(favorites_item);
    }

    account_menu.push(<%= make_sub_item("Settings", :controller => :user, :action => "edit") %>);
    account_menu.push(<%= make_sub_item("Change&nbsp;Password", :controller => :user, :action => "change_password") %>);
  <% end %>

  def.push(<%= make_main_item("My&nbsp;Account", {:controller => :user, :action => "home"}, {:name => "my_account", :level => :member}) %>);
  def[def.length-1].sub = account_menu;

  var posts_menu = [];
  posts_menu.push(<%= make_sub_item("View posts", :controller => :post, :action => "index") %>);
  posts_menu.push(<%= make_sub_item("Upload", :controller => :post, :action => "upload") %>);
  /* <%= make_sub_item("Subscriptions", :controller => :post, :action => "index") %>, */
  <!-- <li id="my-subscriptions-container"><%= link_to "Subscriptions", "/", :id => "my-subscriptions" %> -->
  posts_menu.push(<%= make_sub_item("Random", :controller => :post, :tags => "order:random") %>);
  posts_menu.push(<%= make_sub_item("Popular", :controller => :post, :action => "popular_recent") %>);
  posts_menu.push(<%= make_sub_item("Image&nbsp;Search", :controller => :post, :action => "similar") %>);
  posts_menu.push(<%= make_sub_item("History", :controller => :history, :action => "index") %>);
  <% if @current_user.is_contributor_or_higher? %>
    posts_menu.push(<%= make_sub_item("Batch upload", :controller => :batch) %>);
  <% end %>
  <% if @current_user.is_janitor_or_higher? %>
    posts_menu.push(<%= make_sub_item("Moderate", :controller => :post, :action => "moderate") %>);

    var posts_flagged = Cookie.get("posts_flagged");
    if (posts_flagged && parseInt(posts_flagged) > "0") {
      posts_menu[posts_menu.length-1].class_names = ["bolded"];
    }
  <% end %>

  def.push(<%= make_main_item("Posts", {:controller => :post, :action => "index"}, {:name => "posts"}) %>);
  def[def.length-1].sub = posts_menu;

  var comments_menu = [];
  comments_menu.push(<%= make_sub_item("View&nbsp;comments", :controller => :comment, :action => "index") %>);
  comments_menu.push(<%= make_sub_item("Search", :controller => :comment, :action => "search") %>);
  <% if @current_user.is_janitor_or_higher? %><commit_msg>show number of flagged posts in menu<commit_after><% if @current_user.is_contributor_or_higher? %>
<% content_for("post_cookie_javascripts") do %>
<script type="text/javascript">
  var def = [];

  var account_menu = [];
  <% if @current_user.is_anonymous? %>
    account_menu.push(<%= make_sub_item("Login", {:controller => :user, :action => "login"}, :level => :member) %>);
    account_menu.push(<%= make_sub_item("Reset&nbsp;Password", :controller => :user, :action => "reset_password") %>);
  <% else %>
    account_menu.push(<%= make_sub_item("Logout", :controller => :user, :action => "logout") %>);

    if(Cookie.get("user_id"))
    {
      var profile_item = <%= make_sub_item("My&nbsp;Profile", :controller => :user, :action => "show") %>;
      profile_item.dest += "/" + Cookie.get("user_id")
      account_menu.push(profile_item);
    }

    account_menu.push(<%= make_sub_item("My&nbsp;Mail", :controller => "dmail", :action => "inbox") %>);

    if(Cookie.get("login"))
    {
      var favorites_item = <%= make_sub_item("My&nbsp;Favorites", :controller => "post", :action => "index", :tags => "order:vote vote:3:") %>;
      favorites_item.dest += Cookie.get("login")
      account_menu.push(favorites_item);
    }

    account_menu.push(<%= make_sub_item("Settings", :controller => :user, :action => "edit") %>);
    account_menu.push(<%= make_sub_item("Change&nbsp;Password", :controller => :user, :action => "change_password") %>);
  <% end %>

  def.push(<%= make_main_item("My&nbsp;Account", {:controller => :user, :action => "home"}, {:name => "my_account", :level => :member}) %>);
  def[def.length-1].sub = account_menu;

  var posts_menu = [];
  posts_menu.push(<%= make_sub_item("View posts", :controller => :post, :action => "index") %>);
  posts_menu.push(<%= make_sub_item("Upload", :controller => :post, :action => "upload") %>);
  /* <%= make_sub_item("Subscriptions", :controller => :post, :action => "index") %>, */
  <!-- <li id="my-subscriptions-container"><%= link_to "Subscriptions", "/", :id => "my-subscriptions" %> -->
  posts_menu.push(<%= make_sub_item("Random", :controller => :post, :tags => "order:random") %>);
  posts_menu.push(<%= make_sub_item("Popular", :controller => :post, :action => "popular_recent") %>);
  posts_menu.push(<%= make_sub_item("Image&nbsp;Search", :controller => :post, :action => "similar") %>);
  posts_menu.push(<%= make_sub_item("History", :controller => :history, :action => "index") %>);
  <% if @current_user.is_contributor_or_higher? %>
    posts_menu.push(<%= make_sub_item("Batch upload", :controller => :batch) %>);
  <% end %>
  <% if @current_user.is_janitor_or_higher? %>
    posts_menu.push(<%= make_sub_item("Moderate", :controller => :post, :action => "moderate") %>);

    var posts_flagged = Cookie.get("posts_flagged");
    if (posts_flagged && parseInt(posts_flagged) > "0") {
      posts_menu[posts_menu.length-1].label += " (" + posts_flagged + ")";
      posts_menu[posts_menu.length-1].class_names = ["bolded"];
    }
  <% end %>

  def.push(<%= make_main_item("Posts", {:controller => :post, :action => "index"}, {:name => "posts"}) %>);
  def[def.length-1].sub = posts_menu;

  var comments_menu = [];
  comments_menu.push(<%= make_sub_item("View&nbsp;comments", :controller => :comment, :action => "index") %>);
  comments_menu.push(<%= make_sub_item("Search", :controller => :comment, :action => "search") %>);
  <% if @current_user.is_janitor_or_higher? %>
{'fraction_non_alphanumeric': 0.22541825653067216, 'fraction_numerical': 0.001614323451717053, 'mean_word_length': 5.195454545454545, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 169, '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': '4531537', 'n_tokens_mistral': 2503, 'n_tokens_neox': 2273, 'n_words': 392}