Skip to content

Commit 950246a

Browse files
authored
UX: Apply admin table classes for consistent mobile styling on the recent queries page (#349)
* UX: Apply admin table classes for consistent mobile styling on the recent queries page * DEV: Apply prettier
1 parent d961589 commit 950246a

File tree

2 files changed

+54
-25
lines changed

2 files changed

+54
-25
lines changed

assets/javascripts/discourse/templates/admin/plugins-explorer.hbs

+35-24
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,16 @@
102102
{{/if}}
103103

104104
{{#unless this.selectedItem.destroyed}}
105-
<div class="pull-left">
106-
<div class="groups">
107-
<span class="label">{{i18n "explorer.allow_groups"}}</span>
108-
<span>
109-
<MultiSelect
110-
@value={{this.selectedItem.group_ids}}
111-
@content={{this.groupOptions}}
112-
@options={{hash allowAny=false}}
113-
@onChange={{this.updateGroupIds}}
114-
/>
115-
</span>
116-
</div>
105+
<div class="groups">
106+
<span class="label">{{i18n "explorer.allow_groups"}}</span>
107+
<span>
108+
<MultiSelect
109+
@value={{this.selectedItem.group_ids}}
110+
@content={{this.groupOptions}}
111+
@options={{hash allowAny=false}}
112+
@onChange={{this.updateGroupIds}}
113+
/>
114+
</span>
117115
</div>
118116
{{/unless}}
119117

@@ -289,7 +287,7 @@
289287

290288
{{#unless this.validQueryPresent}}
291289
<div class="container">
292-
<table class="recent-queries">
290+
<table class="d-admin-table recent-queries">
293291
<thead class="heading-container">
294292
<th class="col heading name">
295293
<div
@@ -344,8 +342,8 @@
344342
</thead>
345343
<tbody>
346344
{{#each this.filteredContent as |query|}}
347-
<tr class="query-row">
348-
<td>
345+
<tr class="d-admin-row__content query-row">
346+
<td class="d-admin-row__overview">
349347
<a
350348
{{on "click" this.scrollTop}}
351349
href="/admin/plugins/explorer/?id={{query.id}}"
@@ -354,19 +352,32 @@
354352
<medium class="query-desc">{{query.description}}</medium>
355353
</a>
356354
</td>
357-
<td class="query-created-by">
355+
<td class="d-admin-row__detail query-created-by">
356+
<div class="d-admin-row__mobile-label">
357+
{{i18n "explorer.query_user"}}
358+
</div>
358359
{{#if query.username}}
359-
<a href="/u/{{query.username}}/activity">
360-
<medium>{{query.username}}</medium>
361-
</a>
360+
<div>
361+
<a href="/u/{{query.username}}/activity">
362+
<medium>{{query.username}}</medium>
363+
</a>
364+
</div>
362365
{{/if}}
363366
</td>
364-
<td class="query-group-names">
365-
{{#each query.group_names as |group|}}
366-
<ShareReport @group={{group}} @query={{query}} />
367-
{{/each}}
367+
<td class="d-admin-row__detail query-group-names">
368+
<div class="d-admin-row__mobile-label">
369+
{{i18n "explorer.query_groups"}}
370+
</div>
371+
<div class="group-names">
372+
{{#each query.group_names as |group|}}
373+
<ShareReport @group={{group}} @query={{query}} />
374+
{{/each}}
375+
</div>
368376
</td>
369-
<td class="query-created-at">
377+
<td class="d-admin-row__detail query-created-at">
378+
<div class="d-admin-row__mobile-label">
379+
{{i18n "explorer.query_time"}}
380+
</div>
370381
{{#if query.last_run_at}}
371382
<medium>
372383
{{bound-date query.last_run_at}}

assets/stylesheets/explorer.scss

+19-1
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,27 @@ table.group-reports {
211211
margin: 10px 0;
212212
}
213213
.groups {
214-
margin-bottom: 10px;
214+
margin: 10px 0;
215+
display: flex;
216+
flex-direction: row;
217+
align-items: center;
218+
@include breakpoint("tablet") {
219+
flex-direction: column;
220+
align-items: flex-start;
221+
}
215222
.label {
216223
margin-right: 10px;
217224
color: var(--primary-high);
218225
}
219226
.name {
220227
display: inline;
221228
}
229+
230+
.select-kit.multi-select {
231+
@include breakpoint("tablet") {
232+
width: 360px;
233+
}
234+
}
222235
}
223236
}
224237

@@ -385,6 +398,11 @@ table.group-reports {
385398
display: inline;
386399
}
387400
}
401+
.group-names {
402+
@include breakpoint("tablet") {
403+
text-align: right;
404+
}
405+
}
388406
.query-created-at {
389407
color: var(--primary-medium);
390408
}

0 commit comments

Comments
 (0)