mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: site customization preview links when deployed in a subfolder
This commit is contained in:
parent
b2fcc17ca2
commit
c78dbb7fa5
@ -10,6 +10,14 @@ import showModal from 'discourse/lib/show-modal';
|
|||||||
**/
|
**/
|
||||||
export default Ember.ArrayController.extend({
|
export default Ember.ArrayController.extend({
|
||||||
|
|
||||||
|
undoPreviewUrl: function() {
|
||||||
|
return Discourse.getURL("/?preview-style=");
|
||||||
|
}.property(),
|
||||||
|
|
||||||
|
defaultStyleUrl: function() {
|
||||||
|
return Discourse.getURL("/?preview-style=default");
|
||||||
|
}.property(),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +44,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({
|
|||||||
this.set('originals', originals);
|
this.set('originals', originals);
|
||||||
}.on('init'),
|
}.on('init'),
|
||||||
|
|
||||||
previewUrl: function() { return "/?preview-style=" + this.get('key'); }.property('key'),
|
previewUrl: function() { return Discourse.getURL("/?preview-style=" + this.get('key')); }.property('key'),
|
||||||
disableSave: function() { return !this.get('changed') || this.get('saving'); }.property('changed'),
|
disableSave: function() { return !this.get('changed') || this.get('saving'); }.property('changed'),
|
||||||
|
|
||||||
save: function() {
|
save: function() {
|
||||||
|
@ -65,9 +65,9 @@
|
|||||||
{{#unless selectedItem.changed}}
|
{{#unless selectedItem.changed}}
|
||||||
<a class='preview-link' {{bind-attr href="selectedItem.previewUrl"}} target='_blank' title="{{i18n 'admin.customize.explain_preview'}}">{{i18n 'admin.customize.preview'}}</a>
|
<a class='preview-link' {{bind-attr href="selectedItem.previewUrl"}} target='_blank' title="{{i18n 'admin.customize.explain_preview'}}">{{i18n 'admin.customize.preview'}}</a>
|
||||||
|
|
|
|
||||||
<a href="/?preview-style=" target='_blank' title="{{i18n 'admin.customize.explain_undo_preview'}}">{{i18n 'admin.customize.undo_preview'}}</a>
|
<a href="{{undoPreviewUrl}}" target='_blank' title="{{i18n 'admin.customize.explain_undo_preview'}}">{{i18n 'admin.customize.undo_preview'}}</a>
|
||||||
|
|
|
|
||||||
<a href="/?preview-style=default" target='_blank' title="{{i18n 'admin.customize.explain_rescue_preview'}}">{{i18n 'admin.customize.rescue_preview'}}</a><br>
|
<a href="{{defaultStyleUrl}}" target='_blank' title="{{i18n 'admin.customize.explain_rescue_preview'}}">{{i18n 'admin.customize.rescue_preview'}}</a><br>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user