Initial Commit
This commit is contained in:
@@ -0,0 +1,423 @@
|
||||
{% 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 %}
|
||||
@@ -0,0 +1,249 @@
|
||||
{% 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"
|
||||
>
|
||||
Assign Workers: {{assignorder.name}}
|
||||
</h1>
|
||||
<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: {{assignorder.requiredWorkload.experience}}%"
|
||||
>
|
||||
{{assignorder.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: {{assignorder.requiredWorkload.reliability}}%"
|
||||
>
|
||||
{{assignorder.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: {{assignorder.requiredWorkload.python}}%"
|
||||
>
|
||||
{{assignorder.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: {{assignorder.requiredWorkload.javascript}}%"
|
||||
>
|
||||
{{assignorder.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: {{assignorder.requiredWorkload.cpp}}%"
|
||||
>
|
||||
{{assignorder.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: {{assignorder.requiredWorkload.management}}%"
|
||||
>
|
||||
{{assignorder.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">Relevant Attribute</th>
|
||||
<th scope="col">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Remaining Rounds</th>
|
||||
<td>{{assignorder.maxRounds}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Model</th>
|
||||
<td>{{assignorder.engineeringModel}}</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"
|
||||
>
|
||||
Assign
|
||||
</h2>
|
||||
<form
|
||||
class="m-2"
|
||||
action="{% url 'companyOrder' gameid=game.id username=user.username orderid=assignorder.id %}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Unassigned Workers</th>
|
||||
<th scope="col">Assigned Workers</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{% for worker in company.workers.all %} {%if worker.sick == True%}
|
||||
<div class="m-2">
|
||||
<label for="assign {{worker.id}}">
|
||||
{{worker.name}}({{worker.skilledModels}})</label
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="assign {{worker.id}}"
|
||||
name="assign {{worker.id}}"
|
||||
value="{{worker.id}}"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
{% elif worker.status == 1 %}
|
||||
<div class="m-2">
|
||||
<label for="assign {{worker.id}}">
|
||||
{{worker.name}} ({{worker.skilledModels}})</label
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="assign {{worker.id}}"
|
||||
name="assign {{worker.id}}"
|
||||
value="{{worker.id}}"
|
||||
/>
|
||||
</div>
|
||||
{% endif %} {% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% for worker in assignorder.assignedWorkers.all %}
|
||||
<div class="m-2">
|
||||
<label for="{{worker.id}}">
|
||||
{{worker.name}} ({{worker.skilledModels}})</label
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="unassign {{worker.id}}"
|
||||
name="unassign {{worker.id}}"
|
||||
value="{{worker.id}}"
|
||||
/>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-success m-2"
|
||||
type="submit"
|
||||
name="action"
|
||||
id="save assignment"
|
||||
value="save assignment"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,559 @@
|
||||
{%load static%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
height: 75%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.col-coloring {
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.bottom-row {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
height: 20%;
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
justify-content: space-evenly;
|
||||
height: 5%;
|
||||
width: 100%;
|
||||
}
|
||||
.viewlinker {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
.hovering {
|
||||
}
|
||||
.hovering:hover {
|
||||
background-color: grey;
|
||||
}
|
||||
</style>
|
||||
<title>Company</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var currentURL = window.location.href;
|
||||
var urlSplit = currentURL.split("/");
|
||||
var indexCompany = urlSplit.indexOf("company");
|
||||
var gameid = urlSplit[indexCompany + 1];
|
||||
var url =
|
||||
"ws://" + window.location.host + "/mygame/company/" + gameid + "/";
|
||||
var socket = new WebSocket(url);
|
||||
|
||||
socket.onmessage = function (event) {
|
||||
if (event.data === "nextRound") {
|
||||
document.getElementById("nextRoundForm").submit();
|
||||
} else if (event.data === "endGame") {
|
||||
document.getElementById("endGameForm").submit();
|
||||
} else {
|
||||
var timerDiv = document.getElementById("timer");
|
||||
timerDiv.innerHTML = event.data;
|
||||
}
|
||||
};
|
||||
|
||||
socket.onopen = function () {
|
||||
console.log("Socket opened");
|
||||
};
|
||||
|
||||
socket.onclose = function () {
|
||||
console.log("Socket closed");
|
||||
};
|
||||
|
||||
socket.onerror = function (error) {
|
||||
console.log("Socket error:");
|
||||
};
|
||||
</script>
|
||||
<div
|
||||
class="header row align-items-center text-center justify-content-evenly g-0"
|
||||
>
|
||||
<div class="col-md">{{company.name}}</div>
|
||||
<div class="col-md">
|
||||
<form
|
||||
action="{% url 'companyEvent' gameid=game.id username=user.username eventnumber=0%}"
|
||||
method="get"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<input
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
value="E-Mails"
|
||||
id="viewgamerules"
|
||||
name="action"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md">Money: {{company.money}}</div>
|
||||
<div class="col-md">
|
||||
Customer Satisfaction: {{company.customersatisfaction}}
|
||||
</div>
|
||||
<div class="col-md">
|
||||
Worker Satisfaction: {{company.workersatisfaction}}
|
||||
</div>
|
||||
<div class="col-md">Round: {{game.currentRound}}/{{game.maxRounds}}</div>
|
||||
{% if game.running == True%}
|
||||
<div class="timer col-md" id="timer">Timer:</div>
|
||||
{% else %}
|
||||
<div class="col-md">Game didn't start yet</div>
|
||||
{%endif%}
|
||||
</div>
|
||||
<form
|
||||
id="nextRoundForm"
|
||||
action="{% url 'companyEvent' gameid=game.id username=user.username eventnumber=0%}"
|
||||
method="get"
|
||||
style="display: none"
|
||||
>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
<form
|
||||
id="endGameForm"
|
||||
action="{% url 'standings' gameid=game.id username=user.username%}"
|
||||
method="get"
|
||||
style="display: none"
|
||||
>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
|
||||
<!-- Zeile für den oberen Inhalt -->
|
||||
<div class="container-fluid g-0">
|
||||
<div class="col-md-4 col-coloring overflow-y-auto">
|
||||
<div class="row justify-content-evenly g-0">
|
||||
<div class="col-md-6 p-3">
|
||||
<!-- Inhalt links Zeile 1 -->
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 shadow rounded"
|
||||
>
|
||||
Workers
|
||||
</h1>
|
||||
{%for worker in company.workers.all%}
|
||||
<a
|
||||
class="viewlinker"
|
||||
href="{% url 'companyWorker' gameid=game.id username=user.username workerid=worker.id %}"
|
||||
>
|
||||
<div
|
||||
class="card border-primary mb-3 shadow-lg"
|
||||
style="max-width: 540px"
|
||||
>
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4 align-self-center">
|
||||
<img
|
||||
src="{% static 'mygame/images/worker01.png' %}"
|
||||
class="img-thumbnail"
|
||||
alt="worker"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title justify-content-evenly">
|
||||
{{worker.name}} {%if worker.sick == True%}
|
||||
<p class="text-danger">[sick]</p>
|
||||
{%elif worker.status == 2%}
|
||||
<p class="text-success">[working]</p>
|
||||
{%elif worker.status == 3%}
|
||||
<p class="text-warning">[training]</p>
|
||||
{%endif%}
|
||||
</h5>
|
||||
<div
|
||||
class="progress mb-2"
|
||||
role="progressbar"
|
||||
aria-label="worker-happyness"
|
||||
aria-valuenow="0"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
>
|
||||
{%if worker.happyness > 55 %}
|
||||
<div
|
||||
class="progress-bar overflow-visible text-dark bg-success"
|
||||
style="width: {{worker.happyness}}%"
|
||||
>
|
||||
happyness
|
||||
</div>
|
||||
{% else%}
|
||||
<div
|
||||
class="progress-bar overflow-visible text-dark bg-danger"
|
||||
style="width: {{worker.happyness}}%"
|
||||
>
|
||||
happyness
|
||||
</div>
|
||||
{%endif%}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<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: {{worker.attributes.experience}}%"
|
||||
>
|
||||
experience
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.reliability}}%"
|
||||
>
|
||||
reliability
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.python}}%"
|
||||
>
|
||||
python
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<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: {{worker.attributes.javascript}}%"
|
||||
>
|
||||
javascript
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.cpp}}%"
|
||||
>
|
||||
cpp
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.management}}%"
|
||||
>
|
||||
management
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{%endfor%}
|
||||
</div>
|
||||
<div class="col-md-6 p-3">
|
||||
<!-- Inhalt links Zeile 2 -->
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 shadow rounded"
|
||||
>
|
||||
Orders
|
||||
</h1>
|
||||
{%for order in company.orders.all%}
|
||||
<a
|
||||
class="viewlinker"
|
||||
href="{% url 'companyOrder' gameid=game.id username=user.username orderid=order.id %}"
|
||||
>
|
||||
<!-- Quelle Bild https://pixabay.com/de/vectors/ausr%C3%BCstung-symbol-service-aufbau-1674891/-->
|
||||
|
||||
<div
|
||||
class="card border-primary mb-3 shadow-lg"
|
||||
style="
|
||||
max-width: 540px;
|
||||
background-image: url('{%static 'mygame/images/order.png'%}');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
"
|
||||
>
|
||||
<div class="row g-0">
|
||||
<div class="col-md-12">
|
||||
<div class="card-body">
|
||||
<h5
|
||||
class="card-title border-bottom font-weight-bold fs-4"
|
||||
>
|
||||
{{order.name}}
|
||||
</h5>
|
||||
<div class="card-text fs-5">
|
||||
<p>Model: {{order.engineeringModel}}</p>
|
||||
<p>Profit: {{order.profit}}</p>
|
||||
<p>Rounds left: {{order.maxRounds}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{%endfor%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 overflow-y-auto g-0">
|
||||
<!-- Inhalt mittlerer Block -->
|
||||
<div>{% block content %}{% endblock %}</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-coloring overflow-y-auto">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-6 p-3">
|
||||
<!-- Inhalt rechts Zeile 1 -->
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 shadow rounded fs-2"
|
||||
>
|
||||
Workermarket
|
||||
</h1>
|
||||
{%for worker in company.workermarket.all%}
|
||||
<a
|
||||
class="viewlinker"
|
||||
href="{% url 'companyWorker' gameid=game.id username=user.username workerid=worker.id %}"
|
||||
>
|
||||
<div
|
||||
class="card border-primary mb-3 shadow-lg"
|
||||
style="max-width: 540px"
|
||||
>
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4 align-self-center">
|
||||
<img
|
||||
src="{% static 'mygame/images/worker01.png' %}"
|
||||
class="img-thumbnail"
|
||||
alt="worker"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{worker.name}}</h5>
|
||||
<div class="row"><p>{{worker.skilledModels}}</p></div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<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: {{worker.attributes.experience}}%"
|
||||
>
|
||||
experience
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.reliability}}%"
|
||||
>
|
||||
reliability
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.python}}%"
|
||||
>
|
||||
python
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<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: {{worker.attributes.javascript}}%"
|
||||
>
|
||||
javascript
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.cpp}}%"
|
||||
>
|
||||
cpp
|
||||
</div>
|
||||
</div>
|
||||
<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: {{worker.attributes.management}}%"
|
||||
>
|
||||
management
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{%endfor%}
|
||||
</div>
|
||||
<div class="col-md-6 p-3">
|
||||
<!-- Inhalt rechts Zeile 2 -->
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 shadow rounded fs-2"
|
||||
>
|
||||
Ordermarket
|
||||
</h1>
|
||||
{%for order in game.ordermarket.all%}
|
||||
<a
|
||||
class="viewlinker"
|
||||
href="{% url 'companyOrder' gameid=game.id username=user.username orderid=order.id %}"
|
||||
>
|
||||
<!-- Quelle Bild https://pixabay.com/de/vectors/ausr%C3%BCstung-symbol-service-aufbau-1674891/-->
|
||||
<div
|
||||
class="card border-primary mb-3 shadow-lg"
|
||||
style="
|
||||
max-width: 540px;
|
||||
background-image: url('{%static 'mygame/images/order.png'%}');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
"
|
||||
>
|
||||
<div class="row g-0">
|
||||
<div class="col-md-12">
|
||||
<div class="card-body">
|
||||
<h5
|
||||
class="card-title border-bottom font-weight-bold fs-4"
|
||||
>
|
||||
{{order.name}}
|
||||
</h5>
|
||||
<div class="card-text fs-5">
|
||||
<p>estimated profit: {{order.profit}}</p>
|
||||
<p>max. rounds: {{order.maxRounds}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{%endfor%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Zeile für den unteren Inhalt -->
|
||||
<div class="bottom-row text-center">
|
||||
<h1>Actions</h1>
|
||||
<div class="row g-0">
|
||||
{%for action in company.actions.all%}
|
||||
<div class="col-md-3">
|
||||
<a
|
||||
class="viewlinker"
|
||||
href="{% url 'companyAction' gameid=game.id username=user.username actionid=action.id%}"
|
||||
>
|
||||
<div class="text-light border border-white p-1 m-1 rounded">
|
||||
{{action.name}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{%endfor%}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap einbinden -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,102 @@
|
||||
{% extends "mygame/company.html" %} {% block content %} {% load filters %}
|
||||
<div>
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 m-3 shadow rounded"
|
||||
>
|
||||
E-Mails
|
||||
</h1>
|
||||
|
||||
<form
|
||||
class="row g-0 justify-content-evenly m-2"
|
||||
action="{% url 'companyEvent' gameid=game.id username=user.username eventnumber=eventnumber%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-primary btn-block m-2"
|
||||
type="submit"
|
||||
value="previous"
|
||||
id="previous"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-primary btn-block m-2"
|
||||
type="submit"
|
||||
value="next"
|
||||
id="next"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div
|
||||
class="row g-0 justify-content-center border border-secondary-subtle rounded m-3"
|
||||
>
|
||||
<div class="col-md-10">
|
||||
<h2
|
||||
class="border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
|
||||
>
|
||||
{{companyevent.name}}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col-md-9 m-4">{{companyevent.description}}</div>
|
||||
|
||||
{%if companyevent.modelset == False%}
|
||||
<form
|
||||
class="col-md-8"
|
||||
action="{% url 'companyEventSetModel' gameid=game.id username=user.username eventid=companyevent.id modelnumber=0%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-warning btn-block m-2"
|
||||
type="submit"
|
||||
value="choose model"
|
||||
id="choose model"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
{%endif%} {% if companyevent|isInstanceOf:"SpecialOrder" %}
|
||||
<form
|
||||
class="row g-0 justify-content-evenly m-2"
|
||||
action="{% url 'companySpecialOrder' gameid=game.id username=user.username specialorderid=companyevent.id%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-4">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-success btn-block m-2"
|
||||
type="submit"
|
||||
value="handle"
|
||||
id="handle"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-danger btn-block m-2"
|
||||
type="submit"
|
||||
value="ignore"
|
||||
id="ignore"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{%endif%}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,103 @@
|
||||
{% 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"
|
||||
>
|
||||
Model: {{engineeringmodel.name}}
|
||||
</h1>
|
||||
<form
|
||||
class="row g-0 justify-content-evenly m-2"
|
||||
action="{% url 'companyEventSetModel' gameid=game.id username=user.username eventid=eventid modelnumber=modelnumber%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-primary btn-block m-2"
|
||||
type="submit"
|
||||
value="previous"
|
||||
id="previous"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-primary btn-block m-2"
|
||||
type="submit"
|
||||
value="next"
|
||||
id="next"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h2
|
||||
class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
|
||||
>
|
||||
Description
|
||||
</h2>
|
||||
<div class="row g-0 justify-content-center m-2 mt-4 mb-4">
|
||||
<div class="d-grid gap-2">
|
||||
<button
|
||||
class="btn btn-info"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#collapseDescription"
|
||||
aria-expanded="false"
|
||||
aria-controls="collapseDescription"
|
||||
>
|
||||
View Description
|
||||
</button>
|
||||
</div>
|
||||
<div class="collapse col-md-9 m-2" id="collapseDescription">
|
||||
<div class="card card-body">{{engineeringmodel.description}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m-2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="justify-content-center">
|
||||
<th scope="col" class="text-success text-center fs-2">Positives</th>
|
||||
<th scope="col" class="text-danger text-center fs-2">Negatives</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{%for pro in engineeringmodel.getPros%}
|
||||
<div class="border border-success-subtle rounded p-2 m-2">
|
||||
{{pro}}
|
||||
</div>
|
||||
{%endfor%}
|
||||
</td>
|
||||
<td>
|
||||
{%for con in engineeringmodel.getCons%}
|
||||
<div class="border border-danger-subtle rounded p-2 m-2">{{con}}</div>
|
||||
{%endfor%}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<form
|
||||
class="row g-0 justify-content-evenly m-2"
|
||||
action="{% url 'companyEventSetModel' gameid=game.id username=user.username eventid=eventid modelnumber=modelnumber%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-warning"
|
||||
type="submit"
|
||||
value="set model"
|
||||
id="set model"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lobby</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css"
|
||||
/>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
/* Stil für den Kopfbereich */
|
||||
.header {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Stil für die Buttons im Kopfbereich */
|
||||
.header button {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
background-color: lightgray;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Kopfzeile mit Buttons -->
|
||||
<div class="header">
|
||||
<div class="row g-0 align-items-center">
|
||||
<div class="col-md-6">
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 shadow rounded"
|
||||
>
|
||||
Gamelobby for {{game.name}}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{%if game.gamemaster == user.username%}
|
||||
|
||||
<form
|
||||
class="m-2"
|
||||
action="{% url 'startGame' gameid=game.id username=user.username%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
|
||||
<input
|
||||
class="btn btn-success col-md-12"
|
||||
type="submit"
|
||||
value="start game"
|
||||
id="startGame"
|
||||
name="action"
|
||||
/>
|
||||
</form>
|
||||
{%else%}
|
||||
<form
|
||||
class="m-2"
|
||||
action="{% url 'gamerules' gameid=game.id%}"
|
||||
method="get"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<input
|
||||
class="btn btn-primary col-md-12"
|
||||
type="submit"
|
||||
value="view gamerules"
|
||||
id="viewgamerules"
|
||||
name="action"
|
||||
/>
|
||||
</form>
|
||||
{%endif%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid overflow-y-auto">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1
|
||||
class="col-md-6 bg-secondary-subtle text-center font-weight-bold border-bottom border-2 border-primary p-3 mt-3 shadow rounded"
|
||||
>
|
||||
Game ID: {{game.id}}
|
||||
</h1>
|
||||
<h1
|
||||
class="col-md-6 bg-secondary-subtle text-center font-weight-bold border-bottom border-2 border-primary p-3 mt-3 shadow rounded"
|
||||
>
|
||||
Gamemaster: {{game.gamemaster}}
|
||||
</h1>
|
||||
<ul class="list-group mb-3">
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
<h1
|
||||
class="text-center bg-secondary-subtle font-weight-bold border-bottom border-2 border-primary p-3 mt-3 shadow rounded"
|
||||
>
|
||||
Joined Players:
|
||||
</h1>
|
||||
</li>
|
||||
{%for player in game.participants.all%}
|
||||
|
||||
<li class="list-group-item bg-secondary-subtle fs-4">
|
||||
{{player.name}}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h1
|
||||
class="text-center bg-secondary-subtle font-weight-bold border-bottom border-2 border-primary p-3 mt-3 shadow rounded"
|
||||
>
|
||||
Gamesettings:
|
||||
</h1>
|
||||
{%if game.gamemaster == user.username%}
|
||||
<form
|
||||
action="{% url 'lobby' gameid=game.id username=user.username%}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Number of rounds: {{ gamesettingsform.rounds }}
|
||||
</li>
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Roundtimer: {{ gamesettingsform.timer }}
|
||||
</li>
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Ordermarket size: {{ gamesettingsform.ordermarketsize }}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="d-grid gap-2 mt-2">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
value="changesettings"
|
||||
id="changesettings"
|
||||
name="action"
|
||||
>
|
||||
save settings
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{%else%}
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Number of rounds: {{gamesettingsform.rounds.initial}}
|
||||
</li>
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Roundtimer: {{gamesettingsform.timer.initial}}
|
||||
</li>
|
||||
<li class="list-group-item bg-secondary-subtle">
|
||||
Ordermarket size: {{gamesettingsform.ordermarketsize.initial}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{%endif%}
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Login</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
background-color: grey;
|
||||
}
|
||||
.container {
|
||||
padding: 20px;
|
||||
background-color: lightblue;
|
||||
border: 2px solid black;
|
||||
text-align: center;
|
||||
}
|
||||
.errormessage {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="body">
|
||||
<div class="container">
|
||||
{%if error_message%}
|
||||
<div class="errormessage">{{error_message}}</div>
|
||||
{% endif %}
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 m-3 shadow rounded"
|
||||
>
|
||||
Login
|
||||
</h1>
|
||||
<form
|
||||
class="row g-0 justify-content-center"
|
||||
action="{% url 'loginView' %}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %} {%for field in form%}
|
||||
<div class="col-md-12 fs-3">{{field.label}}</div>
|
||||
<div class="col-md-12 m-2">{{field}}</div>
|
||||
{%endfor%}
|
||||
<div class="col-md-6 m-2">
|
||||
<button type="submit" class="col-md-12 btn btn-primary">
|
||||
Start!
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,247 @@
|
||||
{% 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"
|
||||
>
|
||||
Order: {{viewedorder.name}}
|
||||
</h1>
|
||||
{%if errormessage%}
|
||||
<div class="m-2 pb-0 text-center text-light bg-danger rounded">
|
||||
{{errormessage}}
|
||||
</div>
|
||||
{%endif%}
|
||||
<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: {{viewedorder.requiredWorkload.experience}}%"
|
||||
>
|
||||
{{viewedorder.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: {{viewedorder.requiredWorkload.reliability}}%"
|
||||
>
|
||||
{{viewedorder.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: {{viewedorder.requiredWorkload.python}}%"
|
||||
>
|
||||
{{viewedorder.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: {{viewedorder.requiredWorkload.javascript}}%"
|
||||
>
|
||||
{{viewedorder.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: {{viewedorder.requiredWorkload.cpp}}%"
|
||||
>
|
||||
{{viewedorder.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: {{viewedorder.requiredWorkload.management}}%"
|
||||
>
|
||||
{{viewedorder.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>
|
||||
<tr>
|
||||
{%if viewedorder.status == 0%}
|
||||
<th scope="row">Estimated Profit</th>
|
||||
{%else%}
|
||||
<th scope="row">Profit</th>
|
||||
{% endif%}
|
||||
<td>{{viewedorder.profit}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{%if viewedorder.status == 0%}
|
||||
<th scope="row">Maximum Rounds</th>
|
||||
{%else%}
|
||||
<th scope="row">Rounds left</th>
|
||||
{% endif%}
|
||||
<td>{{viewedorder.maxRounds}}</td>
|
||||
</tr>
|
||||
{%if viewedorder.status == 1%}
|
||||
|
||||
<tr>
|
||||
<th scope="row">Engineeringmodel</th>
|
||||
<td>{{viewedorder.engineeringModel}}</td>
|
||||
</tr>
|
||||
{% endif%}
|
||||
<tr>
|
||||
<th scope="row">Customer Description</th>
|
||||
<td>{{viewedorder.specialorder.hint}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form
|
||||
class="row g-0 justify-content-evenly m-2"
|
||||
action="{% url 'companyOrder' gameid=game.id username=user.username orderid=viewedorder.id %}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %} {%if viewedorder.status == 0 %}
|
||||
<div class="row g-0 justify-content-evenly">
|
||||
<div class="col-md-6 p-2">
|
||||
<input
|
||||
class="form-control"
|
||||
type="number"
|
||||
placeholder="Insert your Offer"
|
||||
id="offerfield"
|
||||
name="offerfield"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-6 p-2">
|
||||
<input
|
||||
class="btn btn-primary w-100"
|
||||
type="submit"
|
||||
value="offer"
|
||||
id="offer"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{%elif viewedorder.status == 1 %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-danger btn-block m-2"
|
||||
type="submit"
|
||||
value="cancel"
|
||||
id="cancel"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-success btn-block m-2"
|
||||
type="submit"
|
||||
value="assign resources"
|
||||
id="assign resources"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{%endif%}
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Standings</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #e6f2ff;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1
|
||||
class="text-center font-weight-bold border-bottom border-2 border-primary p-3 m-3 shadow rounded"
|
||||
>
|
||||
Leaderboard for {{game.name}}
|
||||
</h1>
|
||||
<table class="table table-striped p-3 m-3 shadow rounded">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Place</th>
|
||||
<th scope="col">Company</th>
|
||||
<th scope="col">Money</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%for item in leaderboard%}
|
||||
<div>
|
||||
<tr>
|
||||
<td>{{item.0}}</td>
|
||||
<td>{{item.1.name}}</td>
|
||||
<td>{{item.1.money}}$</td>
|
||||
</tr>
|
||||
</div>
|
||||
{%endfor%}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>Please complete the following Survey:</div>
|
||||
<a href="https://www.survio.com/survey/d/V6G8P1V8W7N1Z6E3Y">Survey</a>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,248 @@
|
||||
{% 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"
|
||||
>
|
||||
Training: {{trainworker.name}}
|
||||
</h1>
|
||||
<h2
|
||||
class="col-md-4 border-bottom border-1 border-primary p-2 m-2 mt-4 shadow rounded text-center"
|
||||
>
|
||||
Description
|
||||
</h2>
|
||||
<div class="row g-0 justify-content-center m-2">
|
||||
<div class="col-md-12 m-2 p-2 border border-secondary-subtle rounded">
|
||||
<p>Choose a skill that you want to train (add 10 points).</p>
|
||||
<p class="text-danger">
|
||||
The worker will be blocked from working on orders for one round!
|
||||
</p>
|
||||
</div>
|
||||
<form
|
||||
action="{% url 'companyTraining' gameid=game.id username=user.username workerid=trainworker.id %}"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="m-2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Skill</th>
|
||||
<th scope="col">Strength</th>
|
||||
<th scope="col">Selection</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">experience</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.experience}}%"
|
||||
>
|
||||
{{trainworker.attributes.experience}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="experienceRadio"
|
||||
value="experience"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="experienceRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">reliability</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.reliability}}%"
|
||||
>
|
||||
{{trainworker.attributes.reliability}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="reliabilityRadio"
|
||||
value="reliability"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="reliabilityRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">python</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.python}}%"
|
||||
>
|
||||
{{trainworker.attributes.python}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="pythonRadio"
|
||||
value="python"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="pythonRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">javascript</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.javascript}}%"
|
||||
>
|
||||
{{trainworker.attributes.javascript}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="javascriptRadio"
|
||||
value="javascript"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="javascriptRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">cpp</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.cpp}}%"
|
||||
>
|
||||
{{trainworker.attributes.cpp}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="cppRadio"
|
||||
value="cpp"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="cppRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">management</th>
|
||||
<td>
|
||||
<div
|
||||
class="progress align-self-center"
|
||||
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: {{trainworker.attributes.management}}%"
|
||||
>
|
||||
{{trainworker.attributes.management}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="trainskill"
|
||||
id="managementRadio"
|
||||
value="management"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="managementRadio"
|
||||
>train</label
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<input
|
||||
class="btn btn-success"
|
||||
type="submit"
|
||||
value="start training"
|
||||
id="start training"
|
||||
name="action"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,243 @@
|
||||
{% 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"
|
||||
>
|
||||
Worker: {{viewedworker.name}}
|
||||
</h1>
|
||||
|
||||
<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: {{viewedworker.attributes.experience}}%"
|
||||
>
|
||||
{{viewedworker.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: {{viewedworker.attributes.reliability}}%"
|
||||
>
|
||||
{{viewedworker.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: {{viewedworker.attributes.python}}%"
|
||||
>
|
||||
{{viewedworker.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: {{viewedworker.attributes.javascript}}%"
|
||||
>
|
||||
{{viewedworker.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: {{viewedworker.attributes.cpp}}%"
|
||||
>
|
||||
{{viewedworker.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: {{viewedworker.attributes.management}}%"
|
||||
>
|
||||
{{viewedworker.attributes.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>
|
||||
<tr>
|
||||
<th scope="row">Skilled Model</th>
|
||||
<td>{{viewedworker.skilledModels}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Amplifyer</th>
|
||||
<td>{{viewedworker.amplifyer}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Salary</th>
|
||||
<td>{{viewedworker.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: {{viewedworker.happyness}}%"
|
||||
>
|
||||
{{viewedworker.happyness}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form
|
||||
action="{% url 'companyWorker' gameid=game.id username=user.username workerid=viewedworker.id %}"
|
||||
method="post"
|
||||
>
|
||||
<div class="d-grid gap-2">
|
||||
{% csrf_token %} {%if viewedworker.status == 0 %}
|
||||
<input
|
||||
class="btn btn-primary m-2"
|
||||
type="submit"
|
||||
value="hire"
|
||||
id="hire"
|
||||
name="action"
|
||||
/>
|
||||
{%elif viewedworker.status == 2 or viewedworker.status == 3 %}
|
||||
<input
|
||||
class="btn btn-danger m-2"
|
||||
type="submit"
|
||||
value="fire"
|
||||
id="fire"
|
||||
name="action"
|
||||
disabled="True"
|
||||
/>
|
||||
<input
|
||||
class="btn btn-primary m-2 mt-0"
|
||||
type="submit"
|
||||
value="train"
|
||||
id="train"
|
||||
name="action"
|
||||
disabled="True"
|
||||
/>
|
||||
{%else%}
|
||||
<input
|
||||
class="btn btn-danger m-2"
|
||||
type="submit"
|
||||
value="fire"
|
||||
id="fire"
|
||||
name="action"
|
||||
/>
|
||||
<input
|
||||
class="btn btn-primary m-2 mt-0"
|
||||
type="submit"
|
||||
value="train"
|
||||
id="train"
|
||||
name="action"
|
||||
/>
|
||||
{%endif%}
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user