This commit is contained in:
Argyrios Deligiannidis
2022-06-26 23:19:01 +03:00
parent 80ff869d66
commit e84cc555a2
1506 changed files with 877444 additions and 0 deletions
@@ -0,0 +1 @@
{% extends 'djreservation/mail/email_base.html' %}
@@ -0,0 +1 @@
{% extends 'djreservation/mail/email_base.html' %}
+1
View File
@@ -0,0 +1 @@
{% extends 'djreservation/mail/email_base.html' %}
@@ -0,0 +1,29 @@
{% load i18n %}
{% trans 'Hi,' %} <strong>{{reservation.user.get_full_name}}</strong>
<br>
{% block precontent %}{%endblock%}
<strong>{% trans 'Reservation status' %}:</strong> {{reservation.get_status_display}}
<br>
<strong>{% trans 'Reservation start date' %}:</strong> {{reservation.reserved_start_date}}
<br>
<strong>{% trans 'Reservation end date' %}:</strong> {{reservation.reserved_end_date}}
<hr>
{% block content %}{%endblock%}
<br>
<h1> {% trans 'List of products'%}</h1>
<ul>
{% for product in reservation.product_set.all%}
<li> <strong>{% if product.borrowed %} {% trans 'Borrowed' %} {%else%} {% trans 'Not borrowed' %} {%endif%} </strong> {{product}} </li>
{% endfor%}
</ul>
<br>
{% block extra_contact %}
{% endblock %}
<br>
{% trans 'Thanks' %}
<br> <br>
{% trans 'Tramited by' %}: {{user.get_full_name}}
@@ -0,0 +1 @@
{% extends 'djreservation/mail/email_base.html' %}
@@ -0,0 +1 @@
{% extends 'djreservation/mail/email_base.html' %}
@@ -0,0 +1,61 @@
{% load i18n %}
<table id="products">
<tr style="background: #79aec8 none repeat scroll 0 0">
<th><input type="checkbox" name="all" value="uncheck"></th>
<th> {% trans 'Approves all' %} </th>
</tr>
{% for product in instance.product_set.all%}
<tr>
<td>
{% if instance.status == instance.RETURNED %}
{% if product.borrowed %}
{% trans 'Returned' %}
{%else%}
{% trans 'Not borrowed' %}
{% endif %}
{% else %}
<input type="checkbox" name="djreservation_product_list"
value="{{product.pk}}" {% if product.borrowed %}checked{%endif%} >
</td>
{% endif %}
<td>{{product}}</td>
</tr>
{% endfor %}
</table>
<script>
(function($){
$('input[name="all"]').change(function(){
if($(this).is(':checked') ){
$('#products input').prop( "checked", true );
}else{
$('#products input').prop( "checked", false );
}
});
{% if instance.status == instance.BORROWED %}
$('#products input').change(function(){
$("#id_status").val({{instance.BORROWED}});
$("#id_status option").each(
function(i,x){ if( {{instance.BORROWED}} != $(x).val() ){ $(x).remove(); }});
});
{% endif %}
$('#id_status').change(function(event){
var sel = $(this).find("option:selected").val();
if(sel == 2){
$('#products input').prop( "checked", true );
}else if (sel == 3) {
$('#products input').prop( "checked", false );
}else if(sel == 4){
}
})
})(django.jQuery)
</script>
+25
View File
@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<form method="post" >
{% csrf_token %}
<table class="table">
{{form}}
<tr>
<td>{% trans "Available:" %}</td>
<td> {{ available_amount}} </td>
</tr>
{% for field in extra_fields%}
<tr>
<td>{{field.label}}</td>
<td>{{field.value}}</td>
</tr>
{%endfor%}
<tr>
<td></td>
<td><input class="btn btn-success" type="submit" value="{% trans 'Reserve'%}"></td>
</tr>
</table>
</form>
{%endblock%}
@@ -0,0 +1,37 @@
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<form class="form-horizontal" method="post">
{% csrf_token %}
<h2>{% trans 'Are you sure? See above the products details' %}</h2>
<input type="submit"
class="btn btn-success" value="{% trans 'Finish this reservation' %}" />
</form>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-1">
<h1> {% trans 'Reserved products' %} </h1>
<ul class="list-group">
{% for product in reservation.product_set.all %}
<li class="list-group-item">
{{product}}
<a href="{% url 'delete_product_reservation' product.pk%}" style="position: absolute;right: 15px;" >
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</a>
</li>
{% empty %}
<li class="list-group-item">
{% trans "Products are not reserved yet" %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col-md-6 col-md-offset-3">
{% trans 'Thanks, your reservation was processed successfully' %}
</div>
</div>
{% endblock %}
@@ -0,0 +1,87 @@
{% extends 'base.html' %}
{% load static i18n %}
{% block css%}
<link rel="stylesheet" type="text/css" media="screen"
href="{% static 'css/bootstrap-datetimepicker.min.css' %}">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css"
rel="stylesheet">
<style>
.bootstrap-datetimepicker-widget{
min-width: 250px;
width: 270px;
}
</style>
{%endblock%}
{% block content %}
{% block content_title%}
<h1> {% trans "Creating a reservation"%} </h1>
{% endblock %}
{{form.errors}}
<form class="form-horizontal" method="post">
{% csrf_token %}
{% block form_start %}{% endblock %}
<div class="form-group">
{{ form.reserved_start_date.errors }}
<label id="{{ form.reserved_start_date.id_label_tag }}" class="col-sm-2 control-label" > {% trans 'Reservation start date' %} </label>
<div id="dtp_reserved_start_date" class="input-append date">
<div class="col-sm-2">
{{ form.reserved_start_date }}
</div>
<div class="col-sm-2">
<span class="add-on">
<i class="glyphicon glyphicon-calendar" aria-hidden="true" data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
</div>
</div>
<div class="form-group">
{{ form.reserved_end_date.errors }}
<label id="{{ form.reserved_end_date.id_label_tag }}" class="col-sm-2 control-label" > {% trans 'Reservation end date' %} </label>
<div id="dtp_reserved_end_date" class="input-append date">
<div class="col-sm-2">
{{ form.reserved_end_date }}
</div>
<div class="col-sm-2">
<span class="add-on">
<i class="glyphicon glyphicon-calendar" aria-hidden="true" data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
</div>
</div>
{% block form_end %}{% endblock %}
<button type="submit" class="btn btn-default">{% trans 'Submit' %}</button>
</form>
{% endblock %}
{% block js %}
<script type="text/javascript"
src="{% static 'js/bootstrap-datetimepicker.min.js' %}">
</script>
<script type="text/javascript">
rsd= $('#dtp_reserved_start_date').datetimepicker({
format: 'MM/dd/yyyy hh:mm',
autoclose: true
});
rd= $('#dtp_reserved_end_date').datetimepicker({
format: 'MM/dd/yyyy hh:mm',
autoclose: true
});
</script>
{% endblock %}
@@ -0,0 +1,75 @@
{% extends 'base.html' %}
{% load static i18n %}
{% block content %}
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
{% for reservation in object_list%}
<div class="panel {% if reservation.status == reservation.REQUESTED %} panel-success {%elif reservation.status == reservation.BORROWED %} panel-danger {%else%}panel-default{%endif%}">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{reservation.pk}}" aria-expanded="true" aria-controls="collapse{{reservation.pk}}">
{{reservation}}
</a>
</h4>
</div>
<div id="collapse{{reservation.pk}}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<ul class="list-group">
{% for product in reservation.product_set.all%}
<li class="list-group-item">{{product}}
{% if product.borrowed %}
<a href="#" style="position: absolute;right: 15px;" >
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
</a>
{%else%}
<a href="#" style="position: absolute;right: 15px;" >
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</a>
{% endif %}
</li>
{% endfor%}
</ul>
{% if reservation.observation_set.count %}
<div class="alert alert-info">
<h2> {% trans 'Observations' %}</h2>
{% for observation in reservation.observation_set.all %}
{{observation.text}}
<hr>
{% endfor%}
</div>
{% endif %}
</div>
</div>
</div>
{% empty %}
<h2> {% trans 'No reservations saved yet' %}</h2>
{% endfor %}
</div>
{% if is_paginated %}
<nav aria-label="...">
<ul class="pager">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">{% trans 'Previous' %}</a>
</li>
{% endif %}
<li>
{% trans 'Page' %} {{ page_obj.number }} -- {{ page_obj.paginator.num_pages }}.
</li>
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">{% trans 'Next' %}</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endblock%}
@@ -0,0 +1,19 @@
{% extends 'djreservation/reservation_form.html'%}
{% load i18n %}
{% block content_title%}
<h1> {% trans "Creating a reservation of :"%} <br><small >{{object}}</small></h1>
{% endblock%}
{% block form_start %}
{{ product_form.non_field_errors }}
<div class="form-group">
{{product_form.amount.errors }}
<label for="id_amount" class="col-sm-2 control-label">{{product_form.amount.label}}</label>
<div class="col-sm-2">
{{product_form.amount}}
{{product_form.available_amount}}
{{product_form.model_instance}}
</div></div>
{% endblock %}