Commit b39f8f1d by benjaoming

Printer friendliness

parent f9130a6e
...@@ -79,7 +79,7 @@ class Article(models.Model): ...@@ -79,7 +79,7 @@ class Article(models.Model):
"""NB! This generator is expensive, so use it with care!!""" """NB! This generator is expensive, so use it with care!!"""
cnt = 0 cnt = 0
for obj in self.articleforobject_set.filter(is_mptt=True): for obj in self.articleforobject_set.filter(is_mptt=True):
for child in obj.content_object.get_children().filter(**kwargs): for child in obj.content_object.get_children().filter(**kwargs).order_by('articles__article__current_revision__title'):
cnt += 1 cnt += 1
if max_num and cnt > max_num: return if max_num and cnt > max_num: return
yield child yield child
......
...@@ -11,7 +11,13 @@ ...@@ -11,7 +11,13 @@
<link href="{{ STATIC_URL }}wiki/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="{{ STATIC_URL }}wiki/bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- TODO: Put all this stuff in Less --> <!-- TODO: Put all this stuff in Less -->
<style> <style media="print">
.navbar,
.nav-tabs li a,
#article-breadcrumbs
{display: none;}
</style>
<style media="all">
#div_id_title .asteriskField{display:none} #div_id_title .asteriskField{display:none}
#id_title {font-size: 20px; height: 30px; padding: 6px; width: 98%;} #id_title {font-size: 20px; height: 30px; padding: 6px; width: 98%;}
#id_summary {width: 98%; padding: 6px;} #id_summary {width: 98%; padding: 6px;}
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
{% trans "Save changes" %} {% trans "Save changes" %}
</button> </button>
<a href="{% url 'wiki:delete' path=urlpath.path article_id=article.id %}" class="pull-right btn btn-danger"> <a href="{% url 'wiki:delete' path=urlpath.path article_id=article.id %}" class="pull-right btn">
<span class="icon-trash"></span> <span class="icon-trash"></span>
{% trans "Delete article" %} {% trans "Delete article" %}
</a> </a>
......
{% load i18n %}{% load url from future %} {% load i18n %}{% load url from future %}
{% if urlpath %} {% if urlpath %}
<div id="article-breadcrumbs">
<ul class="breadcrumb pull-left" class=""> <ul class="breadcrumb pull-left" class="">
{% for ancestor in urlpath.cached_ancestors %} {% for ancestor in urlpath.cached_ancestors %}
<span class="divider">/</span> <span class="divider">/</span>
...@@ -58,4 +60,5 @@ ...@@ -58,4 +60,5 @@
</div> </div>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div>
{% endif %} {% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment