worlddb-admin 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Manifest.txt +34 -0
  3. data/app/assets/javascripts/world_db_admin/application.js +15 -0
  4. data/app/assets/stylesheets/world_db_admin/application.css.scss +98 -0
  5. data/app/controllers/world_db_admin/cities_controller.rb +28 -0
  6. data/app/controllers/world_db_admin/codes_controller.rb +14 -0
  7. data/app/controllers/world_db_admin/continents_controller.rb +16 -0
  8. data/app/controllers/world_db_admin/countries_controller.rb +142 -0
  9. data/app/controllers/world_db_admin/langs_controller.rb +14 -0
  10. data/app/controllers/world_db_admin/pages_controller.rb +12 -0
  11. data/app/controllers/world_db_admin/regions_controller.rb +25 -0
  12. data/app/controllers/world_db_admin/tags_controller.rb +34 -0
  13. data/app/controllers/world_db_admin/world_db_admin_controller.rb +9 -0
  14. data/app/helpers/world_db_admin/application_helper.rb +82 -0
  15. data/app/helpers/world_db_admin/part_helper.rb +58 -0
  16. data/app/helpers/world_db_admin/routes_helper.rb +65 -0
  17. data/app/views/layouts/world_db_admin/world_db_admin.html.erb +36 -0
  18. data/app/views/world_db_admin/cities/index.html.erb +43 -0
  19. data/app/views/world_db_admin/codes/index.html.erb +105 -0
  20. data/app/views/world_db_admin/continents/index.html.erb +56 -0
  21. data/app/views/world_db_admin/countries/_countries.html.erb +39 -0
  22. data/app/views/world_db_admin/countries/index.html.erb +51 -0
  23. data/app/views/world_db_admin/countries/index_territories.html.erb +31 -0
  24. data/app/views/world_db_admin/countries/show.html.erb +116 -0
  25. data/app/views/world_db_admin/langs/index.html.erb +28 -0
  26. data/app/views/world_db_admin/pages/about.html.erb +65 -0
  27. data/app/views/world_db_admin/pages/index.html.erb +2 -0
  28. data/app/views/world_db_admin/regions/index.html.erb +54 -0
  29. data/app/views/world_db_admin/shared/_cities.html.erb +11 -0
  30. data/app/views/world_db_admin/shared/_countries.html.erb +23 -0
  31. data/app/views/world_db_admin/shared/_regions.html.erb +22 -0
  32. data/app/views/world_db_admin/shared/_tags.html.erb +11 -0
  33. data/app/views/world_db_admin/tags/index.html.erb +15 -0
  34. data/app/views/world_db_admin/tags/show.html.erb +63 -0
  35. data/app/views/world_db_admin/tags/template.txt.erb +6 -0
  36. data/config/routes.rb +40 -0
  37. data/lib/worlddb/admin/version.rb +1 -1
  38. metadata +35 -1
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>world.db Web Admin</title>
5
+ <%= stylesheet_link_tag "world_db_admin/application", :media => "all" %>
6
+ <%= javascript_include_tag "world_db_admin/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <p>
12
+ <%= link_to 'Continents', continents_path() %> &bull;
13
+ <%= link_to 'Countries', countries_path() %> &bull;
14
+ <%= link_to 'Territories', territories_path() %> &bull;
15
+ <%= link_to 'Regions', regions_path() %> &bull;
16
+ <%= link_to 'Cities', cities_path() %> &bull;
17
+ <%= link_to 'Tags', tags_path() %> &bull;
18
+ <%= link_to 'Languages', langs_path() %> &bull;
19
+ <%= link_to 'Codes', codes_path() %> &bull;
20
+ <%= link_to 'About', about_path() %> .::.
21
+
22
+ <!-- fix: use named url_helper for /api -->
23
+ <%= link_to "Web Service Demo & Docu / HTTP API (JSON / CSV)", '/api' %>
24
+ <!-- todo: add some more links -->
25
+ </p>
26
+
27
+ <div class='content'>
28
+ <%= yield %>
29
+ </div>
30
+
31
+ <div class='version'>
32
+ <%= powered_by %>
33
+ </div>
34
+
35
+ </body>
36
+ </html>
@@ -0,0 +1,43 @@
1
+
2
+ <h3><%= City.count %> Cities</h3>
3
+
4
+ <p>
5
+ Sort By: <%= link_to 'Key A-Z', cities_path( :order => 'key' ) %>
6
+ &bull;
7
+ <%= link_to 'Title A-Z', cities_path( :order => 'title' ) %>
8
+ &bull;
9
+ <%= link_to 'Population', cities_path( :order => 'pop' ) %>
10
+ &bull;
11
+ <%= link_to 'Metro Population', cities_path( :order => 'popm' ) %>
12
+
13
+ &nbsp; &nbsp; | &nbsp; &nbsp;
14
+
15
+ Download: <%= link_to 'CSV', csv_cities_path(), :title => 'Comma-separated values; tabular data in plain text' %>
16
+ &bull;
17
+ <%= link_to 'Table', table_cities_path(), :title => 'Hypertext table' %>
18
+ </p>
19
+
20
+
21
+ <table>
22
+
23
+ <% @cities.each do |city| %>
24
+ <tr>
25
+ <td class='city-key'><a name='<%= city.key %>'></a><%= city.key %></td>
26
+ <td><%= city.title_w_synonyms %></td>
27
+ <td><%= number_to_human( city.pop ) %></td>
28
+ <td>
29
+ <% if city.popm.present? %>
30
+ M: <%= number_to_human( city.popm ) %>
31
+ <% end %>
32
+ </td>
33
+ <td>
34
+ <%= image_tag_for_country( city.country ) %>
35
+ <%= link_to city.country.title, short_country_path( city.country ) %>
36
+ <% if city.region.present? %>
37
+ &gt; <%= city.region.title %>
38
+ <% end %>
39
+ </td>
40
+ </tr>
41
+ <% end %>
42
+
43
+ </table>
@@ -0,0 +1,105 @@
1
+
2
+
3
+ <h3><%= Country.count %> Countries </h3>
4
+
5
+
6
+ <table>
7
+ <tr>
8
+ <td></td>
9
+ <td>TLD</td>
10
+ <td></td>
11
+ <td>FIFA</td>
12
+ <td></td>
13
+ <td>ISO3</td>
14
+ <td>Motor</td>
15
+ <td>UN?</td>
16
+ <td>FIFA?</td>
17
+ <td>Languages</td>
18
+ </tr>
19
+
20
+ <% @countries.each do |country| %>
21
+ <tr>
22
+ <td class='country-key'><%= country.key %></td>
23
+ <td style='white-space: nowrap;'>
24
+ <% if country.net.present? %>
25
+ <% if country.net != country.key %>
26
+ <span class='code-ne'>&ne; .<%= country.net %></span>
27
+ <% else %>
28
+ .<%= country.net %>
29
+ <% end %>
30
+ <% else %>
31
+ <span class='code-x'>x</span>
32
+ <% end %>
33
+ </td>
34
+ <td>
35
+ <%= country.title %>
36
+ <span class='country-key'>
37
+ <%= '*supra' if country.is_supra? %>
38
+ <%= '*dependency' if country.is_dependency? %>
39
+ </span>
40
+ </td>
41
+ <td style='white-space: nowrap;'>
42
+ <% if country.fifa.present? %>
43
+ <% if country.fifa != country.code %>
44
+ <span class='code-ne'><%= country.fifa %> &ne;</span>
45
+ <% else %>
46
+ <%= country.fifa %>
47
+ <% end %>
48
+ <% else %>
49
+ <span class='code-x'>x</span>
50
+ <% end %>
51
+ </td>
52
+ <td><%= country.code %></td>
53
+ <td style='white-space: nowrap;'>
54
+ <% if country.iso3.present? %>
55
+ <% if country.iso3 != country.code %>
56
+ <span class='code-ne'>&ne; <%= country.iso3 %></span>
57
+ <% else %>
58
+ <%= country.iso3 %>
59
+ <% end %>
60
+ <% else %>
61
+ <span class='code-x'>x</span>
62
+ <% end %>
63
+ </td>
64
+ <td>
65
+ <% if country.motor.present? %>
66
+ <%= country.motor %>
67
+ <% else %>
68
+ <span class='code-x'>x</span>
69
+ <% end %>
70
+ </td>
71
+ <td>
72
+ <!-- check if un tag present
73
+ fix: find a better way!! -->
74
+ <% tags = country.tags.top.select { |tag| tag.key == 'un' } %>
75
+ <% if tags.size > 0 %>
76
+ Yes
77
+ <% else %>
78
+ <span class='code-x'>x</span>
79
+ <% end %>
80
+ </td>
81
+ <td>
82
+ <!-- check if un tag present
83
+ fix: find a better way!! -->
84
+ <% tags = country.tags.top.select { |tag| tag.key == 'fifa' } %>
85
+ <% if tags.size > 0 %>
86
+ Yes
87
+ <% else %>
88
+ <span class='code-x'>x</span>
89
+ <% end %>
90
+ </td>
91
+ <td>
92
+ <% if country.langs.count > 0 %>
93
+ <% country.langs.each_with_index do |lang,index| %>
94
+ <span class='lang-key'>
95
+ <%= lang.key %>
96
+ </span>
97
+ <%= lang.title %>
98
+ <% end %>
99
+ <% else %>
100
+ <span class='code-x'>x</span>
101
+ <% end %>
102
+ </td>
103
+ </tr>
104
+ <% end %><!-- each country -->
105
+ </table>
@@ -0,0 +1,56 @@
1
+ <h3><%= @continents.count %> Continents /
2
+ <%= Country.where(s:true).count %> Supras /
3
+ <%= Country.where(c:true).count %> Countries /
4
+ <%= Country.where(d:true).count %> Territories
5
+ </h3>
6
+
7
+
8
+
9
+
10
+ <p>
11
+ Sort By: <%= link_to 'Key A-Z', continents_path( :order => 'key' ) %>
12
+ &bull;
13
+ <%= link_to 'Title A-Z', continents_path( :order => 'title' ) %>
14
+ &bull;
15
+ <%= link_to 'Code A-Z', continents_path( :order => 'code' ) %>
16
+ &bull;
17
+ <%= link_to 'Population', continents_path( :order => 'pop' ) %>
18
+ &bull;
19
+ <%= link_to 'Area (in km²)', continents_path( :order => 'area' ) %>
20
+ </p>
21
+
22
+
23
+
24
+ <% Continent.all.each do |continent| %>
25
+
26
+ <h4>
27
+ <%= continent.title %>
28
+ </h4>
29
+
30
+ <% count = continent.countries.where( s: true ).count
31
+ if count > 0
32
+ %>
33
+ <p>
34
+ <%= render_countries( continent.countries.where( s: true ), order: @order, count: count ) %>
35
+ </p>
36
+ <% end %>
37
+
38
+
39
+ <% count = continent.countries.where( c: true ).count
40
+ if count > 0
41
+ %>
42
+ <p>
43
+ <%= render_countries( continent.countries.where( c: true ), order: @order, count: count ) %>
44
+ </p>
45
+ <% end %>
46
+
47
+
48
+ <% count = continent.countries.where( d: true ).count
49
+ if count > 0
50
+ %>
51
+ <p>
52
+ <%= render_countries( continent.countries.where( d: true ), order: @order, count: count ) %>
53
+ </p>
54
+ <% end %>
55
+
56
+ <% end %><!-- each continent -->
@@ -0,0 +1,39 @@
1
+
2
+ <table>
3
+ <% countries.each do |country| %>
4
+ <tr>
5
+ <td>
6
+ <%= country.continent.title if country.continent.present? %>
7
+ </td>
8
+ <td class='country-key' style='vertical-align: baseline;'>
9
+ <%= country.key %>
10
+ </td>
11
+ <td style='vertical-align: baseline;'>
12
+ <%= image_tag_for_country( country ) %>
13
+ </td>
14
+ <td style='vertical-align: baseline;'>
15
+ <span style='white-space: nowrap;'>
16
+ <%= link_to "#{country.title} (#{country.code})", short_country_path( country ) %>
17
+ </span>
18
+ <br>
19
+ <%= render_tags( country.tags.top ) %>
20
+ </td>
21
+ <td style='white-space: nowrap; vertical-align: baseline;'>
22
+ <%= number_to_human( country.pop ) %>
23
+ </td>
24
+ <td style='white-space: nowrap; vertical-align: baseline;'>
25
+ <%= number_to_human( country.area ) %> km²
26
+ </td>
27
+
28
+ <td style='vertical-align: baseline; text-align: right;'>
29
+ <span class='city-count'>
30
+ (<%= country.cities.count %>)
31
+ </span>
32
+ </td>
33
+ <td style='vertical-align: baseline;'>
34
+ <%= render_cities( country.cities ) %>
35
+ </td>
36
+ </tr>
37
+
38
+ <% end %><!-- each country -->
39
+ </table>
@@ -0,0 +1,51 @@
1
+
2
+
3
+ <h3><%= @countries.count %> Countries / <%= City.count %> Cities</h3>
4
+
5
+ <p>
6
+ All
7
+ <span class='country-count'>
8
+ (<%= @countries.count %>)
9
+ </span>
10
+ <% Continent.all.each do |continent| %>
11
+ &bull;
12
+ <%= continent.title %>
13
+ <span class='country-count'>
14
+ (<%= continent.countries.where( c: true ).count %>)
15
+ </span>
16
+ <% end %>
17
+ </p>
18
+
19
+
20
+
21
+ <p>
22
+ Sort By: <%= link_to 'A-Z', countries_path( :order => 'title' ) %>
23
+ &bull;
24
+ <%= link_to 'Population', countries_path( :order => 'pop' ) %>
25
+ &bull;
26
+ <%= link_to 'Area (in km²)', countries_path( :order => 'area' ) %>
27
+
28
+
29
+ &nbsp; &nbsp; | &nbsp; &nbsp;
30
+
31
+ Download:
32
+
33
+ <%= link_to 'CSV', csv_countries_path(), :title => 'Comma-separated values; tabular data in plain text' %>
34
+ &bull;
35
+ <%= link_to 'Table', table_countries_path(), :title => 'Hypertext table' %>
36
+ </p>
37
+
38
+
39
+ <!--
40
+ <p>
41
+ Filter By:
42
+ <%# COUNTRY_FILTER_TAGS.each_with_index do |tag,index| %>
43
+ <%# if index > 0 %>
44
+ &bull;
45
+ <%# end %>
46
+ <%#= link_to tag, countries_path( :tag => tag ) %>
47
+ <%# end %>
48
+ </p>
49
+ -->
50
+
51
+ <%= render :partial => 'countries', :locals => { :countries => @countries } %>
@@ -0,0 +1,31 @@
1
+
2
+
3
+ <h3><%= @countries.count %> Territories / <%= City.count %> Cities</h3>
4
+
5
+ <p>
6
+ All
7
+ <span class='country-count'>
8
+ (<%= @countries.count %>)
9
+ </span>
10
+ <% Continent.all.each do |continent| %>
11
+ &bull;
12
+ <%= continent.title %>
13
+ <span class='country-count'>
14
+ (<%= continent.countries.where( d: true ).count %>)
15
+ </span>
16
+ <% end %>
17
+ </p>
18
+
19
+
20
+
21
+ <p>
22
+ Sort By: <%= link_to 'A-Z', territories_path( :order => 'title' ) %>
23
+ &bull;
24
+ <%= link_to 'Population', territories_path( :order => 'pop' ) %>
25
+ &bull;
26
+ <%= link_to 'Area (in km²)', territories_path( :order => 'area' ) %>
27
+ </p>
28
+
29
+
30
+
31
+ <%= render :partial => 'countries', :locals => { :countries => @countries } %>
@@ -0,0 +1,116 @@
1
+
2
+ <h3>
3
+ <%= image_tag_for_country( @country, size: '64x64' ) %>
4
+
5
+ <!-- fix: use full_title e.g. is title (code) -->
6
+ <%= @country.title %>
7
+ (<%= @country.code %>)
8
+
9
+
10
+ <% if @country.parent.present? %>
11
+ / Part of
12
+ <%= image_tag_for_country( @country.parent ) %>
13
+ <%= link_to "#{@country.parent.title} (#{@country.parent.code})", short_country_path( @country.parent ) %>
14
+ <% end %>
15
+
16
+ </h3>
17
+
18
+ <p>
19
+ <%= render_tags( @country.tags.top ) %>
20
+ </p>
21
+
22
+ <% if @country.langs.count > 0 %>
23
+ <h4><%= @country.langs.count %> Languages</h4>
24
+ <p>
25
+ <% @country.langs.each_with_index do |lang,index| %>
26
+ <%= '•' if index > 0 %>
27
+ <span class='lang-key'>
28
+ <%= lang.key %>
29
+ </span>
30
+ <%= lang.title %>
31
+
32
+ <% end %><!-- each lang -->
33
+ </p>
34
+ <% end %>
35
+
36
+
37
+ <% if @country.countries.count > 0 %>
38
+ <h4><%= @country.countries.count %> Countries</h4>
39
+
40
+ <table>
41
+ <% @country.countries.each do |country| %>
42
+ <tr>
43
+ <td class='country-key' style='vertical-align: baseline;'>
44
+ <%= country.key %>
45
+ </td>
46
+ <td style='vertical-align: baseline;'>
47
+ <%= image_tag_for_country( country ) %>
48
+ </td>
49
+ <td style='vertical-align: baseline;'>
50
+ <%= link_to country.title_w_synonyms, short_country_path( country ) %>
51
+ <br>
52
+ <%= render_tags( country.tags.top ) %>
53
+ </td>
54
+ </tr>
55
+ <% end %> <!-- each region -->
56
+ </table>
57
+
58
+ <% end %>
59
+
60
+
61
+
62
+ <h4><%= @country.regions.count %> Regions</h4>
63
+
64
+ <table>
65
+ <% @country.regions.each do |region| %>
66
+ <tr>
67
+ <td class='region-key' style='vertical-align: baseline;'>
68
+ <a name='<%= region.key %>'></a><!-- todo: use anchor helper, exists? check it -->
69
+ <%= region.key %>
70
+ </td>
71
+ <td style='vertical-align: baseline;'>
72
+ <%= region.title_w_synonyms %>
73
+ <br>
74
+ <%= render_tags( region.tags ) %>
75
+ </td>
76
+ <td style='vertical-align: baseline;'>
77
+ <span class='city-count'>
78
+ (<%= region.cities.count %>)
79
+ </span>
80
+ </td>
81
+ <td style='vertical-align: baseline;'>
82
+ <%= render_cities( region.cities) %>
83
+ </td>
84
+ </tr>
85
+ <% end %> <!-- each region -->
86
+ </table>
87
+
88
+
89
+
90
+
91
+
92
+ <h4><%= @country.cities.count %> Cities</h4>
93
+
94
+ <table>
95
+ <% @country.cities.each do |city| %>
96
+ <tr>
97
+ <td class='city-key'>
98
+ <%= city.key %>
99
+ </td>
100
+ <td>
101
+ <%= city.title_w_synonyms %>
102
+ </td>
103
+ <td>
104
+ <%= number_to_human( city.pop ) %>
105
+ </td>
106
+ <td>
107
+ <% if city.popm.present? %>
108
+ M: <%= number_to_human( city.popm ) %>
109
+ <% end %>
110
+ </td>
111
+ <td>
112
+ <%= city.region.title if city.region.present? %>
113
+ </td>
114
+ </tr>
115
+ <% end %> <!-- each city -->
116
+ </table>
@@ -0,0 +1,28 @@
1
+
2
+ <h3><%= Lang.count %> Languages</h3>
3
+
4
+ <table>
5
+ <% @langs.each do |lang| %>
6
+
7
+ <tr>
8
+ <td class='lang-key'>
9
+ <%= lang.key %>
10
+ </td>
11
+ <td>
12
+ <%= lang.title %>
13
+ </td>
14
+ <td>
15
+ <span class='lang-count'>
16
+ (<%= lang.countries.count %>)
17
+ </span>
18
+ </td>
19
+ <td>
20
+ <% lang.countries.each_with_index do |country,index| %>
21
+ <%= '•' if index > 0 %>
22
+ <%= image_tag_for_country( country ) %>
23
+ <%= link_to country.title, short_country_path( country ) %>
24
+ <% end %><!-- each country -->
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ </table>
@@ -0,0 +1,65 @@
1
+
2
+
3
+ <h2>What's <code>world.db</code>?</h2>
4
+
5
+ <p>
6
+ A free open world database &amp; schema.
7
+ <a href="https://github.com/geraldb/world.db">More &raquo;</a>
8
+ </p>
9
+
10
+ <hr>
11
+
12
+
13
+ <table>
14
+ <tr><td style='text-align: right'><%= Country.count %> </td><td>Countries</td></tr>
15
+ <tr><td style='text-align: right'><%= Region.count %> </td><td>Regions</td></tr>
16
+ <tr><td style='text-align: right'><%= City.count %> </td><td>Cities</td></tr>
17
+ <tr><td style='text-align: right'><%= Tag.count %> </td><td>Tags</td></tr>
18
+ <tr><td style='text-align: right'><%= Tagging.count %> </td><td>Taggings</td></tr>
19
+ <tr><td style='text-align: right'><%= Lang.count %> </td><td>Lang</td></tr>
20
+ <tr><td style='text-align: right'><%= Usage.count %> </td><td>Usage</td></tr>
21
+ <tr><td></td><td></td></tr>
22
+ <tr><td style='text-align: right'><%= Country.count+
23
+ Region.count+
24
+ City.count + Tag.count + Tagging.count + Lang.count + Usage.count %></td><td>Total</td></tr>
25
+ </table>
26
+
27
+
28
+ <h3><%= Country.count %> Countries </h3>
29
+
30
+ <!-- all countries tag cloud style -->
31
+ <p>
32
+ <% Country.by_key.each_with_index do |country,index| %>
33
+
34
+ <% if index > 0 %>
35
+ &bull;
36
+ <% end %>
37
+
38
+ <span class='country-key'>
39
+ <%= country.key %>
40
+ </span>
41
+ <%= link_to country.title_w_synonyms, short_country_path( country ),
42
+ :title => "#{number_to_human(country.pop)} / #{number_to_human(country.area)} km²",
43
+ :class => country_style( country ) %>
44
+ <% end %>
45
+ </p>
46
+
47
+
48
+ <h3><%= City.count %> Cities </h3>
49
+
50
+ <!-- all cities tag cloud style -->
51
+ <p>
52
+ <% City.by_key.each_with_index do |city,index| %>
53
+
54
+ <% if index > 0 %>
55
+ &bull;
56
+ <% end %>
57
+
58
+ <span class='city-key'>
59
+ <%= city.key %>
60
+ </span>
61
+ <%= link_to city.title_w_synonyms, short_city_path( city ),
62
+ :title => "#{number_to_human(city.pop)} / M: #{number_to_human(city.popm)}",
63
+ :class => city_style( city ) %>
64
+ <% end %>
65
+ </p>
@@ -0,0 +1,2 @@
1
+ <h1>Pages#index</h1>
2
+ <p>Find me in app/views/pages/index.html.erb</p>
@@ -0,0 +1,54 @@
1
+
2
+ <h3><%= Region.count %> Regions</h3>
3
+
4
+ <table>
5
+ <% @countries.each do |country| %>
6
+
7
+ <% if country.regions.count > 0 %>
8
+ <tr>
9
+ <td class='country-key' style='vertical-align: baseline;'>
10
+ <%= country.key %>
11
+ </td>
12
+ <td style='white-space: nowrap; vertical-align: baseline;'>
13
+ <%= image_tag_for_country( country ) %>
14
+ <%= link_to "#{country.title} (#{country.code})", short_country_path( country ) %>
15
+
16
+ <span class='city-count'>
17
+ (<%= country.regions.count %>)
18
+ </span>
19
+ </td>
20
+ <td>
21
+
22
+ <table>
23
+ <% country.regions.each do |region| %>
24
+ <tr>
25
+ <td class='region-key' style='vertical-align: baseline;'>
26
+ <%= region.key %>
27
+ </td>
28
+ <td style='vertical-align: baseline;'>
29
+ <%= region.title_w_synonyms %>
30
+ <br>
31
+ <%= render_tags( region.tags ) %>
32
+ </td>
33
+ <td style='vertical-align: baseline; text-align: right;'>
34
+ <span class='city-count'>
35
+ (<%= region.cities.count %>)
36
+ </span>
37
+ </td>
38
+ <td style='vertical-align: baseline;'>
39
+ <% region.cities.each_with_index do |city,index| %>
40
+ <%= '•' if index > 0 %>
41
+ <%= city.title %>
42
+ <% end %><!-- each city -->
43
+ </td>
44
+ </tr>
45
+
46
+ <% end %> <!-- each region -->
47
+ </table>
48
+
49
+ </td>
50
+ </tr>
51
+ <% end %><!-- if country.regions.count > 0 -->
52
+
53
+ <% end %><!-- each country -->
54
+ </table>
@@ -0,0 +1,11 @@
1
+
2
+ <!-- requires para cities -->
3
+
4
+ <span class='cities'>
5
+ <% cities.each_with_index do |city,index| %>
6
+ <% if index > 0 %>
7
+ &bull;
8
+ <% end %>
9
+ <%= city.title %>
10
+ <% end %> <!-- each city -->
11
+ </span>
@@ -0,0 +1,23 @@
1
+
2
+ <!-- requires para countries
3
+ optional count
4
+ -->
5
+
6
+ <span class='countries'>
7
+ <% countries.each_with_index do |country,index| %>
8
+ <% if index > 0 %>
9
+ &nbsp;
10
+ <% end %>
11
+ <span class='country-key'><%= country.key %></span>
12
+ <%= image_tag_for_country( country ) %>
13
+ <%= link_to "#{country.title} (#{country.code})", short_country_path( country ) %>
14
+ <% end %><!-- each country -->
15
+
16
+
17
+ <% if count.present? %>
18
+ <span class='country-count'>
19
+ (<%= count %>)
20
+ </span>
21
+ <% end %>
22
+
23
+ </span>