magic_addresses 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f12839c532821bac3a3c14145815f9e8dd848f06
4
- data.tar.gz: 37507c80ba3f97ca13338bf10d5ea7961b47c29e
3
+ metadata.gz: 5ce2eb110f0c01b4eb5343fe36e2ac86232ed426
4
+ data.tar.gz: 301f699f7f353b76b4c47ba465707f668654b5f1
5
5
  SHA512:
6
- metadata.gz: a3cb7493c3cff3adba7f646c66f0ade891309814990afa4e478ce52a519276f5145faae4643ddcc2da1c24afec3b4f8517773c338708c8e9387d9410b79cadfe
7
- data.tar.gz: f7946d919e48fb6e9b1922732232e7e9cc5fc72ce294da60a2cde3f48cc6b08639ffefd32c573fd1ac92cef974da31cc26f1307c292bedf1b035f70727f8640c
6
+ metadata.gz: fcaf5f9066b5f40c99c606e27afd73cfb92260eaa2e72e420f7c83c635fa6c2f9fd2fa4c6ae2d5d18a891ef23e2912a130156fbf86b6669131ea3d4eb99b85e5
7
+ data.tar.gz: 2b659fca4d16849d8a4ed0fdfb612e4493967429938e3cd01da3239f666d620fdd611aaea3613b7819f858ab503cb6a0040c2fdb07d50002c13ed4b475bc8b5c
data/README.md CHANGED
@@ -72,6 +72,11 @@ be sure to activate it in initializer before migrate!
72
72
 
73
73
  ```
74
74
 
75
+
76
+ **NEW** since *v. 0.0.25*:
77
+ rewrite the template of admin views, just place [admin_template](https://github.com/berlinmagic/magic_addresses/tree/master/app/views/magic_addresses/_admin_template.html.erb) in *YOUR_PROJECT/app/views/magic_addresses/_admin_template.html.erb* and rewrite it for your needs ...
78
+
79
+
75
80
  ### in your Controllers:
76
81
 
77
82
  ```ruby
@@ -0,0 +1,58 @@
1
+ <div class="section">
2
+ <div class="corset full">
3
+
4
+ <div class="row">
5
+ <div class="col-sm-4 col-md-3 col-xl-2">
6
+
7
+ <div class="box setting">
8
+ <div class="header">
9
+ Locations
10
+ </div>
11
+ <div class="body flat-top">
12
+ <ul class="nav_list flat">
13
+
14
+ <% %w(country state city district subdistrict).each do |l| %>
15
+
16
+ <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
+ <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
+ <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
+ <% end %>
20
+ </li>
21
+
22
+ <% end %>
23
+
24
+ </ul>
25
+ </div>
26
+ </div>
27
+
28
+ </div>
29
+ <div class="col-sm-8 col-md-9 col-xl-10">
30
+
31
+
32
+ <div class="box setting">
33
+ <div class="header">
34
+ <%= yield :headline %>
35
+ </div>
36
+ <div class="body">
37
+
38
+ <%= body %>
39
+
40
+ </div>
41
+ </div>
42
+
43
+ <br/>
44
+ <br/>
45
+
46
+
47
+ </div>
48
+ </div>
49
+
50
+ </div>
51
+ </div>
52
+
53
+ <br/>
54
+ <br/>
55
+
56
+
57
+
58
+
@@ -0,0 +1,23 @@
1
+ <div class="section head">
2
+ <div class="corset full">
3
+ <%= yield :headline %>
4
+ </div>
5
+ </div>
6
+
7
+ <div class="section">
8
+ <div class="corset full">
9
+
10
+ <%= body %>
11
+
12
+ <br/>
13
+ <br/>
14
+
15
+ </div>
16
+ </div>
17
+
18
+ <br/>
19
+ <br/>
20
+
21
+
22
+
23
+
@@ -1,95 +1,50 @@
1
- <div class="section">
2
- <div class="corset full">
3
-
4
- <div class="row">
5
- <div class="col-sm-4 col-md-3 col-xl-2">
6
-
7
- <div class="box setting">
8
- <div class="header">
9
- Locations
10
- </div>
11
- <div class="body flat-top">
12
- <ul class="nav_list flat">
13
-
14
- <% %w(country state city district subdistrict).each do |l| %>
15
-
16
- <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
- <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
- <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
- <% end %>
20
- </li>
21
-
22
- <% end %>
23
-
24
- </ul>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <div class="col-sm-8 col-md-9 col-xl-10">
30
-
31
-
32
- <div class="box setting">
33
- <div class="header">
34
- <%= t("activerecord.attributes.magic_addresses_city.other") %>
35
- </div>
36
- <div class="body">
37
-
38
- <table class="table table-striped">
39
- <thead>
40
- <tr>
41
- <th><%= t("helpers.label.magic_addresses_city.name") %></th>
42
- <th>Addresses</th>
43
-
44
- <th><%= t("activerecord.attributes.magic_addresses_state.one") %></th>
45
- <th><%= t("activerecord.attributes.magic_addresses_country.one") %></th>
46
-
47
- <th><%= t("helpers.label.magic_addresses_city.default_name") %></th>
48
- <th>FSM-State</th>
49
- <th>Triggers</th>
50
- </tr>
51
- </thead>
52
- <tbody>
53
- <% @cities.each do |city| %>
54
- <tr>
55
-
56
- <td><strong><%= city.name %></strong></td>
57
-
58
- <td><%= city.addresses.count %></td>
59
-
60
- <td><%= city.state.name if city.state %></td>
61
- <td>
62
- <%= country_flag( city.country.iso_code, "small" ) if city.country %>
63
- <%= city.country.name if city.country %>
64
- </td>
65
-
66
- <td><%= city.default_name %></td>
67
- <td><%= city.fsm_state %></td>
68
- <td>
69
- <%# %w(activate deactivate).each do |state| %>
70
- <%# if city.machine.trigger?(state.to_sym) %>
71
- <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
72
- <%# end %>
73
- <%# end %>
74
- </td>
75
- </tr>
76
- <% end %>
77
- </tbody>
78
- </table>
79
- </div>
80
- </div>
1
+ <%= address_admin_template do %>
81
2
 
