Skip to content

Commit 380e24f

Browse files
committed
in finder-file-select, show file details
1 parent 5a8cd1c commit 380e24f

File tree

3 files changed

+85
-78
lines changed

3 files changed

+85
-78
lines changed

client/browser/FinderFileSelect.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,18 @@ export default function FinderFileSelect(props) {
8787
<dd>{selectedFile.name}</dd>
8888
</dl>
8989
<dl>
90-
<dt>{gettext("Content-Type (Size)")}:</dt>
91-
<dd>{selectedFile.mime_type} ({selectedFile.file_size})</dd>
90+
<dt>{gettext("Details")}:</dt>
91+
<dd>{selectedFile.summary}</dd>
9292
</dl>
9393
<dl>
9494
<dt>{gettext("Modified at")}:</dt>
9595
<dd>{renderTimestamp(selectedFile.last_modified_at)}</dd>
9696
</dl>
97-
<div>
98-
<button type="button" onClick={deleteFile}>{gettext("Delete")}</button>
99-
</div>
97+
<dl>
98+
<dt>{gettext("Content-Type")}:</dt>
99+
<dd>{selectedFile.mime_type}</dd>
100+
</dl>
101+
<button className="delete-file-button" type="button" onClick={deleteFile}>{gettext("Delete")}</button>
100102
</figcaption>
101103
</> :
102104
<span onClick={openDialog} onDragEnter={openDialog}>

client/scss/finder-browser.scss

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
display: flex;
2020
align-items: center;
2121
justify-content: center;
22+
23+
&:hover {
24+
cursor: pointer;
25+
}
2226
}
2327

2428
>figcaption {
29+
position: relative;
2530
display: flex;
2631
flex-direction: column;
2732
padding: .25rem .5rem;
@@ -32,6 +37,7 @@
3237
dl {
3338
font-size: small;
3439
margin: 0 0 .25rem 0;
40+
line-height: 18px;
3541
}
3642
dt {
3743
font-weight: bold;
@@ -41,14 +47,11 @@
4147
margin: 0;
4248
}
4349

44-
div:last-child {
45-
display: flex;
46-
flex-grow: 1;
47-
justify-content: flex-end;
48-
padding: 0.25rem;
49-
50-
>button {
50+
.delete-file-button {
5151
margin: 0;
52+
position: absolute;
53+
right: 0.5rem;
54+
bottom: 0.5rem;
5255
padding: 0.25rem 0.5rem;
5356
color: $delete-button-fg-color;
5457
background-color: $delete-button-bg-color;
@@ -59,9 +62,10 @@
5962

6063
&:hover {
6164
opacity: 1;
65+
cursor: pointer;
6266
}
6367
}
64-
}
68+
6569
}
6670
}
6771
}
@@ -238,88 +242,88 @@ dialog {
238242
}
239243

240244
.browser-editor {
241-
flex-direction: column;
245+
flex-direction: column;
242246

243-
img {
244-
width: 100%;
245-
&.thumbnail {
246-
max-width: 175px;
247-
}
247+
img {
248+
width: 100%;
249+
&.thumbnail {
250+
max-width: 175px;
248251
}
252+
}
249253

250-
form {
251-
display: block;
252-
margin: 0.5rem 1rem;
253-
.form-row {
254-
label {
255-
display: inline-block;
256-
&:has(~ [required]) {
257-
font-weight: bold;
258-
}
254+
form {
255+
display: block;
256+
margin: 0.5rem 1rem;
257+
.form-row {
258+
label {
259+
display: inline-block;
260+
&:has(~ [required]) {
261+
font-weight: bold;
259262
}
263+
}
260264

261-
.errorlist {
262-
display: inline-block;
263-
color: $error-color;
264-
list-style: none;
265-
margin: 0;
266-
}
265+
.errorlist {
266+
display: inline-block;
267+
color: $error-color;
268+
list-style: none;
269+
margin: 0;
270+
}
267271

268-
input, select, textarea {
269-
display: block;
270-
color: $body-fg-color;
271-
background-color: $body-bg-color;
272-
margin-bottom: 0.5rem;
273-
padding: 4px 8px;
274-
border: 1px solid $border-color;
275-
border-radius: 5px;
276-
max-width: calc(100% - 2rem);
277-
278-
&:focus-visible {
279-
outline: none;
280-
box-shadow: $focus-visible-box-shadow;
281-
}
272+
input, select, textarea {
273+
display: block;
274+
color: $body-fg-color;
275+
background-color: $body-bg-color;
276+
margin-bottom: 0.5rem;
277+
padding: 4px 8px;
278+
border: 1px solid $border-color;
279+
border-radius: 5px;
280+
max-width: calc(100% - 2rem);
281+
282+
&:focus-visible {
283+
outline: none;
284+
box-shadow: $focus-visible-box-shadow;
282285
}
286+
}
283287

284-
@include labels.labels;
288+
@include labels.labels;
285289

286-
.select-labels-field [role="listbox"] {
287-
top: auto;
288-
bottom: 100%;
289-
margin-block-end: 2px;
290-
}
290+
.select-labels-field [role="listbox"] {
291+
top: auto;
292+
bottom: 100%;
293+
margin-block-end: 2px;
291294
}
295+
}
292296

293-
.button-row {
294-
display: flex;
295-
justify-content: flex-end;
296-
margin: 2rem 1rem 1rem;
297-
298-
button {
299-
margin-left: 1rem;
300-
border: none;
301-
border-radius: 5px;
302-
padding: 0.5rem 1rem;
303-
opacity: 0.9;
304-
305-
&:hover {
306-
opacity: 1;
307-
cursor: pointer;
308-
}
297+
.button-row {
298+
display: flex;
299+
justify-content: flex-end;
300+
margin: 2rem 1rem 1rem;
309301

310-
&.default {
311-
background-color: #065fc8;
312-
color: #fff;
313-
}
302+
button {
303+
margin-left: 1rem;
304+
border: none;
305+
border-radius: 5px;
306+
padding: 0.5rem 1rem;
307+
opacity: 0.9;
314308

315-
&.dismiss {
316-
background-color: #b15107;
317-
color: #fff;
318-
}
309+
&:hover {
310+
opacity: 1;
311+
cursor: pointer;
312+
}
313+
314+
&.default {
315+
background-color: #065fc8;
316+
color: #fff;
317+
}
318+
319+
&.dismiss {
320+
background-color: #b15107;
321+
color: #fff;
319322
}
320323
}
321324
}
322325
}
326+
}
323327

324328
@include dropdown.dropdown;
325329

finder/models/file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def as_dict(self):
189189
'sha1': self.sha1,
190190
'mime_type': self.mime_type,
191191
'last_modified_at': self.last_modified_at,
192+
'summary': self.summary,
192193
'folderitem_component': self.folderitem_component,
193194
'browser_component': self.browser_component,
194195
'download_url': self.get_download_url(),

0 commit comments

Comments
 (0)