<div id="scroller-anchor"></div>
<div class="collapse" id="massActions" style="width: 500px;  border-left: 1px solid #ddd; margin-left: -16px; padding: 0px 15px; z-index: 3; background-color: rgba(255, 255, 255, 0.7);">

	<h3 style="margin-top: 0; padding-left: 3px;">Групповые операции<span aria-hidden="true" id="massActionsClose" class="close" style="padding-right: 15px;">&times;</span></h3>
	
	<span style="padding-left: 4px;">Выбрано стрельб&emsp;<span style="font-weight: bold;" id="massActionsJobCount"></span></span>
	<br>
	<br>
	<table class="table" id="massActionsTable" style="max-width: 515px;">
		<tbody>
			<tr>
				<td style="cursor: pointer; display: none;" class="massActionButton" data-action="star">
					<i class="fa fa-star star-yellow"></i>&emsp;Добавить в избранное
				</td>
				<td style="cursor: pointer; display: none;" class="massActionButton" data-action="unstar">
					<i class="fa fa-star text-muted"></i>&emsp;Убрать из избранного
				</td>
			</tr>
			<tr>
				<td style="cursor: pointer; display: none;" class="massActionButton" data-action="compare">
					<i class="fa fa-bar-chart text-success"></i>&emsp;Добавить к сравнению
				</td>
				<td style="cursor: pointer; display: none;" class="massActionButton" data-action="uncompare">
					<i class="fa fa-bar-chart text-danger"></i>&emsp;Убрать из сравнения
				</td>
			</tr>
			<tr>
				<td style="cursor: pointer;" class="massActionButton" data-action="move">
					<i class="fa fa-truck text-info"></i>&emsp;Перенести в другую задачу
				</td>
			</tr>
			<tr>
				<td style="cursor: pointer;" class="massActionButton" data-action="remove">
					<i class="fa fa-trash text-danger"></i>&emsp;Удалить
				</td>
			</tr>
		</tbody>
	</table>
</div>


<div class="modal fade" id="moveModal" tabindex="-1" role="dialog" aria-labelledby="moveModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Переместить стрельбы в другую задачу?</h4>	
				<span class="text-muted" id="moveModalJobList"></span> 				
			</div>
			<div class="modal-body">
				<div class="input-group firestarter-input" id="moveModalTaskInput">
					<input type="text" class="form-control firestarter-input__task" placeholder="Задача (таск)" name="task_input" id="task_input"/>
					<span class="input-group-btn">
       					<button class="btn btn-brand" type="button" id="moveModalSubmit">Поехали</button>
    					</span>
				</div>
		    </div>   				
  			</div>
  		</div>
</div>

<div class="modal fade" id="starModal" tabindex="-1" role="dialog" aria-labelledby="starModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Добавить стрельбы в избранное?</h4>					
				<span class="text-muted" id="starModalJobList"></span> 
			</div>
			<div class="modal-body">
    				<button class="btn btn-brand" type="button" id="starModalSubmit">Добавить</button>
		    </div>   				
  			</div>
  		</div>
</div>

<div class="modal fade" id="unstarModal" tabindex="-1" role="dialog" aria-labelledby="unstarModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Убрать стрельбы из избранного?</h4>		
				<span class="text-muted" id="unstarModalJobList"></span> 			
			</div>
			<div class="modal-body">
				<button class="btn btn-brand" type="button" id="unstarModalSubmit">Убрать</button>
		    </div>   				
  			</div>
  		</div>
</div>

<div class="modal fade" id="removeModal" tabindex="-1" role="dialog" aria-labelledby="removeModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Удалить стрельбы?</h4>	
				<span class="text-muted" id="removeModalJobList"></span> 					
			</div>
			<div class="modal-body">
				<button class="btn btn-danger" type="button" id="removeModalSubmit">Удалить</button>
		    </div>   				
  			</div>
  		</div>
</div>

<div class="modal fade" id="compareModal" tabindex="-1" role="dialog" aria-labelledby="compareModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Добавить стрельбы в сравнение?</h4>
				<span class="text-muted" id="compareModalJobList"></span> 						
			</div>
			<div class="modal-body">
				<button class="btn btn-brand" type="button" id="compareModalSubmit">Добавить</button>
		    </div>   				
  			</div>
  		</div>
</div>

