autoprefixer-rails (10.4.19.0)
execjs (~> 2)
aws-eventstream (1.3.0)
- aws-partitions (1.1004.0)
- aws-sdk-core (3.212.0)
+ aws-partitions (1.1009.0)
+ aws-sdk-core (3.213.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
- aws-sdk-kms (1.95.0)
+ aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
- aws-sdk-s3 (1.170.1)
+ aws-sdk-s3 (1.172.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
factory_bot_rails (6.4.4)
factory_bot (~> 6.5)
railties (>= 5.0.0)
- faraday (2.12.0)
- faraday-net_http (>= 2.0, < 3.4)
+ faraday (2.12.1)
+ faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-http-cache (2.5.1)
faraday (>= 0.8)
- faraday-net_http (3.3.0)
- net-http
+ faraday-net_http (3.4.0)
+ net-http (>= 0.5.0)
ffi (1.17.0)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- json (2.8.1)
+ json (2.8.2)
jwt (2.9.3)
base64
kgio (2.11.4)
- kramdown (2.4.0)
- rexml
+ kramdown (2.5.1)
+ rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
maxminddb (0.1.22)
mini_magick (4.13.2)
mini_mime (1.1.5)
- mini_portile2 (2.8.7)
+ mini_portile2 (2.8.8)
mini_racer (0.9.0)
libv8-node (~> 18.19.0.0)
minitest (5.25.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rchardet (1.8.0)
- rdoc (6.7.0)
+ rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.11)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
- rubocop-ast (1.35.0)
+ rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
- rubocop-performance (1.22.1)
+ rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.27.0)
if user&.active?
can [:create, :comment, :close, :reopen], Note if scope?(token, :write_notes)
+ can [:create, :destroy], NoteSubscription if scope?(token, :write_notes)
can [:show, :data], Trace if scope?(token, :read_gpx)
can [:create, :update, :destroy], Trace if scope?(token, :write_gpx)
can [:details], User if scope?(token, :read_prefs)
};
function initialize(path, id) {
- content.find("button[type=submit]").on("click", function (e) {
+ content.find("button[name]").on("click", function (e) {
e.preventDefault();
var data = $(e.target).data();
- var form = e.target.form;
-
- $(form).find("button[type=submit]").prop("disabled", true);
-
- $.ajax({
+ var name = $(e.target).attr("name");
+ var ajaxSettings = {
url: data.url,
type: data.method,
oauth: true,
- data: { text: $(form.text).val() },
- success: function () {
- OSM.loadSidebarContent(path, function () {
+ success: () => {
+ OSM.loadSidebarContent(path, () => {
initialize(path, id);
moveToNote();
});
},
- error: function (xhr) {
- $(form).find("#comment-error")
+ error: (xhr) => {
+ content.find("#comment-error")
.text(xhr.responseText)
- .prop("hidden", false);
- updateButtons(form);
+ .prop("hidden", false)
+ .get(0).scrollIntoView({ block: "nearest" });
+ updateButtons();
}
- });
+ };
+
+ if (name !== "subscribe" && name !== "unsubscribe") {
+ ajaxSettings.data = { text: $("textarea").val() };
+ }
+
+ content.find("button[name]").prop("disabled", true);
+ $.ajax(ajaxSettings);
});
content.find("textarea").on("input", function (e) {
}
}
- function updateButtons(form) {
- $(form).find("button[type=submit]").prop("disabled", false);
- if ($(form.text).val() === "") {
- $(form.close).text($(form.close).data("defaultActionText"));
- $(form.comment).prop("disabled", true);
+ function updateButtons() {
+ var resolveButton = content.find("button[name='close']");
+ var commentButton = content.find("button[name='comment']");
+
+ content.find("button[name]").prop("disabled", false);
+ if (content.find("textarea").val() === "") {
+ resolveButton.text(resolveButton.data("defaultActionText"));
+ commentButton.prop("disabled", true);
} else {
- $(form.close).text($(form.close).data("commentActionText"));
- $(form.comment).prop("disabled", false);
+ resolveButton.text(resolveButton.data("commentActionText"));
}
}
initialize: function (id, options) {
L.Map.prototype.initialize.call(this, id, options);
- var copyright_link = $("<a>", {
- href: "/copyright",
- text: I18n.t("javascripts.map.openstreetmap_contributors")
- }).prop("outerHTML");
- var copyright = I18n.t("javascripts.map.copyright_text", { copyright_link: copyright_link });
-
- var donate = $("<a>", {
- "href": "https://supporting.openstreetmap.org",
- "class": "donate-attr",
- "text": I18n.t("javascripts.map.make_a_donation")
- }).prop("outerHTML");
-
- var terms = $("<a>", {
- href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
- text: I18n.t("javascripts.map.website_and_api_terms")
- }).prop("outerHTML");
-
- var cyclosm_link = $("<a>", {
- href: "https://www.cyclosm.org",
- target: "_blank",
- text: I18n.t("javascripts.map.cyclosm_name")
- }).prop("outerHTML");
- var osm_france_link = $("<a>", {
- href: "https://openstreetmap.fr/",
- target: "_blank",
- text: I18n.t("javascripts.map.osm_france")
- }).prop("outerHTML");
- var cyclosm = I18n.t("javascripts.map.cyclosm_credit", { cyclosm_link: cyclosm_link, osm_france_link: osm_france_link });
-
- var thunderforest_link = $("<a>", {
- href: "https://www.thunderforest.com/",
- target: "_blank",
- text: I18n.t("javascripts.map.andy_allan")
- }).prop("outerHTML");
- var thunderforest = I18n.t("javascripts.map.thunderforest_credit", { thunderforest_link: thunderforest_link });
-
- var tracestrack_link = $("<a>", {
- href: "https://www.tracestrack.com/",
- target: "_blank",
- text: I18n.t("javascripts.map.tracestrack")
- }).prop("outerHTML");
- var tracestrack = I18n.t("javascripts.map.tracestrack_credit", { tracestrack_link: tracestrack_link });
-
- var hotosm_link = $("<a>", {
- href: "https://www.hotosm.org/",
- target: "_blank",
- text: I18n.t("javascripts.map.hotosm_name")
- }).prop("outerHTML");
- var hotosm = I18n.t("javascripts.map.hotosm_credit", { hotosm_link: hotosm_link, osm_france_link: osm_france_link });
-
this.baseLayers = [];
- this.baseLayers.push(new L.OSM.Mapnik({
- attribution: copyright + " ♥ " + donate + ". " + terms,
- code: "M",
- keyid: "mapnik",
- name: I18n.t("javascripts.map.base.standard")
- }));
-
- this.baseLayers.push(new L.OSM.CyclOSM({
- attribution: copyright + ". " + cyclosm + ". " + terms,
- code: "Y",
- keyid: "cyclosm",
- name: I18n.t("javascripts.map.base.cyclosm")
- }));
-
- if (OSM.THUNDERFOREST_KEY) {
- this.baseLayers.push(new L.OSM.CycleMap({
- attribution: copyright + ". " + thunderforest + ". " + terms,
- apikey: OSM.THUNDERFOREST_KEY,
- code: "C",
- keyid: "cyclemap",
- name: I18n.t("javascripts.map.base.cycle_map")
- }));
-
- this.baseLayers.push(new L.OSM.TransportMap({
- attribution: copyright + ". " + thunderforest + ". " + terms,
- apikey: OSM.THUNDERFOREST_KEY,
- code: "T",
- keyid: "transportmap",
- name: I18n.t("javascripts.map.base.transport_map")
- }));
- }
+ for (const layerDefinition of OSM.LAYER_DEFINITIONS) {
+ if (layerDefinition.apiKeyId && !OSM[layerDefinition.apiKeyId]) continue;
- if (OSM.TRACESTRACK_KEY) {
- this.baseLayers.push(new L.OSM.TracestrackTopo({
- attribution: copyright + ". " + tracestrack + ". " + terms,
- apikey: OSM.TRACESTRACK_KEY,
- code: "P",
- keyid: "tracestracktopo",
- name: I18n.t("javascripts.map.base.tracestracktop_topo")
- }));
- }
+ const layerOptions = {
+ attribution: makeAttribution(layerDefinition.credit),
+ code: layerDefinition.code,
+ keyid: layerDefinition.keyId,
+ name: I18n.t(`javascripts.map.base.${layerDefinition.nameId}`)
+ };
+ if (layerDefinition.apiKeyId) {
+ layerOptions.apikey = OSM[layerDefinition.apiKeyId];
+ }
- this.baseLayers.push(new L.OSM.HOT({
- attribution: copyright + ". " + hotosm + ". " + terms,
- code: "H",
- keyid: "hot",
- name: I18n.t("javascripts.map.base.hot")
- }));
+ const layer = new L.OSM[layerDefinition.leafletOsmId](layerOptions);
+ this.baseLayers.push(layer);
+ }
this.noteLayer = new L.FeatureGroup();
this.noteLayer.options = { code: "N" };
this.setMaxZoom(event.layer.options.maxZoom);
}
});
+
+ function makeAttribution(credit) {
+ let attribution = "";
+
+ attribution += I18n.t("javascripts.map.copyright_text", {
+ copyright_link: $("<a>", {
+ href: "/copyright",
+ text: I18n.t("javascripts.map.openstreetmap_contributors")
+ }).prop("outerHTML")
+ });
+
+ attribution += credit.donate ? " ♥ " : ". ";
+ attribution += makeCredit(credit);
+ attribution += ". ";
+
+ attribution += $("<a>", {
+ href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
+ text: I18n.t("javascripts.map.website_and_api_terms")
+ }).prop("outerHTML");
+
+ return attribution;
+ }
+
+ function makeCredit(credit) {
+ const children = {};
+ for (const childId in credit.children) {
+ children[childId] = makeCredit(credit.children[childId]);
+ }
+ const text = I18n.t(`javascripts.map.${credit.id}`, children);
+ if (credit.href) {
+ const link = $("<a>", {
+ href: credit.href,
+ text: text
+ });
+ if (credit.donate) {
+ link.addClass("donate-attr");
+ } else {
+ link.attr("target", "_blank");
+ }
+ return link.prop("outerHTML");
+ } else {
+ return text;
+ }
+ }
},
updateLayers: function (layerParam) {
//= depend_on settings.yml
//= depend_on settings.local.yml
+//= depend_on layers.yml
//= depend_on key.yml
//= require qs/dist/qs
TRACESTRACK_KEY: <%= Settings.tracestrack_key.to_json %>,
<% end %>
+ LAYER_DEFINITIONS: <%= YAML.load_file(Rails.root.join("config/layers.yml")).to_json %>,
LAYERS_WITH_MAP_KEY: <%= YAML.load_file(Rails.root.join("config/key.yml")).keys.to_json %>,
MARKER_GREEN: <%= image_path("marker-green.png").to_json %>,
--- /dev/null
+module Api
+ class NoteSubscriptionsController < ApiController
+ before_action :check_api_writable
+ before_action :authorize
+
+ authorize_resource
+
+ def create
+ note_id = params[:note_id].to_i
+ note = Note.find(note_id)
+ note.subscribers << current_user
+ rescue ActiveRecord::RecordNotFound
+ report_error "Note #{note_id} not found.", :not_found
+ rescue ActiveRecord::RecordNotUnique
+ report_error "You are already subscribed to note #{note_id}.", :conflict
+ end
+
+ def destroy
+ note_id = params[:note_id].to_i
+ note = Note.find(note_id)
+ count = note.subscriptions.where(:user => current_user).delete_all
+ report_error "You are not subscribed to note #{note_id}.", :not_found if count.zero?
+ rescue ActiveRecord::RecordNotFound
+ report_error "Note #{note_id} not found.", :not_found
+ end
+ end
+end
<p class='alert alert-warning'><%= t ".anonymous_warning" %></p>
<% end -%>
+ <div class="row">
+ <div class="col">
+ <h4><%= t(".discussion") %></h4>
+ </div>
+
+ <% if current_user %>
+ <div class="col-auto">
+ <% if @note.subscribers.exists?(current_user.id) %>
+ <%= tag.button t(".unsubscribe"),
+ :type => "button",
+ :class => "btn btn-sm btn-primary",
+ :name => "unsubscribe",
+ :data => { :method => "DELETE",
+ :url => api_note_subscription_path(@note) } %>
+ <% else %>
+ <%= tag.button t(".subscribe"),
+ :type => "button",
+ :class => "btn btn-sm btn-primary",
+ :name => "subscribe",
+ :data => { :method => "POST",
+ :url => api_note_subscription_path(@note) } %>
+ <% end %>
+ </div>
+ <% end %>
+ </div>
+
<% if @note_comments.length > 1 %>
<div class='note-comments'>
<ul class="list-unstyled">
--- /dev/null
+- leafletOsmId: "Mapnik"
+ code: "M"
+ keyId: "mapnik"
+ nameId: "standard"
+ credit:
+ id: "make_a_donation"
+ href: "https://supporting.openstreetmap.org"
+ donate: true
+
+- leafletOsmId: "CyclOSM"
+ code: "Y"
+ keyId: "cyclosm"
+ nameId: "cyclosm"
+ credit:
+ id: "cyclosm_credit"
+ children:
+ cyclosm_link:
+ id: "cyclosm_name"
+ href: "https://www.cyclosm.org"
+ osm_france_link:
+ id: "osm_france"
+ href: "https://openstreetmap.fr/"
+
+- leafletOsmId: "CycleMap"
+ code: "C"
+ keyId: "cyclemap"
+ nameId: "cycle_map"
+ apiKeyId: "THUNDERFOREST_KEY"
+ credit:
+ id: "thunderforest_credit"
+ children:
+ thunderforest_link:
+ id: "andy_allan"
+ href: "https://www.thunderforest.com/"
+
+- leafletOsmId: "TransportMap"
+ code: "T"
+ keyId: "transportmap"
+ nameId: "transport_map"
+ apiKeyId: "THUNDERFOREST_KEY"
+ credit:
+ id: "thunderforest_credit"
+ children:
+ thunderforest_link:
+ id: "andy_allan"
+ href: "https://www.thunderforest.com/"
+
+- leafletOsmId: "TracestrackTopo"
+ code: "P"
+ keyId: "tracestracktopo"
+ nameId: "tracestracktop_topo"
+ apiKeyId: "TRACESTRACK_KEY"
+ credit:
+ id: "tracestrack_credit"
+ children:
+ tracestrack_link:
+ id: "tracestrack"
+ href: "https://www.tracestrack.com/"
+
+- leafletOsmId: "HOT"
+ code: "H"
+ keyId: "hot"
+ nameId: "hot"
+ credit:
+ id: "hotosm_credit"
+ children:
+ hotosm_link:
+ id: "hotosm_name"
+ href: "https://www.hotosm.org/"
+ osm_france_link:
+ id: "osm_france"
+ href: "https://openstreetmap.fr/"
description: Beskrivelse
created_at: Oprettet den
last_changed: Sidst ændret
+ apply: Anvend
+ all: Alle
+ open: Åben
+ closed: Lukket
+ status: Status
show:
title: 'Bemærkning: %{id}'
description: Beskrivelse
description: Hinweis
created_at: Erstellt am
last_changed: Zuletzt geändert
+ apply: Anwenden
+ all: Alle
+ open: Offen
+ closed: Geschlossen
+ status: Status
show:
title: 'Hinweis: %{id}'
description: Beschreibung
description: Περιγραφή
created_at: Δημιουργήθηκε στις
last_changed: Τελευταία αλλαγή
+ apply: Εφαρμογή
+ all: Όλα
+ open: Ανοιχτές
+ closed: Κλειστές
+ status: Κατάσταση
show:
title: 'Σημείωση: %{id}'
description: Περιγραφή
resolve: Επιλύστε
reactivate: Επανενεργοποίηση
comment_and_resolve: Σχολιάστε και Επιλύστε
- comment: Σχολιάζω
+ comment: Σχολιάστε
log_in_to_comment: Συνδεθείτε για να σχολιάσετε σε αυτή την σημείωση
report_link_html: Εάν αυτή η σημείωση περιέχει ευαίσθητες πληροφορίες που πρέπει
να αφαιρεθούν, μπορείτε %{link}.
report: report this note
coordinates_html: "%{latitude}, %{longitude}"
anonymous_warning: This note includes comments from anonymous users which should be independently verified.
+ discussion: Discussion
+ subscribe: Subscribe
+ unsubscribe: Unsubscribe
hide: Hide
resolve: Resolve
reactivate: Reactivate
description: Description
created_at: Créée le
last_changed: Dernière modification
+ apply: Appliquer
+ all: Tous
+ open: Ouvert
+ closed: Fermé
+ status: État
show:
title: 'Note : %{id}'
description: Description
old_messages:
one: '%{count} mensaxe vella'
other: '%{count} mensaxes vellas'
- no_messages_yet_html: Aínda non ten ningunha mensaxe. Por que non se pon en
+ no_messages_yet_html: Aínda non tes ningunha mensaxe. Por que non te pos en
contacto con algunhas das %{people_mapping_nearby_link}?
people_mapping_nearby: persoas preto de ti
messages_table:
back_to_inbox: Volver á caixa de entrada
create:
message_sent: Mensaxe enviada
- limit_exceeded: Estivo enviando unha morea de mensaxes recentemente. Agarde
+ limit_exceeded: Enviaches unha morea de mensaxes dun tempo a esta parte. Agarda
uns intres denantes de tentar enviar máis.
no_such_message:
title: Non se atopou a mensaxe
heading: Non se atopou a mensaxe
- body: Non hai ningunha mensaxe con esa ID.
+ body: Non hai ningunha mensaxe con ese identificador.
outbox:
title: Caixa de saída
messages:
one: Enviaches %{count} mensaxe
other: Enviaches %{count} mensaxes
- no_sent_messages_html: Aínda non enviou ningunha mensaxe. Por que non se pon
- en contacto con algunhas das %{people_mapping_nearby_link}?
+ no_sent_messages_html: Aínda non enviaches ningunha mensaxe. Por que non te
+ pos en contacto con algunhas das %{people_mapping_nearby_link}?
people_mapping_nearby: persoas preto de ti
muted:
title: Mensaxes silenciadas
not_revoke_admin_current_user: Non se puido revogar os dereitos de administrador
do usuario actual.
grant:
- are_you_sure: Ten a certeza de querer concederlle o rol "%{role}" ó usuario
- "%{name}"?
+ are_you_sure: Queres concederlle o rol "%{role}" ó usuario "%{name}"?
revoke:
- are_you_sure: Ten a certeza de querer revogarlle o rol "%{role}" ó usuario "%{name}"?
+ are_you_sure: Queres quitarlle o rol "%{role}" ó usuario "%{name}"?
user_blocks:
model:
non_moderator_update: Cómpre ser moderador para crear ou actualizar un bloqueo.
description: Descrición
created_at: Creado o
last_changed: Última modificación
+ apply: Aplicar
+ all: Todas
+ open: Abertas
+ closed: Pechadas
+ status: Estado
show:
title: 'Nota: %{id}'
description: Descrición
description: תיאור
created_at: 'יצירה:'
last_changed: 'שינוי אחרון:'
+ apply: החלה
+ all: הכול
+ open: פתוחה
+ closed: סגורה
+ status: מצב
show:
title: 'הערה: %{id}'
description: תיאור
index:
created_at: 'निर्माण का समय:'
last_changed: अंतिम परिवर्तन
+ apply: लागू करें
+ all: सभी
+ open: खोलें
+ closed: बंद किया हुआ
+ status: स्थिति
show:
title: 'नोट: %{id}'
description: विवरण
description: Descrizione
created_at: Creata il
last_changed: Modificata per l'ultima volta
+ apply: Applica
+ all: Tutto
+ open: Aperto
+ closed: Chiuso
+ status: Stato
show:
title: 'Nota: %{id}'
description: Descrizione
doorkeeper:
errors:
messages:
+ account_selection_required: 인가 서버에는 최종 사용자의 계정 선택이 필요합니다
consent_required: 인가 서버에는 최종 사용자의 동의가 필요합니다
interaction_required: 인가 서버에는 최종 사용자의 소통이 필요합니다
login_required: 인가 서버에는 최종 사용자의 인증이 필요합니다
알려주십시오. 요청의 정확한 URL을 기록해 두십시오.
bad_request:
title: 잘못된 요청
+ description: 오픈스트리트맵 서버에서 요청하신 작업이 유효하지 않습니다 (HTTP 400)
forbidden:
title: 접근 거부됨
description: 오픈스트리트맵 서버에 요청한 이 작업은 관리자만 사용할 수 있습니다(HTTP 403).
description: 설명
created_at: 만든 날짜
last_changed: 마지막으로 바뀜
+ apply: 적용
+ all: 모두
+ open: 열림
+ closed: 닫힘
+ status: 상태
show:
title: '참고: %{id}'
description: 설명
no_notes: Keng Notizen
description: Beschreiwung
last_changed: Lescht Ännerung
+ status: Status
show:
title: 'Notiz: %{id}'
description: Beschreiwung
introduction: Klik op de kaart om nabije objecten te vinden.
nearby: Objecten in de buurt
enclosing: Omsluitende objecten
+ nodes:
+ timeout:
+ sorry: Het ophalen van de gegevens voor het ID %{id} duurde te lang.
old_nodes:
not_found:
sorry: 'Sorry, knooppunt #%{id} versie %{version} kon niet worden gevonden.'
+ timeout:
+ sorry: Het ophalen van de gegevens voor knooppunt met het ID %{id} duurde te
+ lang.
+ ways:
+ timeout:
+ sorry: Het ophalen van de gegevens voor de weg met het ID %{id} duurde te lang.
old_ways:
not_found:
sorry: 'Sorry, weg #%{id} versie %{version} niet kon worden gevonden.'
+ timeout:
+ sorry: Het ophalen van de geschiedenis voor de weg met het ID %{id} duurde te
+ lang.
+ relations:
+ timeout:
+ sorry: Het ophalen van de relatie met het ID %{id} duurde te lang.
old_relations:
not_found:
sorry: 'Sorry, relatie #%{id} versie %{version} kon niet worden gevonden.'
+ timeout:
+ sorry: Het ophalen van de geschiedenis voor de relatie met het ID %{id} duurde
+ te lang.
changeset_comments:
feeds:
comment:
hospital: Ziekenhuis
building: Belangrijk gebouw
station: Spoorwegstation
+ railway_halt: Spoorweghalte
+ subway_station: Metrostation
+ tram_stop: Tramhalte
summit: Top
peak: Piek
tunnel: Tunnel
readable_summary: voor mensen leesbare samenvatting
informal_translations: informele vertalingen
continue: Doorgaan
+ cancel: Annuleren
you need to accept or decline: Lees de nieuwe Bijdragersvoorwaarden en besluit
daarna deze te accepteren of te verwerpen voordat u door kunt gaan.
legale_select: 'Selecteer het land waarin u woont:'
description: Beschrijving
created_at: Aangemaakt op
last_changed: Laatste wijziging
+ apply: Toepassen
+ all: Alle
+ open: Open
+ closed: Gesloten
+ status: Status
show:
title: 'Opmerking: %{id}'
description: Beschrijving
add: Opmerking toevoegen
notes_paging_nav:
showing_page: Pagina %{page}
+ next: Volgende
+ previous: Vorige
javascripts:
close: Sluiten
share:
empty: Geen weer te geven redigeringen.
heading: Lijst met redigeringen
title: Lijst met redigeringen
+ new: Nieuwe redactie
new:
heading: Gegevens voor nieuwe redigering invoeren
title: Aanmaak van een nieuwe redigering
# Author: Okras
# Author: Pacha Tchernof
# Author: Parukhin
+# Author: Pavel200071
# Author: Perevod16
# Author: PlushBoy
# Author: Pplex.vhs
muted:
title: Заглушённые сообщения
reply:
- wrong_user: Ð\92Ñ\8b воÑ\88ли как `%{user}', но оÑ\82веÑ\82 на ваÑ\88 вопÑ\80оÑ\81 бÑ\8bл оÑ\82пÑ\80авлен не
- этому пользователю. Пожалуйста, войдите как соответствующий вашему вопросу
- полÑ\8cзоваÑ\82елÑ\8c, Ñ\87Ñ\82обÑ\8b пÑ\80оÑ\87иÑ\82аÑ\82Ñ\8c оÑ\82веÑ\82.
+ wrong_user: Ð\92Ñ\8b воÑ\88ли в Ñ\81иÑ\81Ñ\82емÑ\83 под именем '%{user}', но Ñ\81ообÑ\89ение, на коÑ\82оÑ\80ое
+ вы просили ответить, не было отправлено этому пользователю. Пожалуйста, войдите
+ в Ñ\81иÑ\81Ñ\82емÑ\83 под пÑ\80авилÑ\8cнÑ\8bм именем, Ñ\87Ñ\82обÑ\8b оÑ\82веÑ\82иÑ\82Ñ\8c.
show:
title: Просмотр сообщения
reply_button: Ответить
unread_button: Пометить как непрочитанное
destroy_button: Удалить
back: Назад
- wrong_user: Ð\92Ñ\8b воÑ\88ли как полÑ\8cзоваÑ\82елÑ\8c `%{user}', но оÑ\82веÑ\82 на ваÑ\88 вопÑ\80оÑ\81 бÑ\8bл
- оÑ\82пÑ\80авлен не Ñ\8dÑ\82им или не Ñ\8dÑ\82омÑ\83 полÑ\8cзоваÑ\82елÑ\8e. Ð\9fожалÑ\83йÑ\81Ñ\82а, войдиÑ\82е как Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83Ñ\8eÑ\89ий
- вашему вопросу пользователь, чтобы прочитать его.
+ wrong_user: Ð\92Ñ\8b воÑ\88ли в Ñ\81иÑ\81Ñ\82емÑ\83 под именем '%{user}', но Ñ\81ообÑ\89ение, коÑ\82оÑ\80ое вÑ\8b
+ пÑ\80оÑ\81или пÑ\80оÑ\87иÑ\82аÑ\82Ñ\8c, не бÑ\8bло оÑ\82пÑ\80авлено Ñ\8dÑ\82им полÑ\8cзоваÑ\82елем. Ð\9fожалÑ\83йÑ\81Ñ\82а, войдиÑ\82е
+ в систему под правильным именем, чтобы прочитать его.
sent_message_summary:
destroy_button: Удалить
heading:
настройках.
user_role:
filter:
- not_a_role: Строка «%{role}» не является допустимой ролью.
+ not_a_role: Строка '%{role}' не является допустимой ролью.
already_has_role: Пользователь уже имеет роль %{role}.
doesnt_have_role: У пользователя нет роли %{role}.
not_revoke_admin_current_user: Невозможно отозвать роль отозвать администратора
# Exported from translatewiki.net
# Export driver: phpyaml
# Author: Ajeje Brazorf
+# Author: GianAntonucci
# Author: Gmelfi
# Author: LametinoWiki
# Author: Macofe
friendly: '%e %B %Y ê %H:%M'
helpers:
file:
- prompt: Scegghi file
+ prompt: Scarta u pricu
submit:
diary_comment:
create: Cummenta
diary_entry:
create: Pùbblica
- update: Agghiorna
+ update: Attualizza
issue_comment:
- create: Agghiunci cummentu
+ create: Agghiunci un cummentu
message:
create: Manna
client_application:
- create: Riggistra
- update: Agghiorna
+ create: Riggìstrati
+ update: Attualizza
oauth2_application:
- create: Riggistrati
- update: Aggiorna
+ create: Riggìstrati
+ update: Attualizza
redaction:
- create: Crea l'occultamentu
- update: Sarva occultamentu
+ create: Crea u redact
+ update: Sarba u redact
trace:
create: Càrrica
- update: Sarva li canciamenti
+ update: Sarba i canci
user_block:
- create: Crea lu bloccu
- update: Aggiorna lu bloccu
+ create: Crea u bloccu
+ update: Attualizza u bloccu
activerecord:
+ errors:
+ messages:
+ display_name_is_user_n: nun po èssiri user_n abbestra ca si n nun è u to ID
+ utenti
+ models:
+ user_mute:
+ is_already_muted: già sta mutu
models:
- acl: Lista di cuntrollu d'accessu
- changeset: Gruppu di canciamenti
- changeset_tag: Etichetta dû gruppu di canciamenti
- country: Paisi
- diary_comment: Cummentu ntô diariu
+ acl: Lista di cuntrollu di l’accessi
+ changeset: Gruppu dî canci
+ changeset_tag: Etichetta dû gruppu dî canci
+ country: Pajisi
+ diary_comment: Cummentu nnô diariu
diary_entry: Vuci dû diariu
friend: Amicu
+ issue: Prubblema
language: Lingua
message: Missaggiu
node: Gruppu
old_node: Gruppu vecchiu
old_node_tag: Etichetta vecchia dû gruppu
old_relation: Rilazzioni vecchia
- old_relation_member: Membru vecchiu dâ rilazzioni
+ old_relation_member: Mèmmiru vecchiu dâ rilazzioni
old_relation_tag: Etichetta vecchia dâ rilazzioni
old_way: Caminu vecchiu
old_way_node: Gruppu vecchiu dû caminu
old_way_tag: Etichetta vecchia dû caminu
relation: Rilazzioni
- relation_member: Membru dâ rilazzioni
+ relation_member: Mèmmiru dâ rilazzioni
relation_tag: Etichetta dâ rilazzioni
+ report: Signalazzioni
session: Sissioni
- trace: Tracciatu
- tracepoint: Puntu dû tracciatu
- tracetag: Etichetta dû tracciatu
+ trace: Traccia
+ tracepoint: Puntu dâ traccia
+ tracetag: Etichetta dâ traccia
user: Utenti
user_preference: Prifirenza di l'utenti
- user_token: Lassa-passari di l'utenti
+ user_token: Còdici di l'utenti
way: Caminu
way_node: Gruppu dû caminu
way_tag: Etichetta dû caminu
attributes:
client_application:
- callback_url: URL di callback
- support_url: URL di l'assistenza
- allow_write_prefs: canciari li mpustazzioni d'utenti.
- allow_write_diary: criari vuci dû diariu, cummenti e fari amici.
- allow_write_api: cancia la cartina
- allow_read_gpx: lèggi li sò tracciati GPS privati.
- allow_write_gpx: càrrica li tracciati GPS
- allow_write_notes: cancia li noti
+ name: Nomu (ubblicatoriu)
+ url: Nnirizzu URL mastru di l’applicazzioni (ubblicatoriu)
+ callback_url: Nnirizzu URL di richiamata
+ support_url: Nnirizzu URL pi l’assistenza
+ allow_read_prefs: leggi i so prifirenzi di l’utenti
+ allow_write_prefs: cancia i so mpustazzioni di l’utenti.
+ allow_write_diary: criari pàggini dû diariu, cummenti e fàrisi amici
+ allow_write_api: cancia a carta
+ allow_read_gpx: leggi i so tracci GPS privati
+ allow_write_gpx: càrrica i traccia GPS
+ allow_write_notes: cancia i noti
diary_comment:
body: Corpu
diary_entry:
user: Utenti
- title: Oggettu
+ title: Uggettu
body: Corpu
latitude: Latitùdini
- longitude: Loncitùdini
+ longitude: Luncitùdini
language_code: Lingua
doorkeeper/application:
name: Nomu
redirect_uri: URI di rimannu
+ confidential: Applicazzioni cunfidinziali?
+ scopes: Pirmisi
friend:
user: Utenti
friend: Amicu
trace:
user: Utenti
visible: Visìbbili
- name: Nomu dû file
+ name: Nomu dû pricu
size: Grannizza
latitude: Latitùdini
- longitude: Loncitùdini
+ longitude: Luncitùdini
public: Pùbblicu
description: Discrizzioni
- gpx_file: Carricari file GPX
+ gpx_file: Scarta u pricu dâ traccia GPS
visibility: Visibbilità
tagstring: Etichetti
message:
sender: Mittenti
- title: Oggettu
+ title: Uggettu
body: Corpu
- recipient: Distinatariu
+ recipient: Ricàpitu
redaction:
title: Tìtulu
description: Discrizzioni
+ report:
+ category: Scarta na scaciuni pâ to signalazzioni
+ details: Dinni cchiù assai ncapu ô prubblema (ubblicatoriu).
user:
- email: Posta elittrònica
- new_email: Nnirizzu di posta elittrònica novu
+ auth_provider: Tranzuntaturi
+ auth_uid: UID di tranzuntazzioni
+ email: E-mail
+ new_email: Nnirizzu e-mail novu
active: Attivu
display_name: Nomu ammustratu
description: Discrizzioni dû prufilu
home_lat: Latitùdini
home_lon: Luncitùdini
languages: Lingui prifiruti
- pass_crypt: Palora d'òrdini
- pass_crypt_confirmation: Cunferma password
+ preferred_editor: Edituri prifirutu
+ pass_crypt: Chiavi d’accessu
+ pass_crypt_confirmation: Cunferma chiavi d’accessu
help:
+ doorkeeper/application:
+ redirect_uri: Usa un ringu pi ogni URI
trace:
tagstring: spartuti câ vìrgula
user_block:
- needs_view: Havi a tràsiri l'utenti avanti chi stu bloccu veni livatu?
+ needs_view: A l'utenti serbi di tràsiri prima ca si leva ssu bloccu?
user:
- new_email: (nun veni ammustratu mai pubblicamenti)
+ new_email: (mai fattu vìdiri ô pùbblicu)
datetime:
distance_in_words_ago:
x_minutes:
one: 1 annu fa
other: '%{count} anni fa'
editor:
- default: Pridifinutu (com'a ora %{name})
+ default: Pridifinutu (camora %{name})
id:
name: iD
- description: iD (editor ntô browser)
+ description: iD (edituri nnô browser)
remote:
- name: Telecumannu
- description: Telecumannu (JOSM, Potlatch, Merkaartor)
+ name: Cuntrollu di luntanu
+ description: Cuntrollu di luntanu (JOSM, Potlatch, Merkaartor)
auth:
providers:
none: Nuḍḍu
api:
notes:
comment:
- opened_at_html: Criatu %{when}
- opened_at_by_html: Criatu %{when} di %{user}
- commented_at_html: Aggiurnatu %{when}
- commented_at_by_html: Aggiurnatu %{when} di %{user}
- closed_at_html: Arrisurvuta %{when}
- closed_at_by_html: Arrisurvuta %{when} di %{user}
- reopened_at_html: Rigraputa %{when}
- reopened_at_by_html: Rigraputa %{when} di %{user}
+ opened_at_html: Criata %{when}
+ opened_at_by_html: Criata %{when} di %{user}
+ commented_at_html: Attualizzata %{when}
+ commented_at_by_html: Attualizzata %{when} di %{user}
+ closed_at_html: Risurbuta %{when}
+ closed_at_by_html: Risurbuta %{when} di %{user}
+ reopened_at_html: Graputa arrè %{when}
+ reopened_at_by_html: Graputa arrè %{when} di %{user}
rss:
- title: Noti d'OpenStreetMap
- description_area: N’elencu dî noti signalati, cummintati o arrisurvuti ntâ
- tò zona [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]
- description_item: Un flussu RSS pâ nota %{id}
+ title: Noti di OpenStreetMap
+ description_area: Na lista di noti, signalati, cummintati o risurbuti nnâ
+ to zona [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]
+ description_item: Un feed RSS pâ nota %{id}
opened: nota nova (vicinu a %{place})
commented: cummentu novu (vicinu a %{place})
- closed: nota arrisurvuta (vicinu a %{place})
- reopened: nota riattivata (vicinu a %{place})
+ closed: nota risurbuta (vicinu a %{place})
+ reopened: nota graputa arrè (vicinu a %{place})
entry:
comment: Cummentu
full: Nota cumpleta
account:
deletions:
show:
- title: Cancella lu mè cuntu
- delete_account: Cancella cuntu
- confirm_delete: Sî sicuru?
- cancel: Annulla
+ title: Scancella u me cuntu
+ delete_account: Scancella u cuntu
+ confirm_delete: Sicuru sì?
+ cancel: Sfai
accounts:
edit:
- title: Cancia lu cuntu
- my settings: Li mè mpustazzioni
- current email address: Nnirizzu email attuali
- external auth: Autinticazzioni esterna
+ title: Cancia u cuntu
+ my settings: Mpustazzioni
+ current email address: Nnirizzu e-mail attuali
+ external auth: Tranzuntari di fora
openid:
- link: http://wiki.openstreetmap.org/wiki/IT:OpenID
- link text: chi voli diri?
+ link: http://wiki.openstreetmap.org/wiki/OpenID
+ link text: zoccu è chissu?
public editing:
- heading: Canciamenti pùbblici
- enabled: Attivati. Nun sî anònimu e poi canciari li dati.
- enabled link text: chi voli diri?
- disabled: Disattivati, e nun poi canciari li dati, tutti li canciamenti pricidenti
- sunnu anònimi.
- disabled link text: pirchì nun pozzu fari canciamenti?
+ heading: Canciu pùbblicu
+ enabled: Abbilitati. Senza anònimu e cû pirmisu pi canciari i dati.
+ enabled link text: zoccu è chissu?
+ disabled: Disabbilitati e senza u pirmisu pi canciari i dati, tutti i canci
+ d’avanti sunnu anònimi.
+ disabled link text: picchì nun pozzu fari canci?
contributor terms:
- heading: Cunnizzioni di cuntribbuzzioni
- agreed: Accittasti li cunnizzioni di cuntribbuzzioni novi.
- not yet agreed: Ancora nun accittasti li cunnizzioni di cuntribbuzzioni novi.
- review link text: Quannu voi tu vai nta stu link pi lèggiri e accittari li
- cunnizzioni di cuntribbuzzioni novi.
- agreed_with_pd: Dichiarasti macari chi cunzìddiri li tò canciamenti ntô Duminiu
- Pùbblicu.
- link text: chi voli diri?
- save changes button: Sarva li canciamenti
- delete_account: Cancella cuntu...
+ heading: Règuli pî cuntribbuti
+ agreed: Accittasti i règuli pî cuntribbuti novi.
+ not yet agreed: Ancora nun accittasti i règuli pî cuntribbuti novi.
+ review link text: Quannu rinesci ammacca sta lijami pi ti lèggiri i règuli
+ pî cuntribbuti novi e p’accittalli.
+ agreed_with_pd: Dicisti macari ca cunzìddiri i to canci comu si sunnu di duminiu
+ pùbblicu.
+ link text: zoccu è chissu?
+ save changes button: Sarba i canci
+ delete_account: Scancella u cuntu...
go_public:
- heading: Canciamenti pùbblici
- make_edits_public_button: Arrenni tutti li mè canciamenti pùbblici
+ heading: Canciu pùbblicu
+ make_edits_public_button: Tutti i me canci falli pùbblici
update:
- success_confirm_needed: Li nfurmazzioni di l'utenti foru aggiurnati boni. Cuntrolla
- la tò posta elittrònica chi t'havi a arrivari nu missaggiu pi cunfirmari lu
- nnirizzu di posta novu.
- success: Li nfurmazzioni di l'utenti foru aggiurnati boni.
+ success_confirm_needed: Nfurmazzioni di l'utenti attualizzati. Cuntrolla a to
+ e-mail pi cunfirmari u to nnirizzu di posta elittrònica novu.
+ success: Nfurmazzioni di l'utenti attualizzati.
destroy:
- success: Cuntu cancillatu.
+ success: Cuntu scancillatu.
browse:
version: Virsioni
- in_changeset: Gruppu di canciamenti
+ in_changeset: Gruppu dî canci
anonymous: anònimu
- no_comment: (nuḍḍu cummentu)
- part_of: Fa parti di
- download_xml: Scàrrica ntô furmatu XML
- view_history: Talìa la crunuluggìa
- view_details: Talìa li dittagghî
+ no_comment: (senza cummentu)
+ part_of: Parti di
+ download_xml: Scàrrica XML
+ view_history: Talìa a storia
+ view_details: Talìa i minutagghi
location: 'Locu:'
node:
title_html: 'Gruppu: %{name}'
- history_title_html: 'Crunuluggìa dû gruppu: %{name}'
+ history_title_html: 'Storia dû gruppu: %{name}'
way:
title_html: 'Caminu: %{name}'
- history_title_html: 'Crunuluggìa dû caminu: %{name}'
- nodes: Gruppa
+ history_title_html: 'Storia dû caminu: %{name}'
+ nodes: Gruppi
also_part_of_html:
one: parti dû caminu %{related_ways}
other: parti dî camini %{related_ways}
relation:
title_html: 'Rilazzioni: %{name}'
- history_title_html: 'Crunuluggìa dâ rilazzioni: %{name}'
+ history_title_html: 'Storia dâ rilazzioni: %{name}'
members: Mèmmiri
members_count:
one: 1 mèmmiru
entry_html: Rilazzioni %{relation_name}
entry_role_html: Rilazzioni %{relation_name} (comu %{relation_role})
not_found:
- title: Nun attruvatu
- sorry: 'Purtroppu, %{type} #%{id} nun si potti attruvari.'
+ title: Senza truvatu
+ sorry: 'Purtroppu, %{type} #%{id} nun si potti truvari.'
type:
- node: lu gruppu
- way: lu caminu
+ node: gruppu
+ way: caminu
relation: la rilazzioni
changeset: lu gruppu di canciamenti
note: nota
"yes": Passu di muntagna
natural:
bay: Gulfu
- beach: Praia
- cape: Capu
+ beach: Praja
+ cape: Punta
cave_entrance: Trasuta dâ grutta
cliff: Sdirrupu
crater: Crateri
glacier: Ghiacciaiu
grassland: Pratu
heath: Brughiera
- hill: Cullina
+ hill: Muntagnola
island: Ìsula
land: Terra
marsh: Margiu
accountant: Raggiuneri
administrative: Ufficiu pùbblicu lucali
architect: Architettu
- company: Sucità
+ company: Azzienna
+ diplomatic: Ufficiu diplumàticu
employment_agency: Agginzìa pû travagghiu
estate_agent: Agginzìa Mmubbiliari
government: Ufficiu pùbblicu
intro_text: OpenStreetMap è na cartina dû munnu, criata di genti comu a tìa e
lìbbira a adupirari secunnu na licenza graputa.
partners_partners: cullabburatura
+ tou: Cunnizzioni pi l’usu
osm_offline: La basi di dati d'OpenStreetMap comu a ora nun è n lìnia pirchì si
stannu facennu travagghî di manutinzioni funnamintali.
osm_read_only: La basi di dati d'OpenStreetMap comu a ora è ntâ mudalità di sula
littura pirchì si stannu facennu travagghî di manutinzioni funnamintali.
+ nothing_to_preview: Nenti di vìdiri.
help: Guida
about: Nfurmazzioni
copyright: Dritti d'auturi
learn_more: Sapìrinni cchiossai
- more: Àutri cosi
+ more: Autru
user_mailer:
diary_comment_notification:
subject: '[OpenStreetMap] %{user} cummintau na vuci dû tò diariu'
no home location: Ancora nun mpustasti la tò pusizzioni basi.
update home location on click: Aggiorna la pusizzioni basi quannu cliccu supra
â carta?
+ show: Fa’ vìdiri
+ delete: Scancella
+ update:
+ success: Cuntu attualizzatu.
sessions:
new:
tab_title: Trasi
email or username: 'Nnirizzu di posta elittrònica o nomu utenti:'
- password: 'Palora d''òrdini:'
+ password: 'Chiavi d’accessu:'
remember: Arricòrdati di mìa
lost password link: Pirdisti la tò palora d'òrdini?
login_button: Trasi
aggiurnatu.
community_driven_title: Guidatu dâ cumunità
open_data_title: Dati graputi
+ open_data_open_data: dati graputi
legal_title: Noti ligali
partners_title: Cullabburatura
copyright:
contributors_intro_html: 'Li nostri cuntribbutura sunnu migghiara di genti.
Pigghiamu macari dati cu licenza graputa furnuti di l''agginzìi cartugràfichi
nazziunali e d''àutri fonti, tra dî quali:'
+ contributors_nz_new_zealand: Nova Zilanna
+ contributors_rs_serbia: Serbia
+ contributors_si_slovenia: Sluvenia
+ contributors_es_spain: Spagna
contributors_footer_2_html: La nclusioni dî dati nta OpenStreetMap nun ìmplica
ca lu sò furnituri origginali susteni OpenStreetMap, furnisci na quarchi
garanzìa, o accetta na quarchi rispunzabbilità.
taxiway: pista di rullaggiu
apron: Ària di parcheggiu ariupurtuali
admin: Cunfini amministrativu
+ capital: Capitali
forest: Furesta
wood: Voscu
+ sand: Rina
golf: Campu di golf
park: Villa
common: Cumuni
create:
flash: Occultamentu criatu.
update:
- flash: Canciamenti sarvati.
+ flash: Canci sarbati.
destroy:
- not_empty: St'occultamentu nun è vacanti. Pi favuri leva di l'occultamentu tutti
- li virsioni chi nni fannu parti avanti chi lu distrudi.
- flash: Occultamentu distruiutu.
- error: Ammattìu n'erruri ntô distrùiri st'occultamentu.
+ not_empty: Sta rivisioni nun è vacanti. Leva a rivisioni a tutti i virsioni
+ chi ci appartèninu avanti ca a distrudi.
+ flash: Rivisioni distruduta.
+ error: Cci fu nu sbagghiu ntô mentri ca scancillava ssa rivisioni.
+ validations:
+ leading_whitespace: àvi nu spazziu jancu ô principiu
+ trailing_whitespace: àvi nu spazziu jancu â fini
+ url_characters: àvi caràttari URL spiciali (%{characters})
...
notes:
index:
subheading_submitted: جمع تھی ڳیا
+ apply: لاڳو کرو
+ all: یکے
+ open: کھولو
+ closed: بند تھیا
+ status: حیثیت
show:
title: نوٹ:%{id}
description: تفصیل
# Author: SkyEye FAST
# Author: StarrySky
# Author: StephDC
+# Author: TFX202X
# Author: TianyinLee
# Author: Tntchn
# Author: TsuyaMarisa
description: 描述
created_at: 创建于
last_changed: 最后更改于
+ apply: 应用
+ all: 全部
+ open: 打开
+ closed: 关闭
+ status: 状态
show:
title: 注记:%{id}
description: 描述
post "close"
post "reopen"
end
+
+ resource :subscription, :only => [:create, :destroy], :controller => "note_subscriptions"
end
resources :user_blocks, :only => :show, :id => /\d+/, :controller => "user_blocks"
--- /dev/null
+require "test_helper"
+
+module Api
+ class NoteSubscriptionsControllerTest < ActionDispatch::IntegrationTest
+ def test_routes
+ assert_routing(
+ { :path => "/api/0.6/notes/1/subscription", :method => :post },
+ { :controller => "api/note_subscriptions", :action => "create", :note_id => "1" }
+ )
+ assert_routing(
+ { :path => "/api/0.6/notes/1/subscription", :method => :delete },
+ { :controller => "api/note_subscriptions", :action => "destroy", :note_id => "1" }
+ )
+ end
+
+ def test_create
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+ note = create(:note_with_comments)
+ assert_empty note.subscribers
+
+ assert_difference "NoteSubscription.count", 1 do
+ assert_difference "note.subscribers.count", 1 do
+ post api_note_subscription_path(note), :headers => auth_header
+ assert_response :success
+ end
+ end
+ assert_equal user, note.subscribers.last
+ end
+
+ def test_create_fail_anonymous
+ note = create(:note_with_comments)
+
+ assert_no_difference "NoteSubscription.count" do
+ assert_no_difference "note.subscribers.count" do
+ post api_note_subscription_path(note)
+ assert_response :unauthorized
+ end
+ end
+ end
+
+ def test_create_fail_no_scope
+ user = create(:user)
+ auth_header = bearer_authorization_header user, :scopes => %w[read_prefs]
+ note = create(:note_with_comments)
+
+ assert_no_difference "NoteSubscription.count" do
+ assert_no_difference "note.subscribers.count" do
+ post api_note_subscription_path(note), :headers => auth_header
+ assert_response :forbidden
+ end
+ end
+ end
+
+ def test_create_fail_note_not_found
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+
+ assert_no_difference "NoteSubscription.count" do
+ post api_note_subscription_path(999111), :headers => auth_header
+ assert_response :not_found
+ end
+ assert_match "not found", @response.body
+ end
+
+ def test_create_fail_already_subscribed
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+ note = create(:note_with_comments)
+ create(:note_subscription, :user => user, :note => note)
+
+ assert_no_difference "NoteSubscription.count" do
+ assert_no_difference "note.subscribers.count" do
+ post api_note_subscription_path(note), :headers => auth_header
+ assert_response :conflict
+ end
+ end
+ assert_match "already subscribed", @response.body
+ end
+
+ def test_destroy
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+ other_user = create(:user)
+ note = create(:note_with_comments)
+ other_note = create(:note_with_comments)
+ create(:note_subscription, :user => user, :note => note)
+ create(:note_subscription, :user => other_user, :note => note)
+ create(:note_subscription, :user => user, :note => other_note)
+
+ assert_difference "NoteSubscription.count", -1 do
+ assert_difference "note.subscribers.count", -1 do
+ delete api_note_subscription_path(note), :headers => auth_header
+ assert_response :success
+ end
+ end
+ note.reload
+ assert_equal [other_user], note.subscribers
+ assert_equal [user], other_note.subscribers
+ end
+
+ def test_destroy_fail_anonymous
+ note = create(:note_with_comments)
+
+ delete api_note_subscription_path(note)
+ assert_response :unauthorized
+ end
+
+ def test_destroy_fail_no_scope
+ user = create(:user)
+ auth_header = bearer_authorization_header user, :scopes => %w[read_prefs]
+ note = create(:note_with_comments)
+ create(:note_subscription, :user => user, :note => note)
+
+ assert_no_difference "NoteSubscription.count" do
+ assert_no_difference "note.subscribers.count" do
+ delete api_note_subscription_path(note), :headers => auth_header
+ assert_response :forbidden
+ end
+ end
+ end
+
+ def test_destroy_fail_note_not_found
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+
+ delete api_note_subscription_path(999111), :headers => auth_header
+ assert_response :not_found
+ assert_match "not found", @response.body
+ end
+
+ def test_destroy_fail_not_subscribed
+ user = create(:user)
+ auth_header = bearer_authorization_header user
+ note = create(:note_with_comments)
+
+ delete api_note_subscription_path(note), :headers => auth_header
+ assert_response :not_found
+ assert_match "not subscribed", @response.body
+ end
+ end
+end
end
end
- def test_add_comment
+ test "can add comment" do
note = create(:note_with_comments)
user = create(:user)
sign_in_as(user)
assert_button "Reactivate", :disabled => false
end
end
+
+ test "no subscribe button when not logged in" do
+ note = create(:note_with_comments)
+ visit note_path(note)
+
+ within_sidebar do
+ assert_no_button "Subscribe"
+ assert_no_button "Unsubscribe"
+ end
+ end
+
+ test "can subscribe" do
+ note = create(:note_with_comments)
+ user = create(:user)
+ sign_in_as(user)
+ visit note_path(note)
+
+ within_sidebar do
+ assert_button "Subscribe"
+ assert_no_button "Unsubscribe"
+
+ click_on "Subscribe"
+
+ assert_no_button "Subscribe"
+ assert_button "Unsubscribe"
+ end
+ end
+
+ test "can unsubscribe" do
+ note = create(:note_with_comments)
+ user = create(:user)
+ create(:note_subscription, :note => note, :user => user)
+ sign_in_as(user)
+ visit note_path(note)
+
+ within_sidebar do
+ assert_no_button "Subscribe"
+ assert_button "Unsubscribe"
+
+ click_on "Unsubscribe"
+
+ assert_button "Subscribe"
+ assert_no_button "Unsubscribe"
+ end
+ end
end