diff options
author | Jochen Topf <jochen@topf.org> | 2012-01-23 09:40:31 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2012-01-23 09:40:31 +0100 |
commit | ce94aac91f0678c086622f3e62c86cfdd4ace17d (patch) | |
tree | 9ba4d044f6c97e628f6b3f0a0a17f7cd5761f145 | |
parent | 1fa2eacf8efc60c5dcc70f210de97d78780d1c2f (diff) | |
download | taginfo-ce94aac91f0678c086622f3e62c86cfdd4ace17d.tar taginfo-ce94aac91f0678c086622f3e62c86cfdd4ace17d.tar.gz |
Moved unused Potlatch stuff to test area. This needs some work before it is ready.
-rw-r--r-- | web/lib/ui/sources/db.rb | 9 | ||||
-rw-r--r-- | web/lib/ui/sources/josm.rb | 20 | ||||
-rw-r--r-- | web/lib/ui/sources/merkaartor.rb | 9 | ||||
-rw-r--r-- | web/lib/ui/sources/potlatch.rb | 38 | ||||
-rw-r--r-- | web/lib/ui/sources/wiki.rb | 9 | ||||
-rw-r--r-- | web/lib/ui/test.rb | 34 | ||||
-rwxr-xr-x | web/taginfo.rb | 5 | ||||
-rw-r--r-- | web/views/sources/potlatch/features.erb | 0 | ||||
-rw-r--r-- | web/views/sources/potlatch/index.erb | 7 | ||||
-rw-r--r-- | web/views/test/index.erb | 1 | ||||
-rw-r--r-- | web/views/test/potlatch/categories.erb (renamed from web/views/sources/potlatch/categories.erb) | 2 | ||||
-rw-r--r-- | web/views/test/potlatch/category.erb (renamed from web/views/sources/potlatch/category.erb) | 2 | ||||
-rw-r--r-- | web/views/test/potlatch/feature.erb (renamed from web/views/sources/potlatch/feature.erb) | 2 | ||||
-rw-r--r-- | web/views/test/potlatch/index.erb | 6 |
14 files changed, 44 insertions, 100 deletions
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 diff --git a/web/taginfo.rb b/web/taginfo.rb index 1b60efe..b4b1426 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -339,11 +339,6 @@ class Taginfo < Sinatra::Base load 'lib/ui/search.rb' load 'lib/ui/reports.rb' - load 'lib/ui/sources/db.rb' - load 'lib/ui/sources/wiki.rb' - load 'lib/ui/sources/josm.rb' - load 'lib/ui/sources/potlatch.rb' - load 'lib/ui/sources/merkaartor.rb' load 'lib/ui/embed.rb' load 'lib/ui/test.rb' diff --git a/web/views/sources/potlatch/features.erb b/web/views/sources/potlatch/features.erb deleted file mode 100644 index e69de29..0000000 --- a/web/views/sources/potlatch/features.erb +++ /dev/null diff --git a/web/views/sources/potlatch/index.erb b/web/views/sources/potlatch/index.erb deleted file mode 100644 index 5a1a289..0000000 --- a/web/views/sources/potlatch/index.erb +++ /dev/null @@ -1,7 +0,0 @@ -<h1><img src="/img/sources/potlatch.32.png" alt="" title="Potlatch"/> Potlatch</h1> - -<ul> - <li><a href="/sources/potlatch/categories">Categories</a></li> - <li><a href="/sources/potlatch/features">Features</a></li> -</ul> - diff --git a/web/views/test/index.erb b/web/views/test/index.erb index d767526..db0cb48 100644 --- a/web/views/test/index.erb +++ b/web/views/test/index.erb @@ -7,5 +7,6 @@ <ul> <li><a href="/test/tags">Tags</a></li> <li><a href="/test/wiki_import">Wiki import</a></li> + <li><a href="/test/potlatch">Potlatch</a></li> </ul> </div> diff --git a/web/views/sources/potlatch/categories.erb b/web/views/test/potlatch/categories.erb index 3aa75d1..97725a3 100644 --- a/web/views/sources/potlatch/categories.erb +++ b/web/views/test/potlatch/categories.erb @@ -9,7 +9,7 @@ </tr><tr> <td class="content" id="categories"> <% @categories.each do |row| %> - <div> <a href="/sources/potlatch/categories#<%= escape row['id'] %>"><%= row['name'] %></a></div> + <div> <a href="/test/potlatch/categories#<%= escape row['id'] %>"><%= row['name'] %></a></div> <% end %> </div> <td class="arrow">❱</td> diff --git a/web/views/sources/potlatch/category.erb b/web/views/test/potlatch/category.erb index 2355ec6..396e426 100644 --- a/web/views/sources/potlatch/category.erb +++ b/web/views/test/potlatch/category.erb @@ -1,5 +1,5 @@ <% @features.each do |row| %> - <div> <a href="/sources/potlatch/features/<%= escape row['name'] %>"><%= row['name'] %></a></div> + <div> <a href="/test/potlatch/features/<%= escape row['name'] %>"><%= row['name'] %></a></div> <% end %> <script type="text/javascript"> jQuery('#features a').bind('click', function() { diff --git a/web/views/sources/potlatch/feature.erb b/web/views/test/potlatch/feature.erb index 6e53f0b..fd864c9 100644 --- a/web/views/sources/potlatch/feature.erb +++ b/web/views/test/potlatch/feature.erb @@ -2,7 +2,7 @@ <p style="background: #ffffff; padding: 4px; -moz-border-radius: 3px; text-align: center; min-height: 36px; vertical-align: middle;"> <% if @feature['icon_image'] %> - <img src="/sources/potlatch/icon/<%= @feature['icon_image'] %>" alt="Icon" title="Icon"/> + <img src="/test/potlatch/icon/<%= @feature['icon_image'] %>" alt="Icon" title="Icon"/> <% end %> </p> diff --git a/web/views/test/potlatch/index.erb b/web/views/test/potlatch/index.erb new file mode 100644 index 0000000..3fb0428 --- /dev/null +++ b/web/views/test/potlatch/index.erb @@ -0,0 +1,6 @@ +<h1>Potlatch</h1> + +<ul> + <li><a href="/test/potlatch/categories">Categories</a></li> +</ul> + |