<commit_before><template name="chat">
<div id="chat" class="row" style="min-height: 0px;">
  {{> chat_connections}}
  {{> chat_main}}
  {{> chat_users}}
</div>
{{> chat_input}}
</template>

<template name="chat_connections">
  <div id="chat-servers" class="bs-sidebar col-md-2 hidden-xs hidden-sm col-sm-1" style="overflow: auto;">
    <div class="panel panel-info">
      <div class="panel-heading">
        <strong>Servers</strong>
        <span class="pull-right">
          <button id="server-add-btn" class="btn btn-primary compact-icon-btn enable-tipsy" title="Add new server" data-toggle="modal" data-target="#addServerModal">
            <icon class="glypicon glyphicon-plus"></icon>
          </button>
        </span>
      </div>
      <div class="panel-body">
        <ul class="nav bs-sidenav">
          {{#each servers}}
            {{> chat_connection_server}}
          {{/each}}
        </ul>
      </div>
    </div>
  </div>
  {{> add_server_modal}}
</template>

<template name="add_server_modal">
<div class="modal fade" id="addServerModal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Add a server</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <div class="form-group">
              {{> servers_list_for_user}}
            </div>
            <div class="form-group">
              <input id="server-join-nick" type="text" class="form-control" name="nick" required="true" placeholder="Nick">
            </div>
            <div class="form-group">
              <input id="server-join-name" type="text" class="form-control" name="name" placeholder="Name">
            </div>
            <div class="form-group">
              <input id="server-join-password" type="password" class="form-control" name="password" placeholder="Password">
            </div>
            <div class="form-group">
              <input id="server-join-channels" type="text" class="form-control" name="channels" placeholder="Channels...">
            <div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Submit">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="chat_connection_server">
  <li id='server-{{ _id }}' class='server' data-server-id='{{ _id }}'>
    <a id='serverLink-{{ _id }}' class='server-link' data-server-id='{{ _id }}' data-roomtype="server" href="#">
      {{name}}
      <span class="pull-right">
        {{ showStatusIcon status }}
        <div class="btn-group">
          <button type="button" class="server-room-menu-btn btn btn-default dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
          </button>
          {{> server_menu}}
        </div>
      </span>
    </a>
    {{> server_channels}}
    {{> server_pms}}
    {{> edit_server_channel}}
  </li>
</template>

<template name="edit_server_modal">
<div class="modal fade" id="editServerModal-{{ _id }}" data-server-id="{{ _id }}" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Edit <strong>{{name}}</strong> server</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <input type="hidden" name="user_server_id" value="{{_id}}">
            <div class="form-group">
              <input type="text" class="form-control" name="nick" required="true" placeholder="Nick" value="{{ nick }}">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="real_name" placeholder="Name" value="{{ real_name }}">
            </div>
            <div class="form-group">
              <input type="password" class="form-control" name="password" placeholder="Password" value="{{ password }}">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="channels" placeholder="Channels..." value="{{ channels }}">
            <div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Save changes">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="server_menu">
  <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="server-menu-{{ _id }}" style="min-width: 85px; width: 85px;">
    <li>
      <a class="addChannelLink" data-toggle="modal" data-target="#addServerChannel-{{ _id }}" href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}"><i class="glyphicon glyphicon-plus"></i> Channel</a>
      <a class="serverEditLink" href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}" data-toggle="modal" data-target="#editServerModal-{{ _id }}"><i class="glyphicon glyphicon-pencil"></i> Edit</a>
      <a href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}"><i class="glyphicon glyphicon-remove"></i> Close</a>
    </li>
  </ul>
  {{> edit_server_modal}}
  {{> add_server_channel}}
</template>

