Skip to content

Commit

Permalink
UX: Apply admin table classes for consistent mobile styling on the re…
Browse files Browse the repository at this point in the history
…cent queries page
  • Loading branch information
ellaestigoy committed Dec 23, 2024
1 parent d961589 commit 02c2623
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 22 deletions.
53 changes: 32 additions & 21 deletions assets/javascripts/discourse/templates/admin/plugins-explorer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@
{{/if}}

{{#unless this.selectedItem.destroyed}}
<div class="pull-left">
<div class="groups">
<span class="label">{{i18n "explorer.allow_groups"}}</span>
<span>
<MultiSelect
@value={{this.selectedItem.group_ids}}
@content={{this.groupOptions}}
@options={{hash allowAny=false}}
@onChange={{this.updateGroupIds}}
/>
</span>
</div>
<div class="groups">
<span class="label">{{i18n "explorer.allow_groups"}}</span>
<span>
<MultiSelect
@value={{this.selectedItem.group_ids}}
@content={{this.groupOptions}}
@options={{hash allowAny=false}}
@onChange={{this.updateGroupIds}}
/>
</span>
</div>
{{/unless}}

Expand Down Expand Up @@ -289,7 +287,7 @@

{{#unless this.validQueryPresent}}
<div class="container">
<table class="recent-queries">
<table class="d-admin-table recent-queries">
<thead class="heading-container">
<th class="col heading name">
<div
Expand Down Expand Up @@ -344,8 +342,8 @@
</thead>
<tbody>
{{#each this.filteredContent as |query|}}
<tr class="query-row">
<td>
<tr class="d-admin-row__content query-row">
<td class="d-admin-row__overview">
<a
{{on "click" this.scrollTop}}
href="/admin/plugins/explorer/?id={{query.id}}"
Expand All @@ -354,19 +352,32 @@
<medium class="query-desc">{{query.description}}</medium>
</a>
</td>
<td class="query-created-by">
<td class="d-admin-row__detail query-created-by">
<div class="d-admin-row__mobile-label">
{{i18n "explorer.query_user"}}
</div>
{{#if query.username}}
<a href="/u/{{query.username}}/activity">
<medium>{{query.username}}</medium>
</a>
<div>
<a href="/u/{{query.username}}/activity">
<medium>{{query.username}}</medium>
</a>
</div>
{{/if}}
</td>
<td class="query-group-names">
<td class="d-admin-row__detail query-group-names">
<div class="d-admin-row__mobile-label">
{{i18n "explorer.query_groups"}}
</div>
<div class="group-names">
{{#each query.group_names as |group|}}
<ShareReport @group={{group}} @query={{query}} />
{{/each}}
</div>
</td>
<td class="query-created-at">
<td class="d-admin-row__detail query-created-at">
<div class="d-admin-row__mobile-label">
{{i18n "explorer.query_time"}}
</div>
{{#if query.last_run_at}}
<medium>
{{bound-date query.last_run_at}}
Expand Down
20 changes: 19 additions & 1 deletion assets/stylesheets/explorer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,27 @@ table.group-reports {
margin: 10px 0;
}
.groups {
margin-bottom: 10px;
margin: 10px 0;
display: flex;
flex-direction: row;
align-items: center;
@include breakpoint("tablet") {
flex-direction: column;
align-items: flex-start;
}
.label {
margin-right: 10px;
color: var(--primary-high);
}
.name {
display: inline;
}

.select-kit.multi-select {
@include breakpoint("tablet") {
width: 360px;
}
}
}
}

Expand Down Expand Up @@ -385,6 +398,11 @@ table.group-reports {
display: inline;
}
}
.group-names {
@include breakpoint("tablet") {
text-align: right;
}
}
.query-created-at {
color: var(--primary-medium);
}
Expand Down

0 comments on commit 02c2623

Please sign in to comment.