DEV: Tagless components

This commit is contained in:
Jarek Radosz 2023-01-16 10:02:09 +01:00
parent ba418ede2f
commit 7d7b067b98
8 changed files with 95 additions and 87 deletions

View File

@ -1,5 +1,7 @@
<div
<div class="progress progress-striped {{if this.active 'active'}}">
<div
class="progress-bar progress-bar-striped
{{if active 'progress-bar-animated'}}"
{{if this.active 'progress-bar-animated'}}"
style={{barStyle}}
></div>
></div>
</div>

View File

@ -3,7 +3,7 @@ import { computed } from "@ember/object";
import { htmlSafe } from "@ember/template";
export default Component.extend({
classNameBindings: [":progress", ":progress-striped", "active"],
tagName: "",
active: computed("percent", function () {
return parseInt(this.get("percent"), 10) !== 100;

View File

@ -1,4 +1,5 @@
<td>
<tr>
<td>
{{#if this.officialRepoBadge}}
{{d-icon
this.officialRepoBadge
@ -7,16 +8,16 @@
title=this.officialRepoBadgeTitle
}}
{{/if}}
</td>
</td>
<td>
<td>
<a href="{{repo.url}}">{{repo.name}}</a>
<span class="current commit-hash" title={{repo.version}}>
{{repo.prettyVersion}}
</span>
</td>
</td>
<td>
<td>
{{#if repo.checkingStatus}}
Checking for new version...
{{else if repo.upToDate}}
@ -66,4 +67,5 @@
{{/if}}
</div>
{{/if}}
</td>
</td>
</tr>

View File

@ -4,7 +4,7 @@ import { inject as service } from "@ember/service";
export default Component.extend({
router: service(),
tagName: "tr",
tagName: "",
upgradeDisabled: computed(
"upgradingRepo",

View File

@ -1,4 +1,5 @@
{{#if currentUser.admin}}
<tr>
<th colspan="5">
{{#if versionCheck.upToDate}}
<a href="{{href}}" data-auto-route="true">
@ -11,4 +12,5 @@
</a>
{{/if}}
</th>
</tr>
{{/if}}

View File

@ -2,7 +2,7 @@ import getURL from "discourse-common/lib/get-url";
import Component from "@ember/component";
export default class extends Component {
tagName = "tr";
tagName = "";
get href() {
return getURL("/admin/upgrade");

View File

@ -1 +1,3 @@
{{output}}
<div class="logs">
{{output}}
</div>

View File

@ -3,7 +3,7 @@ import { observer } from "@ember/object";
import { scheduleOnce } from "@ember/runloop";
export default Component.extend({
classNameBindings: [":logs"],
tagName: "",
_outputChanged: observer("output", function () {
scheduleOnce("afterRender", this, "_scrollBottom");