Commit 6fb74457c6a65c0f50ebc77875d39792d9b1b9c1

Authored by Marcel Kawski
1 parent 615f9267

Add sorting user's drafts

collector/storage/static/storage/css/document.css
... ... @@ -197,6 +197,10 @@ i.remove-form-row:hover {
197 197 width: 15%;
198 198 }
199 199  
  200 +.col-sm-lp {
  201 + width: 7%;
  202 +}
  203 +
200 204 .col-name {
201 205 width: 30%;
202 206 }
... ...
collector/storage/templates/storage/draft_list.html
... ... @@ -12,6 +12,7 @@
12 12 <table class="data-table doc-table" id="drafts-table">
13 13 <thead>
14 14 <tr>
  15 + <th class="col-sm-lp">Lp.</th>
15 16 <th>Nazwa-ID</th>
16 17 </tr>
17 18 </thead>
... ... @@ -19,6 +20,7 @@
19 20 <tbody>
20 21 {% for draft in drafts %}
21 22 <tr>
  23 + <td>{{ forloop.counter }}</td>
22 24 <td><a href="{% url 'annotation' draft.id %}">{{ draft }}</a></td>
23 25 </tr>
24 26 {% endfor %}
... ...
collector/storage/views.py
... ... @@ -1069,7 +1069,9 @@ class DraftListView(ListView):
1069 1069  
1070 1070 def get_context_data(self, **kwargs):
1071 1071 context = super(DraftListView, self).get_context_data(**kwargs)
1072   - drafts = [ann.document for ann in Annotation.objects.filter(user=self.request.user, finished=False)]
  1072 + drafts = [ann.document for ann in
  1073 + Annotation.objects.filter(user=self.request.user, finished=False).order_by('start_time')
  1074 + ]
1073 1075 context['drafts'] = drafts
1074 1076 return context
1075 1077  
... ...