82
- <br/>
83
- <br/>
84
-
85
-
86
- </div>
87
- </div>
88
-
89
- </div>
90
- </div>
3
+ <%= content_for :headline do %>
4
+ <%= t("activerecord.attributes.magic_addresses_city.other") %>
5
+ <% end %>
91
6
 
92
- <br/>
93
- <br/>
7
+ <table class="table table-striped">
8
+ <thead>
9
+ <tr>
10
+ <th><%= t("helpers.label.magic_addresses_city.name") %></th>
11
+ <th>Addresses</th>
12
+
13
+ <th><%= t("activerecord.attributes.magic_addresses_state.one") %></th>
14
+ <th><%= t("activerecord.attributes.magic_addresses_country.one") %></th>
15
+
16
+ <th><%= t("helpers.label.magic_addresses_city.default_name") %></th>
17
+ <th>FSM-State</th>
18
+ <th>Triggers</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% @cities.each do |city| %>
23
+ <tr>
24
+
25
+ <td><strong><%= city.name %></strong></td>
26
+
27
+ <td><%= city.addresses.count %></td>
28
+
29
+ <td><%= city.state.name if city.state %></td>
30
+ <td>
31
+ <%= country_flag( city.country.iso_code, "small" ) if city.country %>
32
+ <%= city.country.name if city.country %>
33
+ </td>
34
+
35
+ <td><%= city.default_name %></td>
36
+ <td><%= city.fsm_state %></td>
37
+ <td>
38
+ <%# %w(activate deactivate).each do |state| %>
39
+ <%# if city.machine.trigger?(state.to_sym) %>
40
+ <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
41
+ <%# end %>
42
+ <%# end %>
43
+ </td>
44
+ </tr>
45
+ <% end %>
46
+ </tbody>
47
+ </table>
94
48
 
95
49
 
