Skip to content

Commit

Permalink
fix: avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Oct 8, 2023
1 parent a9384ca commit 4295afa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/components/telegram/bot/users/details.panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@

<ext-displayfield bind="{record.is_bot}" :label="l10n(`Is bot`)" labelAlign="left" labelWidth="200"/>

<ext-displayfield bind="{record.phone}" :label="l10n(`Phone`)" labelAlign="left" labelWidth="200"/>
<ext-displayfield bind="{record.phone_text}" :label="l10n(`Phone`)" labelAlign="left" labelWidth="200"/>

<ext-displayfield bind="{record.created}" :label="l10n(`Creation date`)" labelAlign="left" labelWidth="200"/>
<ext-displayfield bind="{record.created_text}" :label="l10n(`Creation date`)" labelAlign="left" labelWidth="200"/>

<ext-displayfield bind="{record.last_activity}" :label="l10n(`Last activity date`)" labelAlign="left" labelWidth="200"/>
<ext-displayfield bind="{record.last_activity_text}" :label="l10n(`Last activity date`)" labelAlign="left" labelWidth="200"/>

<ext-displayfield bind="{record.subscription_status}" :label="l10n(`Subscription status`)" labelAlign="left" labelWidth="200"/>

<ext-displayfield bind="{record.ban_status}" :label="l10n(`Ban status`)" labelAlign="left" labelWidth="200"/>
</ext-panel>
</template>
</CardsPanel>
Expand Down
31 changes: 31 additions & 0 deletions src/components/telegram/bot/users/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@ export default Ext.define( "", {
},
},

{
"name": "phone_text",
calculate ( data ) {
return data.phone || "--";
},
},

{
"name": "subscription_status",
calculate ( data ) {
if ( data.subscribed ) {
return app.locale.l10n( `Subscribed` );
}
else {
return app.locale.l10n( `Not subscribed` );
}
},
},

{
"name": "ban_status",
calculate ( data ) {
if ( data.banned ) {
return app.locale.l10n( `Banned` );
}
else {
return app.locale.l10n( `Not banned` );
}
},
},

{
"name": "created_text",
calculate ( data ) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/telegram/bot/users/panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ext-column dataIndex="full_name" flex="1" sorter='{"property":"first_name"}' :text="l10n(`Name`)"/>

<ext-column dataIndex="phone" flex="1" :text="l10n(`Phone`)"/>
<ext-column dataIndex="phone_text" flex="1" sorter='{"property":"phone"}' :text="l10n(`Phone`)"/>
</ext-grid>
</template>
</CardsPanel>
Expand Down

0 comments on commit 4295afa

Please sign in to comment.