mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
f529296129
no issue
Ember is migrating to `<AngleBracketSyntax />` for component invocation, see https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md
We were in a half-way situation where some templates used angle bracket syntax in some places, this PR updates templates to use the syntax everywhere.
This simplifies the rules for what template code is referring to...
`<Component>` = a component
`{{helper}}` = a helper (or locally assigned handlebars variable)
`{{this.foo}}` = data on the template backing context (a component/controller)
`{{@foo}}` = a named argument passed into the component that the component backing class has not modified (note: this commit does not introduce any named arguments)
- ran codemod https://github.com/ember-codemods/ember-angle-brackets-codemod on the following directories:
- `app/templates`
- `lib/koenig-editor/addon/templates`
- removed positional params from components as angle bracket syntax does not support them
- `gh-feature-flag`
- `gh-tour-item`
- `gh-cm-editor`
- `gh-fullscreen-modal`
- `gh-task-button`
- updates some code that was missed in aaf9f88ebc
to use explicit this
70 lines
No EOL
3 KiB
Handlebars
70 lines
No EOL
3 KiB
Handlebars
<LinkTo @route="editor.edit" @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data gh-post-list-featured" @title="Edit this post">
|
||
{{#if this.isFeatured}}
|
||
<span data-tooltip="Featured" class="dib pl1 pr1 nr1 nl1">{{svg-jar "star-filled" class="fill-blue w3 h3"}}</span>
|
||
{{/if}}
|
||
</LinkTo>
|
||
|
||
<LinkTo @route="editor.edit" @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data gh-post-list-title" @title="Edit this post">
|
||
<h3 class="gh-content-entry-title">
|
||
{{this.post.title}}
|
||
</h3>
|
||
<p>
|
||
<span class="gh-content-entry-meta">
|
||
By <span class="midgrey-l2 fw5">{{this.authorNames}}</span>
|
||
|
||
{{#if this.primaryTag}}
|
||
in <span class="midgrey-l2 fw5">{{this.primaryTag}}</span>
|
||
{{/if}}
|
||
|
||
{{#if this.isScheduled}}
|
||
– <span class="gh-schedule-time">Scheduled to be published and sent {{gh-format-post-time this.post.publishedAtUTC scheduled=true}}</span>
|
||
{{/if}}
|
||
</span>
|
||
</p>
|
||
</LinkTo>
|
||
|
||
<LinkTo @route="editor.edit" @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data gh-post-list-status" @title="Edit this post">
|
||
<div class="flex items-center">
|
||
{{#if this.isScheduled}}
|
||
<span class="gh-content-status-draft gh-badge nowrap">
|
||
Scheduled
|
||
</span>
|
||
{{/if}}
|
||
|
||
{{#if this.isDraft}}
|
||
<span class="gh-content-status-draft gh-badge gh-badge-purple nowrap">
|
||
Draft
|
||
</span>
|
||
{{/if}}
|
||
|
||
{{#if (and this.isPublished (not this.post.page))}}
|
||
<span class="gh-content-status-published nowrap" title="Post has been sent by email">
|
||
Published
|
||
</span>
|
||
{{/if}}
|
||
|
||
{{#if this.session.user.isOwnerOrAdmin}}
|
||
{{#if (or this.post.email (and this.post.isScheduled this.post.sendEmailWhenPublished))}}
|
||
{{#if (eq this.post.email.status "failed")}}
|
||
<span data-tooltip="Failed to send post by email" class="gh-content-status-emailed error">
|
||
{{svg-jar "send-email" class="stroke-red"}}
|
||
</span>
|
||
{{else}}
|
||
{{#if this.isScheduled}}
|
||
<span data-tooltip="To be sent by email" class="gh-content-status-emailed scheduled">
|
||
{{svg-jar "send-email" class="stroke-green-d2"}}
|
||
</span>
|
||
{{else}}
|
||
<span data-tooltip="Sent by email" class="gh-content-status-emailed">
|
||
{{svg-jar "send-email" class="stroke-midgrey"}}
|
||
</span>
|
||
{{/if}}
|
||
{{/if}}
|
||
{{/if}}
|
||
{{/if}}
|
||
</div>
|
||
</LinkTo>
|
||
|
||
<LinkTo @route="editor.edit" @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data gh-post-list-updated" @title="Edit this post">
|
||
<span class="nowrap">{{gh-format-post-time this.post.updatedAtUTC draft=true}}</span>
|
||
</LinkTo> |