Skip to content

Commit 23d01b6

Browse files
Refactor #pretty_country to show flag by default
1 parent 70795d5 commit 23d01b6

File tree

12 files changed

+16
-16
lines changed

12 files changed

+16
-16
lines changed

app/decorators/merchant_decorator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def all_links
8383
].compact_blank
8484
end
8585

86-
def pretty_country(show_flag: false)
86+
def pretty_country(show_flag: true)
8787
pretty_country_html(country, show_flag: show_flag)
8888
end
8989

app/helpers/application_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def select_options_for(klass, enum_name)
3737
enum.keys.map { |k| [klass.human_enum_name(enum_name, k), k] }
3838
end
3939

40-
def pretty_country_html(country, show_flag: false)
40+
def pretty_country_html(country, show_flag: true)
4141
c = ISO3166::Country[country]
4242

4343
name = c.translations[I18n.locale.to_s] ||

app/models/merchant_proposal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def to_osm
8686

8787
if country
8888
properties['addr:country'] = country
89-
extra_keys['country'] = model.pretty_country(show_flag: true)
89+
extra_keys['country'] = model.pretty_country
9090
end
9191

9292
extra_keys['latitude'] = latitude if latitude

app/presenters/statistics_presenter.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@ def merchants_monero_by_country
9292
base_merchants.monero.group(:country).count.map do |k, v|
9393
next unless v >= 3
9494

95-
[pretty_country_html(k, show_flag: true), v]
95+
[pretty_country_html(k), v]
9696
end.compact_blank
9797
end
9898

9999
def merchants_june_by_country
100100
base_merchants.june.group(:country).count.map do |k, v|
101-
[pretty_country_html(k, show_flag: true), v]
101+
[pretty_country_html(k), v]
102102
end
103103
end
104104

105105
def merchants_by_countries
106106
base_merchants
107107
.where(country: WEST_EUROPEAN_COUNTRIES)
108108
.group(:country).count.map do |k, v|
109-
[pretty_country_html(k, show_flag: true), v]
109+
[pretty_country_html(k), v]
110110
end
111111
end
112112

@@ -134,7 +134,7 @@ def merchants_by_area_and_days(
134134
range = range_start..range_end
135135

136136
area.each_with_object({}) do |country, hash|
137-
label = pretty_country_html(country, show_flag: true)
137+
label = pretty_country_html(country)
138138
base_merchants
139139
.where(country: country)
140140
.where(created_at: range)

app/services/merchants/check_and_report_removed_on_osm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def merchants
5959
def merchants_list
6060
@merchants_list ||= MerchantDecorator.wrap(merchants).map do |merchant|
6161
<<~MARKDOWN
62-
- [ ] **#{merchant.name}** [##{merchant.identifier}] #{pretty_country_html(merchant.country, show_flag: true)}
62+
- [ ] **#{merchant.name}** [##{merchant.identifier}] #{pretty_country_html(merchant.country)}
6363
- Date: #{I18n.l(merchant.deleted_at)}
6464
- [On Bank-Exit](#{merchant_url(merchant, debug: 'true')})
6565
- [On OpenStreetMap](#{merchant.osm_link})

app/views/admin/comments/_comment.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tr
88
.text-xs.truncate
99
span.font-bold= comment.pseudonym
1010
|< [
11-
= pretty_country_html(comment.language, show_flag: true)
11+
= pretty_country_html(comment.language)
1212
| ]
1313

1414
td

app/views/admin/directories/_directory.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tr.hover:bg-primary/5.transition-colors data-update-url=update_position_admin_di
2626
- if address&.geocoded?
2727
- if address.country_code
2828
span title=address.label
29-
= pretty_country_html(address.country_code, show_flag: true)
29+
= pretty_country_html(address.country_code)
3030
- else
3131
span= address.label
3232

app/views/delivery_zones/_formatted_geocoder_details.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ruby:
99
region = t("FR-#{region}", scope: 'regions')
1010
end
1111

12-
country = pretty_country_html(country_code, show_flag: true)
12+
country = pretty_country_html(country_code)
1313
continent = t(continent_code, scope: 'continents')
1414

1515
sentence = [city, region, country, continent].compact_blank

app/views/delivery_zones/_formatted_zone_by_mode.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- if delivery_zone.world?
22
= lucide_icon 'earth'
33
- elsif delivery_zone.country?
4-
= pretty_country_html(delivery_zone.country_code, show_flag: true)
4+
= pretty_country_html(delivery_zone.country_code)
55
- elsif delivery_zone.continent?
66
span
77
= I18n.t(delivery_zone.continent_code, scope: 'continents')
@@ -13,4 +13,4 @@
1313
= t(delivery_zone.region_code, scope: 'regions') if delivery_zone.region?
1414

1515
span.text-base-content/70.text-sm.ml-1<
16-
= "(#{pretty_country_html(delivery_zone.country_code, show_flag: true)})"
16+
= "(#{pretty_country_html(delivery_zone.country_code)})"

app/views/maps/_merchants_table_row.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tr.odd:hover:bg-base-200.transition-colors
1313
= t(merchant.category, scope: 'categories')
1414

1515
td
16-
== pretty_country_html(merchant.country, show_flag: true)
16+
== pretty_country_html(merchant.country)
1717

1818
td
1919
.flex.items-center.gap-2

0 commit comments

Comments
 (0)