FIX: pin a topic globally wasn't working
This commit is contained in:
parent
b8cf797e31
commit
0a2f615aab
|
@ -1,5 +1,6 @@
|
|||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||
import { categoryLinkHTML } from 'discourse/helpers/category-link';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend(ModalFunctionality, {
|
||||
needs: ["topic"],
|
||||
|
@ -9,7 +10,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
pinnedGloballyCount: 0,
|
||||
bannerCount: 0,
|
||||
|
||||
reset: function() {
|
||||
reset() {
|
||||
this.set("model.pinnedInCategoryUntil", null);
|
||||
this.set("model.pinnedGloballyUntil", null);
|
||||
},
|
||||
|
@ -27,21 +28,24 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
return I18n.t(name, { categoryLink: this.get("categoryLink"), until: until });
|
||||
}.property("categoryLink", "model.{pinned_globally,pinned_until}"),
|
||||
|
||||
pinMessage: function() {
|
||||
return I18n.t("topic.feature_topic.pin", { categoryLink: this.get("categoryLink") });
|
||||
}.property("categoryLink"),
|
||||
@computed("categoryLink")
|
||||
pinMessage(categoryLink) {
|
||||
return I18n.t("topic.feature_topic.pin", { categoryLink });
|
||||
},
|
||||
|
||||
alreadyPinnedMessage: function() {
|
||||
return I18n.t("topic.feature_topic.already_pinned", { categoryLink: this.get("categoryLink"), count: this.get("pinnedInCategoryCount") });
|
||||
}.property("categoryLink", "pinnedInCategoryCount"),
|
||||
|
||||
pinDisabled: function() {
|
||||
return !this._isDateValid(this.get("parsedPinnedInCategoryUntil"));
|
||||
}.property("parsedPinnedInCategoryUntil"),
|
||||
@computed("parsedPinnedInCategoryUntil")
|
||||
pinDisabled(parsedPinnedInCategoryUntil) {
|
||||
return !this._isDateValid(parsedPinnedInCategoryUntil);
|
||||
},
|
||||
|
||||
pinGloballyDisabled: function() {
|
||||
return !this._isDateValid(this.get("parsedPinnedGloballyUntil"));
|
||||
}.property("pinnedGloballyUntil"),
|
||||
@computed("parsedPinnedGloballyUntil")
|
||||
pinGloballyDisabled(parsedPinnedGloballyUntil) {
|
||||
return !this._isDateValid(parsedPinnedGloballyUntil);
|
||||
},
|
||||
|
||||
parsedPinnedInCategoryUntil: function() {
|
||||
return this._parseDate(this.get("model.pinnedInCategoryUntil"));
|
||||
|
|
Loading…
Reference in New Issue