added diary navigation to the diary template; moved diary directory on top of directory row
This commit is contained in:
+27
-2
@@ -7,7 +7,32 @@ from bottle import error, route, run, static_file, template
|
||||
# write diary
|
||||
|
||||
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():
|
||||
# for article in array (just 5 or something)
|
||||
@@ -120,7 +145,7 @@ def presskit():
|
||||
@route('/diary')
|
||||
def diary():
|
||||
"""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)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
% rebase('frame.tpl')
|
||||
|
||||
<div class="diary-dir"> </div>
|
||||
<div class="dir-row"> </div>
|
||||
<div class="diary-dir">
|
||||
{{nav}}
|
||||
</div>
|
||||
|
||||
<!--left column-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user