Filled with Data / Addressbook corrections
This commit is contained in:
@@ -41,38 +41,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
function putStatus( button, status ) {
|
||||
function putStatus( button, status )
|
||||
{
|
||||
$("#saving").html("Speichere..");
|
||||
|
||||
p = button.parent();
|
||||
putObject = [ { "event": p.data("event-id"),
|
||||
"user": p.data("username"),
|
||||
"status": status } ];
|
||||
|
||||
|
||||
request = $.ajax( {
|
||||
type: "PUT",
|
||||
url: "{% url 'event_api' %}",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(putObject),
|
||||
success: function() { $("#saving").html("Ok"); }
|
||||
success: function() { $("#saving").html("Ok"); },
|
||||
error: function(jqXHR, text, errorText) { console.log("Ajax failed " + errorText + JSON.stringify(putObject) ); }
|
||||
});
|
||||
|
||||
setEventButtonStatus( button, status );
|
||||
//request.done(function(jqXHR, textStatus) {
|
||||
// setEventButtonStatus( button, status )
|
||||
//});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
$(".event-comment").bindWithDelay("keypress", function() {
|
||||
|
||||
$("#saving").html("Speichere..");
|
||||
|
||||
putObject = [ { "event": $(this).data("event-id"),
|
||||
"user": $(this).data("username"),
|
||||
"comment": $(this).val() } ];
|
||||
|
||||
|
||||
$.ajax( {
|
||||
type: "PUT",
|
||||
url: "{% url 'event_api' %}",
|
||||
@@ -103,13 +101,17 @@
|
||||
|
||||
|
||||
<div class="container">
|
||||
<form>
|
||||
<p>
|
||||
<div class="row">
|
||||
<div class="row-fluid eventTable">
|
||||
<div class="span12">
|
||||
|
||||
<h2>Termine</h2>
|
||||
|
||||
|
||||
|
||||
<p class="pull-right" ><a href="grid">zur Übersicht</a></p>
|
||||
|
||||
|
||||
<div class="box-content">
|
||||
<table class="table table-striped">
|
||||
|
||||
@@ -140,7 +142,7 @@
|
||||
<td class="center"> {{ event.location }} </td>
|
||||
|
||||
<td class="center">
|
||||
<div class="btn-group event-status-select" data-event-id="{{event.pk}}" data-username="{{user.username}}" >
|
||||
<div class="btn-group event-status-select" data-event-id="{{event.pk}}" data-username="{{user.username}}" >
|
||||
<button class="btn event-status-yes {% if event.participation.status == "Yes" %} btn-success {% else %} btn-info {% endif %}">
|
||||
<i class="icon-ok-sign icon-white"></i>
|
||||
</button>
|
||||
@@ -172,8 +174,9 @@
|
||||
<div class="span12">
|
||||
<em>Änderungen werden automatisch gespeichert: </em> <em id="saving">Ok</em>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,9 +16,14 @@
|
||||
{% block content %}
|
||||
{% addtoblock "css" %}
|
||||
<style>
|
||||
.eventButton {
|
||||
button.eventButton {
|
||||
width: 55px;
|
||||
}
|
||||
span.eventButton {
|
||||
height: 16px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
}
|
||||
.eventButton i {
|
||||
margin-right:2px;
|
||||
}
|
||||
@@ -30,14 +35,14 @@
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
{% if not perms.eventplanner.change_others_participation %}
|
||||
{% if not perms.eventplanner.admin %}
|
||||
$(".eventButton").attr('disabled', 'disabled');
|
||||
$(".deleteButton").hide();
|
||||
{% endif %}
|
||||
|
||||
$('.eventButton').tooltip()
|
||||
|
||||
$(".eventButton").click( function (e) {
|
||||
$("button.eventButton").click( function (e) {
|
||||
e.preventDefault();
|
||||
$(this).removeClass("btn-danger")
|
||||
.removeClass("btn-warning")
|
||||
@@ -135,6 +140,9 @@
|
||||
|
||||
|
||||
{% for p in event.participation %}
|
||||
|
||||
{% if perms.eventplanner.admin %}
|
||||
|
||||
<td class="center userEventTableData" data-username="{{p.user.username}}" data-event="{{event.pk}}">
|
||||
{% if p.status == "Yes" %}
|
||||
<button class="btn btn-mini btn-success eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
@@ -152,7 +160,29 @@
|
||||
<span class="text">?</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
</td> {% endfor %}
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="center userEventTableData" data-username="{{p.user.username}}" data-event="{{event.pk}}">
|
||||
{% if p.status == "Yes" %}
|
||||
<span class="badge badge-success eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">Ja</span>
|
||||
</span>
|
||||
{% elif p.status == "No" %}
|
||||
<span class="badge badge-important eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
{% if p.comment%} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">Nein</span>
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge badge-warning eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">?</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<td>
|
||||
<a class="btn btn-mini btn-inverse deleteButton" data-pk="{{event.pk}}"><i class="icon-trash icon-white"></i> Löschen </a>
|
||||
@@ -160,9 +190,11 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
{% if perms.eventplanner.admin %}
|
||||
<tr>
|
||||
<td class="center"> <a href="add">Termin hinzufügen...</a> </td>
|
||||
<tr>
|
||||
{% endif %}</form>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -173,7 +205,7 @@
|
||||
</div><!--/row-->
|
||||
|
||||
|
||||
{% if perms.eventplanner.change_others_participation %}
|
||||
{% if perms.eventplanner.admin %}
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<button id="saveButton" class="btn btn-primary" disabled="true">Speichern</button>
|
||||
|
||||
Reference in New Issue
Block a user