mirror of
https://github.com/stashapp/stash.git
synced 2026-01-15 04:34:57 +01:00
Minor gallery-related fixes (#3448)
* Fix gallery titles * Fix SceneListTable
This commit is contained in:
parent
c7c4d5b126
commit
dd5cff2aec
5 changed files with 28 additions and 37 deletions
|
|
@ -46,6 +46,9 @@ fragment SlimSceneData on Scene {
|
|||
files {
|
||||
path
|
||||
}
|
||||
folder {
|
||||
path
|
||||
}
|
||||
title
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,3 @@
|
|||
margin-right: 0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
.field-options-table td:first-child {
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import {
|
|||
faTrashAlt,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { objectTitle } from "src/core/files";
|
||||
import { galleryTitle } from "src/core/galleries";
|
||||
import { useRatingKeybinds } from "src/hooks/keybinds";
|
||||
|
||||
const SceneScrapeDialog = lazy(() => import("./SceneScrapeDialog"));
|
||||
|
|
@ -105,7 +106,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
setGalleries(
|
||||
scene.galleries?.map((g) => ({
|
||||
id: g.id,
|
||||
title: objectTitle(g),
|
||||
title: galleryTitle(g),
|
||||
})) ?? []
|
||||
);
|
||||
}, [scene.galleries]);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// @ts-nocheck
|
||||
/* eslint-disable jsx-a11y/control-has-associated-label */
|
||||
import React from "react";
|
||||
import { Table, Button, Form } from "react-bootstrap";
|
||||
import { Table, Form } from "react-bootstrap";
|
||||
import { Link } from "react-router-dom";
|
||||
import * as GQL from "src/core/generated-graphql";
|
||||
import { NavUtils, TextUtils } from "src/utils";
|
||||
import { Icon } from "src/components/Shared";
|
||||
import { FormattedMessage } from "react-intl";
|
||||
import { objectTitle } from "src/core/files";
|
||||
import { galleryTitle } from "src/core/galleries";
|
||||
import SceneQueue from "src/models/sceneQueue";
|
||||
|
||||
interface ISceneListTableProps {
|
||||
scenes: GQL.SlimSceneDataFragment[];
|
||||
|
|
@ -19,14 +18,14 @@ interface ISceneListTableProps {
|
|||
export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
props: ISceneListTableProps
|
||||
) => {
|
||||
const renderTags = (tags: GQL.SlimTagDataFragment[]) =>
|
||||
const renderTags = (tags: Partial<GQL.TagDataFragment>[]) =>
|
||||
tags.map((tag) => (
|
||||
<Link key={tag.id} to={NavUtils.makeTagScenesUrl(tag)}>
|
||||
<h6>{tag.name}</h6>
|
||||
</Link>
|
||||
));
|
||||
|
||||
const renderPerformers = (performers: Partial<GQL.Performer>[]) =>
|
||||
const renderPerformers = (performers: Partial<GQL.PerformerDataFragment>[]) =>
|
||||
performers.map((performer) => (
|
||||
<Link key={performer.id} to={NavUtils.makePerformerScenesUrl(performer)}>
|
||||
<h6>{performer.name}</h6>
|
||||
|
|
@ -34,13 +33,21 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||
));
|
||||
|
||||
const renderMovies = (scene: GQL.SlimSceneDataFragment) =>
|
||||
scene.movies.map((sceneMovie) =>
|
||||
!sceneMovie.movie ? undefined : (
|
||||
<Link to={NavUtils.makeMovieScenesUrl(sceneMovie.movie)}>
|
||||
<h6>{sceneMovie.movie.name}</h6>
|
||||
</Link>
|
||||
)
|
||||
);
|
||||
scene.movies.map((sceneMovie) => (
|
||||
<Link
|
||||
key={sceneMovie.movie.id}
|
||||
to={NavUtils.makeMovieScenesUrl(sceneMovie.movie)}
|
||||
>
|
||||
<h6>{sceneMovie.movie.name}</h6>
|
||||
</Link>
|
||||
));
|
||||
|
||||
const renderGalleries = (scene: GQL.SlimSceneDataFragment) =>
|
||||
scene.galleries.map((gallery) => (
|
||||
<Link key={gallery.id} to={`/galleries/${gallery.id}`}>
|
||||
<h6>{galleryTitle(gallery)}</h6>
|
||||
</Link>
|
||||
));
|
||||
|
||||
const renderSceneRow = (scene: GQL.SlimSceneDataFragment, index: number) => {
|
||||
const sceneLink = props.queue
|
||||
|
|
@ -60,7 +67,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||
type="checkbox"
|
||||
checked={props.selectedIds.has(scene.id)}
|
||||
onChange={() =>
|
||||
props.onSelectChange!(
|
||||
props.onSelectChange(
|
||||
scene.id,
|
||||
!props.selectedIds.has(scene.id),
|
||||
shiftKey
|
||||
|
|
@ -102,15 +109,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||
)}
|
||||
</td>
|
||||
<td>{renderMovies(scene)}</td>
|
||||
<td>
|
||||
{scene.gallery && (
|
||||
<Button className="minimal">
|
||||
<Link to={`/galleries/${scene.gallery.id}`}>
|
||||
<Icon icon={faImage} />
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
</td>
|
||||
<td>{renderGalleries(scene)}</td>
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
|
|
@ -144,7 +143,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||
<FormattedMessage id="movies" />
|
||||
</th>
|
||||
<th>
|
||||
<FormattedMessage id="gallery" />
|
||||
<FormattedMessage id="galleries" />
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
|||
|
|
@ -126,14 +126,6 @@ hr {
|
|||
border: none;
|
||||
border-color: #414c53;
|
||||
padding: 0.25rem 0.75rem;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue