forked from eldalai/vacations
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3c300b
commit 9fb821c
Showing
7 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
templates/vacations_app/assignedvacations_confirm_delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% extends 'vacations_app/base.html' %} | ||
{% load bootstrap4 %} | ||
{% load widget_tweaks %} | ||
|
||
{% block content %} | ||
<h3>Employee Assigned Vacation</h3> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<form method="post">{% csrf_token %} | ||
<p>Are you sure you want to delete "{{ object }}"?</p> | ||
<input type="submit" value="Confirm"> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
{% endblock content %} | ||
{% block scripts %} | ||
{{ block.super }} | ||
{{form.media }} | ||
{% endblock scripts %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% extends 'vacations_app/base.html' %} | ||
{% load bootstrap4 %} | ||
{% load widget_tweaks %} | ||
|
||
{% block content %} | ||
<h3>Employee Assigned Vacation</h3> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<form method="post" class="form"> | ||
{% csrf_token %} | ||
|
||
{% for hidden_field in form.hidden_fields %} | ||
{{ hidden_field }} | ||
{% endfor %} | ||
|
||
{% if form.non_field_errors %} | ||
<div class="alert alert-danger" role="alert"> | ||
{% for error in form.non_field_errors %} | ||
{{ error }} | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
{% for field in form.visible_fields %} | ||
<div class="form-group"> | ||
{{ field.label_tag }} | ||
{% if form.is_bound %} | ||
{% if field.errors %} | ||
{% render_field field class="form-control is-invalid" %} | ||
{% for error in field.errors %} | ||
<div class="help-block"> | ||
{{ error }} | ||
</div> | ||
{% endfor %} | ||
{% else %} | ||
{% render_field field class="form-control is-valid" %} | ||
{% endif %} | ||
{% else %} | ||
{% render_field field class="form-control" %} | ||
{% endif %} | ||
|
||
{% if field.help_text %} | ||
<small class="form-text text-muted">{{ field.help_text }}</small> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
<button type="submit" class="btn btn-info">Save</button> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock content %} | ||
{% block scripts %} | ||
{{ block.super }} | ||
{{form.media }} | ||
{% endblock scripts %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% extends 'vacations_app/base.html' %} | ||
{% load static %} | ||
{% block head %} | ||
{{block.super}} | ||
<link rel="stylesheet" href="{% static 'css/index.css' %}"> | ||
{% endblock head %} | ||
{% block content %} | ||
|
||
{% if user.is_authenticated %} | ||
<h1>Employees Assigned Vacations</h1> | ||
<table class="table table-hover"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th>Employee</th> | ||
<th>Worked Year</th> | ||
<th>Total Days</th> | ||
<th>Actions</th> | ||
</tr> | ||
</thead> | ||
{% for assigned_vacation in object_list %} | ||
<tbody> | ||
<tr> | ||
<td>{{ assigned_vacation.employee.first_name }} {{ assigned_vacation.employee.last_name }} </td> | ||
<td>{{ assigned_vacation.worked_year }}</td> | ||
<td>{{ assigned_vacation.total_days }}</td> | ||
<td> | ||
<a href="{% url 'assigned-vacations-update' assigned_vacation.id %}" class="btn btn-primary">Update</a> | ||
<a href="{% url 'assigned-vacations-delete' assigned_vacation.id %}" class="btn btn-primary">Delete</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
{% endfor %} | ||
</table> | ||
<a href="{% url 'assigned-vacations-create' %}" class="btn btn-primary">Create Assigned Vacations</a> | ||
{% else %} | ||
{% endif %} | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters