Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
/gems
/autogenerated
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
</div>

<div class="buttons">
{{#if resultIcon}}
{{d-icon resultIcon}}
{{#if this.resultIcon}}
{{d-icon this.resultIcon}}
{{/if}}

{{conditional-loading-spinner condition=updatingGlobal size="small"}}
{{conditional-loading-spinner condition=this.updatingGlobal size="small"}}

{{d-button
action=(action "destroyGlobal")
label="admin.landing_pages.destroy"
disabled=updatingGlobal
disabled=this.updatingGlobal
icon="xmark"
}}

{{d-button
action=(action "saveGlobal")
label="admin.landing_pages.save"
class="btn-primary"
disabled=updatingGlobal
disabled=this.updatingGlobal
icon="floppy-disk"
}}
</div>
Expand All @@ -33,7 +33,7 @@
{{i18n "admin.landing_pages.global.scripts.label"}}
</label>

{{value-list values=scripts inputType="array"}}
{{value-list values=this.scripts inputType="array"}}

<div class="control-instructions">
{{{i18n "admin.landing_pages.global.scripts.description"}}}
Expand All @@ -49,11 +49,14 @@
{{{i18n "admin.landing_pages.global.header.description"}}}
</div>

<JsonEditor @content={{jsonHeader}} />
{{#if jsonHeaderError}}
<JsonEditor @content={{this.jsonHeader}} />
{{#if this.jsonHeaderError}}
<span class="validation-error">
{{d-icon "xmark"}}
{{i18n "admin.landing_pages.global.header.error" error=jsonHeaderError}}
{{i18n
"admin.landing_pages.global.header.error"
error=this.jsonHeaderError
}}
</span>
{{/if}}
</div>
Expand All @@ -67,11 +70,14 @@
{{{i18n "admin.landing_pages.global.footer.description"}}}
</div>

<JsonEditor @content={{jsonFooter}} />
{{#if jsonFooterError}}
<JsonEditor @content={{this.jsonFooter}} />
{{#if this.jsonFooterError}}
<span class="validation-error">
{{d-icon "xmark"}}
{{i18n "admin.landing_pages.global.footer.error" error=jsonFooterError}}
{{i18n
"admin.landing_pages.global.footer.error"
error=this.jsonFooterError
}}
</span>
{{/if}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,56 @@
<:body>
<div class="url">
<div class="label">{{i18n "admin.landing_pages.remote.url"}}</div>
<Input @value={{buffered.url}} placeholder={{urlPlaceholder}} />
<Input @value={{this.buffered.url}} placeholder={{urlPlaceholder}} />
</div>

<div class="branch">
<div class="label">{{i18n "admin.customize.theme.remote_branch"}}</div>
<Input @value={{buffered.branch}} placeholder="main" />
<Input @value={{this.buffered.branch}} placeholder="main" />
</div>

<div class="check-private">
<label>
<Input @type="checkbox" @checked={{buffered.private}} />
<Input @type="checkbox" @checked={{this.buffered.private}} />
{{i18n "admin.landing_pages.remote.private"}}
</label>
</div>

{{#if showPublicKey}}
<div class="public-key">
<div class="label">{{i18n "admin.customize.theme.public_key"}}</div>
<Textarea readonly={{true}} @value={{buffered.public_key}} />
<Textarea readonly={{true}} @value={{this.buffered.public_key}} />
</div>
{{/if}}
</:body>

<:footer>
<DButton
@action={{action "update"}}
@disabled={{updateDisabled}}
@disabled={{this.updateDisabled}}
class="btn btn-primary"
@label="admin.landing_pages.remote.update"
/>

<DButton
@action={{action "reset"}}
@disabled={{resetDisabled}}
@disabled={{this.resetDisabled}}
class="btn btn-danger"
@label="admin.landing_pages.remote.reset"
/>

<DButton
@action={{action "test"}}
@disabled={{testDisabled}}
@disabled={{this.testDisabled}}
class="btn btn-test"
@label="admin.landing_pages.remote.test"
/>

{{#if loading}}
{{#if this.loading}}
{{loading-spinner size="small"}}
{{else}}
{{#if testIcon}}
{{d-icon testIcon (hash class=tested)}}
{{#if this.testIcon}}
{{d-icon this.testIcon (hash class=this.tested)}}
{{/if}}
{{/if}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default Component.extend(bufferedProperty("model.remote"), {

@discourseComputed("tested")
testIcon(tested) {
return tested === "success" ? "check" : tested === "error" ? "times" : null;
return tested === "success" ? "check" : tested === "error" ? "xmark" : null;
},

@observes("buffered.hasChanges")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="page-controls">
<div class="page-list-container">
<ComboBox
@value={{page.id}}
@content={{pages}}
@value={{this.page.id}}
@content={{this.pages}}
@onChange={{action "changePage"}}
class="page-select"
@options={{hash none="admin.landing_pages.page.select"}}
Expand All @@ -17,41 +17,41 @@
</div>
</div>

{{#if page}}
{{#if this.page}}
<div class="page-header">
<div class="page-name">
<span>
{{#if page.name}}
{{page.name}}
{{#if this.page.name}}
{{this.page.name}}
{{else}}
{{i18n "admin.landing_pages.page.name.label"}}
{{/if}}
</span>
</div>

<div class="buttons">
{{#if resultMessage}}
<span class="{{resultMessage.style}}">
{{d-icon resultMessage.icon}}
{{{resultMessage.text}}}
{{#if this.resultMessage}}
<span class="{{this.resultMessage.style}}">
{{d-icon this.resultMessage.icon}}
{{{this.resultMessage.text}}}
</span>
{{/if}}

{{conditional-loading-spinner condition=updatingPage size="small"}}
{{conditional-loading-spinner condition=this.updatingPage size="small"}}

{{#if page.id}}
{{#if this.page.id}}
<DButton
@action={{action "exportPage"}}
@label="admin.landing_pages.page.export"
@href={{page.exportUrl}}
@disabled={{updatingPage}}
@href={{this.page.exportUrl}}
@disabled={{this.updatingPage}}
@icon="upload"
/>

<DButton
@action={{action "destroyPage"}}
@label="admin.landing_pages.destroy"
@disabled={{updatingPage}}
@disabled={{this.updatingPage}}
@icon="xmark"
/>
{{/if}}
Expand All @@ -60,14 +60,14 @@
@action={{action "savePage"}}
@label="admin.landing_pages.save"
class="btn-primary"
@disabled={{updatingPage}}
@disabled={{this.updatingPage}}
@icon="floppy-disk"
/>
</div>

<div class="page-url">
<a href="{{pageUrl}}" target="_blank">
{{pageUrl}}
<a href="{{this.pageUrl}}" target="_blank">
{{this.pageUrl}}
{{d-icon "up-right-from-square"}}
</a>
</div>
Expand All @@ -79,7 +79,7 @@
{{i18n "admin.landing_pages.page.name.label"}}
</label>

<Input @value={{page.name}} class="page-name" />
<Input @value={{this.page.name}} class="page-name" />

<div class="control-instructions">
{{i18n "admin.landing_pages.page.name.instructions"}}
Expand All @@ -92,8 +92,8 @@
</label>

<Input
@value={{readonly pagePath}}
disabled={{hasParent}}
@value={{readonly this.pagePath}}
disabled={{this.hasParent}}
onInput={{action "onChangePath" value="target.value"}}
class="page-path"
/>
Expand All @@ -109,8 +109,8 @@
</label>

<ComboBox
@value={{page.parent_id}}
@content={{pages}}
@value={{this.page.parent_id}}
@content={{this.pages}}
@onChange={{action "onChangeParent"}}
class="page-select page-parent"
@options={{hash none="admin.landing_pages.page.select"}}
Expand All @@ -127,11 +127,11 @@
</label>

<ComboBox
@content={{menus}}
@value={{page.menu}}
@content={{this.menus}}
@value={{this.page.menu}}
@valueProperty="name"
@nameProperty="name"
@onChange={{action (mut page.menu)}}
@onChange={{action (mut this.page.menu)}}
class="menu-select"
@options={{hash none="admin.landing_pages.page.menu.select"}}
/>
Expand All @@ -149,9 +149,9 @@
</label>

<ComboBox
@content={{themes}}
@value={{page.theme_id}}
@onChange={{action (mut page.theme_id)}}
@content={{this.themes}}
@value={{this.page.theme_id}}
@onChange={{action (mut this.page.theme_id)}}
@class="theme-select"
@options={{hash none="admin.landing_pages.page.theme.select"}}
/>
Expand All @@ -168,10 +168,10 @@

<GroupChooser
@class="group-select"
@content={{groups}}
@value={{page.group_ids}}
@content={{this.groups}}
@value={{this.page.group_ids}}
@labelProperty="name"
@onChange={{action (mut page.group_ids)}}
@onChange={{action (mut this.page.group_ids)}}
/>

<div class="control-instructions">
Expand All @@ -186,11 +186,11 @@

<CategoryChooser
@class="category-select"
@value={{page.category_id}}
@onChange={{action (mut page.category_id)}}
@value={{this.page.category_id}}
@onChange={{action (mut this.page.category_id)}}
@options={{hash
clearable=true
disabled=hasParent
disabled=this.hasParent
none="admin.landing_pages.page.category.select"
}}
/>
Expand All @@ -211,8 +211,8 @@
</div>

<AceEditor
@content={{page.body}}
@onChange={{fn (mut page.body)}}
@content={{this.page.body}}
@onChange={{fn (mut this.page.body)}}
@mode="html"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if topic.landing_page_url}}
{{#if @outletArgs.topic.landing_page_url}}
<a
href="/{{topic.landing_page_url}}"
href="/{{@outletArgs.topic.landing_page_url}}"
title="{{i18n 'topic.landing_page.link'}}"
class="landing-page-url"
target="_blank"
Expand Down
Loading
Loading