From ce94aac91f0678c086622f3e62c86cfdd4ace17d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Mon, 23 Jan 2012 09:40:31 +0100 Subject: Moved unused Potlatch stuff to test area. This needs some work before it is ready. --- web/lib/ui/sources/db.rb | 9 --------- web/lib/ui/sources/josm.rb | 20 -------------------- web/lib/ui/sources/merkaartor.rb | 9 --------- web/lib/ui/sources/potlatch.rb | 38 -------------------------------------- web/lib/ui/sources/wiki.rb | 9 --------- web/lib/ui/test.rb | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 34 insertions(+), 85 deletions(-) delete mode 100644 web/lib/ui/sources/db.rb delete mode 100644 web/lib/ui/sources/josm.rb delete mode 100644 web/lib/ui/sources/merkaartor.rb delete mode 100644 web/lib/ui/sources/potlatch.rb delete mode 100644 web/lib/ui/sources/wiki.rb (limited to 'web/lib') diff --git a/web/lib/ui/sources/db.rb b/web/lib/ui/sources/db.rb deleted file mode 100644 index a1b6939..0000000 --- a/web/lib/ui/sources/db.rb +++ /dev/null @@ -1,9 +0,0 @@ -# web/lib/ui/sources/db.rb -class Taginfo < Sinatra::Base - - get! '/sources/db' do - @title = 'Database' - erb :'sources/db' - end - -end diff --git a/web/lib/ui/sources/josm.rb b/web/lib/ui/sources/josm.rb deleted file mode 100644 index 1583155..0000000 --- a/web/lib/ui/sources/josm.rb +++ /dev/null @@ -1,20 +0,0 @@ -# web/lib/ui/sources/josm.rb -class Taginfo < Sinatra::Base - - get! '/sources/josm' do - @title = 'JOSM' - erb :'sources/josm/index' - end - - get! '/sources/josm/styles' do - @title = ['Styles', 'JOSM'] - erb :'sources/josm/styles' - end - - get '/sources/josm/styles/:style' do - @stylename = h(params[:style]) - @title = [@stylename, 'Styles', 'JOSM'] - erb :'sources/josm/style' - end - -end diff --git a/web/lib/ui/sources/merkaartor.rb b/web/lib/ui/sources/merkaartor.rb deleted file mode 100644 index 96b3d19..0000000 --- a/web/lib/ui/sources/merkaartor.rb +++ /dev/null @@ -1,9 +0,0 @@ -# web/lib/ui/sources/merkaartor.rb -class Taginfo < Sinatra::Base - - get! '/sources/merkaartor' do - @title = 'Merkaartor' - erb :'sources/merkaartor/index' - end - -end diff --git a/web/lib/ui/sources/potlatch.rb b/web/lib/ui/sources/potlatch.rb deleted file mode 100644 index 3db69e5..0000000 --- a/web/lib/ui/sources/potlatch.rb +++ /dev/null @@ -1,38 +0,0 @@ -# web/lib/ui/sources/potlatch.rb -class Taginfo < Sinatra::Base - - get! '/sources/potlatch' do - @title = 'Potlatch' - - erb :'sources/potlatch/index' - end - - get '/sources/potlatch/categories' do - @title = 'Potlatch Features' - - @categories = @db.execute('SELECT * FROM potlatch.categories ORDER BY name') - - erb :'sources/potlatch/categories' - end - - get '/sources/potlatch/categories/:category' do - @category = params[:category] - @features = @db.execute('SELECT * FROM potlatch.features WHERE category_id=? ORDER BY name', @category) - - erb :'sources/potlatch/category', :layout => false - end - - get '/sources/potlatch/features/:feature' do - @feature_name = params[:feature] - @feature = @db.execute('SELECT * FROM potlatch.features WHERE name=?', @feature_name)[0] - @tags = @db.execute('SELECT * FROM potlatch.tags WHERE feature_name=? ORDER BY key, value', @feature_name) - - erb :'sources/potlatch/feature', :layout => false - end - - get %r{/sources/potlatch/icon/(.*)} do |icon| - content_type :png - send_file('../../var/sources/potlatch/resources/' + icon) - end - -end diff --git a/web/lib/ui/sources/wiki.rb b/web/lib/ui/sources/wiki.rb deleted file mode 100644 index 5260a36..0000000 --- a/web/lib/ui/sources/wiki.rb +++ /dev/null @@ -1,9 +0,0 @@ -# web/lib/ui/sources/wiki.rb -class Taginfo < Sinatra::Base - - get! '/sources/wiki' do - @title = 'Wiki' - erb :'sources/wiki/index' - end - -end diff --git a/web/lib/ui/test.rb b/web/lib/ui/test.rb index 296ecf6..2be2af0 100644 --- a/web/lib/ui/test.rb +++ b/web/lib/ui/test.rb @@ -25,4 +25,38 @@ class Taginfo < Sinatra::Base erb :'test/wiki_import' end + get! '/test/potlatch' do + @title = 'Potlatch' + + erb :'test/potlatch/index' + end + + get '/test/potlatch/categories' do + @title = 'Potlatch Features' + + @categories = @db.execute('SELECT * FROM potlatch.categories ORDER BY name') + + erb :'test/potlatch/categories' + end + + get '/test/potlatch/categories/:category' do + @category = params[:category] + @features = @db.execute('SELECT * FROM potlatch.features WHERE category_id=? ORDER BY name', @category) + + erb :'test/potlatch/category', :layout => false + end + + get '/test/potlatch/features/:feature' do + @feature_name = params[:feature] + @feature = @db.execute('SELECT * FROM potlatch.features WHERE name=?', @feature_name)[0] + @tags = @db.execute('SELECT * FROM potlatch.tags WHERE feature_name=? ORDER BY key, value', @feature_name) + + erb :'test/potlatch/feature', :layout => false + end + + get %r{/test/potlatch/icon/(.*)} do |icon| + content_type :png + send_file('../../var/sources/potlatch/resources/' + icon) + end + end -- cgit v1.2.3