mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 20:15:47 +08: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({
|
||||
|
||||
undoPreviewUrl: function() {
|
||||
return Discourse.getURL("/?preview-style=");
|
||||
}.property(),
|
||||
|
||||
defaultStyleUrl: function() {
|
||||
return Discourse.getURL("/?preview-style=default");
|
||||
}.property(),
|
||||
|
||||
actions: {
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({
|
|||
this.set('originals', originals);
|
||||
}.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'),
|
||||
|
||||
save: function() {
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
{{#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 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}}
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user