|
70 | 70 | <p class="mt-1 text-sm text-gray-500">Currency used for property prices</p> |
71 | 71 | </div> |
72 | 72 |
|
| 73 | + <!-- Available Currencies for Display --> |
| 74 | + <div> |
| 75 | + <label class="block text-sm font-medium text-gray-700 mb-1"> |
| 76 | + Additional Display Currencies |
| 77 | + </label> |
| 78 | + <p class="text-sm text-gray-500 mb-3"> |
| 79 | + Select additional currencies visitors can view prices in. When selected, prices will show |
| 80 | + conversion alongside the original price (e.g., "€250,000 (~$270,000 USD)"). |
| 81 | + </p> |
| 82 | + |
| 83 | + <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3"> |
| 84 | + <% |
| 85 | + current_currencies = @website.available_currencies || [] |
| 86 | + default_currency = @website.default_currency || 'EUR' |
| 87 | + %> |
| 88 | + <% Pwb::Config::COMMON_CURRENCIES.each do |currency_code, label| %> |
| 89 | + <% currency_str = currency_code.to_s %> |
| 90 | + <% is_default = currency_str == default_currency %> |
| 91 | + <label class="flex items-center p-2 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer <%= 'opacity-50' if is_default %>"> |
| 92 | + <input type="checkbox" |
| 93 | + name="pwb_website[available_currencies][]" |
| 94 | + value="<%= currency_str %>" |
| 95 | + <%= 'checked disabled' if is_default %> |
| 96 | + <%= 'checked' if current_currencies.include?(currency_str) && !is_default %> |
| 97 | + class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"> |
| 98 | + <span class="ml-2 text-sm text-gray-700"> |
| 99 | + <%= label %> |
| 100 | + <% if is_default %> |
| 101 | + <span class="text-xs text-gray-400">(default)</span> |
| 102 | + <% end %> |
| 103 | + </span> |
| 104 | + </label> |
| 105 | + <% end %> |
| 106 | + </div> |
| 107 | + |
| 108 | + <!-- Hidden field to ensure empty array is submitted when no checkboxes selected --> |
| 109 | + <input type="hidden" name="pwb_website[available_currencies][]" value=""> |
| 110 | + |
| 111 | + <p class="mt-2 text-sm text-gray-500"> |
| 112 | + <strong>Currency conversion:</strong> |
| 113 | + Exchange rates are updated daily from the European Central Bank. |
| 114 | + Conversions are approximate and for display purposes only. |
| 115 | + </p> |
| 116 | + </div> |
| 117 | + |
73 | 118 | <!-- Default Area Unit --> |
74 | 119 | <div> |
75 | 120 | <label for="default_area_unit" class="block text-sm font-medium text-gray-700 mb-1"> |
|
0 commit comments