mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Using css ellipsis for download rows.
This commit is contained in:
parent
73cb142ae1
commit
badfe691de
7 changed files with 53 additions and 40 deletions
|
|
@ -207,4 +207,20 @@ textarea.otp {
|
|||
|
||||
.inverted label {
|
||||
color: #DDDDDD !important;
|
||||
}
|
||||
}
|
||||
|
||||
.table-ellipsis td.column-ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 0; /* Ensures the content doesn't exceed the cell's width */
|
||||
min-width: 0; /* Can be set to ensure a minimum width for your cells, if needed */
|
||||
}
|
||||
|
||||
.card-title-ellipsis {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import {
|
|||
APIButton,
|
||||
BackButton,
|
||||
CardLink,
|
||||
cardTitleWrapper,
|
||||
encodeMediaPath,
|
||||
ErrorMessage,
|
||||
ExternalCardLink,
|
||||
|
|
@ -289,14 +288,14 @@ export function ArchiveCard({file}) {
|
|||
<CardContent {...s}>
|
||||
<CardHeader>
|
||||
<Container textAlign='left'>
|
||||
<ExternalCardLink to={singlefileUrl}>
|
||||
{cardTitleWrapper(file.title || data.url)}
|
||||
<ExternalCardLink to={singlefileUrl} className='card-title-ellipsis'>
|
||||
{file.title || data.url}
|
||||
</ExternalCardLink>
|
||||
</Container>
|
||||
</CardHeader>
|
||||
{domain &&
|
||||
<CardLink to={domainUrl}>
|
||||
<p {...s}>{domain}</p>
|
||||
<span {...s}>{domain}</span>
|
||||
</CardLink>}
|
||||
<CardMeta {...s}>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -199,10 +199,17 @@ export function CardLink({to, newTab = false, ...props}) {
|
|||
</Link>
|
||||
}
|
||||
|
||||
export function ExternalCardLink({to, ...props}) {
|
||||
export function ExternalCardLink({to, children, ...props}) {
|
||||
const {t} = useContext(ThemeContext);
|
||||
return <a href={to} target='_blank' rel='noopener noreferrer' className='no-link-underscore card-link' {...t}>
|
||||
{props.children}
|
||||
return <a
|
||||
href={to}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className='no-link-underscore card-link'
|
||||
{...t}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
}
|
||||
|
||||
|
|
@ -1184,11 +1191,6 @@ export const toLocaleString = (num, locale = 'en-US') => {
|
|||
return num.toLocaleString(locale);
|
||||
}
|
||||
|
||||
export const cardTitleWrapper = (title, maxLength = 100, breakWord = true) => {
|
||||
const style = breakWord ? {overflowWrap: 'break-word'} : null;
|
||||
return <span style={style}>{textEllipsis(title, maxLength)}</span>
|
||||
}
|
||||
|
||||
function luma(color) {
|
||||
let rgb = (typeof color === 'string') ? hexToRGBArray(color) : color;
|
||||
return (0.2126 * rgb[0]) + (0.7152 * rgb[1]) + (0.0722 * rgb[2]); // SMPTE C, Rec. 709 weightings
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ class RSSDownload extends ChannelDownload {
|
|||
in the future.</Message.Content>
|
||||
</Message>);
|
||||
|
||||
return <Form>
|
||||
return <Form onSubmit={this.handleSubmit}>
|
||||
<WROLModeMessage content='Downloading is disabled while WROL Mode is enabled'/>
|
||||
<Header as='h3'><Icon name='rss' color='orange'/> RSS Feed</Header>
|
||||
<FormInput
|
||||
|
|
@ -619,7 +619,7 @@ export function DownloadMenu({onOpen, disabled}) {
|
|||
/>
|
||||
<Button
|
||||
color='black'
|
||||
content='File'
|
||||
content='Files'
|
||||
disabled={disabled}
|
||||
onClick={() => localOnOpen('file')}
|
||||
style={{marginBottom: '1em'}}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import {
|
|||
import {
|
||||
CardGroupCentered,
|
||||
CardPoster,
|
||||
cardTitleWrapper,
|
||||
encodeMediaPath,
|
||||
ErrorMessage,
|
||||
ExternalCardLink,
|
||||
|
|
@ -81,8 +80,8 @@ function EbookCard({file}) {
|
|||
<CardContent {...s}>
|
||||
<CardHeader>
|
||||
<Container textAlign='left'>
|
||||
<ExternalCardLink to={viewerUrl || downloadUrl}>
|
||||
{cardTitleWrapper(file ? file.title : file.title)}
|
||||
<ExternalCardLink to={viewerUrl || downloadUrl} className='card-title-ellipsis'>
|
||||
{file.title || file.stem || file.name}
|
||||
</ExternalCardLink>
|
||||
</Container>
|
||||
</CardHeader>
|
||||
|
|
@ -145,8 +144,8 @@ function FileCard({file}) {
|
|||
<CardPoster to={downloadUrl} file={file}/>
|
||||
<CardContent {...s}>
|
||||
<CardHeader>
|
||||
<ExternalCardLink to={downloadUrl}>
|
||||
{cardTitleWrapper(file.title || file.name || file.primary_path)}
|
||||
<ExternalCardLink to={downloadUrl} className='card-title-ellipsis'>
|
||||
{file.title || file.name || file.primary_path}
|
||||
</ExternalCardLink>
|
||||
</CardHeader>
|
||||
{author && <b {...s}>{author}</b>}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import {
|
|||
APIButton,
|
||||
CardLink,
|
||||
CardPoster,
|
||||
cardTitleWrapper,
|
||||
defaultSearchOrder,
|
||||
defaultVideoOrder,
|
||||
Duration,
|
||||
|
|
@ -307,7 +306,7 @@ export function VideoCard({file}) {
|
|||
|
||||
let poster = <CardPoster to={video_url} file={file}/>;
|
||||
|
||||
let header = <p {...s}>{cardTitleWrapper(file.title || file.name || video.stem || video.video_path)}</p>;
|
||||
let header = <span {...s} className='card-title-ellipsis'>{file.title || file.name || video.stem || video.name}</span>;
|
||||
if (video_url) {
|
||||
// Link to Channel-Video page or Video page.
|
||||
header = <Link to={video_url} className="no-link-underscore card-link">{header}</Link>;
|
||||
|
|
|
|||
|
|
@ -157,15 +157,13 @@ class RecurringDownloadRow extends React.Component {
|
|||
|
||||
// Show "now" if we have passed the next_download.
|
||||
let next = 'now';
|
||||
if (next_download) {
|
||||
if (new Date() < new Date(next_download)) {
|
||||
next = isoDatetimeToElapsedPopup(next_download);
|
||||
}
|
||||
if (next_download && new Date() < new Date(next_download)) {
|
||||
next = isoDatetimeToElapsedPopup(next_download);
|
||||
}
|
||||
|
||||
return <TableRow>
|
||||
<TableCell>
|
||||
{link(textEllipsis(url, 50))}
|
||||
<TableCell className='column-ellipsis'>
|
||||
{link(url)}
|
||||
</TableCell>
|
||||
<TableCell>{secondsToFrequency(frequency)}</TableCell>
|
||||
<TableCell>
|
||||
|
|
@ -277,8 +275,8 @@ class OnceDownloadRow extends React.Component {
|
|||
}
|
||||
|
||||
return <TableRow>
|
||||
<TableCell>
|
||||
{link(textEllipsis(url, 50))}
|
||||
<TableCell className='column-ellipsis'>
|
||||
{link(url)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{completedAtCell}
|
||||
|
|
@ -292,12 +290,12 @@ class OnceDownloadRow extends React.Component {
|
|||
export function OnceDownloadsTable({downloads, fetchDownloads}) {
|
||||
if (downloads && downloads.length >= 1) {
|
||||
return <>
|
||||
<Table>
|
||||
<Table className='table-ellipsis'>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHeaderCell>URL</TableHeaderCell>
|
||||
<TableHeaderCell>Completed At</TableHeaderCell>
|
||||
<TableHeaderCell>Control</TableHeaderCell>
|
||||
<TableHeaderCell width={11}>URL</TableHeaderCell>
|
||||
<TableHeaderCell width={2}>Completed At</TableHeaderCell>
|
||||
<TableHeaderCell width={3}>Control</TableHeaderCell>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
|
|
@ -326,14 +324,14 @@ export function OnceDownloadsTable({downloads, fetchDownloads}) {
|
|||
|
||||
export function RecurringDownloadsTable({downloads, fetchDownloads}) {
|
||||
if (downloads && downloads.length >= 1) {
|
||||
return <Table>
|
||||
return <Table unstackable className='table-ellipsis'>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHeaderCell>URL</TableHeaderCell>
|
||||
<TableHeaderCell>Download Frequency</TableHeaderCell>
|
||||
<TableHeaderCell>Completed At</TableHeaderCell>
|
||||
<TableHeaderCell>Next</TableHeaderCell>
|
||||
<TableHeaderCell>Control</TableHeaderCell>
|
||||
<TableHeaderCell width={8}>URL</TableHeaderCell>
|
||||
<TableHeaderCell width={2}>Download Frequency</TableHeaderCell>
|
||||
<TableHeaderCell width={2}>Completed At</TableHeaderCell>
|
||||
<TableHeaderCell width={1}>Next</TableHeaderCell>
|
||||
<TableHeaderCell width={3}>Control</TableHeaderCell>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue