profile_editor_helper.rb
10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
module ProfileEditorHelper
include GetText
AREAS_OF_STUDY = [
N_('Agrometeorology'),
N_('Agronomy'),
N_('Foods'),
N_('Anthropology'),
N_('Architecture'),
N_('Arts'),
N_('Astronomy'),
N_('Librarianship'),
N_('Biosciences'),
N_('Biophysics'),
N_('Biology'),
N_('Biotechnology'),
N_('Botany'),
N_('Science Politics'),
N_('Accounting and Actuarial Science'),
N_('Morphologic Sciences'),
N_('Computation'),
N_('Rural Development'),
N_('Law'),
N_('Ecology'),
N_('Economy'),
N_('Education'),
N_('Long-distance Education'),
N_('Physical Education'),
N_('Professional Education'),
N_('Nursing'),
N_('Engineerings'),
N_('Basic and Average education'),
N_('Statistics'),
N_('Stratigraphy'),
N_('Pharmacy'),
N_('Pharmacology'),
N_('Philosophy'),
N_('Physics'),
N_('Plant Protection'),
N_('Genetics'),
N_('Geosciences'),
N_('Geography'),
N_('Geology'),
N_('Hydrology'),
N_('Hydromechanics'),
N_('History'),
N_('Horticulture'),
N_('Informatics'),
N_('Interdisciplinary'),
N_('Journalism'),
N_('Letters'),
N_('Languages'),
N_('Mathematics'),
N_('Medicines'),
N_('Medicine'),
N_('Metallurgy'),
N_('Microbiology'),
N_('Mineralogy'),
N_('Music'),
N_('Nutrition'),
N_('Odontology'),
N_('Paleontology'),
N_('Petrology'),
N_('Production'),
N_('Psychology'),
N_('Psychiatry'),
N_('Quality'),
N_('Chemistry'),
N_('Health'),
N_('Remote Sensing'),
N_('Forestry'),
N_('Sociology'),
N_('Ground'),
N_('Theater'),
N_('Transport'),
N_('Urbanism'),
N_('Veterinary Medicine'),
N_('Zoology'),
N_('Zootecnia'),
N_('Others')
]
COUNTRIES = [
("Afeganistão (افغانستان)"),
("África do Sul (South Africa)"),
("Albânia (Shqipëria)"),
("Alemanha (Deutschland)"),
("Andorra"),
("Angola"),
("Anguila (Anguilla)"),
("Antártica (Antarctica)"),
("Antígua e Barbuda (Antigua and Barbuda)"),
("Antilhas Holandesas (Netherlands Antilles)"),
("Arábia Saudita (العربية السعودية)"),
("Argélia (الجمهورية الجزائرية)"),
("Argentina"),
("Armênia (Հայաստան)"),
("Aruba"),
("Austrália (Australia)"),
("Áustria (Österreich)"),
("Azerbaijão (Azərbaycan)"),
("Bahamas"),
("Bangladesh (বাংলাদেশ)"),
("Barbados"),
("Barein (بحرين)"),
("Bélgica (België)"),
("Belize"),
("Benin (Bénin)"),
("Bermudas (Bermuda)"),
("Bielo-Rússia (Белару́сь)"),
("Bolívia (Bolivia)"),
("Bósnia-Herzegovina (Bosna i Hercegovina)"),
("Botsuana (Botswana)"),
("Brasil"),
("Brunei (Brunei Darussalam)"),
("Bulgária (България)"),
("Burkina Fasso (Burkina Faso)"),
("Burundi (Uburundi)"),
("Butão (འབྲུག་ཡུལ)"),
("Cabo Verde"),
("Camarões (Cameroun)"),
("Camboja (Kampuchea)"),
("Canadá (Canada)"),
("Catar (قطر)"),
("Cazaquistão (Қазақстан)"),
("Chade (Tchad)"),
("Chile"),
("China (中国)"),
("Chipre (Κυπρος)"),
("Cidade do Vaticano (Città del Vaticano)"),
("Cingapura (Singapura)"),
("Colômbia (Colombia)"),
("Comores"),
("Congo"),
("Congo, República democrática do (Congo, Democratic Republic of the)"),
("Coréia do Norte (조선)"),
("Coréia do Sul (한국)"),
("Costa do Marfim (Côte d'Ivoire)"),
("Costa Rica"),
("Croácia (Hrvatska)"),
("Cuba"),
("Dinamarca (Danmark)"),
("Djibuti (Djibouti)"),
("Dominica"),
("Egito (مصر)"),
("El Salvador"),
("Emirados Árabes Unidos (الإمارات العربيّة المتّحد)"),
("Equador (Ecuador)"),
("Eritréia (Ertra)"),
("Eslováquia (Slovensko)"),
("Eslovênia (Slovenija)"),
("Espanha (España)"),
("Estados Unidos (United States)"),
("Estônia (Eesti)"),
("Etiópia (Ityop'iya)"),
("Fiji"),
("Filipinas (Pilipinas)"),
("Finlândia (Suomi)"),
("França (France)"),
("Gabão (Gabon)"),
("Gâmbia (Gambia)"),
("Gana (Ghana)"),
("Geórgia (საქართველო)"),
("Geórgia do Sul e Ilhas Sandwich do Sul (South Georgia and the South Sandwich Islands)"),
("Gibraltar"),
("Granada (Grenada)"),
("Grécia (Eλλας)"),
("Groenlândia (Greenland)"),
("Guadalupe (Guadeloupe)"),
("Guam"),
("Guatemala"),
("Guernsey"),
("Guiana (Guyana)"),
("Guiana Francesa (French Guiana)"),
("Guiné (Guinée)"),
("Guiné-Bissau"),
("Guiné Equatorial (Guinea Ecuatorial)"),
("Haiti (Haïti)"),
("Holanda (Nederland)"),
("Honduras"),
("Hong Kong"),
("Hungria (Magyarország)"),
("Iêmen (اليمن)"),
("Ilha Aland (Aland Islands)"),
("Ilha Bouvet (Bouvet Island)"),
("Ilha Christmas (Christmas Island)"),
("Ilha de Man (Isle of Man)"),
("Ilha Norfolk (Norfolk Island)"),
("Ilhas Cayman (Cayman Islands)"),
("Ilhas Cocos (Keeling) (Cocos Islands)"),
("Ilhas Cook (Cook Islands)"),
("Ilhas Falkland (Malvinas) (Falkland Islands)"),
("Ilhas Faroé (Faroe Islands)"),
("Ilhas Heard e McDonald (Heard Island and McDonald Islands)"),
("Ilhas Marianas do Norte (Northern Mariana Islands)"),
("Ilhas Marshall (Marshall Islands)"),
("Ilhas Maurício (Mauritius)"),
("Ilhas Reunião (Reunion)"),
("Ilhas Salomão (Solomon Islands)"),
("Ilhas Svalbard e Jan Mayen (Svalbard and Jan Mayen)"),
("Ilhas Tokelau (Tokelau)"),
("Ilhas Turks e Caicos (Turks and Caicos Islands)"),
("Ilhas Virgens, Britânicas (Virgin Islands, British)"),
("Ilhas Virgens, EUA (Virgin Islands, U.S.)"),
("Ilhas Wallis e Futuna (Wallis and Futuna)"),
("Índia (India)"),
("Indonésia (Indonesia)"),
("Irã (ایران)"),
("Iraque (العراق)"),
("Irlanda (Ireland)"),
("Islândia (Ísland)"),
("Israel (ישראל)"),
("Itália (Italia)"),
("Jamaica"),
("Japão (日本)"),
("Jordânia (الارد)"),
("Kiribati"),
("Kuwait (الكويت)"),
("Laos (ນລາວ)"),
("Lesoto (Lesotho)"),
("Letônia (Latvija)"),
("Líbano (لبنان)"),
("Libéria (Liberia)"),
("Líbia (ليبية)"),
("Liechtenstein"),
("Lituânia (Lietuva)"),
("Luxemburgo (Lëtzebuerg)"),
("Macau (Macao)"),
("Macedônia (Македонија)"),
("Madagáscar (Madagasikara)"),
("Maiote (Mayotte)"),
("Malásia (Malaysia)"),
("Malavi (Malawi)"),
("Maldivas (ގުޖޭއްރާ ޔާއްރިހޫމްޖ)"),
("Mali"),
("Malta"),
("Marrocos (مغرب)"),
("Martinica (Martinique)"),
("Mauritânia (موريتانية)"),
("México"),
("Micronésia (Micronesia)"),
("Moçambique"),
("Moldávia (Moldova)"),
("Mônaco (Monaco)"),
("Mongólia (Монгол Улс)"),
("Montserrat"),
("Myanmar (Լեռնային Ղարաբաղ)"),
("Namíbia (Namibia)"),
("Nauru (Naoero)"),
("Nepal (नेपाल)"),
("Nicarágua (Nicaragua)"),
("Níger (Niger)"),
("Nigéria (Nigeria)"),
("Niue"),
("Noruega (Norge)"),
("Nova Caledônia (New Caledonia)"),
("Nova Jérsei (Jersey)"),
("Nova Zelândia (New Zealand)"),
("Omã (عمان)"),
("Palau (Belau)"),
("Palestina (Palestine)"),
("Panamá"),
("Papua-Nova Guiné (Papua New Guinea)"),
("Paquistão (پاکستان)"),
("Paraguai (Paraguay)"),
("Peru (Perú)"),
("Pitcairn"),
("Polinésia Francesa (French Polynesia)"),
("Polônia (Polska)"),
("Porto Rico (Puerto Rico)"),
("Portugal"),
("Quênia (Kenya)"),
("Quirquistão (Кыргызстан)"),
("Reino Unido (United Kingdom)"),
("República Centro-Africana (République Centrafricaine)"),
("República Dominicana (Dominican Republic)"),
("República Tcheca (Česko)"),
("Romênia (România)"),
("Ruanda (Rwanda)"),
("Rússia (Россия)"),
("Saara Ocidental (صحراوية)"),
("Samoa"),
("Samoa Americana (American Samoa)"),
("San Marino"),
("Santa Helena (Saint Helena)"),
("Santa Lúcia (Saint Lucia)"),
("São Cristóvão e Névis (Saint Kitts and Nevis)"),
("São Pierre e Miquelon (Saint Pierre and Miquelon)"),
("São Tomé e Príncipe (São Tomé and Príncipe)"),
("São Vincente e Granadinas (Saint Vincent and the Grenadines)"),
("Seicheles (Seychelles)"),
("Senegal (Sénégal)"),
("Serra Leoa (Sierra Leone)"),
("Sérvia e Montenegro (Србија и Црна Гора)"),
("Síria (سورية)"),
("Somália (Soomaaliya)"),
("Sri Lanka"),
("Suazilândia (Swaziland)"),
("Sudão (السودان)"),
("Suécia (Sverige)"),
("Suíça (Schweiz)"),
("Suriname"),
("Tailândia (ราชอาณาจักรไทย)"),
("Taiwan (台灣)"),
("Tajiquistão (Тоҷикистон)"),
("Tanzânia (Tanzania)"),
("Território Britânico do Oceano Índico (British Indian Ocean Territory)"),
("Territórios Franceses do Sul (French Southern Territories)"),
("Territórios Insulares dos Estados Unidos (United States minor outlying islands)"),
("Timor Leste (Timor-Leste)"),
("Togo"),
("Tonga"),
("Trinidad e Tobago (Trinidad and Tobago)"),
("Tunísia (تونس)"),
("Turcomenistão (Türkmenistan)"),
("Turquia (Türkiye)"),
("Tuvalu"),
("Ucrânia (Україна)"),
("Uganda"),
("Uruguai (Uruguay)"),
("Uzbequistão (O'zbekiston)"),
("Vanuatu"),
("Venezuela"),
("Vietnã (Việt Nam)"),
("Zâmbia (Zambia)"),
("Zimbábue (Zimbabwe)")
]
SCHOOLING = [
N_('Post-Doctoral'),
N_('Ph.D.'),
N_('Masters'),
N_('Undergraduate'),
N_('Graduate'),
N_('High School'),
N_('Elementary School')
]
SCHOOLING_STATUS = [
N_('Concluded'),
N_('Incomplete'),
N_('Ongoing')
]
def select_area(title, object, method, options)
labelled_form_field(title, select(object, method, [[_('[Select ...]'), nil]] + ProfileEditorHelper::AREAS_OF_STUDY.map{|s| [gettext(s), s]}, {}, options))
end
def select_country(title, object, method, options)
labelled_form_field(title, select(object, method, [[_('[Select ...]'), nil]] + ProfileEditorHelper::COUNTRIES.map{|s| [s]}, {}, options))
end
def select_schooling(object, method, options)
select(object, method, [[_('[Select ...]'), nil]] + ProfileEditorHelper::SCHOOLING.map{|s| [gettext(s), s]}, {}, options)
end
def select_schooling_status(object, method, options)
select(object, method, [[_('[Select ...]'), nil]] + ProfileEditorHelper::SCHOOLING_STATUS.map{|s| [gettext(s), s]}, {}, options)
end
end