added diary navigation to the diary template; moved diary directory on top of directory row

small-nav
chimchooree 4 years ago
parent 9a25c1a95e
commit b77700f2df

@ -7,7 +7,32 @@ from bottle import error, route, run, static_file, template
# write diary # write diary
def build_nav(): def build_nav():
return "nav" nav = "nav"
return nav
#function build_nav($page, $total) {
# echo '<div class="diary-dir">';
# $limit = 4;
# $min = max($page - $limit, 0);
#$max = min($page + $limit, $total);
# if($min > 0) {
# echo "<a href=diary.php?page=0>first</a>";
# }
# for($i = $min; $i < $max; $i++) {
# if ($i == $page) {
# echo "<strong>$i</strong>";
# } else {
# echo "<a href=diary.php?page=$i>$i</a>";
#}
# }
# if($max < $total) {
# $t = $total - 1;
# echo "<a href=diary.php?page=$t>last</a>";
#}
# echo '</div>';
#}
def make_latest(): def make_latest():
# for article in array (just 5 or something) # for article in array (just 5 or something)
@ -120,7 +145,7 @@ def presskit():
@route('/diary') @route('/diary')
def diary(): def diary():
"""diary page""" """diary page"""
info = {'css': 'diary', 'title': 'blessfrey - about the game', 'year': datetime.datetime.now(), 'snippets': list_snippets(sort_files(gather_files())), 'latest': make_latest()} info = {'css': 'diary', 'title': 'blessfrey - about the game', 'year': datetime.datetime.now(), 'snippets': list_snippets(sort_files(gather_files())), 'latest': make_latest(), 'nav': build_nav()}
return template('diary.tpl', info) return template('diary.tpl', info)
if __name__ == '__main__': if __name__ == '__main__':

@ -1,7 +1,9 @@
% rebase('frame.tpl') % rebase('frame.tpl')
<div class="diary-dir"> </div>
<div class="dir-row"> </div> <div class="dir-row"> </div>
<div class="diary-dir">
{{nav}}
</div>
<!--left column--> <!--left column-->

Loading…
Cancel
Save