{% extends "mygame/company.html" %} {% block content %}
<h1
  class="text-center font-weight-bold border-bottom border-2 border-primary p-3 m-3 shadow rounded text-danger"
>
  Action: {{viewedaction.name}}
</h1>
{%if viewedaction.order%}
<!-- Order offer -->
<h2
  class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
>
  Workload
</h2>

<div class="m-2">
  <table class="table">
    <thead>
      <tr>
        <th scope="col">Required Skill</th>
        <th scope="col">Workload</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">experience</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-experience"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.experience}}%"
            >
              {{viewedaction.order.requiredWorkload.experience}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">reliability</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-reliability"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.reliability}}%"
            >
              {{viewedaction.order.requiredWorkload.reliability}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">python</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-python"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.python}}%"
            >
              {{viewedaction.order.requiredWorkload.python}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">javascript</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-javascript"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.javascript}}%"
            >
              {{viewedaction.order.requiredWorkload.javascript}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">cpp</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-cpp"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.cpp}}%"
            >
              {{viewedaction.order.requiredWorkload.cpp}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">management</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-management"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.order.requiredWorkload.management}}%"
            >
              {{viewedaction.order.requiredWorkload.management}}
            </div>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<h2
  class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
>
  Attributes
</h2>

<div class="m-2">
  <table class="table">
    <thead>
      <tr>
        <th scope="col">Attribute</th>
        <th scope="col">Value</th>
      </tr>
    </thead>
    <tbody>
      {%if viewedaction.amount%}
      <tr>
        <th scope="row" class="fs-5 text-danger">Offered Amount</th>
        <td class="fs-5 text-danger">{{viewedaction.amount}}</td>
      </tr>
      {%endif%}
      <tr>
        {%if viewedaction.amount%}
        <th scope="row">Maximum Rounds</th>
        {%else%}
        <th scope="row">Rounds left</th>
        {%endif%}
        <td>{{viewedaction.order.maxRounds}}</td>
      </tr>
      {%if viewedaction.order.status == 1%}

      <tr>
        <th scope="row">Engineeringmodel</th>
        <td>{{viewedaction.order.engineeringModel}}</td>
      </tr>
      {% endif%}
      <tr>
        <th scope="row">Customer Description</th>
        <td>{{viewedaction.order.specialorder.hint}}</td>
      </tr>
    </tbody>
  </table>
</div>

{%endif%} {%if viewedaction.trainskill%}
<!-- Training -->
<h2
  class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
>
  Training
</h2>
<div class="m-2">
  <table class="table">
    <tbody>
      <tr>
        <th scope="row">Worker</th>
        <td>{{viewedaction.worker.name}}</td>
      </tr>
      <tr>
        <th scope="row">Training Skill</th>
        <td>{{viewedaction.trainskill}}</td>
      </tr>
      <tr>
        <th scope="row">Cost</th>
        <td>{{viewedaction.cost}}</td>
      </tr>
    </tbody>
  </table>
</div>
{%endif%}{%if viewedaction.worker%}
<h2
  class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
>
  Skills
</h2>

<div class="m-2">
  <table class="table">
    <thead>
      <tr>
        <th scope="col">Skill</th>
        <th scope="col">Strength</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">experience</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-experience"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.experience}}%"
            >
              {{viewedaction.worker.attributes.experience}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">reliability</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-reliability"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.reliability}}%"
            >
              {{viewedaction.worker.attributes.reliability}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">python</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-python"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.python}}%"
            >
              {{viewedaction.worker.attributes.python}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">javascript</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-javascript"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.javascript}}%"
            >
              {{viewedaction.worker.attributes.javascript}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">cpp</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-cpp"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.cpp}}%"
            >
              {{viewedaction.worker.attributes.cpp}}
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <th scope="row">management</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-management"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.attributes.management}}%"
            >
              {{viewedaction.worker.attributes.management}}
            </div>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
{%if not viewedaction.trainskill%}
<h2
  class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
>
  Attributes
</h2>
<div class="m-2">
  <table class="table">
    <thead>
      <tr>
        <th scope="col">Attribute</th>
        <th scope="col">Value</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">Skilled Model</th>
        <td>{{viewedaction.worker.skilledModels}}</td>
      </tr>
      <tr>
        <th scope="row">Amplifyer</th>
        <td>{{viewedaction.worker.amplifyer}}</td>
      </tr>
      <tr>
        <th scope="row">Salary</th>
        <td>{{viewedaction.worker.salary}}</td>
      </tr>
      <tr>
        <th scope="row">Happyness</th>
        <td>
          <div
            class="progress"
            role="progressbar"
            aria-label="worker-management"
            aria-valuenow="0"
            aria-valuemin="0"
            aria-valuemax="100"
          >
            <div
              class="progress-bar overflow-visible text-dark"
              style="width: {{viewedaction.worker.happyness}}%"
            >
              {{viewedaction.worker.happyness}}
            </div>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
{%endif%} {%endif%}

<form
  action="{% url 'companyAction' gameid=game.id username=user.username actionid=viewedaction.id %}"
  method="post"
>
  {% csrf_token %}

  <div class="d-grid gap-2">
    <input
      class="btn btn-danger m-2"
      type="submit"
      value="cancel"
      id="cancel"
      name="action"
    />
  </div>
</form>
{% endblock %}
