DEV: Update the template copied from core (#28)

(and use angle brackets in a connector template)
This commit is contained in:
Jarek Radosz 2024-06-19 14:42:05 +02:00 committed by GitHub
parent 36dd79a8c3
commit 0e769465cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 74 additions and 58 deletions

View File

@ -1 +1 @@
{{user-card-directory-toggle}} <UserCardDirectoryToggle />

View File

@ -1,9 +1,13 @@
{{#if this.model.canLoadMore}}
{{hide-application-footer}}
{{/if}}
{{body-class "users-page"}} {{body-class "users-page"}}
<section> <section>
{{#load-more <LoadMore
selector=".user-card-directory .user-card-container" @selector=".user-card-directory .user-card-container"
action=(action "loadMore") @action={{action "loadMore"}}
}} >
<div class="container"> <div class="container">
<div class="users-directory directory"> <div class="users-directory directory">
<PluginOutlet <PluginOutlet
@ -13,48 +17,45 @@
/> />
<div class="directory-controls"> <div class="directory-controls">
<div class="period-controls"> <div class="period-controls">
{{period-chooser <PeriodChooser
period=period @period={{this.period}}
onChange=(action (mut period)) @onChange={{fn (mut this.period)}}
fullDay=false @fullDay={{false}}
}} />
{{#if lastUpdatedAt}} {{#if this.lastUpdatedAt}}
<div class="directory-last-updated"> <div class="directory-last-updated">
{{i18n "directory.last_updated"}} {{i18n "directory.last_updated"}}
{{lastUpdatedAt}} {{this.lastUpdatedAt}}
</div> </div>
{{/if}} {{/if}}
</div> </div>
<div class="inline-form"> <div class="inline-form">
<label class="total-rows"> <label class="total-rows">
{{#if model.totalRows}} {{#if this.model.totalRows}}
{{i18n "directory.total_rows" count=model.totalRows}} {{i18n "directory.total_rows" count=this.model.totalRows}}
{{/if}} {{/if}}
</label> </label>
<Input <Input
@value={{readonly emailInput}} @value={{readonly this.emailInput}}
placeholder={{i18n "directory.filter_name"}} placeholder={{i18n "directory.filter_name"}}
class="filter-name no-blur" class="filter-name no-blur"
{{on {{on "input" (with-event-value this.onUsernameFilterChanged)}}
"input"
(action "onUsernameFilterChanged" value="target.value")
}}
/> />
{{#if showGroupFilter}} {{#if this.showGroupFilter}}
{{combo-box <ComboBox
@value={{this.group}}
@content={{this.groupOptions}}
@onChange={{this.groupChanged}}
@options={{hash none="directory.group.all"}}
class="directory-group-selector" class="directory-group-selector"
value=group />
content=groupOptions
onChange=(action groupChanged)
options=(hash none="directory.group.all")
}}
{{/if}} {{/if}}
{{#if currentUser.staff}} {{#if this.currentUser.staff}}
{{d-button <DButton
icon="wrench" @icon="wrench"
action=(action "showEditColumnsModal") @action={{this.showEditColumnsModal}}
class="btn-default open-edit-columns-btn" class="btn-default open-edit-columns-btn"
}} />
{{/if}} {{/if}}
<PluginOutlet <PluginOutlet
@name="users-directory-controls" @name="users-directory-controls"
@ -63,21 +64,21 @@
</div> </div>
</div> </div>
{{#conditional-loading-spinner condition=isLoading}} <ConditionalLoadingSpinner @condition={{this.isLoading}}>
{{#if userCards.length}} {{#if this.userCards.length}}
<div class="user-card-directory"> <div class="user-card-directory">
{{#each userCards as |userCard|}} {{#each this.userCards as |userCard|}}
<div class="user-card-container"> <div class="user-card-container">
{{user-card-static <UserCardStatic
user=userCard.user @user={{userCard.user}}
visible=true @visible={{true}}
loading=userCard.loading @loading={{userCard.loading}}
username=userCard.user.username @username={{userCard.user.username}}
showUser=this.userCardShowUser @showUser={{this.userCardShowUser}}
}} />
{{#if (theme-setting "show_stats")}} {{#if (theme-setting "show_stats")}}
<div class="user-card-directory-footer"> <div class="user-card-directory-footer">
{{#each columns as |column|}} {{#each this.columns as |column|}}
<span <span
class="stat stat-{{dasherize column.name}} class="stat stat-{{dasherize column.name}}
stat-type-{{column.type}}" stat-type-{{column.type}}"
@ -98,17 +99,17 @@
{{/if}} {{/if}}
</span> </span>
<span class="label"> <span class="label">
{{table-header-toggle <TableHeaderToggle
field=column.name @field={{column.name}}
icon=column.icon @icon={{column.icon}}
order=order @order={{this.order}}
asc=asc @asc={{this.asc}}
automatic=(directory-column-is-automatic @automatic={{directory-column-is-automatic
column=column column=column
) }}
translated=column.user_field_id @translated={{column.user_field_id}}
onActiveRender=setActiveHeader @onActiveRender={{this.setActiveHeader}}
}} />
</span> </span>
</span> </span>
{{/each}} {{/each}}
@ -117,14 +118,29 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{conditional-loading-spinner condition=model.loadingMore}} <ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />
{{else}} {{else}}
<div class="clearfix"></div> <div class="empty-state">
<p>{{i18n "directory.no_results"}}</p> <div class="empty-state-body">
<p>
{{#if this.name}}
{{i18n "directory.no_results_with_search"}}
{{else}}
{{i18n "directory.no_results.body"}}
{{#if this.currentUser.staff}}
{{html-safe
(i18n
"directory.no_results.extra_body" basePath=(base-path)
)
}}
{{/if}}
{{/if}}
</p>
</div>
</div>
{{/if}} {{/if}}
{{/conditional-loading-spinner}} </ConditionalLoadingSpinner>
</div> </div>
</div> </div>
{{/load-more}} </LoadMore>
</section> </section>