Commits

Kenneth Love committed 25a1ea8 Merge

merge

Comments (0)

Files changed (2)

+"""
+TODO
+"""
+__author__ = 'Chris Jones, Kenneth Love'
+__version__ = '0.8.1'
+__license__ = 'MIT'
+
 import re
 
 from flask import Flask, render_template, redirect, url_for, request, flash
             output = [r.lindex(key, n) for n in xrange(r.llen(key))]
         else:
             output = r.get(key)
-        return render_template('key.html', rtype=rtype, key=key, output=output)
+        return render_template('key.html', rtype=rtype, key=key, output=output,
+            ttl=r.ttl(key))
     else:
         return render_template('no_key.html', key=key)
 

templates/key.html

 <article>
 	<header>
 		<h2>{{ rtype }}</h2>
+		{% if ttl %}
+		<h3>Key expires in: {{ ttl }} seconds</h3>
+		{% endif %}
 	</header>
-	<form action="{{ url_for('save', key=key) }}" method="post" 
-		id="key">
+	<form action="{{ url_for('save', key=key) }}" method="post" id="key">
 		<textarea name="value" cols="60" rows="20">{{ output }}</textarea>
 		<div id="controls">
 			<a id="refresh" href="{{ url_for('key', key=key) }}" title="refresh">refresh</a>