git @ Cat's Eye Technologies klaus / 94e80f4
Set base href, for the benefit of rendered pages with relative links. Fixes #177 Jelmer Vernooij authored 8 years ago Jelmer Vernooij committed 8 years ago
2 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
33 <link rel=stylesheet href={{ url_for('static', filename='pygments.css') }}>
44 <link rel=stylesheet href={{ url_for('static', filename='klaus.css') }}>
55 <link rel=icon type="image/png" href="{{ url_for('static', filename='favicon.png') }}" />
6 {% if base_href %}
7 <base href="{{ base_href }}"/>
8 {% endif %}
69 <title>{% block title %}{% endblock %} - {{ SITE_NAME }}</title>
710
811 <script src={{ url_for('static', filename='klaus.js') }}></script>
3535 sort_key = lambda repo: repo.name
3636 reverse = False
3737 repos = sorted(current_app.repos.values(), key=sort_key, reverse=reverse)
38 return render_template('repo_list.html', repos=repos)
38 return render_template('repo_list.html', repos=repos, base_href=None)
3939
4040
4141 def robots_txt():
101101 'path': path,
102102 'blob_or_tree': blob_or_tree,
103103 'subpaths': list(subpaths(path)) if path else None,
104 'base_href': None,
104105 }
105106
106107
200201
201202 def make_template_context(self, *args):
202203 super(IndexView, self).make_template_context(*args)
204
205 self.context['base_href'] = url_for(
206 'blob',
207 repo=self.context['repo'].name,
208 rev=self.context['rev'],
209 path=''
210 )
203211
204212 self.context['page'] = 0
205213 history_length = 10