50
+ <% end %>
@@ -1,106 +1,56 @@
1
- <div class="section">
2
- <div class="corset full">
3
-
4
- <div class="row">
5
- <div class="col-sm-4 col-md-3 col-xl-2">
6
-
7
- <div class="box setting">
8
- <div class="header">
9
- Locations
10
- </div>
11
- <div class="body flat-top">
12
- <ul class="nav_list flat">
13
-
14
- <% %w(country state city district subdistrict).each do |l| %>
15
-
16
- <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
- <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
- <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
- <% end %>
20
- </li>
21
-
22
- <% end %>
23
-
24
- </ul>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <div class="col-sm-8 col-md-9 col-xl-10">
30
-
31
-
32
- <div class="box setting">
33
- <div class="header">
34
- <%= t("activerecord.attributes.magic_addresses_country.other") %>
35
- </div>
36
- <div class="body">
37
-
38
- <table class="table table-striped">
39
- <thead>
40
- <tr>
41
- <th><%= t("helpers.label.magic_addresses_country.name") %></th>
42
-
43
- <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
44
-
45
- <th><%= t("helpers.label.magic_addresses_country.default_name") %></th>
46
-
47
- <th><%= t("helpers.label.magic_addresses_country.dial_code") %></th>
48
-
49
- <th><%= t("helpers.label.magic_addresses_country.fsm_state") %></th>
50
-
51
- <th>Triggers</th>
52
- </tr>
53
- </thead>
54
- <tbody>
55
- <% @countries.each do |country| %>
56
- <tr>
57
-
58
- <td>
59
- <%= country_flag( country.iso_code, "small" ) %>
60
- <strong><%= country.name %></strong>
61
- </td>
62
-
63
- <td>
64
- <% if country.addresses.count > 0 %>
65
- <span class="text-success"><strong><%= country.addresses.count %></strong></span>
66
- <% else %>
67
- <span class="text-warning">-</span>
68
- <% end %>
69
- </td>
70
-
71
- <td><%= country.default_name %></td>
72
- <td><%= country.dial_code %></td>
73
- <td><%= country.fsm_state %></td>
74
- <td>
75
- <%# %w(activate deactivate).each do |state| %>
76
- <%# if city.machine.trigger?(state.to_sym) %>
77
- <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
78
- <%# end %>
79
- <%# end %>
80
- </td>
81
- </tr>
82
- <% end %>
83
- </tbody>
84
- </table>
85
-
86
-
87
-
88
- </div>
89
- </div>
90
-
91
- <br/>
92
- <br/>
93
-
94
-
95
- </div>
96
- </div>
97
-
98
- </div>
99
- </div>
100
-
101
- <br/>
102
- <br/>
1
+ <%= address_admin_template do %>
103
2
 
3
+ <%= content_for :headline do %>
4
+ <%= t("activerecord.attributes.magic_addresses_country.other") %>
5
+ <% end %>
104
6
 
7
+ <table class="table table-striped">
8
+ <thead>
9
+ <tr>
10
+ <th><%= t("helpers.label.magic_addresses_country.name") %></th>
11
+
12
+ <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
13
+
14
+ <th><%= t("helpers.label.magic_addresses_country.default_name") %></th>
15
+
16
+ <th><%= t("helpers.label.magic_addresses_country.dial_code") %></th>
17
+
18
+ <th><%= t("helpers.label.magic_addresses_country.fsm_state") %></th>
19
+
20
+ <th>Triggers</th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <% @countries.each do |country| %>
25
+ <tr>
26
+
27
+ <td>
28
+ <%= country_flag( country.iso_code, "small" ) %>
29
+ <strong><%= country.name %></strong>
30
+ </td>
31
+
32
+ <td>
33
+ <% if country.addresses.count > 0 %>
34
+ <span class="text-success"><strong><%= country.addresses.count %></strong></span>
35
+ <% else %>
36
+ <span class="text-warning">-</span>
37
+ <% end %>
38
+ </td>
39
+
40
+ <td><%= country.default_name %></td>
41
+ <td><%= country.dial_code %></td>
42
+ <td><%= country.fsm_state %></td>
43
+ <td>
44
+ <%# %w(activate deactivate).each do |state| %>
45
+ <%# if city.machine.trigger?(state.to_sym) %>
46
+ <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
47
+ <%# end %>
48
+ <%# end %>
49
+ </td>
50
+ </tr>
51
+ <% end %>
52
+ </tbody>
53
+ </table>
105
54
 
106
55
 
