summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-22 22:45:23 +0100
committerJochen Topf <jochen@topf.org>2010-11-22 22:45:23 +0100
commit26f714820ff70ed4df4c0d5accc60ed77e475804 (patch)
tree5dc4ab053f30cb29fe100e2a64c8ecdccfae6c7e /web/lib
parent5b3162413b91fd185b922dc1a84c4fcc62fb4354 (diff)
downloadtaginfo-26f714820ff70ed4df4c0d5accc60ed77e475804.tar
taginfo-26f714820ff70ed4df4c0d5accc60ed77e475804.tar.gz
Added first version of pages for embedding into wiki
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/ui/embed.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/lib/ui/embed.rb b/web/lib/ui/embed.rb
new file mode 100644
index 0000000..6561da6
--- /dev/null
+++ b/web/lib/ui/embed.rb
@@ -0,0 +1,17 @@
+# web/lib/ui/embed.rb
+class Taginfo < Sinatra::Base
+
+ get '/embed/key' do
+ @key = params[:key]
+ @count = @db.select("SELECT count_all FROM db.keys").condition('key = ?', @key).get_first_value().to_i
+ erb :'embed/key', :layout => false
+ end
+
+ get '/embed/tag' do
+ @key = params[:key]
+ @value = params[:value]
+ @count = @db.select("SELECT count_all FROM db.tags").condition('key = ?', @key).condition('value = ?', @value).get_first_value().to_i
+ erb :'embed/tag', :layout => false
+ end
+
+end