diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-07 15:47:05 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-07 15:47:05 +0100 |
commit | a334668751ca122e0e34c77d297f60818e951df6 (patch) | |
tree | 608072104444ab955774f6eb7dc6ac4ac419c343 /web/views | |
parent | 6c3cf500cd115227148c8a8a8e8ce9c51ac337bc (diff) | |
download | taginfo-a334668751ca122e0e34c77d297f60818e951df6.tar taginfo-a334668751ca122e0e34c77d297f60818e951df6.tar.gz |
Empty table issue cleanup.
Sometimes there are not results for some query and you'll end up with an empty
table. It would be nice if no empty table appears in this case but instead some
nice message. But we can't simply remove the table, because if people use the
search-inside-table function and that was the result of the empty table they
loose the ability to change the search term.
We could only draw the table in the first place if there will be something in
it. But just finding out whether there will be something in the table can be
quite expensive, for instance with searches for values. So we don't want to do
this twice (once in the template to find out whether to draw the table in the
first place and once in the API call filling the table.) So we are currently
stuck with what we have until somebody invents a better way.
Diffstat (limited to 'web/views')
-rw-r--r-- | web/views/key.erb | 8 | ||||
-rw-r--r-- | web/views/tag.erb | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/web/views/key.erb b/web/views/key.erb index 8833eb6..14f952a 100644 --- a/web/views/key.erb +++ b/web/views/key.erb @@ -87,8 +87,12 @@ <option>Standard</option> </select> </form>--> - <table id="grid-josm"> - </table> +<% if @josm_count > 0 %> + <table id="grid-josm"> + </table> +<% else %> + <p class="empty"><%= t.pages.key.josm.no_styles %></p> +<% end %> </div> </div> <iframe id="josmiframe" name="josmiframe"></iframe> diff --git a/web/views/tag.erb b/web/views/tag.erb index caf436d..70ebd8c 100644 --- a/web/views/tag.erb +++ b/web/views/tag.erb @@ -57,8 +57,12 @@ <option>Standard</option> </select> </form>--> - <table id="grid-josm"> - </table> +<% if @josm_count > 0 %> + <table id="grid-josm"> + </table> +<% else %> + <p class="empty"><%= t.pages.key.josm.no_styles %></p> +<% end %> </div> </div> <iframe id="josmiframe" name="josmiframe"></iframe> |