56
+ <% end %>
@@ -1,96 +1,45 @@
1
- <div class="section">
2
- <div class="corset full">
3
-
4
- <div class="row">
5
- <div class="col-sm-4 col-md-3 col-xl-2">
6
-
7
- <div class="box setting">
8
- <div class="header">
9
- Locations
10
- </div>
11
- <div class="body flat-top">
12
- <ul class="nav_list flat">
13
-
14
- <% %w(country state city district subdistrict).each do |l| %>
15
-
16
- <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
- <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
- <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
- <% end %>
20
- </li>
21
-
22
- <% end %>
23
-
24
- </ul>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <div class="col-sm-8 col-md-9 col-xl-10">
30
-
31
-
32
- <div class="box setting">
33
- <div class="header">
34
- <%= t("activerecord.attributes.magic_addresses_district.other") %>
35
- </div>
36
- <div class="body">
37
-
38
- <table class="table table-striped">
39
- <thead>
40
- <tr>
41
- <th><%= t("helpers.label.magic_addresses_district.name") %></th>
42
- <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
43
-
44
- <th><%= t("activerecord.attributes.magic_addresses_city.one") %></th>
45
-
46
- <th><%= t("helpers.label.magic_addresses_district.default_name") %></th>
47
-
48
- <th>FSM-State</th>
49
- <th>Triggers</th>
50
- </tr>
51
- </thead>
52
- <tbody>
53
- <% @districts.each do |scity| %>
54
- <tr>
55
-
56
- <td><strong><%= scity.name %></strong></td>
57
- <td><%= scity.addresses.count %></td>
58
-
59
- <td><%= scity.city.name if scity.city %></td>
60
-
61
- <td><%= scity.default_name %></td>
62
- <td><%= scity.fsm_state %></td>
63
- <td>
64
- <%# %w(activate deactivate).each do |state| %>
65
- <%# if city.machine.trigger?(state.to_sym) %>
66
- <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
67
- <%# end %>
68
- <%# end %>
69
- </td>
70
- </tr>
71
- <% end %>
72
- </tbody>
73
- </table>
74
-
75
-
76
-
77
- </div>
78
- </div>
79
-
80
- <br/>
81
- <br/>
82
-
83
-
84
- </div>
85
- </div>
86
-
87
- </div>
88
- </div>
89
-
90
- <br/>
91
- <br/>
92
-
1
+ <%= address_admin_template do %>
93
2
 
3
+ <%= content_for :headline do %>
4
+ <%= t("activerecord.attributes.magic_addresses_district.other") %>
5
+ <% end %>
94
6
 
7
+ <table class="table table-striped">
8
+ <thead>
9
+ <tr>
10
+ <th><%= t("helpers.label.magic_addresses_district.name") %></th>
11
+ <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
12
+
13
+ <th><%= t("activerecord.attributes.magic_addresses_city.one") %></th>
14
+
15
+ <th><%= t("helpers.label.magic_addresses_district.default_name") %></th>
16
+
17
+ <th>FSM-State</th>
18
+ <th>Triggers</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% @districts.each do |scity| %>
23
+ <tr>
24
+
25
+ <td><strong><%= scity.name %></strong></td>
26
+ <td><%= scity.addresses.count %></td>
27
+
28
+ <td><%= scity.city.name if scity.city %></td>
29
+
30
+ <td><%= scity.default_name %></td>
31
+ <td><%= scity.fsm_state %></td>
32
+ <td>
33
+ <%# %w(activate deactivate).each do |state| %>
34
+ <%# if city.machine.trigger?(state.to_sym) %>
35
+ <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
36
+ <%# end %>
37
+ <%# end %>
38
+ </td>
39
+ </tr>
40
+ <% end %>
41
+ </tbody>
42
+ </table>
95
43
 
44
+ <% end %>
96
45
 
