Display previous stages on attribution view
This commit is contained in:
parent
93b84289fe
commit
26452f9068
6 changed files with 35 additions and 4 deletions
BIN
stages/static/img/closed.png
Normal file
BIN
stages/static/img/closed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 263 B |
BIN
stages/static/img/open.png
Normal file
BIN
stages/static/img/open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 211 B |
|
|
@ -128,7 +128,15 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
$('#student_select').change(function(ev) {
|
||||
$('#student_detail').load('/student/' + $(this).val() + '/summary/').addClass("filled");
|
||||
$('#student_detail').load('/student/' + $(this).val() + '/summary/', function() {
|
||||
$('div#previous_stages_head').toggle(function() {
|
||||
$('ul#previous_stages_list').toggle();
|
||||
$(this).find('img').attr('src', static_url + 'img/open.png');
|
||||
}, function() {
|
||||
$('ul#previous_stages_list').toggle();
|
||||
$(this).find('img').attr('src', static_url + 'img/closed.png');
|
||||
});
|
||||
}).addClass("filled");
|
||||
current_student = $(this).val();
|
||||
if (current_avail !== null) $('input#valid_training').show()
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ class StudentSummaryView(DetailView):
|
|||
model = Student
|
||||
template_name = 'student_summary.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(StudentSummaryView, self).get_context_data(**kwargs)
|
||||
context['previous_stages'] = self.object.training_set.all(
|
||||
).select_related('availability__corporation').order_by('availability__period__end_date')
|
||||
return context
|
||||
|
||||
|
||||
class AvailabilitySummaryView(DetailView):
|
||||
model = Availability
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue