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.
- checksums.yaml +4 -4
- data/Manifest.txt +34 -0
- data/app/assets/javascripts/world_db_admin/application.js +15 -0
- data/app/assets/stylesheets/world_db_admin/application.css.scss +98 -0
- data/app/controllers/world_db_admin/cities_controller.rb +28 -0
- data/app/controllers/world_db_admin/codes_controller.rb +14 -0
- data/app/controllers/world_db_admin/continents_controller.rb +16 -0
- data/app/controllers/world_db_admin/countries_controller.rb +142 -0
- data/app/controllers/world_db_admin/langs_controller.rb +14 -0
- data/app/controllers/world_db_admin/pages_controller.rb +12 -0
- data/app/controllers/world_db_admin/regions_controller.rb +25 -0
- data/app/controllers/world_db_admin/tags_controller.rb +34 -0
- data/app/controllers/world_db_admin/world_db_admin_controller.rb +9 -0
- data/app/helpers/world_db_admin/application_helper.rb +82 -0
- data/app/helpers/world_db_admin/part_helper.rb +58 -0
- data/app/helpers/world_db_admin/routes_helper.rb +65 -0
- data/app/views/layouts/world_db_admin/world_db_admin.html.erb +36 -0
- data/app/views/world_db_admin/cities/index.html.erb +43 -0
- data/app/views/world_db_admin/codes/index.html.erb +105 -0
- data/app/views/world_db_admin/continents/index.html.erb +56 -0
- data/app/views/world_db_admin/countries/_countries.html.erb +39 -0
- data/app/views/world_db_admin/countries/index.html.erb +51 -0
- data/app/views/world_db_admin/countries/index_territories.html.erb +31 -0
- data/app/views/world_db_admin/countries/show.html.erb +116 -0
- data/app/views/world_db_admin/langs/index.html.erb +28 -0
- data/app/views/world_db_admin/pages/about.html.erb +65 -0
- data/app/views/world_db_admin/pages/index.html.erb +2 -0
- data/app/views/world_db_admin/regions/index.html.erb +54 -0
- data/app/views/world_db_admin/shared/_cities.html.erb +11 -0
- data/app/views/world_db_admin/shared/_countries.html.erb +23 -0
- data/app/views/world_db_admin/shared/_regions.html.erb +22 -0
- data/app/views/world_db_admin/shared/_tags.html.erb +11 -0
- data/app/views/world_db_admin/tags/index.html.erb +15 -0
- data/app/views/world_db_admin/tags/show.html.erb +63 -0
- data/app/views/world_db_admin/tags/template.txt.erb +6 -0
- data/config/routes.rb +40 -0
- data/lib/worlddb/admin/version.rb +1 -1
- metadata +35 -1
@@ -0,0 +1,22 @@
|
|
1
|
+
<!-- requires para regions
|
2
|
+
optional count
|
3
|
+
-->
|
4
|
+
|
5
|
+
<span class='regions'>
|
6
|
+
<% regions.each_with_index do |region,index| %>
|
7
|
+
<% if index > 0 %>
|
8
|
+
|
9
|
+
<% end %>
|
10
|
+
<span class='region-key'>
|
11
|
+
<%= "#{region.country.key}.#{region.key}" %>
|
12
|
+
</span>
|
13
|
+
<%= link_to region.title, short_region_path( region ) %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% if count.present? %>
|
17
|
+
<span class='region-count'>
|
18
|
+
(<%= count %>)
|
19
|
+
</span>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
</span>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
<h3><%= Tag.count %> Tags / <%= Tagging.count %> Taggings</h3>
|
3
|
+
|
4
|
+
<p>
|
5
|
+
<% @tags.each_with_index do |tag,index| %>
|
6
|
+
<% if index > 0 %>
|
7
|
+
|
8
|
+
<% end %>
|
9
|
+
<%= link_to tag.key, short_tag_path(tag) %>
|
10
|
+
<span class='tagging-count'>
|
11
|
+
(<%= tag.taggings.count %>)
|
12
|
+
</span>
|
13
|
+
<% end %><!-- each tag -->
|
14
|
+
</p>
|
15
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
<h3><%= @tag.key %></h3>
|
3
|
+
|
4
|
+
<p>
|
5
|
+
Sort By: <%= link_to 'Key A-Z', short_tag_path( @tag, order: 'key' ) %>
|
6
|
+
•
|
7
|
+
<%= link_to 'Title A-Z', short_tag_path( @tag, order: 'title' ) %>
|
8
|
+
•
|
9
|
+
<%= link_to 'Code A-Z', short_tag_path( @tag, order: 'code' ) %>
|
10
|
+
•
|
11
|
+
<%= link_to 'Population', short_tag_path( @tag, order: 'pop' ) %>
|
12
|
+
•
|
13
|
+
<%= link_to 'Area (in km²)', short_tag_path( @tag, order: 'area' ) %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
<% if @tag.countries.count > 0 %>
|
19
|
+
<h4>Countries</h4>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
Download: <%= link_to 'CSV', csv_countries_by_tag_path( @tag ), :title => 'Comma-separated values; tabular data in plain text' %>
|
23
|
+
•
|
24
|
+
<%= link_to 'Table', table_countries_by_tag_path( @tag ), :title => 'Hypertext table' %>
|
25
|
+
</p>
|
26
|
+
|
27
|
+
<% count = @tag.countries.where( s: true ).count
|
28
|
+
if count > 0
|
29
|
+
%>
|
30
|
+
<p>
|
31
|
+
<%= render_countries( @tag.countries.where( s: true ), count: count, order: @order) %>
|
32
|
+
</p>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<% count = @tag.countries.where( c: true ).count
|
36
|
+
if count > 0
|
37
|
+
%>
|
38
|
+
<p>
|
39
|
+
<%= render_countries( @tag.countries.where( c: true ), count: count, order: @order) %>
|
40
|
+
</p>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% count = @tag.countries.where( d: true ).count
|
44
|
+
if count > 0
|
45
|
+
%>
|
46
|
+
<p>
|
47
|
+
<%= render_countries( @tag.countries.where( d: true ), count: count, order: @order) %>
|
48
|
+
</p>
|
49
|
+
<% end %>
|
50
|
+
|
51
|
+
<% end %>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<% count = @tag.regions.count
|
56
|
+
if count > 0
|
57
|
+
%>
|
58
|
+
<h4>Regions</h4>
|
59
|
+
|
60
|
+
<p>
|
61
|
+
<%= render_regions( @tag.regions, count: count, order: @order) %>
|
62
|
+
</p>
|
63
|
+
<% end %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
WorldDbAdmin::Engine.routes.draw do
|
3
|
+
|
4
|
+
match 'about', :to => 'pages#about'
|
5
|
+
|
6
|
+
|
7
|
+
###############################
|
8
|
+
# routes for shortcuts (friendly urls)
|
9
|
+
|
10
|
+
## 2 lower case letters - assume shortcut for country
|
11
|
+
match '/:key', :to => 'countries#shortcut', :as => :short_country_worker, :key => /[a-z]{2}/
|
12
|
+
|
13
|
+
# 2 lower case letters / 2 lower case letters - assume shortcut for country/region
|
14
|
+
match '/:country_key/:key', :to => 'regions#shortcut', :as => :short_region_worker, :country_key => /[a-z]{2}/, :key => /[a-z]{2}/
|
15
|
+
|
16
|
+
match '/tag/:key', :to => 'tags#shortcut', :as => :short_tag_worker, :key => /[a-z][a-z0-9_]*/
|
17
|
+
|
18
|
+
|
19
|
+
match 'territories', :to => 'countries#index_territories', :as => 'territories'
|
20
|
+
|
21
|
+
|
22
|
+
resources :continents
|
23
|
+
resources :countries
|
24
|
+
resources :regions
|
25
|
+
resources :tags
|
26
|
+
resources :cities
|
27
|
+
resources :codes
|
28
|
+
resources :langs
|
29
|
+
|
30
|
+
|
31
|
+
###############################
|
32
|
+
# more routes for shortcuts (friendly urls)
|
33
|
+
|
34
|
+
# 3 and more lower case letters - assume shortcut for city
|
35
|
+
# nb: goes last; do NOT want to catch controller names such as cities,countries,etc.
|
36
|
+
match '/:key', :to => 'cities#shortcut', :as => :short_city_worker, :key => /[a-z]{3,}/
|
37
|
+
|
38
|
+
root :to => 'countries#index'
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worlddb-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -51,6 +51,40 @@ files:
|
|
51
51
|
- Manifest.txt
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
|
+
- app/assets/javascripts/world_db_admin/application.js
|
55
|
+
- app/assets/stylesheets/world_db_admin/application.css.scss
|
56
|
+
- app/controllers/world_db_admin/cities_controller.rb
|
57
|
+
- app/controllers/world_db_admin/codes_controller.rb
|
58
|
+
- app/controllers/world_db_admin/continents_controller.rb
|
59
|
+
- app/controllers/world_db_admin/countries_controller.rb
|
60
|
+
- app/controllers/world_db_admin/langs_controller.rb
|
61
|
+
- app/controllers/world_db_admin/pages_controller.rb
|
62
|
+
- app/controllers/world_db_admin/regions_controller.rb
|
63
|
+
- app/controllers/world_db_admin/tags_controller.rb
|
64
|
+
- app/controllers/world_db_admin/world_db_admin_controller.rb
|
65
|
+
- app/helpers/world_db_admin/application_helper.rb
|
66
|
+
- app/helpers/world_db_admin/part_helper.rb
|
67
|
+
- app/helpers/world_db_admin/routes_helper.rb
|
68
|
+
- app/views/layouts/world_db_admin/world_db_admin.html.erb
|
69
|
+
- app/views/world_db_admin/cities/index.html.erb
|
70
|
+
- app/views/world_db_admin/codes/index.html.erb
|
71
|
+
- app/views/world_db_admin/continents/index.html.erb
|
72
|
+
- app/views/world_db_admin/countries/_countries.html.erb
|
73
|
+
- app/views/world_db_admin/countries/index.html.erb
|
74
|
+
- app/views/world_db_admin/countries/index_territories.html.erb
|
75
|
+
- app/views/world_db_admin/countries/show.html.erb
|
76
|
+
- app/views/world_db_admin/langs/index.html.erb
|
77
|
+
- app/views/world_db_admin/pages/about.html.erb
|
78
|
+
- app/views/world_db_admin/pages/index.html.erb
|
79
|
+
- app/views/world_db_admin/regions/index.html.erb
|
80
|
+
- app/views/world_db_admin/shared/_cities.html.erb
|
81
|
+
- app/views/world_db_admin/shared/_countries.html.erb
|
82
|
+
- app/views/world_db_admin/shared/_regions.html.erb
|
83
|
+
- app/views/world_db_admin/shared/_tags.html.erb
|
84
|
+
- app/views/world_db_admin/tags/index.html.erb
|
85
|
+
- app/views/world_db_admin/tags/show.html.erb
|
86
|
+
- app/views/world_db_admin/tags/template.txt.erb
|
87
|
+
- config/routes.rb
|
54
88
|
- lib/worlddb/admin.rb
|
55
89
|
- lib/worlddb/admin/engine.rb
|
56
90
|
- lib/worlddb/admin/version.rb
|