Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Apply admin table classes for consistent mobile styling on the recent queries page #349

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 35 additions & 24 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">
{{#each query.group_names as |group|}}
<ShareReport @group={{group}} @query={{query}} />
{{/each}}
<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
Loading