fixed breadcrumbs

moved some code to util.py to clean up views.py
added migration for start of db.
This commit is contained in:
2015-06-17 13:46:02 +01:00
parent fb3e8eae5b
commit 2de1fb9491
8 changed files with 143 additions and 78 deletions

View File

@@ -1,9 +1,13 @@
{% extends "base.html" %}
{% block title %}My amazing blog{% endblock %}
{% block title %}CBreader{% endblock %}
{% block breadcrumb %}
{% for crumb in breadcrumbs %}
<li><a href="{{ crumb.url }}"{% if forloop.last %} class="active"{% endif %}>{{ crumb.name }}</a></li>
{% if not forloop.last %}
<li><a href="{{ crumb.url }}">{{ crumb.name }}</a></li>
{% else %}
<li class="active">{{ crumb.name }}</li>
{% endif %}
{% endfor %}
{% endblock %}
{% block content %}

View File

@@ -1,22 +1,35 @@
{% extends "base.html" %}
{% block breadcrumb %}
{% for crumb in breadcrumbs %}
{% if not forloop.last %}
<li><a href="{{ crumb.url }}">{{ crumb.name }}</a></li>
{% else %}
<li class="active">{{ crumb.name }}</li>
{% endif %}
{% endfor %}
{% endblock %}
{% block content %}
<center>
<br/>
<a href="/comic/read/{{ file_name }}/{{ nav.next }}/">
<img src="/comic/read/{{ file_name }}/{{ nav.cur }}/img" height="900" class="img-rounded"></img>
<img src="/comic/read/{{ file_name }}/{{ nav.cur }}/img" height="900" class="img-rounded">
</a>
<br/>
<a href="/comic/read/{{ file_name }}/{{ nav.prev }}/">Prev</a>
{% if pages %}
<select>
{% for file in pages %}
<option value="{{ file.index }}" {% if nav.cur == file.index%}selected="True"{% endif %}>{{ file.name }}</option>
{% endfor %}
</select>
{% else %}
<p>No comics.</p>
{% endif %}
<a href="/comic/read/{{ file_name }}/{{ nav.next }}/">Next</a>
<div class="btn-group">
<a href="/comic/read/{{ file_name }}/{{ nav.prev }}/" class="btn btn-default">Prev</a>
{% if pages %}
<div class="btn-group dropup">
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle ">{{ orig_file_name}}<span class="caret"></span></button>
<ul class="dropdown-menu" id="dropdown-list">
{% for file in pages %}
<li><a href="/comic/read/{{ file_name }}/{{ file.index }}/">{{ file.name }}</a></li>
{% endfor %}
</ul>
</div>
{% else %}
<p>No comics.</p>
{% endif %}
<a href="/comic/read/{{ file_name }}/{{ nav.next }}/" class="btn btn-default">Next</a>
</div>
</center>
{% endblock %}