def list
if request.format == :atom and params[:page]
redirect_to params.merge({ :page => nil }), :status => :moved_permanently
- elsif request.format == :html and !params[:bbox]
+ return
+ end
+
+ if params[:display_name]
+ user = User.find_by_display_name(params[:display_name])
+ if !user || !user.active?
+ render_unknown_user params[:display_name]
+ return
+ end
+ end
+
+ if (params[:friends] || params[:nearby]) && !@user && request.format == :html
+ require_user
+ return
+ end
+
+ if request.format == :html and !params[:bbox]
render :action => :history, :layout => map_layout
else
changesets = conditions_nonempty(Changeset.all)
if params[:display_name]
- user = User.find_by_display_name(params[:display_name])
-
- if user and user.active?
- if user.data_public? or user == @user
- changesets = changesets.where(:user_id => user.id)
- else
- changesets = changesets.where("false")
- end
+ if user.data_public? or user == @user
+ changesets = changesets.where(:user_id => user.id)
else
- render_unknown_user params[:display_name]
- return
+ changesets = changesets.where("false")
end
end
- if params[:friends]
- if @user
- changesets = changesets.where(:user_id => @user.friend_users.public)
- elsif request.format == :html
- require_user
- return
- end
+ if params[:friends] && @user
+ changesets = changesets.where(:user_id => @user.friend_users.public)
end
- if params[:nearby]
- if @user
- changesets = changesets.where(:user_id => @user.nearby)
- elsif request.format == :html
- require_user
- return
- end
+ if params[:nearby] && @user
+ changesets = changesets.where(:user_id => @user.nearby)
end
if params[:bbox]
module TitleHelper
def set_title(title = false)
- if title
- title = t('layouts.project_name.title') + ' | ' + title
- else
- title = t('layouts.project_name.title')
- end
- response.headers["X-Page-Title"] = title
+ response.headers["X-Page-Title"] = t('layouts.project_name.title') + (title ? ' | ' + title : '')
@title = title
end
end
-<div class='browse-section'>
- <% if node.redacted? %>
+<% if node.redacted? %>
+ <div class='browse-section browse-redacted'>
<%= t 'browse.redacted.message_html',
:type => t('browse.redacted.type.node'),
:version => node.version,
:redaction_link => link_to(t('browse.redacted.redaction',
:id => node.redaction.id), node.redaction) %>
- <% else %>
+ </div>
+<% else %>
+ <div class='browse-section browse-node'>
<%= render :partial => "common_details", :object => node %>
<% unless node.ways.empty? and node.containing_relation_members.empty? %>
<%= render :partial => "containing_relation", :collection => node.containing_relation_members %>
</ul>
<% end %>
- <% end %>
-</div>
+ </div>
+<% end %>
-<div class='browse-section'>
- <% if relation.redacted? %>
+<% if relation.redacted? %>
+ <div class='browse-section browse-redacted'>
<%= t 'browse.redacted.message_html',
:type => t('browse.redacted.type.relation'),
:version => relation.version,
:redaction_link => link_to(t('browse.redacted.redaction',
:id => relation.redaction.id), relation.redaction) %><
- <% else %>
+ </div>
+<% else %>
+ <div class='browse-section browse-relation'>
<%= render :partial => "common_details", :object => relation %>
<% unless relation.relation_members.empty? %>
<h4><%= t'browse.part_of' %></h4>
<ul><%= render :partial => "containing_relation", :collection => relation.containing_relation_members %></ul>
<% end %>
- <% end %>
-</div>
+ </div>
+<% end %>
-<div class='browse-section'>
- <% if way.redacted? %>
+<% if way.redacted? %>
+ <div class='browse-section browse-redacted'>
<%= t 'browse.redacted.message_html',
:type => t('browse.redacted.type.way'),
:version => way.version,
:redaction_link => link_to(t('browse.redacted.redaction',
:id => way.redaction.id), way.redaction) %>
- <% else %>
+ </div>
+<% else %>
+ <div class='browse-section browse-way'>
<%= render :partial => "common_details", :object => way %>
<% unless way.way_nodes.empty? %>
<%= render :partial => "containing_relation", :collection => way.containing_relation_members %>
</ul>
<% end %>
- <% end %>
-</div>
+ </div>
+<% end %>
OSM.oauth_consumer_secret = "<%= @oauth.client_application.secret %>";
<% end -%>
</script>
- <title><%= @title %></title>
+ <title><%= t 'layouts.project_name.title' %><%= ' | ' + @title if @title %></title>
</head>
hide_areas: Anubrir árees
history_for_feature: Historial de %{feature}
load_data: Cargar datos
- loaded_an_area_with_num_features: "Cargasti un área que contién %{num_features} carauterístiques. Polo xeneral, dellos restoladores nun pueden amosar bien esta cantidá de datos. Normalmente los restoladores funcionen meyor amosando menos de %{max_features} carauterístiques al tiempu: d'otra miente se tornen lentos/dexen de responder. Si tas seguru d'amosar los datos, pues facelo calcando nel botón d'abaxo."
loading: Cargando...
manually_select: Seleiciona manualmente un área distinta
notes_layer_name: Navegar notes
hide_areas: Схаваць вобласьці
history_for_feature: Гісторыя %{feature}
load_data: Загрузіць зьвесткі
- loaded_an_area_with_num_features: Вы загрузілі мясцовасьць, якая ўтрымлівае %{num_features} аб’ектаў. Увогуле, некаторыя браўзэры ня змогуць апрацаваць такую колькасьць зьвестак. Звычайна найлепшы вынік назіраецца, калі аб’ектаў менш за %{max_features}, пры выкананьні яшчэ нейкіх задачаў браўзэр можа страціць хуткасьць/завіснуць. Калі Вы ўпэўненыя, што жадаеце паказаць гэтыя зьвесткі, націсьніце кнопку ніжэй.
loading: Загрузка…
manually_select: Выбраць іншы абшар
notes_layer_name: Прагляд нататак
hide_areas: Sakriti područja
history_for_feature: Historija za %{feature}
load_data: Učitati podatke
- loaded_an_area_with_num_features: "Učitali ste područje koje sadrži %{num_features} značajki. Općenito, neki se web preglednici ne mogu nositi sa prikazom tolike količine podataka. Inače, preglednici najbolje rade kada prikazuju manje od %{max_features} značajki istovremeno: ukoliko radite još nešto, to može usporiti preglednik ili ga zalediti. Ako ste sigurni da želite prikazati ove podtake, možete to učiniti klikom na dugme ispod."
loading: Učitavanje...
manually_select: Ručno izabrati drukčije područje
object_list:
hide_areas: Schovat oblasti
history_for_feature: Historie pro %{feature}
load_data: Nahrát data
- loaded_an_area_with_num_features: Máte načtenu oblast, která obsahuje %{num_features} prvků. Některé prohlížeče mohou mít potíže při zobrazování takového množství dat. Obecně fungují prohlížeče nejlépe při zobrazování ne více než %{max_features} prvků současně – větší množství může způsobit, že bude prohlížeč reagovat pomalu či vůbec. Pokud jste si jisti, že chcete tato data zobrazit, klikněte na tlačítko níže.
loading: Načítá se…
manually_select: Ručně vybrat jinou oblast
notes_layer_name: Procházet poznámky
hide_areas: Skjul områder
history_for_feature: Historik for %{feature}
load_data: Indlæs data
- loaded_an_area_with_num_features: "Du har indlæst et område som indeholder %{num_features} objekter. Nogle browsere kan have problemer ved håndtering af så meget data. Browsere fungerer generelt bedst med mindre end %{max_features} objekter ad gangen: flere objekter kan gøre at din browser bliver langsom. Hvis du er sikker på, at du vil se alle disse data, så klik på knappen nedenfor."
loading: Indlæser...
manually_select: Vælg et andet område manuelt
notes_layer_name: Gennemse bemærkninger
hide_areas: Flächen ausblenden
history_for_feature: Chronik für %{feature}
load_data: Daten laden
- loaded_an_area_with_num_features: Du hast einen Bereich ausgewählt, der %{num_features} Elemente enthält. Manche Browser werden bei der Verarbeitung einer so großen Datenmenge langsam oder frieren ein (reagieren nicht mehr auf Eingaben). Üblicherweise sollten weniger als %{max_features} Elemente angezeigt werden. Falls du dir sicher bist, dass so viele Elemente laden möchtest, klicke unten auf „Daten laden“.
loading: Lade …
manually_select: Einen anderen Kartenausschnitt manuell auswählen
notes_layer_name: Alle Hinweise anzeigen
hide_areas: Απόκρυψη περιοχών
history_for_feature: Ιστορικό για %{feature}
load_data: Φόρτωση δεδομένων
- loaded_an_area_with_num_features: "Έχετε φορτώσει μια περιοχή που περιέχει %{num_features} χαρακτηριστικά. Γενικά, μερικοί browsers μπορεί να μην αντέχουν να δείξουν τόσα πολλά στοιχεία. Γενικά, οι browsers δουλεύουν καλύτερα δείχνοντας λιγότερα από %{max_features} χαρακτηριστικά τη φορά: με οτιδήποτε άλλο ο browser μπορεί να γίνει αργός ή να μην αντιδρά. Αν είστε σίγουρος ότι θέλετε να δείτε αυτά τα δεδομένα, κάντε κλικ στο παρακάτω κουμπί."
loading: Φόρτωση σε εξέλιξη...
manually_select: Χειροκίνητη επιλογή διαφορετικής περιοχής
notes_layer_name: Περιήγηση Σημειώσεων
hide_areas: Ocultar áreas
history_for_feature: Historial de %{feature}
load_data: Cargar datos
- loaded_an_area_with_num_features: Has cargado un área que contiene %{num_features} objetos. Por lo general, algunos navegadores de internet no aguantan bien el mostrar esta cantidad de información vectorial. Generalmente, el funcionamiento óptimo se da cuando se muestran menos de %{max_features} objetos al mismo tiempo; de otra manera, tu navegador puede volverse lento o no responder. Si estás seguro de que quieres mostrar todos estos datos, puedes hacerlo pulsando el botón que aparece debajo.
loading: Cargando...
manually_select: Seleccionar manualmente un área diferente
notes_layer_name: Ver notas
hide_areas: Peida alad
history_for_feature: Omaduse %{feature} ajalugu
load_data: Laadi andmed
- loaded_an_area_with_num_features: Oled laadinud ala, mis sisaldab %{num_features} objekti. Mõned brauserid ei saa hästi hakkama sellise hulga andmete kuvamisega. Üldiselt suudavad brauserid kuvada korraga kuni %{max_features} objekti. Suurema arvu laadimine võib muuta brauseri aeglaseks või see lakkab üldse toimimast. Kui soovid siiski neid andmeid kuvada, võid seda teha, klõpsates nupul allpool.
loading: Laadin andmeid...
manually_select: Vali uus ala
notes_layer_name: Sirvi märkuseid
hide_areas: Piilota alueet
history_for_feature: Ominaisuuden %{feature} historia
load_data: Lataa tiedot
- loaded_an_area_with_num_features: Olet ladannut alueen, joka sisältää %{num_features} osiota. Yleensä jotkin selaimet eivät kykene näyttämään tätä määrää dataa. Yleisesti selaimet toimivat parhaiten näyttäessään alle %{max_features} kohdetta kerrallaan. Muussa tapauksessa selain saattaa tulla hitaaksi tai lakata toimimasta kokonaan. Jos olet varma että haluat näyttää tämän datan, voit tehdä niin napsauttamalla alla olevaa painiketta.
loading: Ladataan tietoja...
manually_select: Rajaa pienempi alue käsin
notes_layer_name: Näytä karttailmoitukset
hide_areas: Plate areis
history_for_feature: Storic par %{feature}
load_data: Cjame i dâts
- loaded_an_area_with_num_features: "Tu âs cjamât une aree che e conten %{num_features} carataristichis. In gjenerâl, cualchi sgarfadôr al podarès no rivâ a gjestî ben cheste cuantitât di dâts. I sgarfadôrs par solit a lavorin miôr se a mostrin mancul di %{max_features} carataristichis ae volte: cualsisei altri numar al podarès ralentâ/no fâ plui rispuindi il sgarfadôr. Se tu sês sigûr di volê mostrâ chescj dâts, frache sul boton ca sot."
loading: Daûr a cjamâ...
manually_select: Sielç a man une aree divierse
notes_layer_name: Mostre lis notis
hide_areas: Agochar as zonas
history_for_feature: Historial de %{feature}
load_data: Cargar os datos
- loaded_an_area_with_num_features: Cargou unha zona que contén %{num_features} funcionalidades. Pode que algúns navegadores teñan problemas para mostrar correctamente esta cantidade de datos. Xeralmente, os navegadores traballan mellor mostrando menos de %{max_features} funcionalidades á vez. Utilizar máis pode provocar que o navegador vaia lento ou non responda. Se está seguro de que quere mostrar estes datos, pode facelo premendo no seguinte botón.
loading: Cargando...
manually_select: Escoller manualmente unha zona distinta
notes_layer_name: Explorar as notas
hide_areas: להסתרת אזורים
history_for_feature: ההיסטוריה של %{feature}
load_data: טעינת נתונים
- loaded_an_area_with_num_features: "האזור שנטען מכיל %{num_features} תכונות. באופן כללי, חלק מהדפדפנים לא יוכלו להתמודד עם הצגה של כזו כמות של נתונים. לרוב, דפדפנים עובדים באופן מיטבי בהצגת פחות מ־%{max_features} תכונות בו־זמנית: ביצוע משימות נוספות עלול לגרום לדפדפן לפעול באופן איטי או להיתקע. אם ברצונך בכל זאת להציג מידע זה, באפשרותך להציג אותו בלחיצה על הכפתור למטה."
loading: בטעינה...
manually_select: בחירת אזור אחר ידנית
notes_layer_name: עיון בהערות
hide_areas: Területek elrejtése
history_for_feature: "%{feature} előzményei"
load_data: Adatok betöltése
- loaded_an_area_with_num_features: "Olyan területet töltöttél be, amely %{num_features} elemet tartalmaz. Néhány böngésző lehet, hogy nem birkózik meg ekkora mennyiségű adattal. Általában a böngészők egyszerre legfeljebb %{max_features} elemet tudnak megjeleníteni: minden más esetben a böngésző lelassulhat/nem válaszolhat. Ha biztos vagy benne, hogy meg szeretnéd jeleníteni ezeket az adatokat, megteheted ezt az alábbi gombra kattintva."
loading: Betöltés…
manually_select: Más terület kézi kijelölése
notes_layer_name: Jegyzetek böngészése
hide_areas: Celar areas
history_for_feature: Historia de %{feature}
load_data: Cargar datos
- loaded_an_area_with_num_features: Tu ha cargate un area que contine %{num_features} elementos. In general, alcun navigatores del web pote haber problemas in presentar un tal quantitate de datos. Generalmente, un navigator functiona melio monstrante minus de %{max_features} elementos per vice; alteremente, illo pote devenir lente o non responder. Si tu es secur de voler visualisar iste datos, tu pote cliccar super le button a basso.
loading: Cargamento...
manually_select: Seliger manualmente un altere area
notes_layer_name: Percurrer notas
hide_areas: Sembunyikan wilayah
history_for_feature: Riwayat untuk %{feature}
load_data: Memuat Data
- loaded_an_area_with_num_features: "Anda telah memuat wilayah yang berisi %{num_features} fitur. Secara umum, beberapa browser mungkin tidak dapat mengatasi dengan baik untuk menampilkan sejumlah data tersebut, browser akan bekerja dengan baik dalam menampilkan data kurang dari %{max_features} fitur pada saat yang sama: lebih daripada itu akan membuat browser anda menjadi lamban/tidak responsif. Jika anda yakin ingin menampilkan data ini, anda dapat melakukannya dengan mengklik tombol di bawah."
loading: Memuat...
manually_select: Pilih wilayah berbeda secara manual
notes_layer_name: Lihat Catatan
hide_areas: Nascondi le aree
history_for_feature: Cronologia per %{feature}
load_data: Carica dati
- loaded_an_area_with_num_features: "È stata caricata un'area che contiene %{num_features} caratteristiche. In generale, alcuni browser potrebbero non visualizzare correttamente questa quantità di dati. Generalmente i browser lavorano al meglio se si visualizzano meno di %{max_features} caratteristiche alla volta: se si fa qualcos'altro il proprio browser potrebbe diventare lento o non rispondere più. Se si è sicuri di voler visualizzare questi dati, allora si può premere il pulsante sottostante."
loading: Caricamento in corso...
manually_select: Seleziona manualmente un'area differente
notes_layer_name: Mostra le note
hide_areas: 領域を隠す
history_for_feature: "%{feature}の履歴"
load_data: データの読み込み
- loaded_an_area_with_num_features: "%{num_features}件の地物を含む領域を読み込みました。一般に、ブラウザーによっては、この量のデータを表示するとうまく処理できないかもしれません。通常、ブラウザーは一度に%{max_features}件未満の地物を表示させるとうまく動作します。このままでは、ブラウザーが遅くなったり、反応しなくなったりします。それでもこのデータを表示したいならば、以下のボタンをクリックしてください。"
loading: 読み込み中...
manually_select: ドラッグして別の領域を選択
notes_layer_name: メモを閲覧
hide_areas: 지역 숨기기
history_for_feature: "%{feature}의 역사"
load_data: 데이터 불러오기
- loaded_an_area_with_num_features: 당신은 특성을 가진 지역 %{num_features}개를 불러왔습니다. 일반적으로, 일부 브라우저에서는 이 데이터 개수를 모두 처리하지 못할 수도 있습니다. 일반적으로, 브라우저들은 대개 특성 %{max_features}개 이하를 처리하여 보여줄 수 있습니다. 그렇지 않은 경우, 브라우저의 속도가 저하되거나 브라우저의 반응이 느려질 수 있습니다. 여전히 이 데이터를 표시하려면, 아래의 버튼을 클릭하세요.
loading: 불러오는 중...
manually_select: 다른 지역 선택
notes_layer_name: 참고 찾아보기
hide_areas: Slėpti sritis
history_for_feature: Istorija apie %{feature}
load_data: Kraunami duomenys
- loaded_an_area_with_num_features: Jūs įkėlėte sritį, kurioje yra %{num_features} elementų. Dažniausiai naršyklės nelabai gerai susitvarko su tokiu duomenų kiekiu. Paprastai naršyklės kur kas geriau susidoroja, kai elementų yra mažiau nei %{max_features} vienu metu. Bet kokie kiti veiksmai gali stipriai sulėtinti naršyklę. Jei tikrai norite žiūrėti šiuos duomenis, spauskite žemiau esantį mygtuką.
loading: Kraunama...
manually_select: Rankiniu būdu pažymėkite kitą teritoriją
notes_layer_name: Peržiūrėti pastabas
hide_areas: Paslēpt zonas
history_for_feature: Vēsture %{feature}
load_data: Ielādēt datus
- loaded_an_area_with_num_features: "Jūs esat ielādējis apgabalu, kurš satur %{num_features} iezīmes. Pamatā, daži pārlūki var pārāk labi netikt galā ar šādu lielu datu kvantuma parādīšanu. Parasti, pārlūki tiek galā vislabāk rādot mazāk nekā %{max_features} iezīmes vienlaikus: jebkā cita darīšana tos bremzē. Ja Jūs esat drošs, ka vēlaties attēlot šos datus, Jūs tā varat izdarīt spiežot pogu zemāk."
loading: Ielādē…
manually_select: Manuāli izvēlēties citu apgabalu
notes_layer_name: Pārlūkot Piezīmes
hide_areas: Скриј подрачја
history_for_feature: Историја за %{feature}
load_data: Вчитај ги податоците
- loaded_an_area_with_num_features: "Вчитавте простор што содржи %{num_features} елементи. Некои прелистувачи не можат да се справат со толку податоци. Начелно, прелистувачите работат најдобро при помалку од %{max_features} елементи наеднаш: ако правите нешто друго прелистувачот ќе ви биде бавен/пасивен. Ако и покрај тоа сакате да се прикажат овие податоци, тогаш стиснете на копчето подолу."
loading: Вчитувам...
manually_select: Рачно изберете друга површина
notes_layer_name: Прелистај белешки
hide_areas: Sorokkan kawasan
history_for_feature: Sejarah %{feature}
load_data: Muatkan Data
- loaded_an_area_with_num_features: Anda telah memilih satu kawasan yang mengandungi %{num_features} ciri. Pada umumnya, sesetengah pelayar web tidak mungkin mampu memaparkan sebegini banyak data dengan betul. Lazimnya, pelayar paling berkemampuan apabila memaparkan kurang daripada %{max_features} ciri sekaligus; lebih daripada itu mungkin akan melambatkan pelayar anda atau membuatnya tidak responsif. Jika anda betul-betul ingin memaparkan data ini, anda boleh berbuat demikian dengan mengklik butang di bawah.
loading: Memuatkan...
manually_select: Pilih kawasan yang lain secara insani
notes_layer_name: Semak Imbas Nota
hide_areas: Skjul områder
history_for_feature: Historikk for %{feature}
load_data: Last inn data
- loaded_an_area_with_num_features: "Du har lastet et område som inneholder %{num_features} objekter. Noen nettlesere kan få problemer med å håndtere så mye data. Generelt fungerer nettlesere best med mindre enn %{max_features} objekter av gangen: flere objekter kan føre til at nettleseren din blir treg eller fryser helt. Om du er sikker på at du vil se denne informasjonen, kan du gjøre det ved å klikke på knappen under."
loading: Laster...
manually_select: Velg et annet område manuelt
notes_layer_name: Se på merknader
hide_areas: Gebieden verbergen
history_for_feature: Geschiedenis voor %{feature}
load_data: Gegevens laden
- loaded_an_area_with_num_features: U hebt een gebied geladen dat %{num_features} objecten bevat. Sommige browsers kunnen niet goed overweg met zoveel gegevens. Normaal gesproken werken browsers het best met minder dan %{max_features} objecten. Als u er meer weergeeft kan de browser traag worden of niet meer reageren. Als u zeker weet dat u de gegevens wilt weergeven, klik dan op de knop hieronder.
loading: Bezig met laden…
manually_select: Handmatig een ander gebied selecteren
notes_layer_name: Opmerkingen bekijken
hide_areas: Skjul områder
history_for_feature: Historikk for %{feature}
load_data: Last inn data
- loaded_an_area_with_num_features: Dette området inneheld %{num_features} objekt. Nokre nettlesarar kan ikkje handtere så mykje data. For å ikkje risikere at nettlesaren låsar seg bør du halde deg til under %{max_features} objekt. Om du er sikker på at du vil sjå informasjonen kan du klikke på knappen nedanfor.
loading: Lastar...
manually_select: Vel eit anna område manuelt
notes_layer_name: Bla gjennom notiser
hide_areas: Ukryj obszary
history_for_feature: Historia zmian dla %{feature}
load_data: Wczytaj dane
- loaded_an_area_with_num_features: Wczytano obszar zawierający %{num_features} obiektów. Niektóre przeglądarki internetowe mogą nie radzić sobie z wyświetleniem tej ilości danych. Na ogół przeglądarki działają najlepiej przy wyświetlaniu mniej niż %{max_features} obiektów jednocześnie, w przeciwnym przypadku przeglądarka może działać powoli lub przestać odpowiadać. Jeśli jesteś pewien, że chcesz wyświetlić dane, kliknij przycisk poniżej.
loading: Wczytywanie...
manually_select: Ręcznie zaznacz inny obszar
notes_layer_name: Przeglądaj uwagi
hide_areas: Ocultar áreas
history_for_feature: Histórico para %{feature}
load_data: Carregar dados
- loaded_an_area_with_num_features: "Você carregou uma área que contém %{num_features} pontos. Alguns navegadores podem não conseguir exibir essa quantidade de dados. Geralmente, navegadores trabalham melhor exibindo menos de %{max_features} pontos por vez: acima disso pode deixá-lo lento ou travá-lo. Se você tem certeza que deseja exibir estes dados, clique no botão abaixo."
loading: Carregando...
manually_select: Selecionar manualmente uma área diferente
notes_layer_name: Ver Notas
hide_areas: Ocultar áreas
history_for_feature: Histórico de %{feature}
load_data: Carregar Dados
- loaded_an_area_with_num_features: Carregou uma área com %{num_features} elementos. Alguns navegadores de Internet podem ter problemas em mostrar esta quantidade de dados. Geralmente os navegadores funcionam melhor a mostrar até %{max_features} elementos de cada vez. Mais do que isso o navegador poderá ficar muito lento ou até bloquear. Se tem a certeza que quer mostrar esta quantidade de elementos clique no botão seguinte.
loading: A carregar…
manually_select: Selecionar manualmente uma área diferente
notes_layer_name: Ver Erros Reportados
hide_areas: Ascunde suprafețele
history_for_feature: Istoric pentru %{feature}
load_data: Încărcare date
- loaded_an_area_with_num_features: "Ați încărcat o zonă care conține %{num_features} elemente. În general, unele navigatoare nu sunt capabile să facă față afișării unei asemenea cantități de date. Navigatoarele funcționează cel mai bine atunci când afișează mai puțin de %{max_features} elemente simultan: dacă mai faceți și alte operații cu navigatorul dumneavoastră în paralel veți observa o încetinire / lipsă de răspuns din partea navigatorului. Dacă doriți să afișați aceste date apăsați butonul de mai jos."
loading: Se încarcă...
manually_select: Selectare manuală a unei alte zone
object_list:
hide_areas: Скрыть области
history_for_feature: История %{feature}
load_data: Загрузить данные
- loaded_an_area_with_num_features: Вы загрузили область, которая содержит %{num_features} объектов. Некоторые браузеры могут не справиться с отображением такого количества данных. Обычно браузеры могут обрабатывать до %{max_features} объектов. Загрузка большего числа может замедлить ваш браузер или привести к его зависанию. Если вы всё равно хотите отобразить эти данные, нажмите на кнопку ниже.
loading: Загрузка...
manually_select: Выделить другую область
notes_layer_name: Просмотр заметок
hide_areas: Skryť oblasti
history_for_feature: História pre %{feature}
load_data: Načítať údaje
- loaded_an_area_with_num_features: Máte načítanú oblasť, ktorá obsahuje %{num_features} zložiek. Niektoré prehliadače môžu mať problémy so zobrazením takého množstva dát, viac než približne %{max_features} položiek ich môže spomaliť až zablokovať. Pokiaľ ste si istý, že chcete dáta zobraziť, kliknite na tlačítko nižšie.
loading: Nahrávanie...
manually_select: Manuálne vybrať inú oblasť
notes_layer_name: Zobraziť všetky chyby
hide_areas: Skrij področja
history_for_feature: Zgodovina %{feature}
load_data: Naloži podatke
- loaded_an_area_with_num_features: "Naložili ste področje, ki vsebuje %{num_features} elementov. Nekateri spletni brskalniki ne zmorejo prikaza takšne količine podatkov. Na splošno brskalniki najbolje prikazujejo %{max_features} ali manj elementov hkrati: karkoli drugega lahko upočasni vaš brskalnik ali ga naredi neodzivnega. Če ste prepričani, da želite prikazati vse te podatke, pritisnite na spodnji gumb."
loading: Nalaganje ...
manually_select: Ročno izberite drugo področje
notes_layer_name: Brskanje opomb
hide_areas: Sakrij područja
history_for_feature: Istorija za %{feature}
load_data: Učitaj podatke
- loaded_an_area_with_num_features: "Učitali ste područje koje sadrži %{num_features} mogućnosti. Neki pregledači se ne mogu nositi s tolikom količinom podataka. Oni najbolje rade kada prikazuju manje od %{max_features} mogućnosti istovremeno: ako radite još nešto, to može usporiti pregledač ili ga zakočiti. Ako ste sigurni da želite da prikažete ove podatke, možete to uraditi klikom na dugme ispod."
loading: Učitavam…
manually_select: Ručno izaberite drugo područje
object_list:
hide_areas: Сакриј подручја
history_for_feature: Историја за %{feature}
load_data: Учитај податке
- loaded_an_area_with_num_features: "Учитали сте подручје које садржи %{num_features} могућности. Неки прегледачи се не могу носити с толиком количином података. Они најбоље раде када приказују мање од %{max_features} могућности истовремено: ако радите још нешто, то може успорити прегледач или га закочити. Ако сте сигурни да желите да прикажете ове податке, можете то урадити кликом на дугме испод."
loading: Учитавам…
manually_select: Ручно изаберите друго подручје
object_list:
hide_areas: Göm område
history_for_feature: Historik för %{feature}
load_data: Ladda data
- loaded_an_area_with_num_features: "Du har läst in ett område som innehåller %{num_features} objekt. En del webbläsare klarar inte av hantering av sådana stora mängder data. Vanligtvis arbetar webbläsare bäst när de visar mindre än %{max_features} objekt samtidigt: att göra någonting annat kan få din webbläsare att bli långsam eller sluta att svara. Om du är säker på att du vill visa denna data kan du göra det genom att klicka på knappen nedan."
loading: Läser in...
manually_select: Välj ett annan område manuellt
notes_layer_name: Bläddra bland anteckningar
hide_areas: Itago ang mga lugar
history_for_feature: Kasaysayan para sa %{feature}
load_data: Ikarga ang Dato
- loaded_an_area_with_num_features: "Nagkarga ka ng isang pook na naglalaman ng %{num_features} na mga tampok. Sa pangkalahatan, ilang mga pantingin-tingin ang hindi maaaring makaangkop ng mabuti sa pagpapakita ng ganitong dami ng dato. Sa pangkalahatan, gumagana ng pinakamahusay ang mga pantingin-tingin kapag nagpapakita ng mas kakaunti kaysa %{max_features} na mga tampok: ang paggawa ng ibang mga bagay ay maaaring makagawa sa iyong pantingin-tingin upang bumagal/hindi tumutugon. Kung nakatitiyak kang nais mong ipakita ang ganitong dato, magagawa mo ito sa pamamagitan ng pagpindot sa pindutang nasa ibaba."
loading: Ikinakarga...
manually_select: Kinakamay na pumili ng iba pang lugar
object_list:
hide_areas: Приховати ділянки
history_for_feature: Історія %{feature}
load_data: Завантажити Дані
- loaded_an_area_with_num_features: "Ви завантажили ділянку, яка містить %{num_features} об’єктів. Загалом, деякі оглядачі можуть не впоратися з відображенням такої кількості даних. Зазвичай, оглядачі працюють краще, коли водночас показується не більше %{max_features} об'єктів: якщо ж ви робите інакше, це може спричинити сповільнення чи взагалі відсутність відгуку у вашому оглядачі. Коли ви впевнені, що слід показати ці дані, можете натиснути кнопку нижче."
loading: Завантаження…
manually_select: Виберіть іншу ділянку
notes_layer_name: Огляд нотаток
hide_areas: Ẩn các khu vực
history_for_feature: Lịch sử %{feature}
load_data: Tải Dữ liệu
- loaded_an_area_with_num_features: Bạn đã tải vùng chứa %{num_features} đối tượng. Một số trình duyệt bị trục trặc khi hiển thị nhiều dữ liệu như thế. Nói chung, các trình duyệt hoạt động tốt với tối đa %{max_features} đối tượng cùng lúc; nếu hơn thì trình duyệt sẽ chậm chạp. Nếu bạn chắc chắn muốn xem dữ liệu này, hãy bấm nút ở dưới.
loading: Đang tải…
manually_select: Chọn vùng khác thủ công
notes_layer_name: Xem các Ghi chú
hide_areas: 隐藏区域
history_for_feature: "%{feature}的历史"
load_data: 载入数据
- loaded_an_area_with_num_features: 你已经载入一个包含%{num_features}个特征的区域。一般而言,一些浏览器无法正常显示这一数量的数据。通常,浏览器可以较好地显示少于%{max_features}个特征,超过这一数量则会使你的浏览器变慢/无响应。如果你确定你想要显示这些数据,请单击下面的按钮。
loading: 正在载入...
manually_select: 手动选择不同的区域
notes_layer_name: 浏览注释
)
end
- def test_start
- xhr :get, :start
- assert_response :success
- end
-
def test_read_relation
- browse_check 'relation', relations(:visible_relation).relation_id
+ browse_check 'relation', relations(:visible_relation).relation_id, 'browse/feature'
end
def test_read_relation_history
- browse_check 'relation_history', relations(:visible_relation).relation_id
+ browse_check 'relation_history', relations(:visible_relation).relation_id, 'browse/history'
end
def test_read_way
- browse_check 'way', ways(:visible_way).way_id
+ browse_check 'way', ways(:visible_way).way_id, 'browse/feature'
end
def test_read_way_history
- browse_check 'way_history', ways(:visible_way).way_id
+ browse_check 'way_history', ways(:visible_way).way_id, 'browse/history'
end
def test_read_node
- browse_check 'node', nodes(:visible_node).node_id
+ browse_check 'node', nodes(:visible_node).node_id, 'browse/feature'
end
def test_read_node_history
- browse_check 'node_history', nodes(:visible_node).node_id
+ browse_check 'node_history', nodes(:visible_node).node_id, 'browse/history'
end
def test_read_changeset
- browse_check 'changeset', changesets(:normal_user_first_change).id
+ browse_check 'changeset', changesets(:normal_user_first_change).id, 'browse/changeset'
end
def test_read_note
- browse_check 'note', notes(:open_note).id
+ browse_check 'note', notes(:open_note).id, 'browse/note'
end
##
def test_redacted_node_history
get :node_history, :id => nodes(:redacted_node_redacted_version).node_id
assert_response :success
- assert_template 'node_history'
+ assert_template 'browse/history'
# there are 2 revisions of the redacted node, but only one
# should be showing details here.
- assert_select "body div#content div.browse_details", 2
- assert_select "body div#content div.browse_details[id=1] div.common", 0
- assert_select "body div#content div.browse_details[id=2] div.common", 1
+ assert_select ".browse-section", 2
+ assert_select ".browse-section.browse-redacted", 1
+ assert_select ".browse-section.browse-node", 1
end
def test_redacted_way_history
get :way_history, :id => ways(:way_with_redacted_versions_v1).way_id
assert_response :success
- assert_template 'way_history'
+ assert_template 'browse/history'
# there are 4 revisions of the redacted way, but only 2
# should be showing details here.
- assert_select "body div#content div.browse_details", 4
- assert_select "body div#content div.browse_details[id=1] div.common", 1
- assert_select "body div#content div.browse_details[id=2] div.common", 0
- assert_select "body div#content div.browse_details[id=3] div.common", 0
- assert_select "body div#content div.browse_details[id=4] div.common", 1
+ assert_select ".browse-section", 4
+ assert_select ".browse-section.browse-redacted", 2
+ assert_select ".browse-section.browse-way", 2
end
def test_redacted_relation_history
get :relation_history, :id => relations(:relation_with_redacted_versions_v1).relation_id
assert_response :success
- assert_template 'relation_history'
+ assert_template 'browse/history'
# there are 4 revisions of the redacted relation, but only 2
# should be showing details here.
- assert_select "body div#content div.browse_details", 4
- assert_select "body div#content div.browse_details[id=1] div.common", 1
- assert_select "body div#content div.browse_details[id=2] div.common", 0
- assert_select "body div#content div.browse_details[id=3] div.common", 0
- assert_select "body div#content div.browse_details[id=4] div.common", 1
+ assert_select ".browse-section", 4
+ assert_select ".browse-section.browse-redacted", 2
+ assert_select ".browse-section.browse-relation", 2
end
private
# First we check that when we don't have an id, it will correctly return a 404
# then we check that we get the correct 404 when a non-existant id is passed
# then we check that it will get a successful response, when we do pass an id
- def browse_check(type, id)
+ def browse_check(type, id, template)
assert_raise ActionController::UrlGenerationError do
get type
end
end
get type, {:id => id}
assert_response :success
- assert_template type
+ assert_template template
end
end
{ :controller => "changeset", :action => "list", :nearby => true }
)
assert_routing(
- { :path => "/browse/changesets", :method => :get },
+ { :path => "/history", :method => :get },
{ :controller => "changeset", :action => "list" }
)
assert_routing(
- { :path => "/browse/changesets/feed", :method => :get },
+ { :path => "/history/feed", :method => :get },
{ :controller => "changeset", :action => "feed", :format => :atom }
)
- assert_recognizes(
- { :controller => "changeset", :action => "list" },
- { :path => "/browse", :method => :get }
- )
- assert_recognizes(
- { :controller => "changeset", :action => "list" },
- { :path => "/history", :method => :get }
- )
- assert_recognizes(
- { :controller => "changeset", :action => "feed", :format => :atom },
- { :path => "/history/feed", :method => :get }
- )
end
# -----------------------
##
# This should display the last 20 changesets closed.
def test_list
- changesets = Changeset.where("num_changes > 0").order(:created_at => :desc).limit(20)
- assert changesets.size <= 20
get :list, {:format => "html"}
assert_response :success
+ assert_template "changeset/history"
+ assert_select "h2", :text => "Changesets", :count => 1
+
+ get :list, {:format => "html", :bbox => '-180,-90,90,180'}
+ assert_response :success
assert_template "list"
+
+ changesets = Changeset.
+ where("num_changes > 0 and min_lon is not null").
+ order(:created_at => :desc).
+ limit(20)
+ assert changesets.size <= 20
+
# Now check that all 20 (or however many were returned) changesets are in the html
- assert_select "h1", :text => "Changesets", :count => 1
- assert_select "div[id='changeset_list'] ul", :count => changesets.size
+ assert_select "li", :count => changesets.size
changesets.each do |changeset|
# FIXME this test needs rewriting - test for table contents
end
user = users(:public_user)
get :list, {:format => "html", :display_name => user.display_name}
assert_response :success
- assert_template "changeset/_user"
+ assert_template "changeset/history"
## FIXME need to add more checks to see which if edits are actually shown if your data is public
end
user = users(:public_user)
get :feed, {:format => "atom", :display_name => user.display_name}
assert_response :success
- assert_template "changeset/_user"
+ assert_template "changeset/list"
+ assert_equal "application/atom+xml", response.content_type
## FIXME need to add more checks to see which if edits are actually shown if your data is public
end
#print @response.body
#print @response.to_yaml
- assert_select "html", :count => 1 do
- assert_select "head", :count => 1 do
- assert_select "title", :text => /New Diary Entry/, :count => 1
- end
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h1", :text => "New Diary Entry", :count => 1
- end
- assert_select "div#content", :count => 1 do
- # We don't care about the layout, we just care about the form fields
- # that are available
- assert_select "form[action='/diary/new']", :count => 1 do
- assert_select "input[id=diary_entry_title][name='diary_entry[title]']", :count => 1
- assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :count => 1
- assert_select "input#latitude[name='diary_entry[latitude]'][type=text]", :count => 1
- assert_select "input#longitude[name='diary_entry[longitude]'][type=text]", :count => 1
- assert_select "input[name=commit][type=submit][value=Save]", :count => 1
- end
- end
- end
+ assert_select "title", :text => /New Diary Entry/, :count => 1
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h1", :text => "New Diary Entry", :count => 1
+ end
+ assert_select "div#content", :count => 1 do
+ # We don't care about the layout, we just care about the form fields
+ # that are available
+ assert_select "form[action='/diary/new']", :count => 1 do
+ assert_select "input[id=diary_entry_title][name='diary_entry[title]']", :count => 1
+ assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :count => 1
+ assert_select "input#latitude[name='diary_entry[latitude]'][type=text]", :count => 1
+ assert_select "input#longitude[name='diary_entry[longitude]'][type=text]", :count => 1
+ assert_select "input[name=commit][type=submit][value=Save]", :count => 1
end
end
-
end
def test_editing_diary_entry
# Verify that you get a not found error, when you pass a bogus id
get(:edit, {:display_name => entry.user.display_name, :id => 9999}, {'user' => entry.user.id})
assert_response :not_found
- assert_select "html", :count => 1 do
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h2", :text => "No entry with the id: 9999", :count => 1
- end
- end
- end
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h2", :text => "No entry with the id: 9999", :count => 1
end
-
+
# Now pass the id, and check that you can edit it, when using the same
# user as the person who created the entry
get(:edit, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id})
assert_response :success
- assert_select "html", :count => 1 do
- assert_select "head", :count => 1 do
- assert_select "title", :text => /Edit diary entry/, :count => 1
- end
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h1", :text => /Edit diary entry/, :count => 1
- end
- assert_select "div#content", :count => 1 do
- assert_select "form[action='/user/#{entry.user.display_name}/diary/#{entry.id}/edit'][method=post]", :count => 1 do
- assert_select "input#diary_entry_title[name='diary_entry[title]'][value='#{entry.title}']", :count => 1
- assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => entry.body, :count => 1
- assert_select "select#diary_entry_language_code", :count => 1
- assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1
- assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1
- assert_select "input[name=commit][type=submit][value=Save]", :count => 1
- assert_select "input[name=commit][type=submit][value=Edit]", :count => 1
- assert_select "input[name=commit][type=submit][value=Preview]", :count => 1
- assert_select "input", :count => 7
- end
- end
- end
+ assert_select "title", :text => /Edit diary entry/, :count => 1
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h1", :text => /Edit diary entry/, :count => 1
+ end
+ assert_select "div#content", :count => 1 do
+ assert_select "form[action='/user/#{entry.user.display_name}/diary/#{entry.id}/edit'][method=post]", :count => 1 do
+ assert_select "input#diary_entry_title[name='diary_entry[title]'][value='#{entry.title}']", :count => 1
+ assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => entry.body, :count => 1
+ assert_select "select#diary_entry_language_code", :count => 1
+ assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1
+ assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1
+ assert_select "input[name=commit][type=submit][value=Save]", :count => 1
+ assert_select "input[name=commit][type=submit][value=Edit]", :count => 1
+ assert_select "input[name=commit][type=submit][value=Preview]", :count => 1
+ assert_select "input", :count => 7
end
end
-
+
# Now lets see if you can edit the diary entry
new_title = "New Title"
new_body = "This is a new body for the diary entry"
get :view, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id}
assert_response :success
assert_template 'diary_entry/view'
- assert_select "html", :count => 1 do
- assert_select "head", :count => 1 do
- assert_select "title", :text => /Users' diaries | /, :count => 1
- end
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1
- end
- assert_select "div#content", :count => 1 do
- assert_select "div.post_heading", :text => /#{new_title}/, :count => 1
- # This next line won't work if the text has been run through the htmlize function
- # due to formatting that could be introduced
- assert_select "p", :text => /#{new_body}/, :count => 1
- assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1
- # As we're not logged in, check that you cannot edit
- #print @response.body
- assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1
- end
- end
- end
+ assert_select "title", :text => /Users' diaries | /, :count => 1
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1
+ end
+ assert_select "div#content", :count => 1 do
+ assert_select "div.post_heading", :text => /#{new_title}/, :count => 1
+ # This next line won't work if the text has been run through the htmlize function
+ # due to formatting that could be introduced
+ assert_select "p", :text => /#{new_body}/, :count => 1
+ assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1
+ # As we're not logged in, check that you cannot edit
+ #print @response.body
+ assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1
end
# and when not logged in as the user who wrote the entry
get :view, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id}
assert_response :success
assert_template 'diary_entry/view'
- assert_select "html", :count => 1 do
- assert_select "head", :count => 1 do
- assert_select "title", :text => /Users' diaries | /, :count => 1
- end
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h2", :text => /#{users(:normal_user).display_name}'s diary/, :count => 1
- end
- assert_select "div#content", :count => 1 do
- assert_select "div.post_heading", :text => /#{new_title}/, :count => 1
- # This next line won't work if the text has been run through the htmlize function
- # due to formatting that could be introduced
- assert_select "p", :text => /#{new_body}/, :count => 1
- assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1
- # As we're not logged in, check that you cannot edit
- assert_select "li[class=hidden show_if_user_#{entry.user.id}]", :count => 1 do
- assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1
- end
- end
- end
+ assert_select "title", :text => /Users' diaries | /, :count => 1
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h2", :text => /#{users(:normal_user).display_name}'s diary/, :count => 1
+ end
+ assert_select "div#content", :count => 1 do
+ assert_select "div.post_heading", :text => /#{new_title}/, :count => 1
+ # This next line won't work if the text has been run through the htmlize function
+ # due to formatting that could be introduced
+ assert_select "p", :text => /#{new_body}/, :count => 1
+ assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1
+ # As we're not logged in, check that you cannot edit
+ assert_select "li[class=hidden show_if_user_#{entry.user.id}]", :count => 1 do
+ assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1
end
end
- #print @response.body
-
end
def test_edit_diary_entry_i18n
# Now try again when logged in
get :new, {}, {:user => users(:normal_user).id}
assert_response :success
- assert_select "html", :count => 1 do
- assert_select "head", :count => 1 do
- assert_select "title", :text => /New Diary Entry/, :count => 1
- end
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h1", :text => /New Diary Entry/, :count => 1
- end
- assert_select "div#content", :count => 1 do
- assert_select "form[action='/diary/new'][method=post]", :count => 1 do
- assert_select "input#diary_entry_title[name='diary_entry[title]']", :count => 1
- assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => "", :count => 1
- assert_select "select#diary_entry_language_code", :count => 1
- assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1
- assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1
- assert_select "input[name=commit][type=submit][value=Save]", :count => 1
- assert_select "input[name=commit][type=submit][value=Edit]", :count => 1
- assert_select "input[name=commit][type=submit][value=Preview]", :count => 1
- assert_select "input", :count => 7
- end
- end
- end
+ assert_select "title", :text => /New Diary Entry/, :count => 1
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h1", :text => /New Diary Entry/, :count => 1
+ end
+ assert_select "div#content", :count => 1 do
+ assert_select "form[action='/diary/new'][method=post]", :count => 1 do
+ assert_select "input#diary_entry_title[name='diary_entry[title]']", :count => 1
+ assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => "", :count => 1
+ assert_select "select#diary_entry_language_code", :count => 1
+ assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1
+ assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1
+ assert_select "input[name=commit][type=submit][value=Save]", :count => 1
+ assert_select "input[name=commit][type=submit][value=Edit]", :count => 1
+ assert_select "input[name=commit][type=submit][value=Preview]", :count => 1
+ assert_select "input", :count => 7
end
end
# Verify that you get a not found error, when you pass a bogus id
post :comment, {:display_name => entry.user.display_name, :id => 9999}, {:user => users(:public_user).id}
assert_response :not_found
- assert_select "html", :count => 1 do
- assert_select "body", :count => 1 do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h2", :text => "No entry with the id: 9999", :count => 1
- end
- end
- end
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h2", :text => "No entry with the id: 9999", :count => 1
end
# Now try again with the right id
# test all routes which lead to this controller
def test_routes
assert_routing(
- { :path => "/geocoder/search", :method => :post },
+ { :path => "/search", :method => :get },
{ :controller => "geocoder", :action => "search" }
)
assert_routing(
get :new, :display_name => "non_existent_user"
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
end
##
)
assert_routing(
{ :path => "/export", :method => :get },
- { :controller => "site", :action => "index", :export => true }
+ { :controller => "site", :action => "export" }
)
assert_recognizes(
- { :controller => "site", :action => "index", :export => true, :format => "html" },
+ { :controller => "site", :action => "export", :format => "html" },
{ :path => "/export.html", :method => :get }
)
assert_routing(
get :index
assert_response :success
assert_template 'index'
- assert_site_partials
end
def test_index_redirect
get :offline
assert_response :success
assert_template 'offline'
- assert_site_partials 0
- end
-
- def assert_site_partials(count = 1)
- assert_template :partial => '_search', :count => count
- assert_template :partial => '_sidebar', :count => count
end
# test the right editor gets used when the user hasn't set a preference
get :new
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user does not exist"
+ assert_select "h1", "The user does not exist"
# We should get an error if the user doesn't exist
get :new, :display_name => "non_existent_user"
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
end
##
post :create
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user does not exist"
+ assert_select "h1", "The user does not exist"
# We should get an error if the user doesn't exist
post :create, :display_name => "non_existent_user"
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
end
##
get :blocks_on, :display_name => "non_existent_user"
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
# Check the list of blocks for a user that has never been blocked
get :blocks_on, :display_name => users(:normal_user).display_name
get :blocks_by, :display_name => "non_existent_user"
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
# Check the list of blocks given by one moderator
get :blocks_by, :display_name => users(:moderator_user).display_name
end
assert_response :success
assert_template :lost_password
- assert_select "div#error", /^Could not find that email address/
+ assert_select ".error", /^Could not find that email address/
# Test resetting using the address as recorded for a user that has an
# address which is case insensitively unique
assert_response :success
assert_template :account
assert_select "div#errorExplanation", false
- assert_select "div#notice", /^User information updated successfully/
+ assert_select ".notice", /^User information updated successfully/
assert_select "form#accountForm > fieldset > div.form-row > div#user_description_container > div#user_description_content > textarea#user_description", user.description
# Changing name to one that exists should fail
post :account, { :display_name => user.display_name, :user => new_attributes }, { "user" => user.id }
assert_response :success
assert_template :account
- assert_select "div#notice", false
+ assert_select ".notice", false
assert_select "div#errorExplanation"
assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name"
post :account, { :display_name => user.display_name, :user => new_attributes }, { "user" => user.id }
assert_response :success
assert_template :account
- assert_select "div#notice", false
+ assert_select ".notice", false
assert_select "div#errorExplanation"
assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name"
assert_response :success
assert_template :account
assert_select "div#errorExplanation", false
- assert_select "div#notice", /^User information updated successfully/
+ assert_select ".notice", /^User information updated successfully/
assert_select "form#accountForm > fieldset > div.form-row > input#user_display_name[value=?]", "new tester"
# Record the change of name
post :account, { :display_name => user.display_name, :user => user.attributes }, { "user" => user.id }
assert_response :success
assert_template :account
- assert_select "div#notice", false
+ assert_select ".notice", false
assert_select "div#errorExplanation"
assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_new_email"
post :account, { :display_name => user.display_name, :user => user.attributes }, { "user" => user.id }
assert_response :success
assert_template :account
- assert_select "div#notice", false
+ assert_select ".notice", false
assert_select "div#errorExplanation"
assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_new_email"
assert_response :success
assert_template :account
assert_select "div#errorExplanation", false
- assert_select "div#notice", /^User information updated successfully/
+ assert_select ".notice", /^User information updated successfully/
assert_select "form#accountForm > fieldset > div.form-row > input#user_new_email[value=?]", user.new_email
end
get :view, {:display_name => "test"}
assert_response :success
assert_select "div#userinformation" do
- assert_select "a[href=/user/test/edits]", 1
+ assert_select "a[href^=/user/test/edits]", 1
assert_select "a[href=/user/test/traces]", 1
assert_select "a[href=/user/test/diary]", 1
assert_select "a[href=/user/test/diary/comments]", 1
get :view, {:display_name => "blocked"}
assert_response :success
assert_select "div#userinformation" do
- assert_select "a[href=/user/blocked/edits]", 1
+ assert_select "a[href^=/user/blocked/edits]", 1
assert_select "a[href=/user/blocked/traces]", 1
assert_select "a[href=/user/blocked/diary]", 1
assert_select "a[href=/user/blocked/diary/comments]", 1
get :view, {:display_name => "moderator"}
assert_response :success
assert_select "div#userinformation" do
- assert_select "a[href=/user/moderator/edits]", 1
+ assert_select "a[href^=/user/moderator/edits]", 1
assert_select "a[href=/user/moderator/traces]", 1
assert_select "a[href=/user/moderator/diary]", 1
assert_select "a[href=/user/moderator/diary/comments]", 1
get :view, {:display_name => "test"}
assert_response :success
assert_select "div#userinformation" do
- assert_select "a[href=/user/test/edits]", 1
+ assert_select "a[href^=/user/test/edits]", 1
assert_select "a[href=/traces/mine]", 1
assert_select "a[href=/user/test/diary]", 1
assert_select "a[href=/user/test/diary/comments]", 1
get :view, {:display_name => "test"}
assert_response :success
assert_select "div#userinformation" do
- assert_select "a[href=/user/test/edits]", 1
+ assert_select "a[href^=/user/test/edits]", 1
assert_select "a[href=/user/test/traces]", 1
assert_select "a[href=/user/test/diary]", 1
assert_select "a[href=/user/test/diary/comments]", 1
end
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
# Granting a role from a user that already has it should fail
assert_no_difference "UserRole.count" do
end
assert_response :not_found
assert_template "user/no_such_user"
- assert_select "h2", "The user non_existent_user does not exist"
+ assert_select "h1", "The user non_existent_user does not exist"
# Removing a role from a user that doesn't have it should fail
assert_no_difference "UserRole.count" do
##
# utility method to make the HTML screening easier to read.
def assert_in_heading
- assert_select "html:root" do
- assert_select "body" do
- assert_select "div.wrapper" do
- assert_select "div.content-heading" do
- yield
- end
- end
- end
+ assert_select "div.content-heading" do
+ yield
end
end
##
# utility method to make the HTML screening easier to read.
def assert_in_body
- assert_select "html:root" do
- assert_select "body" do
- assert_select "div#content" do
- yield
- end
- end
+ assert_select "div#content" do
+ yield
end
end
-
end
# functional tests rather than this integration test
# There are some things that are specific to the integratio
# that need to be tested, which can't be tested in the functional tests
- assert_select "html:root" do
- assert_select "body" do
- assert_select "div.wrapper", :count => 1 do
- assert_select "div.content-heading", :count => 1 do
- assert_select "h1", "New Diary Entry"
- end
- assert_select "div#content" do
- assert_select "form[action='/diary/new']" do
- assert_select "input[id=diary_entry_title]"
- end
- end
- end
+ assert_select "div.content-heading", :count => 1 do
+ assert_select "h1", "New Diary Entry"
+ end
+ assert_select "div#content" do
+ assert_select "form[action='/diary/new']" do
+ assert_select "input[id=diary_entry_title]"
end
end
-
-
end
end
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_email_password_normal_upcase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_email_password_public_upcase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_email_password_public_titlecase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_username_password_normal
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_username_password_normal_upcase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_username_password_public_upcase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_username_password_public_titlecase
follow_redirect!
assert_response :success
- post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
assert_template 'login'
- post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/browse"}
+ post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/history"}
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_openid_success
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
follow_redirect!
assert_response :success
- post '/login', {'openid_url' => "http://localhost:1123/john.doe?openid.success=true", :referer => "/browse"}
+ post '/login', {'openid_url' => "http://localhost:1123/john.doe?openid.success=true", :referer => "/history"}
assert_response :redirect
res = openid_request(@response.redirect_url)
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template 'changeset/list'
+ assert_template 'changeset/history'
end
def test_login_openid_cancel