DEV: Resolve some template linting issues (#123)

Some larger issues still remain, but this is a good first step
This commit is contained in:
David Taylor 2021-07-02 16:35:50 +01:00 committed by GitHub
parent 814ec14636
commit 4354e1b766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 103 additions and 98 deletions

View File

@ -31,4 +31,4 @@ DEPENDENCIES
rubocop-discourse rubocop-discourse
BUNDLED WITH BUNDLED WITH
2.2.7 2.2.15

View File

@ -42,9 +42,10 @@
{{else}} {{else}}
<div class="name"> <div class="name">
{{d-button action=(action "goHome") icon="chevron-left" class="previous"}} {{d-button action=(action "goHome") icon="chevron-left" class="previous"}}
<h1>{{selectedItem.name}} <h1>
{{selectedItem.name}}
{{#unless editDisabled}} {{#unless editDisabled}}
<a {{action "editName" class="edit-query-name"}}>{{d-icon "pencil-alt"}}</a> <a href {{action "editName" class="edit-query-name"}}>{{d-icon "pencil-alt"}}</a>
{{/unless}} {{/unless}}
</h1> </h1>
</div> </div>

View File

@ -1,5 +1,5 @@
{{#each enuminfo as |enum|}} {{#each enuminfo as |enum|}}
<li value="{{enum.value}}"> <li value={{enum.value}}>
{{enum.name}} {{enum.name}}
</li> </li>
{{/each}} {{/each}}

View File

@ -11,7 +11,7 @@
<dl> <dl>
{{#each table.columns as |col|}} {{#each table.columns as |col|}}
<div> <div>
<dt class="{{if col.sensitive "sensitive"}}" title="{{if col.sensitive (i18n "explorer.schema.sensitive")}}"> <dt class={{if col.sensitive "sensitive"}} title={{if col.sensitive (i18n "explorer.schema.sensitive")}}>
{{#if col.sensitive}} {{#if col.sensitive}}
{{d-icon "exclamation-triangle"}} {{d-icon "exclamation-triangle"}}
{{/if}} {{/if}}

View File

@ -1,4 +1,4 @@
<div class="{{if hideSchema "hidden"}}"> <div class={{if hideSchema "hidden"}}>
{{text-field value=filter placeholderKey="explorer.schema.filter"}} {{text-field value=filter placeholderKey="explorer.schema.filter"}}
{{d-button action=(action "collapseSchema") icon="chevron-right" class="no-text"}} {{d-button action=(action "collapseSchema") icon="chevron-right" class="no-text"}}
{{conditional-loading-spinner condition=loading}} {{conditional-loading-spinner condition=loading}}

View File

@ -1,7 +1,7 @@
<div class="jsfu-shade-container"> <div class="jsfu-shade-container">
<div class="jsfu-file"> <div class="jsfu-file">
<input id="js-file-input" type="file" style="display:none;" accept={{accept}}> <input id="js-file-input" type="file" style="display:none;" accept={{accept}}>
{{d-button class="fileSelect" action=(action "selectFile") class="" icon="upload" label="upload_selector.select_file"}} {{d-button class="fileSelect" action=(action "selectFile") icon="upload" label="upload_selector.select_file"}}
{{conditional-loading-spinner condition=loading size="small"}} {{conditional-loading-spinner condition=loading size="small"}}
</div> </div>
<div class="jsfu-separator"> <div class="jsfu-separator">
@ -12,5 +12,5 @@
<div class="jsfu-paste"> <div class="jsfu-paste">
{{textarea value=value}} {{textarea value=value}}
</div> </div>
<div class="jsfu-shade {{if hover '' 'hidden'}}"><span class="text">{{d-icon "upload"}}</span></div> <div class="jsfu-shade {{if hover "" "hidden"}}"><span class="text">{{d-icon "upload"}}</span></div>
</div> </div>

View File

@ -3,9 +3,9 @@
{{group}} {{group}}
</div> </div>
{{#if visible}} {{#if visible}}
<div class='popup'> <div class="popup">
<label>{{i18n "explorer.link"}} {{group}}</label> <label>{{i18n "explorer.link"}} {{group}}</label>
<input type="text" value={{link}}/> <input type="text" value={{link}}>
{{d-button action="close" class="btn-flat close" icon="times" aria-label="share.close" title="share.close"}} {{d-button action="close" class="btn-flat close" icon="times" aria-label="share.close" title="share.close"}}
</div> </div>
{{/if}} {{/if}}

View File

@ -1,3 +1,3 @@
{{#link-to 'group.reports'}} {{#link-to "group.reports"}}
{{d-icon 'chart-bar'}}{{i18n 'group.reports'}} {{d-icon "chart-bar"}}{{i18n "group.reports"}}
{{/link-to}} {{/link-to}}

View File

@ -1,6 +1,8 @@
{{! source: badge-button component }} {{! source: badge-button component }}
<a href="{{baseuri}}/badges/{{badge.id}}/{{badge.name}}" <a href="{{baseuri}}/badges/{{badge.id}}/{{badge.name}}"
class="user-badge {{badge.badgeTypeClassName}}" class="user-badge {{badge.badgeTypeClassName}}"
title="{{badge.display_name}}" title={{badge.display_name}}
data-badge-name="{{badge.name}}">{{icon-or-image badge.icon}} data-badge-name={{badge.name}}>
<span class="badge-display-name">{{badge.display_name}}</span></a> {{icon-or-image badge.icon}}
<span class="badge-display-name">{{badge.display_name}}</span>
</a>

View File

@ -1 +1 @@
{{{value}}} {{html-safe value}}

View File

@ -1,5 +1,5 @@
{{#if post}} {{#if post}}
<aside class="quote" data-post="{{post.post_number}}" data-topic="{{post.topic_id}}"> <aside class="quote" data-post={{post.post_number}} data-topic={{post.topic_id}}>
<div class="title"> <div class="title">
<div class="quote-controls"> <div class="quote-controls">
<a href="/t/via-quote/{{post.topic_id}}/{{post.post_number}}" <a href="/t/via-quote/{{post.topic_id}}/{{post.post_number}}"
@ -13,7 +13,7 @@
</div> </div>
<blockquote> <blockquote>
<p> <p>
{{{post.excerpt}}} {{html-safe post.excerpt}}
</p> </p>
</blockquote> </blockquote>
</aside> </aside>

View File

@ -1,6 +1,8 @@
{{#if topic}} {{#if topic}}
<a href="{{baseuri}}/t/{{topic.slug}}/{{topic.id}}" <a href="{{baseuri}}/t/{{topic.slug}}/{{topic.id}}">
>{{{topic.fancy_title}}}</a> ({{topic.posts_count}}) {{html-safe topic.fancy_title}}
</a>
({{topic.posts_count}})
{{else}} {{else}}
<a href="{{baseuri}}/t/{{id}}">{{id}}</a> <a href="{{baseuri}}/t/{{id}}">{{id}}</a>
{{/if}} {{/if}}

View File

@ -1 +1 @@
<a href="{{href}}">{{target}}</a> <a href={{href}}>{{target}}</a>

View File

@ -1,6 +1,7 @@
{{#if user}} {{#if user}}
<a href="{{baseuri}}/u/{{user.username}}/activity" <a href="{{baseuri}}/u/{{user.username}}/activity" data-user-card={{user.username}}>
data-user-card="{{user.username}}">{{avatar user imageSize="tiny"}} {{user.username}}</a> {{avatar user imageSize="tiny"}} {{user.username}}
</a>
{{else}} {{else}}
{{id}} {{id}}
{{/if}} {{/if}}

View File

@ -1,5 +1,5 @@
<section class='user-content'> <section class="user-content">
<table class='group-reports'> <table class="group-reports">
<thead> <thead>
<th> <th>
{{i18n "explorer.report_name"}} {{i18n "explorer.report_name"}}
@ -11,12 +11,11 @@
{{i18n "explorer.query_time"}} {{i18n "explorer.query_time"}}
</th> </th>
</thead> </thead>
<tr></tr>
<tbody> <tbody>
{{#each queries as |query|}} {{#each queries as |query|}}
<tr> <tr>
<td> <td>
{{#link-to 'group.reports.show' group.name query.id}}{{query.name}}{{/link-to}} {{#link-to "group.reports.show" group.name query.id}}{{query.name}}{{/link-to}}
</td> </td>
<td>{{query.description}}</td> <td>{{query.description}}</td>
<td> <td>

View File

@ -1,4 +1,4 @@
<section class='user-content'> <section class="user-content">
<h1>{{model.name}}</h1> <h1>{{model.name}}</h1>
<p>{{model.description}}</p> <p>{{model.description}}</p>
<form class="query-run" {{action "run" on="submit"}}> <form class="query-run" {{action "run" on="submit"}}>

View File

@ -1,10 +1,10 @@
{{#d-modal-body title="explorer.import.modal"}} {{#d-modal-body title="explorer.import.modal"}}
<form {{action "dummy" on="submit"}}> <form {{action "dummy" on="submit"}}>
<div class='modal-body'> <div class="modal-body">
{{json-file-uploader value=queryFile extension=".dcquery.json"}} {{json-file-uploader value=queryFile extension=".dcquery.json"}}
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
{{d-button class='btn-primary' action='doImport' type='submit' disabled=notReady icon="plus" label='explorer.import.label'}} {{d-button class="btn-primary" action="doImport" type="submit" disabled=notReady icon="plus" label="explorer.import.label"}}
</div> </div>
</form> </form>
{{/d-modal-body}} {{/d-modal-body}}