'{{description}}' 뱃지를 받았습니다.
"
+ popup:
+ mentioned: '"{{topic}}" - {{site_title}}에서 {{username}} 님이 당신을 언급했습니다'
+ quoted: '"{{topic}}" - {{site_title}}에서 {{username}} 님이 당신을 인용했습니다'
+ replied: '"{{topic}}" - {{site_title}}에서 {{username}} 님이 당신에게 답글을 달았습니다'
+ posted: '"{{topic}}" - {{site_title}}에서 {{username}}님이 글을 게시하였습니다'
upload_selector:
title: "이미지 추가하기"
title_with_attachments: "이미지 또는 파일 추가하기"
@@ -711,6 +726,7 @@ ko:
user: "@{{username}}의 글 검색"
category: "\"{{category}}\" 카테고리 검색"
topic: "이 토픽을 검색"
+ private_messages: "메시지 검색"
site_map: "다른 토픽이나 카테고리로 이동"
go_back: '돌아가기'
not_logged_in_user: 'user page with summary of current activity and preferences'
@@ -730,6 +746,7 @@ ko:
close_topics: "토픽 닫기"
archive_topics: "토픽 보관하기"
notification_level: "알림 설정 변경"
+ choose_new_category: "토픽의 새로운 카테고리를 선택"
selected:
other: "새로운 토픽은 여기에서 볼 수 있습니다.
읽지 않은 토픽은 여기에서 볼 수 있습니다.
');
innerHtml.push('
');
innerHtml.push('
'); // .html5-title
innerHtml.push('
'); // .html5-title-text-wrapper
@@ -102,15 +106,10 @@
}
});
- $.getJSON('https://gdata.youtube.com/feeds/api/videos/' + id + '?v=2&alt=json', function (data) {
- $el.find('#lazyYT-title-' + id).text(data.entry.title.$t);
- });
-
}
$.fn.lazyYT = function (newSettings) {
var defaultSettings = {
- loading_text: 'Loading...',
default_ratio: '16:9',
callback: null, // ToDO execute callback if given
container_class: 'lazyYT-container'
diff --git a/plugins/lazyYT/plugin.rb b/plugins/lazyYT/plugin.rb
index cf02d90882..7a9b8fc2a2 100644
--- a/plugins/lazyYT/plugin.rb
+++ b/plugins/lazyYT/plugin.rb
@@ -18,7 +18,7 @@ class Onebox::Engine::YoutubeOnebox
def to_html
if video_id
# Put in the LazyYT div instead of the iframe
- "
"
+ "
"
else
super
end
diff --git a/plugins/poll/assets/javascripts/components/poll-option.js.es6 b/plugins/poll/assets/javascripts/components/poll-option.js.es6
index aec6e6c79e..fdc1066314 100644
--- a/plugins/poll/assets/javascripts/components/poll-option.js.es6
+++ b/plugins/poll/assets/javascripts/components/poll-option.js.es6
@@ -12,7 +12,8 @@ export default Em.Component.extend({
var styles = [];
if (this.get("color")) { styles.push("color:" + this.get("color")); }
if (this.get("background")) { styles.push("background:" + this.get("background")); }
- return styles.length > 0 ? styles.join(";") : false;
+
+ return (styles.length > 0 ? styles.join(";") : '').htmlSafe();
}.property("color", "background"),
render(buffer) {
diff --git a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6
index 64abdf6680..dd778026f7 100644
--- a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6
+++ b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6
@@ -13,9 +13,9 @@ export default Em.Component.extend({
if (backgroundColor) { styles.push("background: " + backgroundColor); }
option.setProperties({
- percentage: percentage,
+ percentage,
title: I18n.t("poll.option_title", { count: option.get("votes") }),
- style: styles.join(";")
+ style: styles.join(";").htmlSafe()
});
});
diff --git a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs
index b17c1361e9..4f29d18dac 100644
--- a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs
+++ b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs
@@ -5,7 +5,7 @@
|
-
+
|
{{/each}}
diff --git a/plugins/poll/assets/javascripts/discourse/templates/poll.hbs b/plugins/poll/assets/javascripts/discourse/templates/poll.hbs
index 69662d4729..4d6b3bae16 100644
--- a/plugins/poll/assets/javascripts/discourse/templates/poll.hbs
+++ b/plugins/poll/assets/javascripts/discourse/templates/poll.hbs
@@ -1,4 +1,19 @@
+
+ {{#if showingResults}}
+ {{#if isNumber}}
+ {{poll-results-number poll=poll}}
+ {{else}}
+ {{poll-results-standard poll=poll}}
+ {{/if}}
+ {{else}}
+
+ {{#each option in poll.options}}
+ {{poll-option option=option color=poll.color background=poll.background toggle="toggleOption"}}
+ {{/each}}
+
+ {{/if}}
+
{{poll.voters}}
@@ -15,21 +30,6 @@
{{/if}}
{{/if}}
-
- {{#if showingResults}}
- {{#if isNumber}}
- {{poll-results-number poll=poll}}
- {{else}}
- {{poll-results-standard poll=poll}}
- {{/if}}
- {{else}}
-
- {{#each option in poll.options}}
- {{poll-option option=option color=poll.color background=poll.background toggle="toggleOption"}}
- {{/each}}
-
- {{/if}}
-
diff --git a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6
index e9ff8d09f8..2a85abd1c6 100644
--- a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6
+++ b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6
@@ -5,12 +5,7 @@ function createPollView(container, post, poll, vote) {
view = container.lookup("view:poll");
controller.set("vote", vote);
-
- controller.setProperties({
- model: Em.Object.create(poll),
- post: post,
- });
-
+ controller.setProperties({ model: Em.Object.create(poll), post });
view.set("controller", controller);
return view;
@@ -25,7 +20,7 @@ export default {
// listen for back-end to tell us when a post has a poll
messageBus.subscribe("/polls", data => {
- const post = container.lookup("controller:topic").get("postStream").findLoadedPost(data.post_id);
+ const post = container.lookup("controller:topic").get('modee.postStream').findLoadedPost(data.post_id);
// HACK to trigger the "postViewUpdated" event
Em.run.next(_ => post.set("cooked", post.get("cooked") + " "));
});
@@ -33,8 +28,7 @@ export default {
// overwrite polls
PostView.reopen({
_createPollViews: function($post) {
- const self = this,
- post = this.get("post"),
+ const post = this.get("post"),
polls = post.get("polls"),
votes = post.get("polls_votes") || {};
@@ -54,7 +48,7 @@ export default {
pollView = createPollView(container, post, polls[pollName], votes[pollName]);
$poll.replaceWith($div);
- pollView.constructor.renderer.replaceIn(pollView, $div[0]);
+ pollView.renderer.replaceIn(pollView, $div[0]);
pollViews[pollName] = pollView;
});
@@ -80,4 +74,4 @@ export default {
}.on("willClearRender")
});
}
-}
+};
diff --git a/plugins/poll/assets/javascripts/poll_dialect.js b/plugins/poll/assets/javascripts/poll_dialect.js
index 01c8ff37c7..126f483314 100644
--- a/plugins/poll/assets/javascripts/poll_dialect.js
+++ b/plugins/poll/assets/javascripts/poll_dialect.js
@@ -8,7 +8,7 @@
const WHITELISTED_ATTRIBUTES = ["type", "name", "min", "max", "step", "order", "color", "background", "status"];
const WHITELISTED_STYLES = ["color", "background"];
- const ATTRIBUTES_REGEX = new RegExp("(" + WHITELISTED_ATTRIBUTES.join("|") + ")=[^\\s\\]]+", "g");
+ const ATTRIBUTES_REGEX = new RegExp("(" + WHITELISTED_ATTRIBUTES.join("|") + ")=['\"]?[^\\s\\]=]+['\"]?", "g");
Discourse.Dialect.replaceBlock({
start: /\[poll([^\]]*)\]([\s\S]*)/igm,
@@ -44,8 +44,9 @@
// extract poll attributes
(matches[1].match(ATTRIBUTES_REGEX) || []).forEach(function(m) {
- var attr = m.split("=");
- attributes[DATA_PREFIX + attr[0]] = attr[1];
+ var attr = m.split("="), name = attr[0], value = attr[1];
+ value = Handlebars.Utils.escapeExpression(value.replace(/["']/g, ""));
+ attributes[DATA_PREFIX + name] = value;
});
// we might need these values later...
@@ -97,16 +98,14 @@
contents[0][o].splice(1, 0, attr);
}
- // // add some information when type is "multiple"
- // if (attributes[DATA_PREFIX + "type"] === "multiple") {
-
-
- // }
-
var result = ["div", attributes],
poll = ["div"];
- // 1 - POLL INFO
+ // 1 - POLL CONTAINER
+ var container = ["div", { "class": "poll-container" }].concat(contents);
+ poll.push(container);
+
+ // 2 - POLL INFO
var info = ["div", { "class": "poll-info" }];
// # of voters
@@ -147,10 +146,6 @@
poll.push(info);
- // 2 - POLL CONTAINER
- var container = ["div", { "class": "poll-container" }].concat(contents);
- poll.push(container);
-
// 3 - BUTTONS
var buttons = ["div", { "class": "poll-buttons" }];
diff --git a/plugins/poll/assets/stylesheets/poll.scss b/plugins/poll/assets/stylesheets/common/poll.scss
similarity index 85%
rename from plugins/poll/assets/stylesheets/poll.scss
rename to plugins/poll/assets/stylesheets/common/poll.scss
index bc03b5200a..0953710582 100644
--- a/plugins/poll/assets/stylesheets/poll.scss
+++ b/plugins/poll/assets/stylesheets/common/poll.scss
@@ -7,9 +7,7 @@ $option-shadow: dark-light-diff($option-background, $primary, 10%, -10%);
div.poll {
- display: table;
border: 1px solid $border-color;
- width: 500px;
ul, ol {
margin: 0;
@@ -29,10 +27,9 @@ div.poll {
color: $option-foreground;
background: $option-background;
box-shadow: inset 0 -6px rgba(0,0,0,.25), inset 0 0 0 100px rgba(0,0,0,0);
- padding: 0 12px;
+ padding: .5em .7em;
margin-bottom: 10px;
border-radius: 4px;
- height: 2.3em;
&:hover {
box-shadow: inset 0 -6px rgba(0,0,0,.35), inset 0 0 0 100px rgba(0,0,0,.1);
@@ -66,31 +63,21 @@ div.poll {
.poll-info {
color: $text-color;
- width: 150px;
- display: table-cell;
text-align: center;
vertical-align: middle;
- border-right: 1px solid $border-color;
-
- p {
- margin: 40px 20px;
- }
.info-number {
font-size: 3.5em;
}
.info-text {
- display: block;
font-size: 1.7em;
}
}
.poll-container {
- display: table-cell;
vertical-align: middle;
padding: 10px;
- width: 330px;
span {
font-size: 2em;
@@ -98,16 +85,9 @@ div.poll {
}
.poll-buttons {
- border-top: 1px solid $border-color;
- padding: 10px;
-
button {
float: none;
}
-
- .toggle-status {
- float: right;
- }
}
.results {
diff --git a/plugins/poll/assets/stylesheets/desktop/poll.scss b/plugins/poll/assets/stylesheets/desktop/poll.scss
new file mode 100644
index 0000000000..e875c29a03
--- /dev/null
+++ b/plugins/poll/assets/stylesheets/desktop/poll.scss
@@ -0,0 +1,34 @@
+div.poll {
+ display: table;
+ width: 500px;
+ max-width: 500px;
+
+ .poll-info {
+ width: 150px;
+ display: table-cell;
+ border-left: 1px solid $border-color;
+
+ p {
+ margin: 40px 20px;
+ }
+
+ .info-text {
+ display: block;
+ }
+ }
+
+ .poll-container {
+ display: table-cell;
+ width: 330px;
+ max-width: 330px;
+ }
+
+ .poll-buttons {
+ border-top: 1px solid $border-color;
+ padding: 10px;
+
+ .toggle-status {
+ float: right;
+ }
+ }
+}
diff --git a/plugins/poll/assets/stylesheets/mobile/poll.scss b/plugins/poll/assets/stylesheets/mobile/poll.scss
new file mode 100644
index 0000000000..1dc4c95caa
--- /dev/null
+++ b/plugins/poll/assets/stylesheets/mobile/poll.scss
@@ -0,0 +1,9 @@
+div.poll {
+ .poll-buttons {
+ padding: 0 5px 5px 5px;
+
+ button {
+ margin: 4px 2px;
+ }
+ }
+}
diff --git a/plugins/poll/config/locales/client.ar.yml b/plugins/poll/config/locales/client.ar.yml
index 79ea4de815..1d803323f4 100644
--- a/plugins/poll/config/locales/client.ar.yml
+++ b/plugins/poll/config/locales/client.ar.yml
@@ -5,4 +5,15 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-ar: {}
+ar:
+ js:
+ poll:
+ voters:
+ zero: "المصوتون"
+ one: "المصوت"
+ other: "المصوتون"
+ total_votes:
+ zero: "مجموع الأصوات"
+ one: "مجموع التصويت"
+ other: "مجموع الأصوات"
+ average_rating: "متوسط التصنيف: %{average} "
diff --git a/plugins/poll/config/locales/client.de.yml b/plugins/poll/config/locales/client.de.yml
index 821318ea03..c19a0ff67f 100644
--- a/plugins/poll/config/locales/client.de.yml
+++ b/plugins/poll/config/locales/client.de.yml
@@ -8,7 +8,21 @@
de:
js:
poll:
+ voters:
+ zero: "Teilnehmer"
+ one: "Teilnehmer"
+ other: "Teilnehmer"
+ total_votes:
+ zero: "abgegebene Stimmen"
+ one: "abgegebene Stimme"
+ other: "abgegebene Stimmen"
average_rating: "Durchschnittliche Bewertung: %{average}"
+ multiple:
+ help:
+ at_least_min_options: "Du kannst %{count} oder mehr Optionen auswählen."
+ up_to_max_options: "Du kannst bis zu %{count} Optionen auswählen."
+ x_options: "Du kannst %{count} Optionen auswählen."
+ between_min_and_max_options: "Du kannst zwischen %{min} und %{max} Optionen auswählen."
cast-votes:
title: "Gib deine Stimmen ab"
label: "Jetzt abstimmen!"
@@ -21,10 +35,10 @@ de:
open:
title: "Umfrage starten"
label: "Starten"
- confirm: "Möchtest du wirklich diese Umfrage starten?"
+ confirm: "Möchtest du diese Umfrage wirklich starten?"
close:
title: "Umfrage beenden"
label: "Beenden"
- confirm: "Möchtest du wirklich diese Umfrage beenden?"
+ confirm: "Möchtest du diese Umfrage wirklich beenden?"
error_while_toggling_status: "Beim Ändern des Status der Umfrage ist ein Fehler aufgetreten."
error_while_casting_votes: "Beim Abstimmen ist ein Fehler aufgetreten."
diff --git a/plugins/poll/config/locales/client.es.yml b/plugins/poll/config/locales/client.es.yml
index 595e5c174a..a17f23bd30 100644
--- a/plugins/poll/config/locales/client.es.yml
+++ b/plugins/poll/config/locales/client.es.yml
@@ -8,10 +8,24 @@
es:
js:
poll:
+ voters:
+ zero: "votantes"
+ one: "votante"
+ other: "votantes"
+ total_votes:
+ zero: "total votos"
+ one: "total voto"
+ other: "total votos"
average_rating: "Puntuación media: %{average}."
+ multiple:
+ help:
+ at_least_min_options: "Puedes escoger como mínimo %{count} opciones."
+ up_to_max_options: "Puedes escoger hasta %{count} opciones."
+ x_options: "Puedes escoger %{count} opciones."
+ between_min_and_max_options: "Puedes escoger entre %{min} y %{max} opciones."
cast-votes:
title: "Votar"
- label: "Votar ahora"
+ label: "¡Vota!"
show-results:
title: "Mostrar los resultados de la encuesta"
label: "Mostrar resultados"
@@ -21,10 +35,10 @@ es:
open:
title: "Abrir encuesta"
label: "Abrir"
- confirm: "¿Estás seguro de querer abrir esta encuesta?"
+ confirm: "¿Seguro que quieres abrir esta encuesta?"
close:
title: "Cerrar la encuesta"
label: "Cerrar"
- confirm: "¿Estás seguro de querer cerrar esta encuesta?"
+ confirm: "¿Seguro que quieres cerrar esta encuesta?"
error_while_toggling_status: "Ha ocurrido un error mientras se cambiaba el estado de esta encuesta."
- error_while_casting_votes: "Ha ocurrido un error a la hora de mandar los votos."
+ error_while_casting_votes: "Ha ocurrido un error a la hora de enviar los votos."
diff --git a/plugins/poll/config/locales/client.fa_IR.yml b/plugins/poll/config/locales/client.fa_IR.yml
index 12e5b8ac7c..e0445ba6a0 100644
--- a/plugins/poll/config/locales/client.fa_IR.yml
+++ b/plugins/poll/config/locales/client.fa_IR.yml
@@ -8,7 +8,21 @@
fa_IR:
js:
poll:
+ voters:
+ zero: "voters"
+ one: "voter"
+ other: "voters"
+ total_votes:
+ zero: "total votes"
+ one: "total vote"
+ other: "total votes"
average_rating: "میانگین امتیاز: %{average}."
+ multiple:
+ help:
+ at_least_min_options: "You may choose at least %{count} options."
+ up_to_max_options: "You may choose up to %{count} options."
+ x_options: "You may choose %{count} options."
+ between_min_and_max_options: "You may choose between %{min} and %{max} options."
cast-votes:
title: "انداختن رأی شما"
label: "رای بدهید!"
diff --git a/plugins/poll/config/locales/client.fi.yml b/plugins/poll/config/locales/client.fi.yml
index 52e6958643..203330f0c7 100644
--- a/plugins/poll/config/locales/client.fi.yml
+++ b/plugins/poll/config/locales/client.fi.yml
@@ -8,7 +8,21 @@
fi:
js:
poll:
+ voters:
+ zero: "äänestäjät"
+ one: "äänestäjä"
+ other: "äänestäjät"
+ total_votes:
+ zero: "ääntä"
+ one: "ääni"
+ other: "ääntä"
average_rating: "Keskivertoarvio: %{average}."
+ multiple:
+ help:
+ at_least_min_options: "Voita valita vähintään %{count} vaihtoehtoa."
+ up_to_max_options: "Voit valita enintään %{count} vaihtoehtoa."
+ x_options: "Voit valita %{count} vaihtoehtoa."
+ between_min_and_max_options: "Voit valita %{min}-%{max}%{average}."
+ multiple:
+ help:
+ at_least_min_options: "Puoi scegliere al massimo %{count} opzioni."
+ up_to_max_options: "Puoi scegliere fino a %{count} opzioni."
+ x_options: "Puoi scegliere %{count} opzioni."
+ between_min_and_max_options: "Puoi scegliere tra %{min} e %{max} opzioni."
+ cast-votes:
+ title: "Vota"
+ label: "Vota!"
+ show-results:
+ title: "Visualizza i risultati del sondaggio"
+ label: "Mostra i risultati"
+ hide-results:
+ title: "Torna ai tuoi voti"
+ label: "Nascondi i risultati"
+ open:
+ title: "Apri il sondaggio"
+ label: "Apri"
+ confirm: "Sicuro di voler aprire questo sondaggio?"
+ close:
+ title: "Chiudi il sondaggio"
+ label: "Chiudi"
+ confirm: "Sicuro di voler chiudere questo sondaggio?"
+ error_while_toggling_status: "Si è verificato un errore nel commutare lo stato di questo sondaggio."
+ error_while_casting_votes: "Si è verificato un errore nella votazione."
diff --git a/plugins/poll/config/locales/client.pl_PL.yml b/plugins/poll/config/locales/client.pl_PL.yml
index c04d371e5a..0935013e26 100644
--- a/plugins/poll/config/locales/client.pl_PL.yml
+++ b/plugins/poll/config/locales/client.pl_PL.yml
@@ -5,4 +5,40 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-pl_PL: {}
+pl_PL:
+ js:
+ poll:
+ voters:
+ zero: "głosujących"
+ one: "głosujący"
+ other: "głosujących"
+ total_votes:
+ zero: "oddanych głosów"
+ one: "oddany głos"
+ other: "oddanych głosów"
+ average_rating: "Średnia ocena: %{average}."
+ multiple:
+ help:
+ at_least_min_options: "Możesz wybrać co najmniej %{count} pozycje."
+ up_to_max_options: "Możesz wybrać co najwyżej %{count} pozycje."
+ x_options: "Możesz wybrać %{count} pozycje."
+ between_min_and_max_options: "Możesz wybrać pomiędzy %{min} a %{max} pozycjami."
+ cast-votes:
+ title: "Oddaj głos"
+ label: "Oddaj głos!"
+ show-results:
+ title: "Wyświetl wyniki ankiety"
+ label: "Pokaż wyniki"
+ hide-results:
+ title: "Wróć do oddanych głosów"
+ label: "Ukryj wyniki"
+ open:
+ title: "Otwórz ankietę"
+ label: "Otwórz"
+ confirm: "Czy na pewno chcesz otworzyć tę ankietę?"
+ close:
+ title: "Zamknij ankietę"
+ label: "Zamknij"
+ confirm: "Czy na pewno chcesz zamknąć tę ankietę?"
+ error_while_toggling_status: "Wystąpił błąd podczas zmiany statusu tej ankiety."
+ error_while_casting_votes: "Wystąpił błąd podczas oddawania twoich głosów."
diff --git a/plugins/poll/config/locales/client.pt_BR.yml b/plugins/poll/config/locales/client.pt_BR.yml
index bc85fd86b1..6661d0e50b 100644
--- a/plugins/poll/config/locales/client.pt_BR.yml
+++ b/plugins/poll/config/locales/client.pt_BR.yml
@@ -5,4 +5,40 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-pt_BR: {}
+pt_BR:
+ js:
+ poll:
+ voters:
+ zero: "votantes"
+ one: "votante"
+ other: "votantes"
+ total_votes:
+ zero: "total de votos"
+ one: "total de voto"
+ other: "total de votos"
+ average_rating: "Resultado médio: %{average}."
+ multiple:
+ help:
+ at_least_min_options: "Você precisa escolher ao menos %{count} opções."
+ up_to_max_options: "Você pode escolher %{count} opções."
+ x_options: "Você pode escolher %{count} opções."
+ between_min_and_max_options: "Você pode escolher entre %{min} e %{max} opções."
+ cast-votes:
+ title: "Seus votos"
+ label: "Votar agora!"
+ show-results:
+ title: "Mostrar o resultado da enquete"
+ label: "Mostrar resultados"
+ hide-results:
+ title: "Voltar para os seus votos"
+ label: "Esconder resultados"
+ open:
+ title: "Abrir a enquete"
+ label: "Abrir"
+ confirm: "Você tem certeza que deseja abrir essa enquete?"
+ close:
+ title: "Fechar a enquete"
+ label: "Fechar"
+ confirm: "Você tem certeza que deseja fechar essa enquete?"
+ error_while_toggling_status: "Houve um erro ao alternar o status dessa enquete."
+ error_while_casting_votes: "Houve um erro ao coletar seus votos."
diff --git a/plugins/poll/config/locales/client.ru.yml b/plugins/poll/config/locales/client.ru.yml
index 599f51fa5b..fffaebada2 100644
--- a/plugins/poll/config/locales/client.ru.yml
+++ b/plugins/poll/config/locales/client.ru.yml
@@ -8,6 +8,14 @@
ru:
js:
poll:
+ voters:
+ zero: "голосов"
+ one: "голос"
+ other: "голосов"
+ total_votes:
+ zero: "всего голосов"
+ one: "всего проголосовало"
+ other: "всего голосов"
average_rating: "Примерный рейтинг: %{average}."
cast-votes:
title: "Проголосуйте"
diff --git a/plugins/poll/config/locales/client.uk.yml b/plugins/poll/config/locales/client.uk.yml
index 3acfff74e8..f654b80e8c 100644
--- a/plugins/poll/config/locales/client.uk.yml
+++ b/plugins/poll/config/locales/client.uk.yml
@@ -5,4 +5,12 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-uk: {}
+uk:
+ js:
+ poll:
+ voters:
+ zero: "проголосувало"
+ one: "проголосував"
+ other: "проголосувало"
+ total_votes:
+ zero: "кількість голосів"
diff --git a/plugins/poll/config/locales/server.cs.yml b/plugins/poll/config/locales/server.cs.yml
index 709118475a..65910d615e 100644
--- a/plugins/poll/config/locales/server.cs.yml
+++ b/plugins/poll/config/locales/server.cs.yml
@@ -8,5 +8,3 @@
cs:
site_settings:
poll_enabled: "Povolit uživatelům vytvářet hlasování?"
- poll:
- staff_cannot_add_or_remove_options_after_5_minutes: "Po 5 minutách jdou možnosti hlasováni pouze editovat a nejdou už přidávat ani odebírat. Pokud potřebujete přidat nebo odebrat možnosti, zavřete toto téma a založte nové."
diff --git a/plugins/poll/config/locales/server.da.yml b/plugins/poll/config/locales/server.da.yml
index 556751c062..02f8b25b78 100644
--- a/plugins/poll/config/locales/server.da.yml
+++ b/plugins/poll/config/locales/server.da.yml
@@ -19,8 +19,9 @@ da:
default_poll_must_have_different_options: "Afstemningen skal have forskellige muligheder."
named_poll_must_have_different_options: "Afstemningen %{name} skal have forskellige valgmuligheder."
requires_at_least_1_valid_option: "Du skal vælge mindst 1 gyldig mulighed."
- cannot_change_polls_after_5_minutes: "Afstemninger kan ikke ændres efter de første 5 minutter. Kontakt en moderator hvis du har brug for at ændre dem."
- staff_cannot_add_or_remove_options_after_5_minutes: "Efter de første 5 minutter kan afstemningsmuligheder kun rettes - ikke tilføjes eller slettes. Hvis du vil tilføje eller slette muligheder, skal du lukke emnet og oprette et nyt."
+ cannot_change_polls_after_5_minutes: "Du kan ikke tilføje, fjerne eller omdøbe afstemninger efter de første 5 minutter."
+ op_cannot_edit_options_after_5_minutes: "Du kan ikke tilføje eller fjerne afstemningsmuligheder efter de første 5 minutter. Kontakt venligst en moderator hvis du har brug for at rette en mulighed."
+ staff_cannot_add_or_remove_options_after_5_minutes: "Du kan ikke tilføje eller fjerne afstemningsmuligheder efter de første 5 minutter. Du kan lukke emnet og oprette et nyt istedet."
no_polls_associated_with_this_post: "Ingen afstemninger er associeret med dette indlæg."
no_poll_with_this_name: "Ingen afstemning med navnet %{name} er associeret med dette indlæg."
topic_must_be_open_to_vote: "Emnet skal være åbent for at kunne stemme."
diff --git a/plugins/poll/config/locales/server.de.yml b/plugins/poll/config/locales/server.de.yml
index 49d3296112..8948fa8c9c 100644
--- a/plugins/poll/config/locales/server.de.yml
+++ b/plugins/poll/config/locales/server.de.yml
@@ -8,14 +8,20 @@
de:
site_settings:
poll_enabled: "Benutzern das Erstellen von Umfragen erlauben?"
+ poll_maximum_options: "Maximale Anzahl der in einer Umfrage erlaubten Optionen."
poll:
multiple_polls_without_name: "Es gibt mehrere namenlose Umfragen. Benutze das Attribute 'name', um deine Umfragen eindeutig identifizierbar zu machen."
multiple_polls_with_same_name: "Es gibt mehre Umfragen mit dem selben Namen: %{name}. Benutze das Attribute 'name', um deine Umfragen eindeutig identifizierbar zu machen."
default_poll_must_have_at_least_2_options: "Umfragen müssen mindestens 2 Optionen haben."
named_poll_must_have_at_least_2_options: "Die Umfrage mit dem Namen %{name} muss mindestens 2 Optionen haben."
+ default_poll_must_have_less_options: "Die Umfrage muss weniger als %{max} Optionen haben."
+ named_poll_must_have_less_options: "Die Umfrage mit dem Namen %{name} muss weniger als %{max} Optionen haben."
default_poll_must_have_different_options: "Die Umfrage muss unterschiedliche Optionen haben."
- cannot_change_polls_after_5_minutes: "Umfrageoptionen können nach den ersten 5 Minuten nicht mehr geändert werden. Kontaktiere einen Moderator, falls du diese ändern möchtest."
- staff_cannot_add_or_remove_options_after_5_minutes: "Nach den ersten 5 Minuten können Umfrageoptionen lediglich bearbeitet, aber nicht hinzugefügt oder entfernt werden. Falls du Optionen hinzufügen oder entfernen möchtest, musst das dieses Thema schließen und ein neues erstellen."
+ named_poll_must_have_different_options: "Die Umfrage mit dem Namen %{name} muss unterschiedliche Optionen haben."
+ requires_at_least_1_valid_option: "Sie müssen mindestens 1 gültige Option auswählen."
+ cannot_change_polls_after_5_minutes: "Nach den ersten 5 Minuten können Sie keine Umfragen mehr hinzufügen, entfernen oder umbenennen."
+ op_cannot_edit_options_after_5_minutes: "Nach den ersten 5 Minuten können keine Umfrageoptionen mehr hinzugefügt oder entfernt werden. Kontaktieren Sie einen Moderator, wenn Sie eine Umfrageoption ändern müssen."
+ staff_cannot_add_or_remove_options_after_5_minutes: "Nach den ersten 5 Minuten können keine Umfrageoptionen mehr hinzugefügt oder entfernt werden. Sie sollten dieses Thema schließen und stattdessen ein neues erstellen."
no_polls_associated_with_this_post: "Diesem Beitrag sind keine Umfragen zugeordnet."
no_poll_with_this_name: "Diesem Beitrag ist keine Umfrage mit dem Namen %{name} zugeordnet."
topic_must_be_open_to_vote: "Das Thema muss zum Abstimmen geöffnet sein."
diff --git a/plugins/poll/config/locales/server.en.yml b/plugins/poll/config/locales/server.en.yml
index 1590536aff..b1d5582c25 100644
--- a/plugins/poll/config/locales/server.en.yml
+++ b/plugins/poll/config/locales/server.en.yml
@@ -24,8 +24,10 @@ en:
named_poll_must_have_different_options: "Poll named %{name} must have different options."
requires_at_least_1_valid_option: "You must select at least 1 valid option."
- cannot_change_polls_after_5_minutes: "Polls cannot be changed after the first 5 minutes. Contact a moderator if you need to change them."
- staff_cannot_add_or_remove_options_after_5_minutes: "After the first 5 minutes, poll options can only be edited, not added or removed. If you need to add or remove options, you should close this topic and create a new one."
+
+ cannot_change_polls_after_5_minutes: "You cannot add, remove or rename polls after the first 5 minutes."
+ op_cannot_edit_options_after_5_minutes: "You cannot add or remove poll options after the first 5 minutes. Please contact a moderator if you need to edit a poll option."
+ staff_cannot_add_or_remove_options_after_5_minutes: "You cannot add or remove poll options after the first 5 minutes. You should close this topic and create a new one instead."
no_polls_associated_with_this_post: "No polls are associated with this post."
no_poll_with_this_name: "No poll named %{name} associated with this post."
diff --git a/plugins/poll/config/locales/server.es.yml b/plugins/poll/config/locales/server.es.yml
index 86b4c056fc..91a9ffb828 100644
--- a/plugins/poll/config/locales/server.es.yml
+++ b/plugins/poll/config/locales/server.es.yml
@@ -8,14 +8,20 @@
es:
site_settings:
poll_enabled: "¿Permitir la creación de encuestas?"
+ poll_maximum_options: "Número máximo de opciones permitidas en una encuesta."
poll:
multiple_polls_without_name: "Hay varias encuestas sin nombre. Usa la etiqueta 'name' para diferenciar tus encuestas."
multiple_polls_with_same_name: "Hay varias encuestas con el mismo nombre: %{name}. Usa la etiqueta 'name' para diferenciar tus encuestas."
default_poll_must_have_at_least_2_options: "La encuesta debe tener al menos 2 opciones."
named_poll_must_have_at_least_2_options: "La encuesta llamada %{name} debe tener al menos 2 opciones."
- default_poll_must_have_different_options: "La encuesta debe tener opciones diferentes."
- cannot_change_polls_after_5_minutes: "Las encuestas no puede cambiarse después de 5 minutos después de su creación. Contacta a un moderador si necesitas cambiarlas."
- staff_cannot_add_or_remove_options_after_5_minutes: "Después de los primeros 5 minutos, las opciones de la encuesta solo pueden ser editadas, no se pueden añadir ni eliminar. Si necesitas añadir o eliminar opciones, puedes cerrar este tema y crear uno nuevo."
+ default_poll_must_have_less_options: "La encuesta debe tener menos de %{max} opciones."
+ named_poll_must_have_less_options: "La encuesta llamada %{name} debe tener menos de %{max} opciones."
+ default_poll_must_have_different_options: "La encuesta debe tener diferentes opciones."
+ named_poll_must_have_different_options: "La encuesta llamada %{name} debe tener diferentes opciones."
+ requires_at_least_1_valid_option: "Debes escoger al menos 1 opción válida."
+ cannot_change_polls_after_5_minutes: "No se puede modificar, eliminar o renombrar una encuesta una vez transcurridos 5 minutos después de su creación. "
+ op_cannot_edit_options_after_5_minutes: "No se puede modificar, eliminar o renombrar una encuesta una vez transcurridos 5 minutos después de su creación. Por favor, contacta un moderador si necesitas editar las opciones de la encuesta."
+ staff_cannot_add_or_remove_options_after_5_minutes: "No se pueden añadir o eliminar opciones de una encuesta después de los primeros 5 minutos. Podrías cerrar este tema y crear uno nuevo."
no_polls_associated_with_this_post: "No hay encuestas asociadas a este post."
no_poll_with_this_name: "No hay ninguna encuesta llamada %{name} asociada con este post."
topic_must_be_open_to_vote: "Este tema debe estar abierto para votar."
diff --git a/plugins/poll/config/locales/server.fa_IR.yml b/plugins/poll/config/locales/server.fa_IR.yml
index 3227c512d7..df4e6bc980 100644
--- a/plugins/poll/config/locales/server.fa_IR.yml
+++ b/plugins/poll/config/locales/server.fa_IR.yml
@@ -8,14 +8,20 @@
fa_IR:
site_settings:
poll_enabled: "به کاربران اجازه ساخت نظرسنجی ها را بده ؟ "
+ poll_maximum_options: "Maximum number of options allowed in a poll."
poll:
multiple_polls_without_name: "چند نظرسنجی متفاوت بدون اسم است. استفاده کن از 'اسم/code>' ویژگی ٬ تا نظرسنجی منحصر به فرد را تشخیص دهد."
multiple_polls_with_same_name: "چند نظرسنجی با اسم برابر وجود دارند: %{name}.استفاده کن از 'اسم/code>' ویژگی ٬ تا نظرسنجی منحصر به فرد را تشخیص دهد."
default_poll_must_have_at_least_2_options: "نظرسنجی باید حداقل 2 گزینه داشته باشد."
named_poll_must_have_at_least_2_options: "اسم نظرسنجی %{name} باید حداقل 2 گزینه داشته باشد. "
+ default_poll_must_have_less_options: "Poll must have less than %{max} options."
+ named_poll_must_have_less_options: "Poll named %{name} must have less than %{max} options."
default_poll_must_have_different_options: "نظرسنجی باید گزینه های متفاوت داشته باشد. "
- cannot_change_polls_after_5_minutes: "نظرسنجی بعد از 5 دقیقه نمی تواند عوض شود. با گردانندگان تماس بگیر اگر نیاز به تغییر آن را دارید. "
- staff_cannot_add_or_remove_options_after_5_minutes: "بعد از 5 دقیقه نظرسنجی می تواند ویرایش شود٬ نه اضافه می شود نه حذف می شود. اگر نیاز به اضافه کردن یا پاک کردن گزینه ها را دارید٬ باید جستار را پاک کیند و یک جستار جدید بوجود آورید. "
+ named_poll_must_have_different_options: "Poll named %{name} must have different options."
+ requires_at_least_1_valid_option: "You must select at least 1 valid option."
+ cannot_change_polls_after_5_minutes: "You cannot add, remove or rename polls after the first 5 minutes."
+ op_cannot_edit_options_after_5_minutes: "You cannot add or remove poll options after the first 5 minutes. Please contact a moderator if you need to edit a poll option."
+ staff_cannot_add_or_remove_options_after_5_minutes: "You cannot add or remove poll options after the first 5 minutes. You should close this topic and create a new one instead."
no_polls_associated_with_this_post: "هیچ نظرسنجی با این نوشته در تماس نیستند. "
no_poll_with_this_name: "هیچ نظرسنجی اسم گزاری نشده %{name} در تماس به این نوشته نیست. "
topic_must_be_open_to_vote: "جستار باید برای رای گزاری باز باشد. "
diff --git a/plugins/poll/config/locales/server.fi.yml b/plugins/poll/config/locales/server.fi.yml
index 742d73dc3f..12dc5bf0aa 100644
--- a/plugins/poll/config/locales/server.fi.yml
+++ b/plugins/poll/config/locales/server.fi.yml
@@ -8,14 +8,17 @@
fi:
site_settings:
poll_enabled: "Annetaanko käyttäjien luoda äänestyskyselyitä?"
+ poll_maximum_options: "Äänestysvaihtoehtojen suurin sallittu määrä."
poll:
multiple_polls_without_name: "Viesti sisältää useamman nimettömän äänestyskyselyn. Nimeä ne 'name'-määreellä."
multiple_polls_with_same_name: "Useamman kyselyn nimi on %{name}. Anna kaikille eri nimet 'name'-määreellä."
default_poll_must_have_at_least_2_options: "Äänestyksessä pitää olla vähintään 2 vaihtoehtoa."
- named_poll_must_have_at_least_2_options: "Äänestyksessä nimeltä %{name} täytyy olla vähintään 2 vaihtoehtoa."
+ named_poll_must_have_at_least_2_options: "Äänestyksessä nimeltä %{name} pitää olla vähintään 2 vaihtoehtoa."
+ default_poll_must_have_less_options: "Äänestyksessä pitää olla vähemmän, kuin %{max} vaihtoehtoa."
+ named_poll_must_have_less_options: "Äänestyksen nimeltä %{name} pitää sisältää vähemmän, kuin %{max} vaihtoehtoa."
default_poll_must_have_different_options: "Äänestysvaihtoehtojen on erottava toisistaan."
- cannot_change_polls_after_5_minutes: "Äänestyskyselyitä ei voi muuttaa enää 5 minuutin jälkeen. Ota yhteyttä ylläpitoon, jos sinulla on tarve muuttaa kyselyä."
- staff_cannot_add_or_remove_options_after_5_minutes: "Ensimmäisen 5 minuutin jälkeen voit enää vain muotaka olemassa olevia äänestysvaihtoehtoja. Jos sinulla on tarve lisätä tai poistaa vaihtoehtoja, sulje tämä ketju ja luo uusi."
+ named_poll_must_have_different_options: "Äänestyksen nimeltä %{name} vaihtoehtojen on erottava toisistaan."
+ requires_at_least_1_valid_option: "Sinun täytyy valita vähintään 1 vaihtoehto."
no_polls_associated_with_this_post: "Tämä viesti ei sisällä äänestyskyselyä."
no_poll_with_this_name: "Tämä viesti ei sisällä äänestyskyselyä nimeltä %{name}."
topic_must_be_open_to_vote: "Vain avoimessa ketjussa voi äänestää."
diff --git a/plugins/poll/config/locales/server.fr.yml b/plugins/poll/config/locales/server.fr.yml
index a9f9f85f22..22321aa0e8 100644
--- a/plugins/poll/config/locales/server.fr.yml
+++ b/plugins/poll/config/locales/server.fr.yml
@@ -16,8 +16,6 @@ fr:
named_poll_must_have_at_least_2_options: "Le sondage %{name} doit contenir au moins deux options."
default_poll_must_have_less_options: "Un sondage peut contenir jusque %{max} options."
default_poll_must_have_different_options: "Les sondages doivent contenir des options différentes les unes des autres."
- cannot_change_polls_after_5_minutes: "Les sondages ne peuvent être modifiés après cinq minutes. Contactez un modérateur si vous avez besoin de le faire."
- staff_cannot_add_or_remove_options_after_5_minutes: "Après cinq minutes, les options du sondage peuvent uniquement être modifiées. Vous ne pouvez pas en ajouter ou en supprimer. Si vous avez besoin de le faire, vous devez fermer ce sujet et en créer en nouveau."
no_polls_associated_with_this_post: "Aucun sondage n'est associé à ce message."
no_poll_with_this_name: "Aucun sondage nommé %{name} n'est associé avec ce message."
topic_must_be_open_to_vote: "Le sujet doit être ouvert pour pouvoir voter."
diff --git a/plugins/poll/config/locales/server.it.yml b/plugins/poll/config/locales/server.it.yml
index 060eb8db01..1f096450b5 100644
--- a/plugins/poll/config/locales/server.it.yml
+++ b/plugins/poll/config/locales/server.it.yml
@@ -8,8 +8,21 @@
it:
site_settings:
poll_enabled: "Permettere agli utenti di creare sondaggi?"
+ poll_maximum_options: "Numero massimo di opzioni permesse in un sondaggio."
poll:
multiple_polls_without_name: "Ci sono più sondaggi privi di nome. Usa l'attributo 'name' per identificare univocamente i tuoi sondaggi."
multiple_polls_with_same_name: "Ci sono più sondaggi con lo stesso nome: %{name}. Usa l'attributo 'name' per identificare univocamente i tuoi sondaggi."
default_poll_must_have_at_least_2_options: "Il sondaggio deve avere almeno due opzioni."
named_poll_must_have_at_least_2_options: "Il sondaggio con nome %{name} deve avere almeno due opzioni."
+ default_poll_must_have_less_options: "Il sondaggio deve avere meno di %{max} opzioni."
+ named_poll_must_have_less_options: "Il sondaggio dal nome %{name} deve avere meno di %{max} opzioni."
+ default_poll_must_have_different_options: "Il sondaggio deve avere opzioni diverse."
+ named_poll_must_have_different_options: "Il sondaggio dal nome %{name} deve avere opzioni diverse."
+ requires_at_least_1_valid_option: "Devi scegliere almeno una opzione valida."
+ cannot_change_polls_after_5_minutes: "Non puoi aggiungere, cancellare o rinominare i sondaggi dopo i primi 5 minuti."
+ no_polls_associated_with_this_post: "Non ci sono sondaggi associati con questo messaggio."
+ no_poll_with_this_name: "Nessun sondaggio avente nome %{name} è associato a questo messaggio."
+ topic_must_be_open_to_vote: "L'argomento deve essere aperto per poter votare."
+ poll_must_be_open_to_vote: "Il sondaggio deve essere aperto per poter votare."
+ topic_must_be_open_to_toggle_status: "L'argomento deve essere aperto per commutare lo stato."
+ only_staff_or_op_can_toggle_status: "Solo un membro dello staff o l'autore originale possono commutare lo stato di un sondaggio."
diff --git a/plugins/poll/config/locales/server.pl_PL.yml b/plugins/poll/config/locales/server.pl_PL.yml
index c04d371e5a..9e64538081 100644
--- a/plugins/poll/config/locales/server.pl_PL.yml
+++ b/plugins/poll/config/locales/server.pl_PL.yml
@@ -5,4 +5,26 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-pl_PL: {}
+pl_PL:
+ site_settings:
+ poll_enabled: "Pozwolić użytkownikom na tworzenie ankiet?"
+ poll_maximum_options: "Maksymalna ilość dozwolonych opcji w ankiecie."
+ poll:
+ multiple_polls_without_name: "Istnieje kilka nienazwanych ankiet. Uzyj atrybutu 'name', aby umożliwić ich jednoznaczną identyfikację."
+ multiple_polls_with_same_name: "Istnieje kilka ankiet o tej samej nazwie: %{name}. Użyj atrybutu 'name', aby umożliwić ich jednoznaczną identyfikację."
+ default_poll_must_have_at_least_2_options: "Ankieta musi posiadać co najmniej 2 opcje."
+ named_poll_must_have_at_least_2_options: "Ankieta %{name} musi posiadać co najmniej 2 opcje do wyboru."
+ default_poll_must_have_less_options: "Ankieta musi posiadać mniej niż %{max} opcji do wyboru."
+ named_poll_must_have_less_options: "Ankieta %{name} musi posiadać mniej niż %{max} opcji do wyboru."
+ default_poll_must_have_different_options: "Ankieta musi posiadać kilka różnych opcji do wyboru."
+ named_poll_must_have_different_options: "Ankieta %{name} musi posiadać kilka różnych opcji do wyboru."
+ requires_at_least_1_valid_option: "Musisz wybrać co najmniej 1 poprawną opcje."
+ cannot_change_polls_after_5_minutes: "Po upływie 5 minut ankiety nie mogą być zmieniane."
+ op_cannot_edit_options_after_5_minutes: "Po upływie 5 minut nie można dodawać lub usuwać opcji wyboru w ankietach. Skontaktuj się z moderatorem jeśli naprawdę musisz zmienić opcję w tej ankiecie."
+ staff_cannot_add_or_remove_options_after_5_minutes: "Po upływie 5 minut nie można dodawać lub usuwać opcji wyboru w ankietach. Jeśli mimo wszystko chcesz wprowadzić tak drastyczne zmiany, zamknij/usuń ten temat i utwórz poprawną ankietę w nowym."
+ no_polls_associated_with_this_post: "Wskazany wpis nie posiada przypisanych ankiet."
+ no_poll_with_this_name: "Ankieta %{name} nie jest przypisana do tego wpisu."
+ topic_must_be_open_to_vote: "Głosowanie jest możliwe tylko w otwartych tematach."
+ poll_must_be_open_to_vote: "Głosowanie jest możliwe tylko w otwartych ankietach."
+ topic_must_be_open_to_toggle_status: "Zmiana statusu jest możliwa jedynie w otwartych tematach."
+ only_staff_or_op_can_toggle_status: "Status może być zmieniony przez autora wpisu lub członka załogi serwisu."
diff --git a/plugins/poll/config/locales/server.pt_BR.yml b/plugins/poll/config/locales/server.pt_BR.yml
index 691a6527d3..2344927dc6 100644
--- a/plugins/poll/config/locales/server.pt_BR.yml
+++ b/plugins/poll/config/locales/server.pt_BR.yml
@@ -8,6 +8,11 @@
pt_BR:
site_settings:
poll_enabled: "Permitir que usuários criem votações?"
+ poll_maximum_options: "Número máximo de opções permitidas em uma enquete."
poll:
+ multiple_polls_without_name: "Existem várias enquetes sem nome. Use o atributo 'name' para identificar suas enquetes."
+ multiple_polls_with_same_name: "Existem várias enquetes com o mesmo nome: %{name}. Use o atributo 'name' para identificar suas enquetes."
+ default_poll_must_have_at_least_2_options: "Enquetes devem ter ao mínimo 2 opções."
+ named_poll_must_have_at_least_2_options: "A enquete de nome %{name} deve ter ao menos 2 opções."
default_poll_must_have_different_options: "A votação deve ter opções diferentes."
no_polls_associated_with_this_post: "Nenhuma votação está associada com essa mensagem."
diff --git a/plugins/poll/config/locales/server.sq.yml b/plugins/poll/config/locales/server.sq.yml
index fd2389b404..8640d0c933 100644
--- a/plugins/poll/config/locales/server.sq.yml
+++ b/plugins/poll/config/locales/server.sq.yml
@@ -14,8 +14,6 @@ sq:
default_poll_must_have_at_least_2_options: "Poll must have at least 2 options."
named_poll_must_have_at_least_2_options: "Poll named %{name} must have at least 2 options."
default_poll_must_have_different_options: "Poll must have different options."
- cannot_change_polls_after_5_minutes: "Polls cannot be changed after the first 5 minutes. Contact a moderator if you need to change them."
- staff_cannot_add_or_remove_options_after_5_minutes: "After the first 5 minutes, poll options can only be edited, not added or removed. If you need to add or remove options, you should close this topic and create a new one."
no_polls_associated_with_this_post: "No polls are associated with this post."
no_poll_with_this_name: "No poll named %{name} associated with this post."
topic_must_be_open_to_vote: "The topic must be open to vote."
diff --git a/plugins/poll/config/locales/server.tr_TR.yml b/plugins/poll/config/locales/server.tr_TR.yml
index 81cc3025f8..dbce7401ac 100644
--- a/plugins/poll/config/locales/server.tr_TR.yml
+++ b/plugins/poll/config/locales/server.tr_TR.yml
@@ -14,7 +14,6 @@ tr_TR:
default_poll_must_have_at_least_2_options: "Ankette en az 2 seçenek olmalı."
named_poll_must_have_at_least_2_options: "%{name} isimli ankette en az 2 seçenek olmalı."
default_poll_must_have_different_options: "Anketin farklı seçenekleri olmalı."
- cannot_change_polls_after_5_minutes: "Anketler ilk 5 dakikadan sonra değiştirilemez. Değiştirmeniz gerekiyorsa bir moderatör ile iletişime geçin."
no_polls_associated_with_this_post: "Bu gönderiyle alakalı bir anket yok."
no_poll_with_this_name: "Bu gönderiyle alakalı %{name} isimli bir anket yok."
topic_must_be_open_to_vote: "Konu oylanabilmesi için açık olmalı."
diff --git a/plugins/poll/config/locales/server.uk.yml b/plugins/poll/config/locales/server.uk.yml
index 3acfff74e8..7e72e9bbe6 100644
--- a/plugins/poll/config/locales/server.uk.yml
+++ b/plugins/poll/config/locales/server.uk.yml
@@ -5,4 +5,7 @@
# To work with us on translations, join this project:
# https://www.transifex.com/projects/p/discourse-org/
-uk: {}
+uk:
+ site_settings:
+ poll_enabled: "Дозволити користувачам створювати опитування?"
+ poll_maximum_options: "Максимальна кількість варіантів в опитуванні"
diff --git a/plugins/poll/config/locales/server.zh_CN.yml b/plugins/poll/config/locales/server.zh_CN.yml
index 3725f029bf..4cd1599072 100644
--- a/plugins/poll/config/locales/server.zh_CN.yml
+++ b/plugins/poll/config/locales/server.zh_CN.yml
@@ -19,8 +19,9 @@ zh_CN:
default_poll_must_have_different_options: "投票必须有不同的选项。"
named_poll_must_have_different_options: "%{name}投票的选项必须有不同的选项。"
requires_at_least_1_valid_option: "你必须选择至少 1 个有效的选项。"
- cannot_change_polls_after_5_minutes: "投票在创建的 5 分钟后不能被修改。如果你要修改他们,请联系版主。"
- staff_cannot_add_or_remove_options_after_5_minutes: "投票创建 5 分钟后,投票选项只能被编辑,无法增加或者删除。如果你想要增加或删除选项,你应该关闭这个主题并再创建一个新的。"
+ cannot_change_polls_after_5_minutes: "你不能在创建 5 分钟后添加、删除或重命名投票。"
+ op_cannot_edit_options_after_5_minutes: "你不能在创建 5 分钟后添加或删除投票选项。如果你需要修改投票选项请联系版主。"
+ staff_cannot_add_or_remove_options_after_5_minutes: "你不能在创建 5 分钟后添加或删除投票选项。你应该关闭这个主题并创建一个新的。"
no_polls_associated_with_this_post: "这个帖子中没有投票。"
no_poll_with_this_name: "投票“%{name}”没有被关联到帖子。"
topic_must_be_open_to_vote: "主题必须开放才能投票。"
diff --git a/plugins/poll/lib/tasks/migrate_old_polls.rake b/plugins/poll/lib/tasks/migrate_old_polls.rake
index d1422cc1fd..6a3ba5982f 100644
--- a/plugins/poll/lib/tasks/migrate_old_polls.rake
+++ b/plugins/poll/lib/tasks/migrate_old_polls.rake
@@ -14,13 +14,12 @@ task "poll:migrate_old_polls" => :environment do
# go back in time
Timecop.freeze(post.created_at + 1.minute) do
# fix the RAW when needed
+ post.raw << "\n\n"
if post.raw !~ /\[poll\]/
lists = /^[ ]*- .+?$\n\n/m.match(post.raw)
next if lists.blank? || lists.length == 0
first_list = lists[0]
post.raw = post.raw.sub(first_list, "\n[poll]\n#{first_list.strip}\n[/poll]\n")
- else
- post.raw = post.raw + " "
end
# save the poll
post.save
diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb
index b5e48f254c..3808e0aaa5 100644
--- a/plugins/poll/plugin.rb
+++ b/plugins/poll/plugin.rb
@@ -4,7 +4,10 @@
# authors: Vikhyat Korrapati (vikhyat), Régis Hanol (zogstrip)
# url: https://github.com/discourse/discourse/tree/master/plugins/poll
-register_asset "stylesheets/poll.scss"
+register_asset "stylesheets/common/poll.scss"
+register_asset "stylesheets/desktop/poll.scss", :desktop
+register_asset "stylesheets/mobile/poll.scss", :mobile
+
register_asset "javascripts/poll_dialect.js", :server_side
PLUGIN_NAME ||= "discourse_poll".freeze
@@ -260,10 +263,10 @@ after_initialize do
if polls.keys != previous_polls.keys ||
polls.values.map { |p| p["options"] } != previous_polls.values.map { |p| p["options"] }
- # outside the 5-minute edit window?
+ # outside of the 5-minute edit window?
if post.created_at < 5.minutes.ago
- # cannot add/remove/change/re-order polls
- if polls.keys != previous_polls.keys
+ # cannot add/remove/rename polls
+ if polls.keys.sort != previous_polls.keys.sort
post.errors.add(:base, I18n.t("poll.cannot_change_polls_after_5_minutes"))
return
end
@@ -278,8 +281,8 @@ after_initialize do
end
end
else
- # OP cannot change polls
- post.errors.add(:base, I18n.t("poll.cannot_change_polls_after_5_minutes"))
+ # OP cannot edit poll options
+ post.errors.add(:base, I18n.t("poll.op_cannot_edit_options_after_5_minutes"))
return
end
end
diff --git a/plugins/poll/spec/controllers/posts_controller_spec.rb b/plugins/poll/spec/controllers/posts_controller_spec.rb
index 0862586531..3d63d8425b 100644
--- a/plugins/poll/spec/controllers/posts_controller_spec.rb
+++ b/plugins/poll/spec/controllers/posts_controller_spec.rb
@@ -49,6 +49,14 @@ describe PostsController do
expect(json["errors"][0]).to eq(I18n.t("poll.default_poll_must_have_less_options", max: SiteSetting.poll_maximum_options))
end
+ it "prevents self-xss" do
+ xhr :post, :create, { title: title, raw: "[poll name=]\n- A\n- B\n[/poll]" }
+ expect(response).to be_success
+ json = ::JSON.parse(response.body)
+ expect(json["cooked"]).to match("data-poll-")
+ expect(json["polls"]["<script>alert(xss)</script>"]).to be
+ end
+
describe "edit window" do
describe "within the first 5 minutes" do
@@ -92,7 +100,7 @@ describe PostsController do
xhr :put, :update, { id: post_id, post: { raw: new_raw } }
expect(response).not_to be_success
json = ::JSON.parse(response.body)
- expect(json["errors"][0]).to eq(I18n.t("poll.cannot_change_polls_after_5_minutes"))
+ expect(json["errors"][0]).to eq(I18n.t("poll.op_cannot_edit_options_after_5_minutes"))
end
it "can be edited by staff" do
@@ -112,14 +120,14 @@ describe PostsController do
describe "named polls" do
it "should have different options" do
- xhr :post, :create, { title: title, raw: "[poll name=foo]\n- A\n- A[/poll]" }
+ xhr :post, :create, { title: title, raw: "[poll name=""foo""]\n- A\n- A[/poll]" }
expect(response).not_to be_success
json = ::JSON.parse(response.body)
expect(json["errors"][0]).to eq(I18n.t("poll.named_poll_must_have_different_options", name: "foo"))
end
it "should have at least 2 options" do
- xhr :post, :create, { title: title, raw: "[poll name=foo]\n- A[/poll]" }
+ xhr :post, :create, { title: title, raw: "[poll name='foo']\n- A[/poll]" }
expect(response).not_to be_success
json = ::JSON.parse(response.body)
expect(json["errors"][0]).to eq(I18n.t("poll.named_poll_must_have_at_least_2_options", name: "foo"))
diff --git a/script/import_scripts/sfn.rb b/script/import_scripts/sfn.rb
index b5178146c2..f8a14f00d9 100644
--- a/script/import_scripts/sfn.rb
+++ b/script/import_scripts/sfn.rb
@@ -40,7 +40,7 @@ class ImportScripts::Sfn < ImportScripts::Base
@external_users = {}
- CSV.foreach("/Users/zogstrip/Downloads/sfn.csv", col_sep: ";") do |row|
+ CSV.foreach("/Users/zogstrip/Desktop/sfn.csv", col_sep: ";") do |row|
next unless @personify_id_to_contact_key.include?(row[0])
id = @personify_id_to_contact_key[row[0]]
@@ -90,6 +90,7 @@ class ImportScripts::Sfn < ImportScripts::Base
id: user["id"],
email: email,
name: full_name,
+ username: email.split("@")[0],
bio_raw: bio,
created_at: user["created_at"],
post_create_action: proc do |newuser|
@@ -191,13 +192,13 @@ class ImportScripts::Sfn < ImportScripts::Base
"{9613BAC2-229B-4563-9E1C-35C31CDDCE2F}" => 49, # "Students",
}
- # def import_categories
- # puts "", "importing categories..."
+ def import_categories
+ puts "", "importing categories..."
- # create_categories(NEW_CATEGORIES) do |category|
- # { id: category, name: category }
- # end
- # end
+ create_categories(NEW_CATEGORIES) do |category|
+ { id: category, name: category }
+ end
+ end
def import_topics
puts "", "importing topics..."
diff --git a/script/memstats.rb b/script/memstats.rb
old mode 100644
new mode 100755
diff --git a/script/test_email_settings.rb b/script/test_email_settings.rb
old mode 100644
new mode 100755
diff --git a/script/version_bump.rb b/script/version_bump.rb
old mode 100644
new mode 100755
diff --git a/spec/components/discourse_stylesheets_spec.rb b/spec/components/discourse_stylesheets_spec.rb
index 79c3aa477d..c7be72e96d 100644
--- a/spec/components/discourse_stylesheets_spec.rb
+++ b/spec/components/discourse_stylesheets_spec.rb
@@ -7,14 +7,14 @@ describe DiscourseStylesheets do
it "can compile desktop bundle" do
DiscoursePluginRegistry.stubs(:stylesheets).returns(["#{Rails.root}/spec/fixtures/scss/my_plugin.scss"])
builder = described_class.new(:desktop)
- expect(builder.compile).to include('my-plugin-thing')
+ expect(builder.compile(force: true)).to include('my-plugin-thing')
FileUtils.rm builder.stylesheet_fullpath
end
it "can compile mobile bundle" do
DiscoursePluginRegistry.stubs(:mobile_stylesheets).returns(["#{Rails.root}/spec/fixtures/scss/my_plugin.scss"])
builder = described_class.new(:mobile)
- expect(builder.compile).to include('my-plugin-thing')
+ expect(builder.compile(force: true)).to include('my-plugin-thing')
FileUtils.rm builder.stylesheet_fullpath
end
@@ -24,7 +24,7 @@ describe DiscourseStylesheets do
"#{Rails.root}/spec/fixtures/scss/broken.scss"
])
builder = described_class.new(:desktop)
- expect(builder.compile).not_to include('my-plugin-thing')
+ expect(builder.compile(force: true)).not_to include('my-plugin-thing')
FileUtils.rm builder.stylesheet_fullpath
end
end
diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb
index cb9771447d..175aea63b6 100644
--- a/spec/controllers/notifications_controller_spec.rb
+++ b/spec/controllers/notifications_controller_spec.rb
@@ -6,17 +6,17 @@ describe NotificationsController do
let!(:user) { log_in }
it 'should succeed for recent' do
- xhr :get, :recent
+ xhr :get, :index, recent: true
expect(response).to be_success
end
it 'should succeed for history' do
- xhr :get, :history
+ xhr :get, :index
expect(response).to be_success
end
- it 'should succeed for history' do
- xhr :get, :reset_new
+ it 'should succeed' do
+ xhr :put, :mark_read
expect(response).to be_success
end
@@ -24,7 +24,7 @@ describe NotificationsController do
notification = Fabricate(:notification, user: user)
expect(user.reload.unread_notifications).to eq(1)
expect(user.reload.total_unread_notifications).to eq(1)
- xhr :get, :recent
+ xhr :get, :index, recent: true
expect(user.reload.unread_notifications).to eq(0)
expect(user.reload.total_unread_notifications).to eq(1)
end
@@ -33,7 +33,7 @@ describe NotificationsController do
notification = Fabricate(:notification, user: user)
expect(user.reload.unread_notifications).to eq(1)
expect(user.reload.total_unread_notifications).to eq(1)
- xhr :get, :recent, silent: true
+ xhr :get, :index, recent: true, silent: true
expect(user.reload.unread_notifications).to eq(1)
expect(user.reload.total_unread_notifications).to eq(1)
end
@@ -42,7 +42,7 @@ describe NotificationsController do
notification = Fabricate(:notification, user: user)
expect(user.reload.unread_notifications).to eq(1)
expect(user.reload.total_unread_notifications).to eq(1)
- xhr :put, :reset_new
+ xhr :put, :mark_read
user.reload
expect(user.reload.unread_notifications).to eq(0)
expect(user.reload.total_unread_notifications).to eq(0)
@@ -51,7 +51,7 @@ describe NotificationsController do
context 'when not logged in' do
it 'should raise an error' do
- expect { xhr :get, :recent }.to raise_error(Discourse::NotLoggedIn)
+ expect { xhr :get, :index, recent: true }.to raise_error(Discourse::NotLoggedIn)
end
end
diff --git a/test/javascripts/controllers/header-test.js.es6 b/test/javascripts/controllers/header-test.js.es6
deleted file mode 100644
index 4b82269b7f..0000000000
--- a/test/javascripts/controllers/header-test.js.es6
+++ /dev/null
@@ -1,33 +0,0 @@
-moduleFor("controller:header", "controller:header", {
- needs: ['controller:application']
-});
-
-test("showNotifications action", function() {
- let resolveRequestWith;
- const request = new Ember.RSVP.Promise(function(resolve) {
- resolveRequestWith = resolve;
- });
-
- const currentUser = Discourse.User.create({ unread_notifications: 1});
- const controller = this.subject({ currentUser: currentUser });
- const viewSpy = { showDropdownBySelector: sinon.spy() };
-
- sandbox.stub(Discourse, "ajax").withArgs("/notifications").returns(request);
-
- Ember.run(function() {
- controller.send("showNotifications", viewSpy);
- });
-
- equal(controller.get("notifications"), null, "notifications are null before data has finished loading");
- equal(currentUser.get("unread_notifications"), 1, "current user's unread notifications count is not zeroed before data has finished loading");
- ok(viewSpy.showDropdownBySelector.calledWith("#user-notifications"), "dropdown with loading glyph is shown before data has finished loading");
-
- Ember.run(function() {
- resolveRequestWith(["notification"]);
- });
-
- // Can't use deepEquals because controller.get("notifications") is an ArrayProxy, not an Array
- ok(controller.get("notifications").indexOf("notification") !== -1, "notification is in the controller");
- equal(currentUser.get("unread_notifications"), 0, "current user's unread notifications count is zeroed after data has finished loading");
- ok(viewSpy.showDropdownBySelector.calledWith("#user-notifications"), "dropdown with notifications is shown after data has finished loading");
-});
diff --git a/test/javascripts/controllers/notification-test.js.es6 b/test/javascripts/controllers/notification-test.js.es6
deleted file mode 100644
index 63e0da8644..0000000000
--- a/test/javascripts/controllers/notification-test.js.es6
+++ /dev/null
@@ -1,54 +0,0 @@
-import Site from 'discourse/models/site';
-
-const notificationFixture = {
- notification_type: 1, //mentioned
- post_number: 1,
- topic_id: 1234,
- slug: "a-slug",
- data: {
- topic_title: "some title",
- display_username: "velesin"
- },
- site: Site.current()
-};
-
-moduleFor("controller:notification");
-
-test("scope property is correct", function() {
- const controller = this.subject(notificationFixture);
- equal(controller.get("scope"), "notifications.mentioned");
-});
-
-test("username property is correct", function() {
- const controller = this.subject(notificationFixture);
- equal(controller.get("username"), "velesin");
-});
-
-test("description property returns badge name when there is one", function() {
- const fixtureWithBadgeName = _.extend({}, notificationFixture, { data: { badge_name: "badge" } });
- const controller = this.subject(fixtureWithBadgeName);
- equal(controller.get("description"), "badge");
-});
-
-test("description property returns empty string when there is no topic title", function() {
- const fixtureWithEmptyTopicTitle = _.extend({}, notificationFixture, { data: { topic_title: "" } });
- const controller = this.subject(fixtureWithEmptyTopicTitle);
- equal(controller.get("description"), "");
-});
-
-test("description property returns topic title", function() {
- const fixtureWithTopicTitle = _.extend({}, notificationFixture, { data: { topic_title: "topic" } });
- const controller = this.subject(fixtureWithTopicTitle);
- equal(controller.get("description"), "topic");
-});
-
-test("url property returns badge's url when there is a badge", function() {
- const fixtureWithBadge = _.extend({}, notificationFixture, { data: { badge_id: 1, badge_name: "Badge Name"} });
- const controller = this.subject(fixtureWithBadge);
- equal(controller.get("url"), "/badges/1/badge-name");
-});
-
-test("url property returns topic's url when there is a topic", function() {
- const controller = this.subject(notificationFixture);
- equal(controller.get("url"), "/t/a-slug/1234");
-});
diff --git a/test/javascripts/controllers/site-map-category-test.js.es6 b/test/javascripts/controllers/site-map-category-test.js.es6
index 8977799788..77cdbf145b 100644
--- a/test/javascripts/controllers/site-map-category-test.js.es6
+++ b/test/javascripts/controllers/site-map-category-test.js.es6
@@ -20,8 +20,7 @@ test("unreadTotal default", function() {
test("unreadTotal with values", function() {
var controller = this.subject({
currentUser: Discourse.User.create(),
- unreadTopics: 1,
- newTopics: 3
+ model: { unreadTopics: 1, newTopics: 3 }
});
equal(controller.get('unreadTotal'), 4);
});
diff --git a/test/javascripts/fixtures/notification_fixtures.js.es6 b/test/javascripts/fixtures/notification_fixtures.js.es6
index 40e4e6a2b6..22493d34ee 100644
--- a/test/javascripts/fixtures/notification_fixtures.js.es6
+++ b/test/javascripts/fixtures/notification_fixtures.js.es6
@@ -1,2 +1,2 @@
/*jshint maxlen:10000000 */
-export default {"/notifications": [ { notification_type: 2, read: true, post_number: 2, topic_id: 1234, slug: "a-slug", data: { topic_title: "some title", display_username: "velesin" } } ] };
+export default {"/notifications": {notifications: [ { id: 123, notification_type: 2, read: true, post_number: 2, topic_id: 1234, slug: "a-slug", data: { topic_title: "some title", display_username: "velesin" } } ] }};
diff --git a/test/javascripts/helpers/qunit-helpers.js.es6 b/test/javascripts/helpers/qunit-helpers.js.es6
index 054a4686a4..64547080b4 100644
--- a/test/javascripts/helpers/qunit-helpers.js.es6
+++ b/test/javascripts/helpers/qunit-helpers.js.es6
@@ -37,8 +37,6 @@ var oldAvatar = Discourse.Utilities.avatarImg;
function acceptance(name, options) {
module("Acceptance: " + name, {
setup: function() {
- Ember.run(Discourse, Discourse.advanceReadiness);
-
// Don't render avatars in acceptance tests, it's faster and no 404s
Discourse.Utilities.avatarImg = () => "";
@@ -72,6 +70,8 @@ function acceptance(name, options) {
if (options && options.teardown) {
options.teardown.call(this);
}
+ Discourse.User.resetCurrent();
+ Discourse.Site.resetCurrent(Discourse.Site.create(fixtures['site.json'].site));
Discourse.Utilities.avatarImg = oldAvatar;
Discourse.reset();
diff --git a/test/javascripts/jshint-test.js.es6.erb b/test/javascripts/jshint-test.js.es6.erb
index cccd67f15c..6c5884aeaa 100644
--- a/test/javascripts/jshint-test.js.es6.erb
+++ b/test/javascripts/jshint-test.js.es6.erb
@@ -79,7 +79,6 @@ qHint.sendRequest = function (url, callback) {
req.send();
};
-
<%
TO_IGNORE = File.read("#{Rails.root}/.jshintignore").split("\n")
diff --git a/test/javascripts/mdtest/fixtures/Amps and angle encoding.text b/test/javascripts/mdtest/fixtures/Amps and angle encoding.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Amps and angle encoding.xhtml b/test/javascripts/mdtest/fixtures/Amps and angle encoding.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Auto links.text b/test/javascripts/mdtest/fixtures/Auto links.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Auto links.xhtml b/test/javascripts/mdtest/fixtures/Auto links.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Backslash escapes.text b/test/javascripts/mdtest/fixtures/Backslash escapes.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Backslash escapes.xhtml b/test/javascripts/mdtest/fixtures/Backslash escapes.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.text b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.xhtml b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Code Blocks.text b/test/javascripts/mdtest/fixtures/Code Blocks.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Code Blocks.xhtml b/test/javascripts/mdtest/fixtures/Code Blocks.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Code Spans.text b/test/javascripts/mdtest/fixtures/Code Spans.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Code Spans.xhtml b/test/javascripts/mdtest/fixtures/Code Spans.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Hard-wrapped paragraphs with list-like lines.text b/test/javascripts/mdtest/fixtures/Hard-wrapped paragraphs with list-like lines.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Hard-wrapped paragraphs with list-like lines.xhtml b/test/javascripts/mdtest/fixtures/Hard-wrapped paragraphs with list-like lines.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Horizontal rules.text b/test/javascripts/mdtest/fixtures/Horizontal rules.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Horizontal rules.xhtml b/test/javascripts/mdtest/fixtures/Horizontal rules.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Images.text b/test/javascripts/mdtest/fixtures/Images.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Images.xhtml b/test/javascripts/mdtest/fixtures/Images.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).text b/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).xhtml b/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML (Simple).text b/test/javascripts/mdtest/fixtures/Inline HTML (Simple).text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML (Simple).xhtml b/test/javascripts/mdtest/fixtures/Inline HTML (Simple).xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML comments.text b/test/javascripts/mdtest/fixtures/Inline HTML comments.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Inline HTML comments.xhtml b/test/javascripts/mdtest/fixtures/Inline HTML comments.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, inline style.text b/test/javascripts/mdtest/fixtures/Links, inline style.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, inline style.xhtml b/test/javascripts/mdtest/fixtures/Links, inline style.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, reference style.text b/test/javascripts/mdtest/fixtures/Links, reference style.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, reference style.xhtml b/test/javascripts/mdtest/fixtures/Links, reference style.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, shortcut references.text b/test/javascripts/mdtest/fixtures/Links, shortcut references.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Links, shortcut references.xhtml b/test/javascripts/mdtest/fixtures/Links, shortcut references.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Literal quotes in titles.text b/test/javascripts/mdtest/fixtures/Literal quotes in titles.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Literal quotes in titles.xhtml b/test/javascripts/mdtest/fixtures/Literal quotes in titles.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.text b/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.xhtml b/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Markdown Documentation - Syntax.text b/test/javascripts/mdtest/fixtures/Markdown Documentation - Syntax.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Markdown Documentation - Syntax.xhtml b/test/javascripts/mdtest/fixtures/Markdown Documentation - Syntax.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Nested blockquotes.text b/test/javascripts/mdtest/fixtures/Nested blockquotes.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Nested blockquotes.xhtml b/test/javascripts/mdtest/fixtures/Nested blockquotes.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Ordered and unordered lists.text b/test/javascripts/mdtest/fixtures/Ordered and unordered lists.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Ordered and unordered lists.xhtml b/test/javascripts/mdtest/fixtures/Ordered and unordered lists.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Strong and em together.text b/test/javascripts/mdtest/fixtures/Strong and em together.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Strong and em together.xhtml b/test/javascripts/mdtest/fixtures/Strong and em together.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Tabs.text b/test/javascripts/mdtest/fixtures/Tabs.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Tabs.xhtml b/test/javascripts/mdtest/fixtures/Tabs.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Tidyness.text b/test/javascripts/mdtest/fixtures/Tidyness.text
old mode 100755
new mode 100644
diff --git a/test/javascripts/mdtest/fixtures/Tidyness.xhtml b/test/javascripts/mdtest/fixtures/Tidyness.xhtml
old mode 100755
new mode 100644
diff --git a/test/javascripts/mixins/selected-posts-count-test.js.es6 b/test/javascripts/mixins/selected-posts-count-test.js.es6
index 830d9033ee..9533acdce5 100644
--- a/test/javascripts/mixins/selected-posts-count-test.js.es6
+++ b/test/javascripts/mixins/selected-posts-count-test.js.es6
@@ -1,9 +1,10 @@
-module("Discourse.SelectedPostsCount");
+module("SelectedPostsCount");
+import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
import Topic from 'discourse/models/topic';
var buildTestObj = function(params) {
- return Ember.Object.createWithMixins(Discourse.SelectedPostsCount, params || {});
+ return Ember.Object.createWithMixins(SelectedPostsCount, params || {});
};
test("without selectedPosts", function () {
diff --git a/test/javascripts/models/nav-item-test.js.es6 b/test/javascripts/models/nav-item-test.js.es6
index bb32d28422..1af1bb14ea 100644
--- a/test/javascripts/models/nav-item-test.js.es6
+++ b/test/javascripts/models/nav-item-test.js.es6
@@ -1,16 +1,10 @@
-var asianCategory = Discourse.Category.create({name: '确实是这样', id: 343434});
module("Discourse.NavItem", {
setup: function() {
Ember.run(function() {
+ const asianCategory = Discourse.Category.create({name: '确实是这样', id: 343434});
Discourse.Site.currentProp('categories').addObject(asianCategory);
});
- },
-
- teardown: function() {
- Em.run(function() {
- Discourse.Site.currentProp('categories').removeObject(asianCategory);
- });
}
});
diff --git a/test/javascripts/models/rest-model-test.js.es6 b/test/javascripts/models/rest-model-test.js.es6
index 182532b139..73a77e7203 100644
--- a/test/javascripts/models/rest-model-test.js.es6
+++ b/test/javascripts/models/rest-model-test.js.es6
@@ -19,7 +19,7 @@ test('munging', function() {
test('update', function() {
const store = createStore();
- store.find('widget', 123).then(function(widget) {
+ return store.find('widget', 123).then(function(widget) {
equal(widget.get('name'), 'Trout Lure');
ok(!widget.get('isSaving'));
@@ -36,7 +36,7 @@ test('updating simultaneously', function() {
expect(2);
const store = createStore();
- store.find('widget', 123).then(function(widget) {
+ return store.find('widget', 123).then(function(widget) {
const firstPromise = widget.update({ name: 'new name' });
const secondPromise = widget.update({ name: 'new name' });
@@ -47,7 +47,6 @@ test('updating simultaneously', function() {
secondPromise.catch(function() {
ok(true, 'the second promise fails');
});
-
});
});
@@ -62,7 +61,7 @@ test('save new', function() {
const promise = widget.save({ name: 'Evil Widget' });
ok(widget.get('isSaving'));
- promise.then(function() {
+ return promise.then(function() {
ok(!widget.get('isSaving'));
ok(widget.get('id'), 'it has an id');
ok(widget.get('name'), 'Evil Widget');
@@ -90,7 +89,7 @@ test('creating simultaneously', function() {
test('destroyRecord', function() {
const store = createStore();
- store.find('widget', 123).then(function(widget) {
+ return store.find('widget', 123).then(function(widget) {
widget.destroyRecord().then(function(result) {
ok(result);
});
diff --git a/test/javascripts/models/result-set-test.js.es6 b/test/javascripts/models/result-set-test.js.es6
index 2df92f5bd5..c846fd8872 100644
--- a/test/javascripts/models/result-set-test.js.es6
+++ b/test/javascripts/models/result-set-test.js.es6
@@ -20,6 +20,7 @@ test('pagination support', function() {
equal(rs.get('totalRows'), 4);
ok(rs.get('loadMoreUrl'), 'has a url to load more');
ok(!rs.get('loadingMore'), 'it is not loading more');
+ ok(rs.get('canLoadMore'));
const promise = rs.loadMore();
@@ -28,6 +29,7 @@ test('pagination support', function() {
ok(!rs.get('loadingMore'), 'it finished loading more');
equal(rs.get('length'), 4);
ok(!rs.get('loadMoreUrl'));
+ ok(!rs.get('canLoadMore'));
});
});
});
diff --git a/test/javascripts/models/store-test.js.es6 b/test/javascripts/models/store-test.js.es6
index 6411f141f4..f0dca5ad75 100644
--- a/test/javascripts/models/store-test.js.es6
+++ b/test/javascripts/models/store-test.js.es6
@@ -37,7 +37,7 @@ test('createRecord with a record as attributes returns that record from the map'
test('find', function() {
const store = createStore();
- store.find('widget', 123).then(function(w) {
+ return store.find('widget', 123).then(function(w) {
equal(w.get('name'), 'Trout Lure');
equal(w.get('id'), 123);
ok(!w.get('isNew'), 'found records are not new');
@@ -51,28 +51,28 @@ test('find', function() {
test('find with object id', function() {
const store = createStore();
- store.find('widget', {id: 123}).then(function(w) {
+ return store.find('widget', {id: 123}).then(function(w) {
equal(w.get('firstObject.name'), 'Trout Lure');
});
});
test('find with query param', function() {
const store = createStore();
- store.find('widget', {name: 'Trout Lure'}).then(function(w) {
+ return store.find('widget', {name: 'Trout Lure'}).then(function(w) {
equal(w.get('firstObject.id'), 123);
});
});
test('update', function() {
const store = createStore();
- store.update('widget', 123, {name: 'hello'}).then(function(result) {
+ return store.update('widget', 123, {name: 'hello'}).then(function(result) {
ok(result);
});
});
test('findAll', function() {
const store = createStore();
- store.findAll('widget').then(function(result) {
+ return store.findAll('widget').then(function(result) {
equal(result.get('length'), 2);
const w = result.findBy('id', 124);
ok(!w.get('isNew'), 'found records are not new');
@@ -80,9 +80,9 @@ test('findAll', function() {
});
});
-test('destroyRecord', function() {
+test('destroyRecord', function(assert) {
const store = createStore();
- store.find('widget', 123).then(function(w) {
+ return store.find('widget', 123).then(function(w) {
store.destroyRecord('widget', w).then(function(result) {
ok(result);
});
@@ -91,7 +91,7 @@ test('destroyRecord', function() {
test('find embedded', function() {
const store = createStore();
- store.find('fruit', 1).then(function(f) {
+ return store.find('fruit', 1).then(function(f) {
ok(f.get('farmer'), 'it has the embedded object');
ok(f.get('category'), 'categories are found automatically');
});
@@ -99,7 +99,7 @@ test('find embedded', function() {
test('findAll embedded', function() {
const store = createStore();
- store.findAll('fruit').then(function(fruits) {
+ return store.findAll('fruit').then(function(fruits) {
equal(fruits.objectAt(0).get('farmer.name'), 'Old MacDonald');
equal(fruits.objectAt(0).get('farmer'), fruits.objectAt(1).get('farmer'), 'points at the same object');
equal(fruits.objectAt(2).get('farmer.name'), 'Luke Skywalker');
diff --git a/test/javascripts/test_helper.js b/test/javascripts/test_helper.js
index 9935676b67..a968d47947 100644
--- a/test/javascripts/test_helper.js
+++ b/test/javascripts/test_helper.js
@@ -9,10 +9,10 @@
//= require ../../app/assets/javascripts/discourse/lib/probes
// Externals we need to load first
-//= require development/jquery-2.1.1
+//= require jquery.debug
//= require jquery.ui.widget
//= require handlebars
-//= require development/ember
+//= require ember.custom.debug
//= require message-bus
//= require ember-qunit
//= require fake_xml_http_request
@@ -76,9 +76,7 @@ d.write('