@@ -1,95 +1,45 @@
1
- <div class="section">
2
- <div class="corset full">
3
-
4
- <div class="row">
5
- <div class="col-sm-4 col-md-3 col-xl-2">
6
-
7
- <div class="box setting">
8
- <div class="header">
9
- Locations
10
- </div>
11
- <div class="body flat-top">
12
- <ul class="nav_list flat">
13
-
14
- <% %w(country state city district subdistrict).each do |l| %>
15
-
16
- <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
- <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
- <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
- <% end %>
20
- </li>
21
-
22
- <% end %>
23
-
24
- </ul>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <div class="col-sm-8 col-md-9 col-xl-10">
30
-
31
-
32
- <div class="box setting">
33
- <div class="header">
34
- <%= t("activerecord.attributes.magic_addresses_state.other") %>
35
- </div>
36
- <div class="body">
37
-
38
- <table class="table table-striped">
39
- <thead>
40
- <tr>
41
- <th><%= t("helpers.label.magic_addresses_state.name") %></th>
42
- <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
43
-
44
- <th><%= t("activerecord.attributes.magic_addresses_country.one") %></th>
45
-
46
- <th><%= t("helpers.label.magic_addresses_state.default_name") %></th>
47
-
48
- <th>FSM-State</th>
49
- <th>Triggers</th>
50
- </tr>
51
- </thead>
52
- <tbody>
53
- <% @states.each do |state| %>
54
- <tr>
55
-
56
- <td><strong><%= state.name %></strong></td>
57
- <td><%= state.addresses.count %></td>
58
-
59
- <td><%= state.country.name if state.country %></td>
60
-
61
- <td><%= state.default_name %></td>
62
- <td><%= state.fsm_state %></td>
63
- <td>
64
- <%# %w(activate deactivate).each do |state| %>
65
- <%# if city.machine.trigger?(state.to_sym) %>
66
- <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
67
- <%# end %>
68
- <%# end %>
69
- </td>
70
- </tr>
71
- <% end %>
72
- </tbody>
73
- </table>
74
-
75
-
76
-
77
- </div>
78
- </div>
79
-
80
- <br/>
81
- <br/>
82
-
83
-
84
- </div>
85
- </div>
86
-
87
- </div>
88
- </div>
89
-
90
- <br/>
91
- <br/>
92
-
93
-
1
+ <%= address_admin_template do %>
94
2
 
3
+ <%= content_for :headline do %>
4
+ <%= t("activerecord.attributes.magic_addresses_state.other") %>
5
+ <% end %>
6
+
7
+ <table class="table table-striped">
8
+ <thead>
9
+ <tr>
10
+ <th><%= t("helpers.label.magic_addresses_state.name") %></th>
11
+ <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
12
+
13
+ <th><%= t("activerecord.attributes.magic_addresses_country.one") %></th>
14
+
15
+ <th><%= t("helpers.label.magic_addresses_state.default_name") %></th>
16
+
17
+ <th>FSM-State</th>
18
+ <th>Triggers</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% @states.each do |state| %>
23
+ <tr>
24
+
25
+ <td><strong><%= state.name %></strong></td>
26
+ <td><%= state.addresses.count %></td>
27
+
28
+ <td><%= state.country.name if state.country %></td>
29
+
30
+ <td><%= state.default_name %></td>
31
+ <td><%= state.fsm_state %></td>
32
+ <td>
33
+ <%# %w(activate deactivate).each do |state| %>
34
+ <%# if city.machine.trigger?(state.to_sym) %>
35
+ <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
36
+ <%# end %>
37
+ <%# end %>
38
+ </td>
39
+ </tr>
40
+ <% end %>
41
+ </tbody>
42
+ </table>
43
+
44
+ <% end %>
95
45
 