<template name="add_server_channel">
<div class="modal fade" id="addServerChannel-{{ _id }}" data-server-id="{{ _id }}" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Join new channel</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <input type="hidden" name="user_server_id" value="{{_id}}">
            <div class="form-group">
              <input type="text" class="form-control" name="name" required="true" placeholder="#ChannelName">
            </div>
            <div class="form-group">
              <input type="password" class="form-control" name="password" placeholder="Password" value="{{ password }}">
            </div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Join">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="server_pms">
  <ul class="nav bs-siderbar">
    {{#each pms _id}}
      {{> server_pm_item}}
    {{/each}}
  </ul>
</template>

<template name="server_pm_item">
  <li class="dropdown">
    <a id="pmLink-{{ server_id }}_{{ name }}" role="button" class="server-room pm" href="#" data-roomtype="pm" data-roomid="{{ server_id}}_{{ name }}" data-nick="{{ name }}" data-server-id="{{ server_id }}">
      <i class="icon-user"></i>
      {{ name }}
      <span class="pull-right">        
        <span class="badge">{{ unread_logs_count "pm" server_id name }}</span>
        <div class="btn-group">
          <button type="button" class="server-room-menu-btn btn btn-default dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
          </button>
          {{> server_pm_menu}}
        </div>
      </span>
    </a>
  </li>
</template>

<template name="server_pm_menu"><commit_msg>Added missing user icon for server PM entries.<commit_after><template name="chat">
<div id="chat" class="row" style="min-height: 0px;">
  {{> chat_connections}}
  {{> chat_main}}
  {{> chat_users}}
</div>
{{> chat_input}}
</template>

<template name="chat_connections">
  <div id="chat-servers" class="bs-sidebar col-md-2 hidden-xs hidden-sm col-sm-1" style="overflow: auto;">
    <div class="panel panel-info">
      <div class="panel-heading">
        <strong>Servers</strong>
        <span class="pull-right">
          <button id="server-add-btn" class="btn btn-primary compact-icon-btn enable-tipsy" title="Add new server" data-toggle="modal" data-target="#addServerModal">
            <icon class="glypicon glyphicon-plus"></icon>
          </button>
        </span>
      </div>
      <div class="panel-body">
        <ul class="nav bs-sidenav">
          {{#each servers}}
            {{> chat_connection_server}}
          {{/each}}
        </ul>
      </div>
    </div>
  </div>
  {{> add_server_modal}}
</template>

<template name="add_server_modal">
<div class="modal fade" id="addServerModal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Add a server</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <div class="form-group">
              {{> servers_list_for_user}}
            </div>
            <div class="form-group">
              <input id="server-join-nick" type="text" class="form-control" name="nick" required="true" placeholder="Nick">
            </div>
            <div class="form-group">
              <input id="server-join-name" type="text" class="form-control" name="name" placeholder="Name">
            </div>
            <div class="form-group">
              <input id="server-join-password" type="password" class="form-control" name="password" placeholder="Password">
            </div>
            <div class="form-group">
              <input id="server-join-channels" type="text" class="form-control" name="channels" placeholder="Channels...">
            <div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Submit">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="chat_connection_server">
  <li id='server-{{ _id }}' class='server' data-server-id='{{ _id }}'>
    <a id='serverLink-{{ _id }}' class='server-link' data-server-id='{{ _id }}' data-roomtype="server" href="#">
      {{name}}
      <span class="pull-right">
        {{ showStatusIcon status }}
        <div class="btn-group">
          <button type="button" class="server-room-menu-btn btn btn-default dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
          </button>
          {{> server_menu}}
        </div>
      </span>
    </a>
    {{> server_channels}}
    {{> server_pms}}
    {{> edit_server_channel}}
  </li>
</template>

<template name="edit_server_modal">
<div class="modal fade" id="editServerModal-{{ _id }}" data-server-id="{{ _id }}" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Edit <strong>{{name}}</strong> server</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <input type="hidden" name="user_server_id" value="{{_id}}">
            <div class="form-group">
              <input type="text" class="form-control" name="nick" required="true" placeholder="Nick" value="{{ nick }}">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="real_name" placeholder="Name" value="{{ real_name }}">
            </div>
            <div class="form-group">
              <input type="password" class="form-control" name="password" placeholder="Password" value="{{ password }}">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="channels" placeholder="Channels..." value="{{ channels }}">
            <div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Save changes">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="server_menu">
  <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="server-menu-{{ _id }}" style="min-width: 85px; width: 85px;">
    <li>
      <a class="addChannelLink" data-toggle="modal" data-target="#addServerChannel-{{ _id }}" href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}"><i class="glyphicon glyphicon-plus"></i> Channel</a>
      <a class="serverEditLink" href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}" data-toggle="modal" data-target="#editServerModal-{{ _id }}"><i class="glyphicon glyphicon-pencil"></i> Edit</a>
      <a href="#" style="padding: 3px 5px;" data-server-id="{{ _id }}"><i class="glyphicon glyphicon-remove"></i> Close</a>
    </li>
  </ul>
  {{> edit_server_modal}}
  {{> add_server_channel}}
</template>

<template name="add_server_channel">
<div class="modal fade" id="addServerChannel-{{ _id }}" data-server-id="{{ _id }}" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <form class="form" role="form">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">Join new channel</h4>
        </div>
        <div class="modal-body">
          <fieldset>
            <input type="hidden" name="user_server_id" value="{{_id}}">
            <div class="form-group">
              <input type="text" class="form-control" name="name" required="true" placeholder="#ChannelName">
            </div>
            <div class="form-group">
              <input type="password" class="form-control" name="password" placeholder="Password" value="{{ password }}">
            </div>
          </fieldset>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input type="submit" class="btn btn-primary" value="Join">
        </div>
      </form>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</template>

<template name="server_pms">
  <ul class="nav bs-siderbar">
    {{#each pms _id}}
      {{> server_pm_item}}
    {{/each}}
  </ul>
</template>

<template name="server_pm_item">
  <li class="dropdown">
    <a id="pmLink-{{ server_id }}_{{ name }}" role="button" class="server-room pm" href="#" data-roomtype="pm" data-roomid="{{ server_id}}_{{ name }}" data-nick="{{ name }}" data-server-id="{{ server_id }}">
      <i class="glyphicon glyphicon-user"></i>
      {{ name }}
      <span class="pull-right">        
        <span class="badge">{{ unread_logs_count "pm" server_id name }}</span>
        <div class="btn-group">
          <button type="button" class="server-room-menu-btn btn btn-default dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
          </button>
          {{> server_pm_menu}}
        </div>
      </span>
    </a>
  </li>
</template>

<template name="server_pm_menu">
{'fraction_non_alphanumeric': 0.20203452527743526, 'fraction_numerical': 0.0027127003699136867, 'mean_word_length': 2.804174484052533, 'pattern_counts': {'":': 0, '<': 401, '<?xml version=': 0, '>': 431, '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': '86256', 'n_tokens_mistral': 5048, 'n_tokens_neox': 4967, 'n_words': 1027}