Eventplanner: Grid / Translation
This commit is contained in:
32
eventplanner/templates/eventplanner/event_update_form.html
Normal file
32
eventplanner/templates/eventplanner/event_update_form.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends "website/base.html" %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
|
||||
<!-- No Feature slider -->
|
||||
{% block feature_slider %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<!-- Static Navbar at top -->
|
||||
{% block navbar_options %} navbar navbar-inverse navbar-static-top {% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" class="btn btn-primary" value="Abschicken"></input>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -125,8 +125,8 @@
|
||||
<tr>
|
||||
<td class="center"> <a href="{{ event.pk }}"> {{ event.title }} </a> </td>
|
||||
<td class="center"> {{ event.date }} </td>
|
||||
<td class="center"> {{ event.time }} </td>
|
||||
<!-- <td class="center"> {{ event.location }} </td> -->
|
||||
<td class="center"> {% if event.time %} {{ event.time }} {% endif %} </td>
|
||||
<!-- <td class="center"> {{ event.location }} </td> -->
|
||||
<td class="center"> Ort </td>
|
||||
|
||||
<td class="center">
|
||||
159
eventplanner/templates/eventplanner/events_grid.html
Normal file
159
eventplanner/templates/eventplanner/events_grid.html
Normal file
@@ -0,0 +1,159 @@
|
||||
{% extends "website/base.html" %}
|
||||
|
||||
{% load sekizai_tags staticfiles %}
|
||||
|
||||
|
||||
<!-- No Feature slider -->
|
||||
{% block feature_slider %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<!-- Static Navbar at top -->
|
||||
{% block navbar_options %} navbar navbar-inverse navbar-static-top {% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% addtoblock "css" %}
|
||||
<style>
|
||||
.eventButton {
|
||||
width: 55px;
|
||||
}
|
||||
.eventButton i {
|
||||
margin-right:2px;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endaddtoblock %}
|
||||
|
||||
{% addtoblock "js" %}
|
||||
<script>
|
||||
|
||||
$('.eventButton').tooltip()
|
||||
|
||||
$(".eventButton").click( function () {
|
||||
$(this).removeClass("btn-danger")
|
||||
.removeClass("btn-warning")
|
||||
.removeClass("btn-success");
|
||||
|
||||
if ( $(this).data('status') == "Yes" )
|
||||
{
|
||||
$(this).data( "status", "?" )
|
||||
.addClass("btn-warning");
|
||||
$(this).children("span.text").html("?");
|
||||
} else if ( $(this).data('status') == "?" )
|
||||
{
|
||||
$(this).data( "status", "No" )
|
||||
.addClass("btn-danger");
|
||||
$(this).children("span.text").html("Nein");
|
||||
|
||||
} else if ( $(this).data('status') == "No" )
|
||||
{
|
||||
$(this).data( "status", "Yes" )
|
||||
.addClass("btn-success");
|
||||
$(this).children("span.text").html("Ja");
|
||||
}
|
||||
|
||||
$('#saveButton').removeAttr('disabled');
|
||||
});
|
||||
|
||||
$("#saveButton").click( function() {
|
||||
|
||||
arr = [];
|
||||
|
||||
$('.userEventTableData').each( function() {
|
||||
|
||||
dataObject = {
|
||||
"event" : $(this).data("event"),
|
||||
"musician": $(this).data("musician"),
|
||||
"status" : $(this).children("button").data("status")
|
||||
};
|
||||
|
||||
arr.push(dataObject);
|
||||
});
|
||||
|
||||
$.ajax( {
|
||||
type: "PUT",
|
||||
url: "/eventParticipation/",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(arr)
|
||||
});
|
||||
$('#saveButton').attr('disabled','true');
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endaddtoblock %}
|
||||
|
||||
<div class="container">
|
||||
<form>
|
||||
<div class="row">
|
||||
<div class="row-fluid eventTable">
|
||||
<div class="span12">
|
||||
|
||||
<h2>Termine</h2>
|
||||
|
||||
<div class="box-content">
|
||||
<table class="table table-striped">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Termin </th>
|
||||
<th> Datum </th>
|
||||
{% for name in musicianNames %}
|
||||
<th> {{ name|capfirst }} </th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for event in events %}
|
||||
<tr class="eventRow">
|
||||
<td class="center"> <a href="{{ event.pk }}"> {{ event.title }} </a> </td>
|
||||
<td class="center"> {{ event.date }} </td>
|
||||
|
||||
|
||||
{% for p in event.participation %}
|
||||
<td class="center userEventTableData" data-musician="{{p.musician.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}}">
|
||||
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">Ja</span>
|
||||
</button>
|
||||
{% elif p.status == "No" %}
|
||||
<button class="btn btn-mini btn-danger eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
{% if p.comment%} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">Nein</span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="btn btn-mini btn-warning eventButton" title="{{p.comment}}" data-status="{{p.status}}">
|
||||
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
|
||||
<span class="text">?</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
|
||||
</div><!--/row-->
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<button id="saveButton" class="btn btn-primary" disabled="true" >Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user