DEV: enforces ember-template-lint: simple-unless (#9146)

This commit is contained in:
Joffrey JAFFEUX 2020-03-09 13:44:34 +01:00 committed by GitHub
parent 0e752db411
commit 4f37233208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 59 deletions

View File

@ -9,6 +9,7 @@ module.exports = {
"no-invalid-interactive": true, "no-invalid-interactive": true,
"link-rel-noopener": true, "link-rel-noopener": true,
"no-unnecessary-concat": true, "no-unnecessary-concat": true,
"no-unused-block-params": true "no-unused-block-params": true,
"simple-unless": true
} }
}; };

View File

@ -58,7 +58,28 @@
<div class="body"> <div class="body">
<div class="main"> <div class="main">
{{#unless showError}} {{#if showError}}
{{#if showTimeoutError}}
<div class="alert alert-error report-alert timeout">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.timeout_error"}}</span>
</div>
{{/if}}
{{#if showExceptionError}}
<div class="alert alert-error report-alert exception">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.exception_error"}}</span>
</div>
{{/if}}
{{#if showNotFoundError}}
<div class="alert alert-error report-alert not-found">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.not_found_error"}}</span>
</div>
{{/if}}
{{else}}
{{#if hasData}} {{#if hasData}}
{{#if currentMode}} {{#if currentMode}}
{{component modeComponent model=model options=options}} {{component modeComponent model=model options=options}}
@ -91,28 +112,7 @@
</div> </div>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{else}} {{/if}}
{{#if showTimeoutError}}
<div class="alert alert-error report-alert timeout">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.timeout_error"}}</span>
</div>
{{/if}}
{{#if showExceptionError}}
<div class="alert alert-error report-alert exception">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.exception_error"}}</span>
</div>
{{/if}}
{{#if showNotFoundError}}
<div class="alert alert-error report-alert not-found">
{{d-icon "exclamation-triangle"}}
<span>{{i18n "admin.dashboard.not_found_error"}}</span>
</div>
{{/if}}
{{/unless}}
</div> </div>
{{#if showFilteringUI}} {{#if showFilteringUI}}

View File

@ -7,7 +7,9 @@
</span> </span>
<span class="icons"> <span class="icons">
{{#unless theme.selected}} {{#if theme.selected}}
{{d-icon "caret-right"}}
{{else}}
{{#if theme.default}} {{#if theme.default}}
{{d-icon "check" class="default-indicator" title="admin.customize.theme.default_theme_tooltip"}} {{d-icon "check" class="default-indicator" title="admin.customize.theme.default_theme_tooltip"}}
{{/if}} {{/if}}
@ -20,9 +22,7 @@
{{#unless theme.enabled}} {{#unless theme.enabled}}
{{d-icon "ban" class="light-grey-icon" title="admin.customize.theme.disabled_component_tooltip"}} {{d-icon "ban" class="light-grey-icon" title="admin.customize.theme.disabled_component_tooltip"}}
{{/unless}} {{/unless}}
{{else}} {{/if}}
{{d-icon "caret-right"}}
{{/unless}}
</span> </span>
</div> </div>

View File

@ -76,7 +76,14 @@
{{/if}} {{/if}}
</td> </td>
<td class="col actions"> <td class="col actions">
{{#unless item.editing}} {{#if item.editing}}
{{d-button
class="btn-default"
action=(action "save")
actionParam=item
label="admin.logs.save"}}
<a href {{action "cancel" item}}>{{i18n "cancel"}}</a>
{{else}}
{{d-button {{d-button
class="btn-default btn-danger" class="btn-default btn-danger"
action=(action "destroy") action=(action "destroy")
@ -102,14 +109,7 @@
icon="ban" icon="ban"
label="admin.logs.screened_ips.actions.block"}} label="admin.logs.screened_ips.actions.block"}}
{{/if}} {{/if}}
{{else}} {{/if}}
{{d-button
class="btn-default"
action=(action "save")
actionParam=item
label="admin.logs.save"}}
<a href {{action "cancel" item}}>{{i18n "cancel"}}</a>
{{/unless}}
</td> </td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -52,13 +52,13 @@
{{/if}} {{/if}}
</h1> </h1>
{{plugin-outlet name="user-card-after-username" args=(hash user=user showUser=(action "showUser" user)) tagName=''}} {{plugin-outlet name="user-card-after-username" args=(hash user=user showUser=(action "showUser" user)) tagName=''}}
{{#unless nameFirst}} {{#if nameFirst}}
<h2 class='username'>{{username}}</h2>
{{else}}
{{#if user.name}} {{#if user.name}}
<h2 class='full-name'>{{user.name}}</h2> <h2 class='full-name'>{{user.name}}</h2>
{{/if}} {{/if}}
{{else}} {{/if}}
<h2 class='username'>{{username}}</h2>
{{/unless}}
{{#if user.title}} {{#if user.title}}
<h2>{{user.title}}</h2> <h2>{{user.title}}</h2>
{{/if}} {{/if}}

View File

@ -67,7 +67,9 @@
{{plugin-outlet name="full-page-search-below-search-info" args=(hash search=searchTerm)}} {{plugin-outlet name="full-page-search-below-search-info" args=(hash search=searchTerm)}}
{{#unless searching}} {{#if searching}}
{{loading-spinner size="medium"}}
{{else}}
<div class="search-results"> <div class="search-results">
{{#load-more selector=".fps-result" action=(action "loadMore")}} {{#load-more selector=".fps-result" action=(action "loadMore")}}
{{#each model.posts as |result|}} {{#each model.posts as |result|}}
@ -172,9 +174,7 @@
{{/conditional-loading-spinner}} {{/conditional-loading-spinner}}
{{/load-more}} {{/load-more}}
</div> </div>
{{else}} {{/if}}
{{loading-spinner size="medium"}}
{{/unless}}
</div> </div>
<div class="search-advanced-sidebar"> <div class="search-advanced-sidebar">

View File

@ -7,7 +7,11 @@
}} }}
{{#select-kit/select-kit-body selectKit=selectKit}} {{#select-kit/select-kit-body selectKit=selectKit}}
{{#unless selectKit.isLoading}} {{#if selectKit.isLoading}}
<span class="is-loading">
{{loading-spinner size="small"}}
</span>
{{else}}
{{#if selectKit.filter}} {{#if selectKit.filter}}
{{#if selectKit.hasNoContent}} {{#if selectKit.hasNoContent}}
<span class="no-content"> <span class="no-content">
@ -23,11 +27,7 @@
value=value value=value
}} }}
{{/each}} {{/each}}
{{else}} {{/if}}
<span class="is-loading">
{{loading-spinner size="small"}}
</span>
{{/unless}}
{{/select-kit/select-kit-body}} {{/select-kit/select-kit-body}}
<div class="select-kit-wrapper"></div> <div class="select-kit-wrapper"></div>

View File

@ -9,7 +9,13 @@
{{#select-kit/select-kit-body selectKit=selectKit}} {{#select-kit/select-kit-body selectKit=selectKit}}
{{component selectKit.options.filterComponent selectKit=selectKit}} {{component selectKit.options.filterComponent selectKit=selectKit}}
{{#unless selectKit.isLoading}} {{#if selectKit.isLoading}}
<span class="is-loading">
{{#if site}}
{{loading-spinner size="small"}}
{{/if}}
</span>
{{else}}
{{#if selectKit.filter}} {{#if selectKit.filter}}
{{#if selectKit.hasNoContent}} {{#if selectKit.hasNoContent}}
<span class="no-content"> <span class="no-content">
@ -25,13 +31,7 @@
value=value value=value
}} }}
{{/each}} {{/each}}
{{else}} {{/if}}
<span class="is-loading">
{{#if site}}
{{loading-spinner size="small"}}
{{/if}}
</span>
{{/unless}}
{{/select-kit/select-kit-body}} {{/select-kit/select-kit-body}}
<div class="select-kit-wrapper"></div> <div class="select-kit-wrapper"></div>