<div class="modal fade" id="uncompareModal" tabindex="-1" role="dialog" aria-labelledby="uncompareModalLabel">
 		<div class="modal-dialog" role="document">
  			<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4>Убрать стрельбы из сравнения?</h4>	
				<span class="text-muted" id="uncompareModalJobList"></span>				
			</div>
			<div class="modal-body">
				<button class="btn btn-brand" type="button" id="uncompareModalSubmit">Убрать</button>
		    </div>   				
  			</div>
  		</div>
</div>

{% for fire in fire %}
<div class="job_row" id="job_row__{{ fire.id }}" data-job="{{ fire.id }}">
<table class="taskpageJobsTable table table-hover table-condensed" style="margin-bottom: 0;" id="b_firebyid__table__{{ fire.id }}">
	<tr>
        <td width="100%">
            <div id="b_firebyid__{{ fire.id }}" class="b_fireblock__main b_fireblock__main__noraml">
	            <span id="b_firebyid__firename__{{ fire.id }}" style="display:none;">{{ fire.name }}</span>
	            <span id="b_firebyid__firecomment__{{ fire.id }}" style="display:none;">{{ fire.dsc }}</span>
	            <span id="b_firebyid__fireversion__{{ fire.id }}" style="display:none;">{{ fire.ver }}</span>
	            <span id="b_firebyid__fireregression__{{ fire.id }}" style="display:none;">{{ fire.regression }}</span>
	            <span id="b_firebyid__firecomponent__{{ fire.id}}" style="display:none;">{{ fire.component_id }}</span>
	            <!-- верхняя строка -->
	            <table>
                    <tr>
                      {% if fire.star == 1 or fire.onair == 1 %}
                       <td class="b_firebyid__img">
                       <div style="position:relative;">
                             <div class="b_firebyid__img__pos1" id="b_firebyid__img__pos1__{{ fire.id }}" style="{% if fire.star == 1 or fire.compare == 1 %}{% else %}display:none;{% endif %}">
                                   {% if fire.star == 1 %}
                                   <i class="fa fa-star star-yellow"></i>
                                   {% endif %}

                                   {% if fire.star == 0 and fire.compare == 1 %}
                                   <i class="fa fa-bar-chart text-success"></i>
                                   {% endif %}
                             </div>
                             {% if fire.onair == 0 %}
                             <div class="b_firebyid__img__pos2" id="b_firebyid__img__pos2__{{ fire.id }}" style="{% if fire.star == 0 or fire.compare == 1 %}{% else %}display:none;{% endif %}">
                                   {% if fire.star == 1 and fire.compare == 1 %}
                                   <i class="fa fa-bar-chart text-success"></i>
                                   {% endif %}
                             </div>
                             {% endif %}
                             <a href="/{{ fire.id }}">

                             {% if fire.onair == 1 %}
                             <div class="b_firebyid__img__graph" id="b_firebyid__namediv__{{ fire.id }}" style="background-color:white; width:125px; height:91px;">

                                   <div class="b_firebyid__onair__maintext">
                                         ON AIR
                                   </div>
                                   <div class="b_firebyid__onair__maindiv">
                                         <table width="100%">
                                               <tr>
                                                     <td class="b_firebyid__onair__paramname">Прошло:</td>
                                                     <td class="b_firebyid__onair__paramvalue">{{ fire.duration }}</td>
                                               </tr>
                                               <tr>
                                                     <td colspan="2" style="padding-top:5px;"></td>
                                               </tr>
                                               <tr>
                                                     <td class="b_firebyid__onair__paramname">Осталось:</td>
                                                     <td class="b_firebyid__onair__paramvalue">~ {{ fire.onair_remain }}</td>
                                               </tr>
                                         </table>
                                   </div>
                             </div>

                             {% else %}
                             <div id="job_{{ fire.id }}_preview" class="job_preview" data-job="{{ fire.id }}" data-star="{{ fire.star }}" style="border: 1px solid #ddd; width:125px; height:91px;"></div>
                             {% endif %}
                             </a>
                       </div>
                       </td>
                      {% else %}
                       <td class="b_firebyid__imglight">
                       <div style="position:relative;">
                             <div class="b_firebyid__img__pos1" id="b_firebyid__img__pos1__{{ fire.id }}" style="{% if fire.compare == 1 %}{% else %}display:none;{% endif %}">
                                   {% if fire.compare == 1 %}
                                   <i class="fa fa-bar-chart text-success"></i>
                                   {% endif %}
                             </div>
                       </div>
                       <a href="/{{ fire.id }}">
                       		<div id="job_{{ fire.id }}_preview" class="job_preview" data-job="{{ fire.id }}" data-star="{{ fire.star }}" style="border: 1px solid #ddd; width:50px; height:36px;"></div>
                       </a>
                      </td>
                    {% endif %}
            <td class="b_firebyid__checkboxtd">
            <input type="checkbox" class="checkbox" id="b_firebyid__checkbox__{{ fire.id }}" data-job="{{ fire.id }}" data-star="{{ fire.star }}" data-compare="{{ fire.compare }}">
            </td>
            <td class="b_firebyid__datablock">
            <table border="0" width="100%" cellspacing="0" cellpadding="0">
                  <tr>
                        {% if fire.star == 1 or fire.onair == 1 %}
                        <td class="b_firebyid__datablock__id" id="b_firebyid__datablock__id__{{ fire.id }}">{{ fire.id }}</td>
                        {% else %}
                        <td class="b_firebyid__datablock__idlight" id="b_firebyid__datablock__id__{{ fire.id }}">{{ fire.id }}</td>
                        {% endif %}

                        <td class="b_firebyid__datablock__nametd">

                        <div class="b_firebyid__datablock__nameblock" id="b_firebyid__nameblock__{{ fire.id }}">

                              {% if fire.star == 1 or fire.onair == 1 %}

                              <div class="b_firebyid__datablock__name">

                                    {% else %}

                                    <div class="b_firebyid__datablock__namelight">

                                          {% endif %}

                                          <span id="b_firebyid__name__{{ fire.id }}">
                                                <a href="/{{ fire.id }}" class="{% if fire.star == 1 or fire.onair == 1 %}b_firebyid_name__url{% else %}b_firebyid_name__urllight{% endif %}">{{ fire.name }}</a> 
                                          </span>
                                    </div>
                                    {% if fire.star == 1 or fire.onair == 1 %}
                                    <div class="b_firebyid__datablock__time" id="b_firebyid__time__{{ fire.id }}">
                                          {{ fire.duration }}
                                    </div>
                                    {% else %}
                                    <div class="b_firebyid__datablock__timelight" id="b_firebyid__time__{{ fire.id }}">
                                          <span class="b_fireid_datablock__paramslight__usparam">
                                                {{ fire.date_start }}
                                          </span>&nbsp;&nbsp;/&nbsp;&nbsp;
                                          <span class="b_fireid_datablock__paramslight__usparam2">
                                                {{ fire.duration }}
                                          </span>
                                    </div>
                                    {% endif %}
                              </div>
                        </td>
                  </tr>
            </table>
            <table border="0" width="100%">
                  <tr>
                        <td width="100%">

                        {% if fire.star == 1 or fire.onair == 1 %}
                        <div class="b_fireid_datablock__params">

                              <table border="0" width="100%">
                                    <tr>
                                          <td class="b_firebyid__datablock__param">нагрузка:</td>
                                          <td class="b_firebyid__datablock__val">{% if fire.rps_from == fire.rps_to %}{{ fire.rps_from }}{% else %}{{ fire.rps_from }}{% if fire.imbalance_rps > 0 %}&hellip;<span style="font-weight:{% if fire.imbalance_type == 0 %}normal{% else %}bold{% endif %}">{{ fire.imbalance_rps }}</span>{% endif %}&hellip;{{fire.rps_to}}{% endif %}</td>
                                          <td class="b_firebyid__datablock__val2">
                                          <table>
                                                <tr>
                                                      <td>
                                                      <a href="//staff.yandex-team.ru/{{ fire.author }}" class="auto-person-card auto-person-card__normal" title="{{ fire.author }}" target="_blank">{{ fire.author }}</a>
                                                      </td>
                                                </tr>
                                          </table>
                                          </td>
                                    </tr>
                                    <tr>
                                          <td class="b_firebyid__datablock__param">{% if fire.patrons %}патроны:{% endif %}</td>
                                          <td class="b_firebyid__datablock__val">{{ fire.patrons }}</td>
                                          <td class="b_firebyid__datablock__val2" id="b_firebyid__datablock__ver__{{ fire.id }}"> {% if fire.ver %}
                                          v.{{ fire.ver }}
                                          {% endif %}</td>
                                    </tr>
                                    <tr>
                                          <td colspan="3" class="b_firebyid__datablock__tankinfo">
                                          {{ fire.tank }}
                                          <span style="padding-left:10px">
                                          </span>{{ fire.target }}
                                          <span style="padding-left:5px">
                                          </span>:
                                          <span style="padding-left:5px">
                                          </span>{{ fire.port }}
                                          </td>
                                    </tr>
                              </table>
                        </div>
                        {% else %}
                        <table border="0" width="100%">
                              <tr>
                                    <td width="100%">
                                    <div class="b_fireid_datablock__paramslight">
                                          <table>
                                                <tr>
                                                      <td><span class="b_fireid_datablock__paramslight__usparam">{% if fire.rps_from == fire.rps_to %}{{ fire.rps_from }}{% else %}{{ fire.rps_from }}{% if fire.imbalance_rps > 0 %}&hellip;<span style="font-weight:{% if fire.imbalance_type == 0 %}normal{% else %}bold{% endif %}">{{ fire.imbalance_rps }}</span>{% endif %}&hellip;{{ fire.rps_to }}{% endif %}</span>&nbsp;&nbsp;/&nbsp;&nbsp;</td>
                                                      
                                                      <td id="b_firebyid__datablock__vertd__{{ fire.id }}" style="display:{% if fire.ver %}block{% else %}none{% endif %}">
                                                      <span class="b_fireid_datablock__paramslight__usparam" id="b_firebyid__datablock__ver__{{ fire.id }}">v.{{ fire.ver }}</span>&nbsp;&nbsp;/&nbsp;&nbsp;</td>

                                                      {% if fire.patrons %}
                                                      <td>
                                                      <span class="b_fireid_datablock__paramslight__usparam">
                                                            {{ fire.patrons }}
                                                      </span>&nbsp;&nbsp;/&nbsp;&nbsp;
                                                      </td>
                                                      {% endif %}
                                                      <td style="padding-left:3px; padding-right:3px;">
                                                      <span class="b_fireid_datablock__paramslight__usparam">
                                                            <a href="//staff.yandex-team.ru/{{ fire.author }}" class="auto-person-card auto-person-card__lite" title="{{ fire.author }}" target="_blank">{{ fire.author }}</a>
                                                      </span>
                                                      </td>
                                                </tr>
                                          </table>
                                    </div>
                                    </td>
                                    <td style="text-align:right;">

                                    <div class="b_fireid_datablock__paramslight2">
                                          {{ fire.tank }}
                                          <span style="padding-left:10px">
                                          </span>{{ fire.target }}
                                          <span style="padding-left:5px">
                                          </span>:
                                          <span style="padding-left:5px">
                                          </span>{{ fire.port }}
                                    </div>
                                    </td>
                              </tr>
                        </table>
                        {% endif %}
                        </td>
                        <td>

                        {% if fire.star == 1 or fire.onair == 1 %}
                        <div class="b_firebyid__datablock__rightblock">
                              <div class="b_firebyid__datablock__time2">
                                    {{ fire.date_start }}
                              </div>
                              {% if fire.quit_status == 0 %}
                              {% else %}
                              <div class="b_firebyid__datablock__stop">
                                    <span style="padding-left:5px;">
                                          {% if fire.quit_status == 1%}
                                          	<i class="fa fa-hand-paper-o text-danger" style='font-size: 24px; cursor: default;' title="ручная остановка"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 21 or fire.quit_status == 2 %}
                                         	<i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по time"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 22 %}
                                          	<i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по http"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 23 %}
                                          	<i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по net"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 4 %}
                                          	<i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="нет файла с патронами"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 5 %}
                                          	<i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="нет параметра address"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 6 %}
                                          	<i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="загрузка > 90%"></i>
                                          {% endif %}
                                          {% if fire.quit_status == 7 %}
                                          	<i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="незвестный параметр"></i>
                                          {% endif %}
                                    </span>
                              </div>
                              {% endif %}

                              <div class="b_firebyid__datablock__errors">
                              	{% if fire.http_200 %}<b class="label label-success http_indicator" title="http">2xx</b>{% endif %}
								{% if fire.http_300 %}<b class="label label-info http_indicator" title="http">3xx</b>{% endif %}
								{% if fire.http_400 %}<b class="label label-warning http_indicator" title="http">4xx</b>{% endif %}
								{% if fire.http_500 %}<b class="label label-danger http_indicator" title="http">5xx</b>{% endif %}
                                <b class="label {% if fire.net == 1 %}label-danger{% else  %}label-success{% endif %} net_indicator">NET</b>
                              </div>
                        </div>
                        {% endif %}
                        </td>
                  </tr>
            </table>
            </td>
            <td class="b_firebyid__commenttd" id="b_firebyid__commenttd__{{ fire.id }}">
            <table>
            <tr>
            <td>
            <div class="b_firebyid__commentdiv" id="b_firebyid__comment__{{ fire.id }}">
                  {% if fire.star == 1 or fire.onair == 1 %}
                  <div class="b_firebyid__comment">
                        {{ fire.dsc }}
                  </div>
                  {% else %}
                  <div class="b_firebyid__commentlight">
                        {{ fire.dsc }}
                  </div>
                  {% endif %}
            </div>
            <script nonce='{{ common.CSP_SCRIPT_NONCE }}'>
         	// PARSE URLS in TEXT 
         	var text = "{{ fire.dsc|linebreaks }}";
            text = text.replace(
                /((http|https|ftp|ftps):\/\/[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,3}(\/\S*)?)/g,
                '<a href="$1" target="_blank" class="b_link">$1</a>'
            );
         	this.text=this.text.replace(/\r\n|\r|\n/g,'<br>');
            var classname = $("#b_firebyid__comment__{{ fire.id }} div:first-child").attr('class');
            this.content = '<div class="'+classname+'">'+this.text+'</div>';
            this.contentdiv=this.content;
            $("#b_firebyid__comment__{{ fire.id }}").html(this.contentdiv);
            </script>
            </td>
            <td>
            <div style="width:13px; cursor: pointer; padding:0.2em;">
            	<i class="fa fa-pencil text-warning" style="display:none; font-size: 12px;" id="b_firebyid__commentedit__{{ fire.id }}" title="Редактировать описание стрельбы" alt="Редактировать описание стрельбы">
            	</i>
            </div>
            </td>
            </tr>
            </table>
            </td>
      </tr>
