rewrite 'suivi:details' template

This commit is contained in:
Arthur Gerbaud
2016-08-06 19:55:57 +02:00
parent aefeb2e349
commit e593981696
5 changed files with 34 additions and 95 deletions

View File

@@ -1,10 +1,2 @@
<ul class="nav nav-pills nav-justified" role="tablist" style="padding-bottom:20px;float:bottom;">
<li role="presentation" class="active"><a href="#suivi" aria-controls="suivi" role="tab" data-toggle="tab">Suivi</a></li>
<li role="presentation"><a href="#fiche" aria-controls="fiche" role="tab" data-toggle="tab">Fiche</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="suivi">{% include "suivi/sujet_suivi.html" %}</div>
<div role="tabpanel" class="tab-pane" id="fiche">{% include "sujets/sujet_details_inner.html" %}</div>
</div>
Notes : {{ notes }}
<div class="col-md-6">{% include "suivi/sujet_suivi.html" %}</div>
<div class="col-md-6">{% include "sujets/sujet_details_inner.html" %}</div>

View File

@@ -1,13 +1,12 @@
{% load notes %}
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">Notes
<span class="pull-right"><span class="label">Total : {{ notes.count }}</span></span></h3>
</div>
<table class="table table-striped table-bordered">
{% for note in notes %}
{% inline_table note %}
{% endfor %}
</table>
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">Notes
<span class="pull-right"><span class="label">Total : {{ notes.count }}</span></span></h3>
</div>
<table class="table table-striped table-bordered">
{% for note in notes %}
{% inline_table note header="date" %}
{% endfor %}
</table>
</div>

View File

@@ -28,5 +28,5 @@ class SuiviSujetView(SuivisView, generic.DetailView):
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
context['notes'] = self.object.notes.all()
context['notes'] = self.object.notes.all().order_by('created_date')
return context