
{% extends "base.html" %}
{% block pagename %}mobilefirestarter{% endblock %}
{% block title %}Запустить стрельбу{% endblock %}
{% load lookup %}

{% block body %}


<div class="header-bottom-padding"></div>
<div class="container-fluid" style="padding-bottom: 15px;">

<form method="POST" action="/mobilefirestarter/fire_ios" id="mobileFireForm">
	{% block waiter %}
	<div class="waiter_body alert alert-warning" id="waiter_body" style="display: none;">
		<span>Ждём запуска онлайн-стрельбы с танка <span id="tank" style="font-weight: bold;"></span>:<span id="port" style="font-weight: bold;"></span></span>
		<br>
		<label style="font-weight: bold;">Статус:&emsp;</label><span id="status" data-status=""></span>
		<span style="margin-left: 0.4em;"><i class="krutilka fa fa-circle-o-notch fa-spin" aria-hidden="true"></i></span>
		<span style="display: none;" id="link" data-link=""></span>
	</div>
	{% endblock %}

	{% block error %}
		{% if error %}
            <div class="error_block alert alert-danger" id="error_block" role="alert">
                <span id="error_text">{{ error }}</span>
            </div>
		{% else %}
            <div class="error_block alert alert-danger" id="error_block" style="display: none" role="alert">
                <span id="error_text"></span>
            </div>
		{% endif %}
	{% endblock %}


    <div class="input-group mobilefirestarter-input">
		<span class="input-group-addon mobilefirestarter-input__title" >URL</span>
		<input class="form-control mobilefirestarter-input" placeholder="artifacts_url" data-type="url" size=120 maxlength=120 value="{{ conf|lookup:'meta'|lookup:'job_name' }}" id="url_input" name="url_input"/>
	</div>
    <div class="input-group mobilefirestarter-input">
		<span class="input-group-addon mobilefirestarter-input__title" >Таск</span>
		<input class="form-control mobilefirestarter-input" value="LOAD-272" placeholder="startrek task" data-type="task" size=120 maxlength=120 id="task_input" name="task_input"/>
	    {% if recent_user_tasks %}
		<span class="input-group-addon mobilefirestarter-suggest__container">
			Недавние:
			{% for task in recent_user_tasks %}
				<span class="mobilefirestarter-suggest mobilefirestarter-suggest__task link-dotted clickable">{{ task }}</span>
			{% endfor %}
		</span>
		{% endif %}
    </div>
<br style="font-size: 6pt;">
<button class="btn btn-brand" name="submitMobileFire" id="submitMobileFire">Огонь!</button>
<br>
<br>
</form>

<!-- Modal config-->
<div class="modal fade" id="configModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <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 class="modal-title"><span class="person">{{ person }}</span></h4>
      </div>
      <div class="modal-body">
          <div id="jobsList">
          </div>
      </div>
    </div>
  </div>
</div>

<!-- <script nonce='{{ common.CSP_SCRIPT_NONCE }}' src="/media/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script nonce='{{ common.CSP_SCRIPT_NONCE }}'>
    var editor = ace.edit("editor");
    document.getElementById('editor').style.fontSize='12pt';
    editor.getSession().setMode("ace/mode/yaml");
    editor.setShowPrintMargin(false);
    editor.commands.addCommand({
    	  name: 'submit_form.',
    	  bindKey: {win: 'Ctrl-Enter', mac: 'Command-Enter'},
    	  exec: function(editor) {
    		  	$("#mobilefirestarter-submit").click()
    		  }
    	  });
    editor.setOptions({
	    maxLines: Infinity
	});
</script>-->

</div>

<link href="/media/css/mobilefirestarter.css?version=43.4" type="text/css" rel="stylesheet" />
<script nonce='{{ common.CSP_SCRIPT_NONCE }}' type='text/javascript' src='/media/js/vendor/jquerymd5.js'></script>
<script nonce='{{ common.CSP_SCRIPT_NONCE }}' type='text/javascript' src='/media/js/mobilefirestarter_ios.js?version=43.4'></script>
{% endblock %}
