Skip to content

Commit

Permalink
update display
Browse files Browse the repository at this point in the history
  • Loading branch information
daocatt committed Mar 14, 2024
1 parent 2cc39e3 commit bcef31c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
6 changes: 1 addition & 5 deletions js/src/admin/components/EditBadgeCategoryModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ export default class EditBadgeCategoryModal extends Modal {
'name',
<div className="Form-group">
<label>{app.translator.trans('gtdxyz-flarum-badges.admin.badge_category.name')}:</label>
<input
className="FormControl"
placeholder={app.translator.trans('gtdxyz-flarum-badges.admin.badge_category.name')}
bidi={this.name}
/>
<input className="FormControl" placeholder={app.translator.trans('gtdxyz-flarum-badges.admin.badge_category.name')} bidi={this.name} />
</div>,
50
);
Expand Down
8 changes: 2 additions & 6 deletions js/src/admin/components/EditBadgeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ export default class EditBadgeModal extends Modal {
'image',
<div className="Form-group">
<label>{app.translator.trans('gtdxyz-flarum-badges.admin.badge.image')}:</label>
<input
className="FormControl"
placeholder={app.translator.trans('gtdxyz-flarum-badges.admin.badge.image_placeholder')}
bidi={this.image}
/>
<input className="FormControl" placeholder={app.translator.trans('gtdxyz-flarum-badges.admin.badge.image_placeholder')} bidi={this.image} />
</div>,
50
);
Expand Down Expand Up @@ -211,7 +207,7 @@ export default class EditBadgeModal extends Modal {
.save({
name: this.name(),
icon: this.icon(),
image: this.isImage()?this.image():null,
image: this.isImage() ? this.image() : null,
description: this.description(),
isVisible: this.isVisible(),
iconColor: this.iconColor(),
Expand Down
1 change: 0 additions & 1 deletion js/src/forum/components/BadgeItemPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default class BadgeItemPage extends Page {
</div>
)}


{app.session?.user?.isAdmin() && badge && app.forum.attribute('canViewDetailedBadgeUsers') && (
<h3>
{app.translator.trans('gtdxyz-flarum-badges.forum.badge.earned_by_count', {
Expand Down
4 changes: 1 addition & 3 deletions js/src/forum/components/BadgeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class BadgeModal extends Modal {

// Badge earning reason
const earning_reason = false;
if(earning_reason && this.attrs.userBadgeData && (this.attrs.userBadgeData.description() || app.forum.attribute('canGiveBadge'))) {
if (earning_reason && this.attrs.userBadgeData && (this.attrs.userBadgeData.description() || app.forum.attribute('canGiveBadge'))) {
items.add(
'earning_reason',
<div className={'BadgeModalListItem'}>
Expand Down Expand Up @@ -117,8 +117,6 @@ export default class BadgeModal extends Modal {
);
}



// Badge category
if (this.attrs.userBadgeData) {
items.add(
Expand Down
5 changes: 2 additions & 3 deletions js/src/forum/components/BadgesProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default class BadgesProfilePage extends UserPage {
if (!this.user || this.loading) {
return <LoadingIndicator size={46} />;
}
if(app.session.user){

if (app.session.user) {
return UserBadgeList.component({
user: this.user,
});
Expand All @@ -29,7 +29,6 @@ export default class BadgesProfilePage extends UserPage {
</div>
);
}

}

show(user) {
Expand Down
4 changes: 1 addition & 3 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ app.initializers.add('gtdxyz-flarum-badges', (app) => {
name: 'badges',
icon: 'fas fa-user-tag',
},
[
app.translator.trans('gtdxyz-flarum-badges.forum.badge.badges')
]
[app.translator.trans('gtdxyz-flarum-badges.forum.badge.badges')]
),
15
);
Expand Down

0 comments on commit bcef31c

Please sign in to comment.