Ejemplo n.º 1
0
 def index():
     note = Notes()
     todays_note = note.get_todays_note()
     counts = note.get_notes_count()
     return render_template(
         'index.html',
         red=counts['red'],
         blue=counts['blue'],
         green=counts['green'],
         note=todays_note
     )
Ejemplo n.º 2
0
 def selected(type):
     note = Notes()
     todays_note = note.get_todays_note(type)
     colors = {
         'red': '#FF6666',
         'green': '#559955',
         'blue': '0000FF'
     }
     if todays_note:
         message = todays_note.note
     else:
         message = 'Sorry no note for this color today :('
     return render_template(
         'selected.html',
         color=colors[type],
         message=message,
         has_message=todays_note is not None
     )