@@ -1,98 +1,48 @@
1
- <div class="section">
2
- <div class="corset full">
3
-
4
- <div class="row">
5
- <div class="col-sm-4 col-md-3 col-xl-2">
6
-
7
- <div class="box setting">
8
- <div class="header">
9
- Locations
10
- </div>
11
- <div class="body flat-top">
12
- <ul class="nav_list flat">
13
-
14
- <% %w(country state city district subdistrict).each do |l| %>
15
-
16
- <li class="<%= 'active current' if current_page?(url_for(controller: "magic_addresses/#{l.tableize}", action: "index")) %>">
17
- <%= link_to url_for(controller: "magic_addresses/#{l.tableize}", action: "index") do %>
18
- <%= t("activerecord.attributes.magic_addresses_#{l}.other") %> <span class="label"><%= "::MagicAddresses::#{l.classify}".constantize.count %></span>
19
- <% end %>
20
- </li>
21
-
22
- <% end %>
23
-
24
- </ul>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <div class="col-sm-8 col-md-9 col-xl-10">
30
-
31
-
32
- <div class="box setting">
33
- <div class="header">
34
- <%= t("activerecord.attributes.magic_addresses_subdistrict.other") %>
35
- </div>
36
- <div class="body">
37
-
38
-
39
- <table class="table table-striped">
40
- <thead>
41
- <tr>
42
- <th><%= t("helpers.label.magic_addresses_subdistrict.name") %></th>
43
- <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
44
-
45
- <th><%= t("activerecord.attributes.magic_addresses_district.one") %></th>
46
- <th><%= t("activerecord.attributes.magic_addresses_city.one") %></th>
47
-
48
- <th><%= t("helpers.label.magic_addresses_subdistrict.default_name") %></th>
49
-
50
- <th>FSM-State</th>
51
- <th>Triggers</th>
52
- </tr>
53
- </thead>
54
- <tbody>
55
- <% @subdistricts.each do |scity| %>
56
- <tr>
57
-
58
- <td><strong><%= scity.name %></strong></td>
59
- <td><%= scity.addresses.count %></td>
60
-
61
- <td><%= scity.district.name if scity.district %></td>
62
- <td><%= scity.city.name if scity.city %></td>
63
-
64
- <td><%= scity.default_name %></td>
65
- <td><%= scity.fsm_state %></td>
66
- <td>
67
- <%# %w(activate deactivate).each do |state| %>
68
- <%# if city.machine.trigger?(state.to_sym) %>
69
- <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
70
- <%# end %>
71
- <%# end %>
72
- </td>
73
- </tr>
74
- <% end %>
75
- </tbody>
76
- </table>
77
-
78
-
79
-
80
- </div>
81
- </div>
82
-
83
- <br/>
84
- <br/>
85
-
86
-
87
- </div>
88
- </div>
89
-
90
- </div>
91
- </div>
92
-
93
- <br/>
94
- <br/>
95
-
1
+ <%= address_admin_template do %>
96
2
 
3
+ <%= content_for :headline do %>
4
+ <%= t("activerecord.attributes.magic_addresses_subdistrict.other") %>
5
+ <% end %>
97
6
 
7
+ <table class="table table-striped">
8
+ <thead>
9
+ <tr>
10
+ <th><%= t("helpers.label.magic_addresses_subdistrict.name") %></th>
11
+ <th><%= t("activerecord.attributes.magic_addresses_address.other") %></th>
12
+
13
+ <th><%= t("activerecord.attributes.magic_addresses_district.one") %></th>
14
+ <th><%= t("activerecord.attributes.magic_addresses_city.one") %></th>
15
+
16
+ <th><%= t("helpers.label.magic_addresses_subdistrict.default_name") %></th>
17
+
18
+ <th>FSM-State</th>
19
+ <th>Triggers</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <% @subdistricts.each do |scity| %>
24
+ <tr>
25
+
26
+ <td><strong><%= scity.name %></strong></td>
27
+ <td><%= scity.addresses.count %></td>
28
+
29
+ <td><%= scity.district.name if scity.district %></td>
30
+ <td><%= scity.city.name if scity.city %></td>
31
+
32
+ <td><%= scity.default_name %></td>
33
+ <td><%= scity.fsm_state %></td>
34
+ <td>
35
+ <%# %w(activate deactivate).each do |state| %>
36
+ <%# if city.machine.trigger?(state.to_sym) %>
37
+ <%#= link_to state.to_s.titleize, trigger_wizard_city_path(city, state), class: "btn btn-default btn-sm" %>
38
+ <%# end %>
39
+ <%# end %>
40
+ </td>
41
+ </tr>
42
+ <% end %>
43
+ </tbody>
44
+ </table>
45
+
46
+
47
+ <% end %>
98
48
 
@@ -34,26 +34,26 @@ de:
34
34
  country_name: "Land"
35
35
  magic_addresses_city:
36
36
  name: "Stadt-Name"
37
- name_default: "Stadt (system)"
37
+ default_name: "Stadt (system)"
38
38
  fsm_state: "Status"
39
39
  magic_addresses_country:
40
40
  name: "Land-Name"
41
- name_default: "Land (system)"
41
+ default_name: "Land (system)"
42
42
  fsm_state: "Status"
43
43
  iso_code: "Ländercode"
44
44
  dial_code: "Vorwahl"
45
45
  magic_addresses_state:
