This fixes a server error for the booking REST api and some html errors.
Change-Id: I86475967bbc8cd4c8f82f62e03789f1c9752d446
Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
from booking.models import Booking
from dashboard.models import Server, Resource, ResourceStatus
-
class BookingSerializer(serializers.ModelSerializer):
- installer_name = serializers.RelatedField(source='installer', read_only=True)
- scenario_name = serializers.RelatedField(source='scenario', read_only=True)
+ installer_name = serializers.CharField(source='installer.name')
+ scenario_name = serializers.CharField(source='scenario.name')
class Meta:
model = Booking
class ResourceStatusSerializer(serializers.ModelSerializer):
class Meta:
model = ResourceStatus
- fields = ('id', 'resource', 'timestamp','type', 'title', 'content')
\ No newline at end of file
+ fields = ('id', 'resource', 'timestamp','type', 'title', 'content')
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
"order": [[0, "asc"]]
});
});
{% block content %}
<div class="row">
- <div class="col-lg-12">
- <div class="panel panel-default">
<div class="panel-body">
<div class="dataTables_wrapper">
<table class="table table-striped table-bordered table-hover" id="table"
</table>
</div>
<!-- /.table-responsive -->
- </div>
<!-- /.panel-body -->
- </div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
<script type="text/javascript">
$(document).ready(function () {
- $('#table').DataTable({});
+ $('#table').DataTable({
+ scrollX: true,
+ });
});
</script>
-{% endblock extrajs %}
\ No newline at end of file
+{% endblock extrajs %}
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 2}
],
});
});
</script>
-{% endblock tablejs %}
\ No newline at end of file
+{% endblock tablejs %}
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 6}
],
});
});
</script>
-{% endblock tablejs %}
\ No newline at end of file
+{% endblock tablejs %}
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 1}
],
});
});
</script>
-{% endblock tablejs %}
\ No newline at end of file
+{% endblock tablejs %}
{% block content %}
<div class="row">
<div class="col-lg-12">
- <div class="panel panel-default">
- <div class="panel-body">
<div class="dataTables_wrapper">
<table class="table table-striped table-bordered table-hover" id="table" cellspacing="0"
width="100%">
</table>
</div>
<!-- /.table-responsive -->
- </div>
<!-- /.panel-body -->
- </div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
{% block extrajs %}
<!-- DataTables JavaScript -->
- <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
- rel="stylesheet">
-
<script src={% static "bower_components/datatables/media/js/jquery.dataTables.min.js" %}></script>
<script src={% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js" %}></script>
{% block tablejs %}
{% endblock tablejs %}
-{% endblock extrajs %}
\ No newline at end of file
+{% endblock extrajs %}
<link href="{% static "bower_components/metisMenu/dist/metisMenu.min.css" %}" rel="stylesheet">
<!-- Custom CSS -->
- <link href="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/css/sb-admin-2.css" %}"
+ <link href="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/css/sb-admin-2.min.css" %}"
rel="stylesheet">
<link href="{% static "css/theme.css" %}" rel="stylesheet">
<script src="{% static "bower_components/metisMenu/dist/metisMenu.min.js" %}"></script>
<!-- Custom Theme JavaScript -->
-<script src="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/js/sb-admin-2.js" %}"></script>
+<script src="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/js/sb-admin-2.min.js" %}"></script>
{% block extrajs %}
{% endblock extrajs %}