{% if book.new_publishable %}p{% endif %}
{% if chunk.changed %}+{% endif %}
</td>
+ <td>{{ book.project.name }}</td>
</tr>
{% endwith %}
{% else %}
{% if book.published %}P{% endif %}
{% if book.new_publishable %}p{% endif %}
</td>
+ <td>{{ book.project.name }}</td>
</tr>
{% endif %}
{% endif %}
<input type='hidden' name="all" value="{{ request.GET.all }}" />
<input type='hidden' name="status" value="{{ request.GET.status }}" />
+<input type='hidden' name="project" value="{{ request.GET.project }}" />
</form>
{% endfor %}
</select></th>
+ <th><select name="project" class="filter">
+ <option value=''>- {% trans "project" %} -</option>
+ <option {% if request.GET.project == '-' %}selected="selected"
+ {% endif %}value="-">- {% trans "none" %} -</option>
+ {% for project in projects %}
+ <option {% if request.GET.project == project.pk|slugify %}selected="selected"
+ {% endif %}value='{{ project.pk }}'>{{ project.name }}</option>
+ {% endfor %}
+ </select></th>
+
</tr></thead>
{% with cnt=books|length %}
from django import template
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
-from catalogue.models import Chunk
+from catalogue.models import Chunk, Project
register = template.Library()
chunks = foreign_filter(chunks, arg_or_GET('user'), 'user', User, 'username')
chunks = foreign_filter(chunks, arg_or_GET('stage'), 'stage', Chunk.tag_model, 'slug')
chunks = search_filter(chunks, arg_or_GET('title'), ['book__title', 'title'])
+ chunks = foreign_filter(chunks, arg_or_GET('project'), 'book__project', Project, 'pk')
return chunks
"books": ChunksList(document_list_filter(request, **filters)),
"stages": Chunk.tag_model.objects.all(),
"states": _states_options,
+ "projects": Project.objects.all(),
})
return new_context