def notifications(): unread_links = database.get_matching_links(unread=True, starred=False, archived=False) result = { 'success': True, 'value': len(unread_links) } return jsonify(result)
def starred(): options = { "time": datetime.now(), "title": "Starred - Linkbucket", "viewmode_visible": False, "active_page": 1, "counts": database.get_counts(), } links = database.get_matching_links(starred=True) links.extend(database.get_matching_links(starred=True, unread=True)) links = sorted(links, key=lambda link: link.date, reverse=True) stats = database.get_stats() stats.move_history_if_necessary() stats.increment_views() return render_template("link_view.html", options=options, links=links)
def archive(): options = { "time": datetime.now(), "title": "Archive - Linkbucket", "viewmode_visible": False, "active_page": 2, "counts": database.get_counts(), } links = database.get_matching_links(archived=True) stats = database.get_stats() stats.move_history_if_necessary() stats.increment_views() return render_template("link_view.html", options=options, links=links)