107 lines
3.9 KiB
HTML
107 lines
3.9 KiB
HTML
{% load counter_tag %}
|
|
{% getAGGroupQuotaData request as agquota %}
|
|
|
|
<div class="progress mb-2">
|
|
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{agquota.1}}" aria-valuemin="0" aria-valuemax="100"></div>
|
|
<div class="progress-bar bg-danger" role="progressbar" style="width: {{agquota.2}}%" aria-valuenow="{{agquota.2}}" aria-valuemin="0" aria-valuemax="100"></div>
|
|
{{agquota.1|filesizeformat}} / {{agquota.0|filesizeformat}}
|
|
</div>
|
|
<small>Sie können mehr Speicherplatz für die Agentur dazubuchen und anschließend jedem Mitarbeiter ein bestimmtes Speicherkontingent zuweisen. Der Speicherplatz wird dann vom Agenturspeicher abgezogen.</small>
|
|
<br /><br />
|
|
<table class="table hover" id="usertableall_quota">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Vorname</th>
|
|
<th scope="col">Nachname</th>
|
|
<th scope="col">Speicherplatz</th>
|
|
<th scope="col">Kontingent in MB</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tableresults">
|
|
{% for item in usersofagency %}
|
|
<tr>
|
|
<td><a href="{% url 'user_updateprofile' item.pk 0 %}">{{item.first_name }}</a></td>
|
|
<td><a href="{% url 'user_updateprofile' item.pk 0 %}">{{ item.last_name }}</a></td>
|
|
<td>
|
|
{% getUserQuotaData item as userquotadata %}
|
|
<div class="progress mb-2">
|
|
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{userquotadata.1}}" aria-valuemin="0" aria-valuemax="100"></div>
|
|
<div class="progress-bar bg-danger" role="progressbar" style="width: {{userquotadata.2}}%" aria-valuenow="{{userquotadata.2}}" aria-valuemin="0" aria-valuemax="100"></div>
|
|
{{userquotadata.0|filesizeformat }} (davon {{userquotadata.1|filesizeformat }})
|
|
</div>
|
|
</td>
|
|
<td>
|
|
{% if request.user.profile.agency.agencypackage > 0 %}
|
|
<input type="text" class="form-control userquotatextinput" value="{{userquotadata.3 }}" aria-describedby="" id="userquota_{{item.pk}}" style="max-width: 40%;">
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr>
|
|
<div class="form-group">
|
|
<button onclick="updateAGQuota()" class="btn btn-primary" id="savenewquota">Speicherplatzverteilung speichern</button>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
var quotavalues = "agency_{{request.user.profile.agency.pk}}__2146274449_SEPERATOR_userquota_23__3324342";
|
|
// If we change it here, we have to change it on the server, too!
|
|
var seperator = "_SEPERATOR_";
|
|
|
|
function updateAGQuota(){
|
|
var quotavalues = "";
|
|
var allUserInputs = $(".userquotatextinput");
|
|
|
|
|
|
for(i = 0; i < allUserInputs.length; i++){
|
|
quotavalues = quotavalues + allUserInputs[i].id + "__" + allUserInputs[i].value + seperator;
|
|
}
|
|
|
|
console.log(quotavalues);
|
|
$("#savenewquota").prop("disabled", true);
|
|
|
|
$.ajax(
|
|
{
|
|
type: "GET",
|
|
url: "/dasettings/ajax",
|
|
data:{
|
|
action : "quotaag_update",
|
|
quotavalues : quotavalues
|
|
},
|
|
success: function( data )
|
|
{
|
|
window.location = window.location;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
// Set DataTable
|
|
$(document).ready(function(){
|
|
$('#usertableall_quota').DataTable({
|
|
order: [3, 'desc'],
|
|
"language": {
|
|
"search" : "Suche",
|
|
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
|
|
"lengthMenu": "Zeige _MENU_ Einträge",
|
|
"zeroRecords": "Nichts gefunden",
|
|
"infoEmpty": "Keine Einträge",
|
|
"paginate": {
|
|
"first": "Erste",
|
|
"last": "Letzte",
|
|
"next": "Nächste",
|
|
"previous": "Zurück"
|
|
},
|
|
},
|
|
"pageLength": 20,
|
|
"buttons" : {
|
|
"className" : "btn-danger"
|
|
}
|
|
});
|
|
})
|
|
</script>
|