46
46
  name: "Bundesland-Name"
47
- name_default: "Bundesland (system)"
47
+ default_name: "Bundesland (system)"
48
48
  fsm_state: "Status"
49
49
  short_name: "Kurzform"
50
50
  magic_addresses_district:
51
51
  name: "Stadtteil-Name"
52
- name_default: "Stadtteil (system)"
52
+ default_name: "Stadtteil (system)"
53
53
  fsm_state: "Status"
54
54
  magic_addresses_subdistrict:
55
55
  name: "Unter-Stadtteil-Name"
56
- name_default: "Unter-Stadtteil (system)"
56
+ default_name: "Unter-Stadtteil (system)"
57
57
  fsm_state: "Status"
58
58
  wizard_city:
59
59
  name: "Name"
@@ -20,26 +20,26 @@ en:
20
20
  zipcode: "Zipcode"
21
21
  magic_addresses_city:
22
22
  name: "City-Name"
23
- name_default: "City (system)"
23
+ default_name: "City (system)"
24
24
  fsm_state: "State"
25
25
  magic_addresses_country:
26
26
  name: "Country-Name"
27
- name_default: "Country (system)"
27
+ default_name: "Country (system)"
28
28
  fsm_state: "Status"
29
29
  iso_code: "Country code"
30
30
  dial_code: "Dial code"
31
31
  magic_addresses_state:
32
32
  name: "State-Name"
33
- name_default: "State (system)"
33
+ default_name: "State (system)"
34
34
  fsm_state: "State"
35
35
  short_name: "Short form"
36
36
  magic_addresses_district:
37
37
  name: "District-Name"
38
- name_default: "District (system)"
38
+ default_name: "District (system)"
39
39
  fsm_state: "State"
40
40
  magic_addresses_subdistrict:
41
41
  name: "Subdistrict-Name"
42
- name_default: "Subdistrict (system)"
42
+ default_name: "Subdistrict (system)"
43
43
  fsm_state: "State"
44
44
  wizard_city:
45
45
  name: "Name"
@@ -3,10 +3,17 @@ require "action_view/helpers/asset_tag_helper"
3
3
  # encoding: utf-8
4
4
  module MgcaHelper
5
5
 
6
- def country_flag( lcl = I18n.locale.to_s, format = "small" )
6
+ def country_flag( lcl = I18n.locale.to_s, format = "small", style = "" )
7
7
  format = "medium" unless %w(small medium large).include?(format)
8
8
  lcl = "xx" unless %w(at by be ba bg ca hr cy cz dk fi fr de gr hu ie it lv li lt lu nl no pl pt ro ru rs sk si es se ch ua gb us).include?( lcl.to_s.downcase )
9
- raw( image_tag( "flags/countries/#{format}/flag-#{lcl.to_s.downcase}.png", class: "flag" ) )
9
+ classes = ["flag"]
10
+ classes << style if style.present?
11
+ raw(image_tag("flags/countries/#{format}/flag-#{lcl.to_s.downcase}.png", class: classes.join(" ")))
12
+ end
13
+
14
+ def address_admin_template(options = {}, &block)
15
+ options.merge!(:body => capture(&block))
16
+ render(:partial => "magic_addresses/admin_template", :locals => options)
10
17
  end
11
18
 
12
19
  end
@@ -1,3 +1,3 @@
1
1
  module MagicAddresses
2
- VERSION = "0.0.24"
2
+ VERSION = "0.0.25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_addresses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Torsten Wetzel
@@ -84,28 +84,28 @@ dependencies:
84
84
  name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.3.10
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.3.10
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec-rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 3.2.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: 3.2.0
111
111
  description: Easy sortable and translated addresses uses google-api with nominatim
@@ -119,6 +119,8 @@ files:
119
119
  - MIT-LICENSE
120
120
  - README.md
121
121
  - Rakefile
122
+ - app/views/magic_addresses/_admin_template.html.erb
123
+ - app/views/magic_addresses/_admin_tmplt.html.erb
122
124
  - app/views/magic_addresses/addresses/_address_fields.html.erb
123
125
  - app/views/magic_addresses/addresses/_addresses_fields.html.erb
124
126
  - app/views/magic_addresses/addresses/fields/_address.html.erb