</table>
</div>
<div id="b_rightblock_frespace__{{ fire.id }}" style="display:none; float: right; margin-top: -50px; padding-right: 3px;">
    <i class="fa fa-star job_row__action {% if fire.star == 1 %}star-yellow{% else %}text-muted{% endif %}" data-job="{{ fire.id }}" data-action="star" data-task="{{ fire.task }}" style="cursor: pointer;"></i>
    <i class="fa fa-bar-chart {% if fire.compare == 1 %}text-success{% else %}text-muted{% endif %} job_row__action" data-job="{{ fire.id }}" data-action="compare" data-actiondetail="{% if fire.compare == 1 %}remove{% else %}add{% endif %}" style="cursor: pointer;"></i><br/>
    <i class="fa fa-repeat text-info job_row__action" data-job="{{ fire.id }}" data-action="repeat" style="cursor: pointer;"></i>
    <i class="fa fa-trash text-danger job_row__action" data-job="{{ fire.id }}" data-action="remove" style="cursor: pointer; margin-left: 3px;"></i>
</div>
    </tr>
</table>
    </div>
{% endfor %}


<script nonce='{{ common.CSP_SCRIPT_NONCE }}' type="text/html" id="fireTemplate">

    <div class="job_row" id="job_row__<%= fire.id %>" data-job="<%= fire.id %>">
    <table class="taskpageJobsTable table table-hover table-condensed" style="margin-bottom: 0;" id="b_firebyid__table__<%= fire.id %>">
        <tr>
            <td width="100%">
                <div id="b_firebyid__<%= fire.id %>" class="b_fireblock__main b_fireblock__main__noraml">
                    <span id="b_firebyid__firename__<%= fire.id %>" style="display:none;"><%= fire.name %></span>
                    <span id="b_firebyid__firecomment__<%= fire.id %>" style="display:none;"><%= fire.dsc %></span>
                    <span id="b_firebyid__fireversion__<%= fire.id %>" style="display:none;"><%= fire.ver %></span>
                    <span id="b_firebyid__fireregression__<%= fire.id %>" style="display:none;"><%= fire.regression %></span>
                    <span id="b_firebyid__firecomponent__<%= fire.id%>" style="display:none;"><%= fire.component_id %></span>
                    <!-- верхняя строка -->
                    <table>
                        <tr>
                          <% if (fire.star === 1) { %>
                           <td class="b_firebyid__img">
                           <div style="position:relative;">

                                 <div class="b_firebyid__img__pos1" id="b_firebyid__img__pos1__<%= fire.id %>" style="<% if (fire.star !== 1 && fire.compare !== 1) { %>display:none;<% } %>">
                                       <% if (fire.star === 1) { %>
                                       <i class="fa fa-star star-yellow"></i>
                                       <% } %>

                                       <% if (fire.star == 0 && fire.compare === 1) { %>
                                       <i class="fa fa-bar-chart text-success"></i>
                                       <% } %>
                                 </div>
                                 <a href="/<%= fire.id %>">
                                 <div id="job_<%= fire.id %>_preview" class="job_preview" data-job="<%= fire.id %>" data-star="<%= fire.star %>" style="border: 1px solid #ddd; width:125px; height:91px;"></div>
                                 </a>
                           </div>
                           </td>
                          <% } else { %>
                           <td class="b_firebyid__imglight">
                           <div style="position:relative;">
                                 <div class="b_firebyid__img__pos1" id="b_firebyid__img__pos1__<%= fire.id %>" style="<% if (fire.compare !== 1) { %>display:none;<% } %>">
                                       <% if (fire.compare === 1) { %>
                                       <i class="fa fa-bar-chart text-success"></i>
                                       <% } %>
                                 </div>
                           </div>
                           <a href="/<%= fire.id %>">
                                <div id="job_<%= fire.id %>_preview" class="job_preview" data-job="<%= fire.id %>" data-star="<%= fire.star %>" style="border: 1px solid #ddd; width:50px; height:36px;"></div>
                           </a>
                           </td>
                        <% } %>
                <td class="b_firebyid__checkboxtd">
                <input type="checkbox" class="checkbox" id="b_firebyid__checkbox__<%= fire.id %>" data-job="<%= fire.id %>" data-star="<%= fire.star %>" data-compare="<%= fire.compare %>">
                </td>
                <td class="b_firebyid__datablock">
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                            <% if (fire.star === 1) { %>
                            <td class="b_firebyid__datablock__id" id="b_firebyid__datablock__id__<%= fire.id %>"><%= fire.id %></td>
                            <% } else { %>
                            <td class="b_firebyid__datablock__idlight" id="b_firebyid__datablock__id__<%= fire.id %>"><%= fire.id %></td>
                            <% } %>

                            <td class="b_firebyid__datablock__nametd">

                            <div class="b_firebyid__datablock__nameblock" id="b_firebyid__nameblock__<%= fire.id %>">

                                  <% if (fire.star === 1) { %>

                                  <div class="b_firebyid__datablock__name">

                                        <% } else { %>

                                        <div class="b_firebyid__datablock__namelight">

                                              <% } %>

                                              <span id="b_firebyid__name__<%= fire.id %>">
                                                    <a href="/<%= fire.id %>" class="<% if (fire.star === 1) { %>b_firebyid_name__url<% } else { %>b_firebyid_name__urllight<% } %>"><%= fire.name %></a>
                                              </span>
                                        </div>
                                        <% if (fire.star === 1) { %>
                                        <div class="b_firebyid__datablock__time" id="b_firebyid__time__<%= fire.id %>">
                                              <%= fire.duration %>
                                        </div>
                                        <% } else { %>
                                        <div class="b_firebyid__datablock__timelight" id="b_firebyid__time__<%= fire.id %>">
                                              <span class="b_fireid_datablock__paramslight__usparam">
                                                    <%= fire.date_start %>
                                              </span>&nbsp;&nbsp;/&nbsp;&nbsp;
                                              <span class="b_fireid_datablock__paramslight__usparam2">
                                                    <%= fire.duration %>
                                              </span>
                                        </div>
                                        <% } %>
                                  </div>
                            </td>
                      </tr>
                </table>
                <table border="0" width="100%">
                      <tr>
                            <td width="100%">

                            <% if (fire.star === 1) { %>
                            <div class="b_fireid_datablock__params">

                                  <table border="0" width="100%">
                                        <tr>
                                              <td class="b_firebyid__datablock__param">нагрузка:</td>
                                              <td class="b_firebyid__datablock__val"><% if (fire.rps_from === fire.rps_to) { %><%= fire.rps_from %><% } else { %><%= fire.rps_from %><% if (fire.imbalance_rps > 0) { %>&hellip;<span style="font-weight:<% if (fire.imbalance_type === 0) { %>normal<% } else { %>bold<% } %>"><%= fire.imbalance_rps %></span><% } %>&hellip;<%=fire.rps_to%><% } %></td>
                                              <td class="b_firebyid__datablock__val2">
                                              <table>
                                                    <tr>
                                                          <td>
                                                          <a href="//staff.yandex-team.ru/<%= fire.author %>" class="auto-person-card auto-person-card__normal" title="<%= fire.author %>" target="_blank"><%= fire.author %></a>
                                                          </td>
                                                    </tr>
                                              </table>
                                              </td>
                                        </tr>
                                        <tr>
                                              <td class="b_firebyid__datablock__param"><% if (fire.patrons) { %>патроны:<% } %></td>
                                              <td class="b_firebyid__datablock__val"><%= fire.patrons %></td>
                                              <td class="b_firebyid__datablock__val2" id="b_firebyid__datablock__ver__<%= fire.id %>"> <% if (fire.ver) { %>
                                              v.<%= fire.ver %>
                                              <% } %></td>
                                        </tr>
                                        <tr>
                                              <td colspan="3" class="b_firebyid__datablock__tankinfo">
                                              <%= fire.tank %>
                                              <span style="padding-left:10px">
                                              </span><%= fire.target %>
                                              <span style="padding-left:5px">
                                              </span>:
                                              <span style="padding-left:5px">
                                              </span><%= fire.port %>
                                              </td>
                                        </tr>
                                  </table>
                            </div>
                            <% } else { %>
                            <table border="0" width="100%">
                                  <tr>
                                        <td width="100%">
                                        <div class="b_fireid_datablock__paramslight">
                                              <table>
                                                    <tr>
                                                          <td><span class="b_fireid_datablock__paramslight__usparam"><%= fire.rps_from %><% if (fire.imbalance_rps > 0) { %>&hellip;<span style="font-weight:bold"><%= fire.imbalance_rps %></span><% } %>&hellip;<%= fire.rps_to %></span>&nbsp;&nbsp;/&nbsp;&nbsp;</td>

                                                          <td id="b_firebyid__datablock__vertd__<%= fire.id %>" style="display:<% if (fire.ver === '') { %>none<% } %>">
                                                          <span class="b_fireid_datablock__paramslight__usparam" id="b_firebyid__datablock__ver__<%= fire.id %>">v.<%= fire.ver %></span>&nbsp;&nbsp;/&nbsp;&nbsp;</td>

                                                          <% if (fire.patrons) { %>
                                                          <td>
                                                          <span class="b_fireid_datablock__paramslight__usparam">
                                                                <%= fire.patrons %>
                                                          </span>&nbsp;&nbsp;/&nbsp;&nbsp;
                                                          </td>
                                                          <% } %>
                                                          <td style="padding-left:3px; padding-right:3px;">
                                                          <span class="b_fireid_datablock__paramslight__usparam">
                                                                <a href="//staff.yandex-team.ru/<%= fire.author %>" class="auto-person-card auto-person-card__lite" title="<%= fire.author %>" target="_blank"><%= fire.author %></a>
                                                          </span>
                                                          </td>
                                                    </tr>
                                              </table>
                                        </div>
                                        </td>
                                        <td style="text-align:right;">

                                        <div class="b_fireid_datablock__paramslight2">
                                              <%= fire.tank %>
                                              <span style="padding-left:10px">
                                              </span><%= fire.target %>
                                              <span style="padding-left:5px">
                                              </span>:
                                              <span style="padding-left:5px">
                                              </span><%= fire.port %>
                                        </div>
                                        </td>
                                  </tr>
                            </table>
                            <% } %>
                            </td>
                            <td>

                            <% if (fire.star === 1) { %>
                            <div class="b_firebyid__datablock__rightblock">
                                  <div class="b_firebyid__datablock__time2">
                                        <%= fire.date_start %>
                                  </div>
                                  <% if (fire.quit_status !== 0) { %>
                                  <div class="b_firebyid__datablock__stop">
                                        <span style="padding-left:5px;">
                                              <% if (fire.quit_status === 1) { %>
                                                <i class="fa fa-hand-paper-o text-danger" style='font-size: 24px; cursor: default;' title="ручная остановка"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 2) { %>
                                                <i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по time"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 21) { %>
                                                <i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по time"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 22) { %>
                                                <i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по http"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 23) { %>
                                                <i class="fa fa-exclamation-circle text-danger" style='font-size: 24px; cursor: default;' title="автостоп по net"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 4) { %>
                                                <i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="нет файла с патронами"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 5) { %>
                                                <i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="нет параметра address"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 6) { %>
                                                <i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="загрузка > 90%"></i>
                                              <% } %>
                                              <% if (fire.quit_status === 7) { %>
                                                <i class="fa fa-question text-muted" style='font-size: 24px; cursor: default;' title="незвестный параметр"></i>
                                              <% } %>
                                        </span>
                                  </div>
                                  <% } %>
                                  <div class="b_firebyid__datablock__errors">
                                    <% if (fire.http_200) { %><b class="label label-success http_indicator" title="http">2xx</b><% } %>
                                    <% if (fire.http_300) { %><b class="label label-info http_indicator" title="http">3xx</b><% } %>
                                    <% if (fire.http_400) { %><b class="label label-warning http_indicator" title="http">4xx</b><% } %>
                                    <% if (fire.http_500) { %><b class="label label-danger http_indicator" title="http">5xx</b><% } %>
                                    <b class="label <% if (fire.net === 1) { %>label-danger<% } else { %>label-success<% } %> net_indicator">net</b>
                                  </div>
                            </div>
                            <% } %>
                            </td>
                      </tr>
                </table>
                </td>
                <td class="b_firebyid__commenttd" id="b_firebyid__commenttd__<%= fire.id %>">
                <table>
                <tr>
                <td>
                <div class="b_firebyid__commentdiv" id="b_firebyid__comment__<%= fire.id %>">
                      <% if (fire.star === 1) { %>
                      <div class="b_firebyid__comment">
                            <%= fire.dsc %>
                      </div>
                      <% } else { %>
                      <div class="b_firebyid__commentlight">
                            <%= fire.dsc %>
                      </div>
                      <% } %>
                </div>
                </td>
                <td>
                <div style="width:13px; cursor: pointer; padding:0.2em;">
                    <i class="fa fa-pencil text-warning" style="display:none; font-size: 12px;" id="b_firebyid__commentedit__<%= fire.id %>" title="Редактировать описание стрельбы" alt="Редактировать описание стрельбы">
                    </i>
                </div>
                </td>
                </tr>
                </table>
                </td>
          </tr>
    </table>
    </div>
    <div id="b_rightblock_frespace__<%= fire.id %>" style="display:none; float: right; margin-top: -50px; padding-right: 3px;">
        <i class="fa fa-star job_row__action <% if (fire.star === 1) { %>star-yellow<% } else { %>text-muted<% } %>" data-job="<%= fire.id %>" data-action="star" data-task="<%= task %>" style="cursor: pointer;"></i>
        <i class="fa fa-bar-chart <% if (fire.compare === 1) { %>text-success<% } else { %>text-muted<% } %> job_row__action" data-job="<%= fire.id %>" data-action="compare" data-actiondetail="<% if (fire.compare === 1) { %>remove<% } else { %>add<% } %>" style="cursor: pointer;"></i><br/>
        <i class="fa fa-repeat text-info job_row__action" data-job="<%= fire.id %>" data-action="repeat" style="cursor: pointer;"></i>
        <i class="fa fa-trash text-danger job_row__action" data-job="<%= fire.id %>" data-action="remove" style="cursor: pointer; margin-left: 3px;"></i>
    </div>
    </tr>
</table>
    </div>
</script>

<script nonce='{{ common.CSP_SCRIPT_NONCE }}'>


    function formatDsc(before) {
        var text='';
        text = text.replace(
            /((http|https|ftp|ftps):\/\/[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,3}(\/\S*)?)/g,
            '<a href="$1" target="_blank" class="b_link">$1</a>'
        );
        this.text=this.text.replace(/\r\n|\r|\n/g,'<br>');
        var classname = $("#b_firebyid__comment__<%= fire.id %> div:first-child").attr('class');
        this.content = '<div class="'+classname+'">'+this.text+'</div>';
        this.contentdiv=this.content;
        $("#b_firebyid__comment__<%= fire.id %>").html(this.contentdiv);
    }

</script>